mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Compare commits
4591 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 00171ca935 | |||
| 9c748beef5 | |||
| 26087e28ad | |||
| 2c3f02c83f | |||
| 19e8121a38 | |||
| 69fd8964a2 | |||
| ccbc16f3a9 | |||
| ec469b5530 | |||
| 8b52eabd48 | |||
| d4b9e2d0f4 | |||
| 470dfba96c | |||
| 43c68d1864 | |||
| 40dd96e83a | |||
| 73bf170800 | |||
| 17ad33c919 | |||
| 1ed47900d8 | |||
| 990afa9032 | |||
| c03a936cfc | |||
| e4a4f93b72 | |||
| f1a99995c4 | |||
| 872e7894b4 | |||
| d338644159 | |||
| bd1fd59fc1 | |||
| 1fa3d21f6a | |||
| de8eda5fdf | |||
| 8158e5b7a0 | |||
| f4b6ae46d1 | |||
| cdf6e460e8 | |||
| be1ae9d4a6 | |||
| 3f42122387 | |||
| 9cca066ee8 | |||
| 8c8715c4dd | |||
| 915c3fd7fa | |||
| f73b4f4a26 | |||
| a54affeb8d | |||
| 18ab85efc2 | |||
| bd1342c164 | |||
| ea9a17ebc2 | |||
| 61eb1a6848 | |||
| a534af68b8 | |||
| 2143f7cee1 | |||
| 80e5642ca2 | |||
| 6e2ede8c56 | |||
| af0a83f0b3 | |||
| 8c0b0714e7 | |||
| f3074fd559 | |||
| 55f02d8c66 | |||
| 2c07c6718f | |||
| 5a01227aa1 | |||
| ce3c92eb1f | |||
| b99c9145bf | |||
| 6ec08f268f | |||
| 8546ac3ce6 | |||
| 9a8dbfd57f | |||
| 756a98a395 | |||
| 9dc7554089 | |||
| 6eac8f78b9 | |||
| 98e2bb8721 | |||
| 842c58a7d6 | |||
| 7a2dca5947 | |||
| 49093d6d38 | |||
| 110e80f0ee | |||
| d71977b4dd | |||
| 11dbd86aa3 | |||
| 40af53b1d6 | |||
| 7e8cc580c9 | |||
| a1ef612662 | |||
| 442fdfd4b2 | |||
| 922cd208f7 | |||
| 4f9a99141e | |||
| 713d91b04e | |||
| 8b541e450b | |||
| 39783a6584 | |||
| f26912960f | |||
| db588bb831 | |||
| b9d2e6664d | |||
| a43337c28e | |||
| eb9001665e | |||
| fcfb29766b | |||
| d8b58205be | |||
| 796b0fec7d | |||
| d5a2fe5180 | |||
| 332c37f332 | |||
| 74574dfae4 | |||
| d2f70f61aa | |||
| 3182cc4277 | |||
| 3b43f90cc8 | |||
| b9a6a96324 | |||
| 7bcfe8f204 | |||
| 99b39aa5bd | |||
| bbf39b0964 | |||
| 7366eebebb | |||
| e36a3acbc0 | |||
| 89c106b29e | |||
| b46fa2e556 | |||
| 35edad3e74 | |||
| 98f89f9079 | |||
| 8ee1be7d09 | |||
| 45c4d3a62b | |||
| 25a9a32f8e | |||
| 11fd9e5fdc | |||
| 403f11fdbf | |||
| b4cba524d3 | |||
| 746cd1e1e6 | |||
| 19cf511895 | |||
| 93dab9e1e9 | |||
| 6b31f58092 | |||
| 480c6dae6d | |||
| 7444f0c651 | |||
| dd37c10d4a | |||
| dd262b7087 | |||
| 65e76adeda | |||
| 3132c8ee08 | |||
| 5a2faab2e6 | |||
| 6e9b6a27cf | |||
| c0d41f05d6 | |||
| 80d37ba698 | |||
| 9a6f2630b2 | |||
| 0a98bc0ee9 | |||
| 47b6955ba0 | |||
| 030e955db7 | |||
| f5b58e5fc9 | |||
| f0179f96a7 | |||
| 3ba49ccecc | |||
| d034ef6f27 | |||
| 7d24727184 | |||
| 939ea4ba30 | |||
| 5478165e16 | |||
| a9f67c2d1d | |||
| ed8f0ab265 | |||
| 20afae5a14 | |||
| caa013b2a4 | |||
| 9548093b46 | |||
| 5fd47352cf | |||
| f1f0f630c7 | |||
| c3cf35ab63 | |||
| 4188e8aaf9 | |||
| 9702987209 | |||
| dd696066b5 | |||
| 1bf1694506 | |||
| 865c29a754 | |||
| 8c1e0537ec | |||
| d5a3ad5b64 | |||
| 30cf5e0164 | |||
| 5421d0866b | |||
| 225bdc21c0 | |||
| a065c10bcb | |||
| 98d8436440 | |||
| 4cf321f3f8 | |||
| 0aa0f2ada2 | |||
| f6d3adcf3d | |||
| e11213dcef | |||
| fe7c93cc05 | |||
| 2b6be3cb0f | |||
| fd49ee5f39 | |||
| 93a36b0df1 | |||
| 4e12febe90 | |||
| 6eabe6bc14 | |||
| 3bc9912f6e | |||
| 4c94804bb0 | |||
| 682e03bdb2 | |||
| ca4fd1e427 | |||
| 91d152e2c2 | |||
| 1d8b30bf4f | |||
| 0311770e8b | |||
| 82cd2f8c93 | |||
| 20400aa9f7 | |||
| 4cbd09c41c | |||
| 4ebb617000 | |||
| 0e70363f4a | |||
| 7baa5efbe4 | |||
| ed710eaa1c | |||
| bfd663c281 | |||
| 5c7fe0fe05 | |||
| 1db5d82b7f | |||
| 3064e40d9e | |||
| 334c4d62b5 | |||
| 715f881dda | |||
| 8bde6aea4b | |||
| 507f8add1c | |||
| f1d9666a20 | |||
| c0076b58cd | |||
| 8cedc052ca | |||
| 6e34d2778f | |||
| dc84cf9914 | |||
| 4b82c8a22b | |||
| 7af7bcae18 | |||
| 93cea6e46e | |||
| 7c72e095fa | |||
| 00e8c7810f | |||
| aebb66682b | |||
| 322115bfcf | |||
| ca5976e3d4 | |||
| 9e94212eac | |||
| 3bba5b5a31 | |||
| 9b71f5fd54 | |||
| a6160b6994 | |||
| 428720f490 | |||
| 3c92d40f6e | |||
| cd66f6e3db | |||
| 1a961660d8 | |||
| abfcb60118 | |||
| 9d3d5e9d65 | |||
| 406392e13d | |||
| 7b7d21ebef | |||
| fbde57dba8 | |||
| dcee7b1605 | |||
| b769ad2c23 | |||
| 3c70d966cb | |||
| d9b573795b | |||
| 3aaf8dfd11 | |||
| e3633ec4a2 | |||
| 0b49680339 | |||
| 439e43a027 | |||
| af8a3a0b66 | |||
| 183c0fcab1 | |||
| bd00471a89 | |||
| ff1ec6ccc6 | |||
| 86136c0ccc | |||
| 087d9745b3 | |||
| b40a7ffbe4 | |||
| 094615b2c5 | |||
| c88e6b344b | |||
| 6e88bff3e3 | |||
| 5aceac6b93 | |||
| b12e1acdec | |||
| 54a1bbe1c4 | |||
| 21eb60f88b | |||
| caf438c63b | |||
| dfef04b325 | |||
| b1caa4f4d5 | |||
| 9e7014b59f | |||
| a1f4e65d03 | |||
| f3d62c94b1 | |||
| 2e28ff78c1 | |||
| 1606137df2 | |||
| 0711dab09d | |||
| 5f57842575 | |||
| 4e16ec2826 | |||
| f8ac46ba07 | |||
| 5d9c6723ee | |||
| 6b4becfd03 | |||
| c8777da2d6 | |||
| 997b7b18af | |||
| b17c1c6721 | |||
| f8786c9bf4 | |||
| f414c16c13 | |||
| f0ef4b2246 | |||
| d32d576d6d | |||
| 39b90ae9fb | |||
| c6f39870ff | |||
| 757d8ac8f7 | |||
| 5e2a81dc26 | |||
| 52050ebe32 | |||
| b1cc114b7b | |||
| 33d477e049 | |||
| c4abdb8050 | |||
| 0af9e19be7 | |||
| b6a0acb8f6 | |||
| 5527c41468 | |||
| 1629e29b98 | |||
| 3091d10b00 | |||
| 766fd20faa | |||
| 8f7e92e466 | |||
| d7b1f28a90 | |||
| 4e679e1cc5 | |||
| d2174e2e75 | |||
| 87f651c119 | |||
| 07c10d6fc3 | |||
| 66d9a33b50 | |||
| 315e7fbbee | |||
| 9cbdb48d6d | |||
| b068d26fad | |||
| fb8e652c3f | |||
| bbedebb57c | |||
| f67b197d49 | |||
| 6ad3bf3130 | |||
| bc4e471847 | |||
| fcec053d59 | |||
| a63f66c90e | |||
| eab6744ac7 | |||
| f46cd9dbf5 | |||
| 37a5af3673 | |||
| b19bb95d66 | |||
| 8ecc5e6f64 | |||
| d073215f10 | |||
| 554eae56d1 | |||
| 4e66d078d2 | |||
| 665408e57f | |||
| a42bbc9722 | |||
| fe33ce02af | |||
| 9362639437 | |||
| 418898029c | |||
| c918ac298c | |||
| 252fd63194 | |||
| 2f5af1bd33 | |||
| cca2c4b314 | |||
| 4501a2cdea | |||
| ea3dc78986 | |||
| eb00dce78e | |||
| 268d73165e | |||
| 5916ebf500 | |||
| ac262f5b5d | |||
| d998e70a25 | |||
| 3585522b24 | |||
| 02e9636f1b | |||
| 3c3c5ef2b6 | |||
| a65ccc0603 | |||
| ff775b2e54 | |||
| e2dbf054ac | |||
| 62f3c9bfa9 | |||
| 4f668e1023 | |||
| ed2e1af3e8 | |||
| 266725a378 | |||
| 9be8ab06ed | |||
| 287ee9d0ea | |||
| 190ad749e4 | |||
| 3c6d5aba22 | |||
| 97c3bcb1b7 | |||
| 9c4eb20221 | |||
| eeb6f7726e | |||
| 631b246881 | |||
| e1c8256602 | |||
| 5728679fd5 | |||
| dcdbaef348 | |||
| 20d82cf6d5 | |||
| a6af9c75e9 | |||
| 970293a229 | |||
| 74ba4b7ae2 | |||
| 6de86e325f | |||
| a84e11451b | |||
| 48e471fdd4 | |||
| 3478240de9 | |||
| e5917a8fa5 | |||
| 49a43dfc8f | |||
| 0395b2ea9c | |||
| 3812ae7949 | |||
| 400fd5c3ec | |||
| 67e6a6077d | |||
| a84bbc62b1 | |||
| dc5e69b4d4 | |||
| 40959fcc61 | |||
| 78f80c35d2 | |||
| 55770c9853 | |||
| 3721c8bb06 | |||
| b9496f8d9d | |||
| bbc6b95c02 | |||
| f0ddf302b2 | |||
| 6596eab66c | |||
| 9205ad6990 | |||
| 49de982ee7 | |||
| 2ea4626911 | |||
| ca00c1dce2 | |||
| c8a89134a7 | |||
| 53c2ebf7f6 | |||
| 133eb8d13a | |||
| dcdb3b36ef | |||
| a202dc9a90 | |||
| 0e9c90a0d9 | |||
| 0165ffa90d | |||
| 794c14b29a | |||
| 012e43de4b | |||
| 36dfb71c60 | |||
| 4366c8734f | |||
| 4ced27e149 | |||
| e48682a9f7 | |||
| 6e39856623 | |||
| 6bd5d7f037 | |||
| ea882d58c6 | |||
| 78bd55c8df | |||
| 4ae5df5509 | |||
| 7812a805ad | |||
| 82c77fa244 | |||
| 7e2ebecd52 | |||
| 054bd23a43 | |||
| 3bbe5d3956 | |||
| fd674b85bb | |||
| facd5988ce | |||
| 581d0ef8a9 | |||
| a9c1af39d6 | |||
| 5f419c014f | |||
| b11566bfc7 | |||
| e5e1ba3c97 | |||
| ebe14fa4ac | |||
| 3da8b4ccad | |||
| e986ff46f7 | |||
| 62199df815 | |||
| 9cc12ff0ac | |||
| d0504c95f4 | |||
| e8ac3ea9ea | |||
| 4b4874e67a | |||
| 7d0d6cd5ee | |||
| d745af6763 | |||
| ed7607935e | |||
| 78da679472 | |||
| 71aee662bd | |||
| 2f89158339 | |||
| 27d15894d8 | |||
| 79e13be04c | |||
| c72a855214 | |||
| fd08d0d80d | |||
| 14d943f588 | |||
| d93ec07dd8 | |||
| 6b96512d46 | |||
| a9cf01113a | |||
| 85ade61ef7 | |||
| 3d44e9ad92 | |||
| a8fb72a807 | |||
| 73959fed45 | |||
| 5f2fed0e25 | |||
| caa3633cbf | |||
| deb8ba2237 | |||
| e267342108 | |||
| 757411bffc | |||
| 7d69289092 | |||
| c9dfcc4de8 | |||
| beba82b22b | |||
| cd169941f2 | |||
| c8f59bf1e0 | |||
| ff8c53ea20 | |||
| 148aee31e4 | |||
| a208c3bf04 | |||
| d9089741bc | |||
| 7beb24553a | |||
| 6142b21dd5 | |||
| b363489702 | |||
| dae03273cd | |||
| be6a837e15 | |||
| d4917a5bd3 | |||
| ffc9aa050d | |||
| e1f5b886fb | |||
| c9ad5779f2 | |||
| 26c5b0c71f | |||
| 1dee705074 | |||
| c0e11bb50e | |||
| f9c951440d | |||
| f35e043cf9 | |||
| 8f1356c3c5 | |||
| 14633bc857 | |||
| 578ea4bae9 | |||
| 2bba0f297b | |||
| 6c1638b132 | |||
| 1a6c2b37ea | |||
| 840c892abd | |||
| 09d8bbb138 | |||
| 832217907f | |||
| 26c5b846e6 | |||
| 59ce1d80a5 | |||
| 2f3e06ac1f | |||
| 37a63ca02b | |||
| 0d63bd575c | |||
| 257f60582a | |||
| bbdc987fc6 | |||
| 124011c321 | |||
| 8456d096d2 | |||
| 32c975b533 | |||
| a3a3670027 | |||
| b6a72826dd | |||
| 6bcf0b5519 | |||
| 3d5cebb3ac | |||
| e82d03ef61 | |||
| 131c09cf76 | |||
| 06f32e3b3e | |||
| eedd7bfd50 | |||
| cbf80117af | |||
| 2b35c1708b | |||
| e093a19c70 | |||
| 6fbcb283b9 | |||
| 7fb70e1701 | |||
| 2fb409b286 | |||
| b0a08cced9 | |||
| 82b7803a7a | |||
| 50ef9830e2 | |||
| d5f430cc11 | |||
| 8ed4fb9405 | |||
| de82d9da9e | |||
| fd27d5ea00 | |||
| 715f8fcce0 | |||
| 3f3c8823ac | |||
| d9d9b05912 | |||
| 55171b25f8 | |||
| 3eb2c940de | |||
| 493611ace5 | |||
| bb8c19aad3 | |||
| b571f03016 | |||
| f605898bae | |||
| 5736bf5dd5 | |||
| 4f9c1da806 | |||
| eb1f3733ee | |||
| d993b9c1df | |||
| 4e16ae9a1f | |||
| ab86f15ba0 | |||
| e058febaad | |||
| 0a801354b1 | |||
| d7f60f69f1 | |||
| d99a4af229 | |||
| 4b33910449 | |||
| c1e9a7ee4b | |||
| 82a02d8585 | |||
| 8d907d2e32 | |||
| 0c16d8f6c3 | |||
| b7bb79c7c8 | |||
| 5340073770 | |||
| 3903174f7c | |||
| a9771078df | |||
| eb1f7797e4 | |||
| aa666dfa9c | |||
| 3e710d8eec | |||
| 384ac63490 | |||
| 954098d1cb | |||
| e71758cfdf | |||
| cea3289bd4 | |||
| 00285a5e88 | |||
| d38676085a | |||
| d8583b2c7a | |||
| 82227b5ace | |||
| 6fa23f330f | |||
| c8f934b5b1 | |||
| 857fba0878 | |||
| a4111fab39 | |||
| 54de51ef3c | |||
| 0915df5b18 | |||
| 53f6198f27 | |||
| 81e7c7d8c8 | |||
| ea64e860de | |||
| e70786e05e | |||
| f1dc26d7ce | |||
| 40a53e3d64 | |||
| e5f298cca5 | |||
| 85b1750660 | |||
| 92e86292dd | |||
| 05131af8da | |||
| 8422dda2c7 | |||
| 606622ab36 | |||
| d77612fe70 | |||
| cab15f6c5e | |||
| 492a072ea8 | |||
| e82e672a93 | |||
| 93971a53d9 | |||
| 3868cb44f1 | |||
| 6fbf6f8bea | |||
| e090ea3efd | |||
| a618d8bc9e | |||
| 09b3dcb6db | |||
| f26e86e4d8 | |||
| 9ff1c39daa | |||
| ef42baf9f0 | |||
| fe459c82e5 | |||
| cdf906b233 | |||
| ead7bc883d | |||
| e55ad25355 | |||
| 838624bf53 | |||
| 83c7dfb6a4 | |||
| 80a3d7bffa | |||
| c9e0c77d73 | |||
| 742f22c09b | |||
| 6481397710 | |||
| 6ad8a9c09d | |||
| 388ccda85d | |||
| 2e0150e601 | |||
| aee865fec9 | |||
| 2dc5e245d0 | |||
| ea3a5950a3 | |||
| 0d439a9879 | |||
| 99f6f8ea9d | |||
| 39e448f7be | |||
| 80c2adbda1 | |||
| c26c43c69c | |||
| 4e8311085f | |||
| cf0be1a0af | |||
| 26d2095dd6 | |||
| c577c2cc6a | |||
| 905d96dd4a | |||
| 2d5ccc7b3e | |||
| a0fed8d9ea | |||
| 4e29e2fc7d | |||
| a811059bfb | |||
| e43a5ff9be | |||
| 00c9ab8c23 | |||
| 197285d12a | |||
| ab430b8c87 | |||
| d1029faa90 | |||
| 6374b99a1a | |||
| ccf96b9e05 | |||
| 3fe70d5cd5 | |||
| adb630ba3a | |||
| 5ed7d5a5d9 | |||
| 4fb9bce79f | |||
| 487f631243 | |||
| 1f7728db35 | |||
| b7c134617d | |||
| c928c21fe7 | |||
| 59fa477edb | |||
| 992d5b8bcd | |||
| fab0eb0d75 | |||
| 6808d33b2f | |||
| 65f22292ed | |||
| b1064efb44 | |||
| df96159eb6 | |||
| 89f0e0a8d1 | |||
| 966f27df34 | |||
| 83c8214b38 | |||
| 21bb17e3ee | |||
| 4ba4901ca9 | |||
| 9de63c1edd | |||
| e991e05b9b | |||
| 51cc78b2a2 | |||
| 8f4e5c2fb8 | |||
| 223893ea5a | |||
| db1c8b3f9e | |||
| 5bd1cc44ec | |||
| f07856eab9 | |||
| 24acd5fb83 | |||
| 84ce2cc211 | |||
| 37d064f553 | |||
| dd952f6d68 | |||
| e63efe2978 | |||
| 26cb154f40 | |||
| fb6929ac3d | |||
| 4e65283081 | |||
| ca5455c592 | |||
| 82f4322d18 | |||
| 36b6bcb674 | |||
| 5a804e3c74 | |||
| 5ff76088b9 | |||
| 9fd822f97e | |||
| 3c49b1dbbe | |||
| ad35b79e3f | |||
| 342366e314 | |||
| c6daa4aa16 | |||
| c0016d7fe9 | |||
| 2f6f52d644 | |||
| a518e7063d | |||
| de8696aa43 | |||
| 02cc1cd6e6 | |||
| dc80f9d0fb | |||
| 0e6cf41923 | |||
| ad0d812aa0 | |||
| 724620b476 | |||
| 736683ce2f | |||
| 7579cd8068 | |||
| e9e8bf4b81 | |||
| e1a2c034e8 | |||
| 6b346c92be | |||
| b6a447798a | |||
| adf2013052 | |||
| a1c073d289 | |||
| 9344d0d0e3 | |||
| 7fa7fa0226 | |||
| 45d2e18808 | |||
| e1ac8589f8 | |||
| 6e67fd2752 | |||
| 474a0dac49 | |||
| 495cadddbd | |||
| 60b13d50c9 | |||
| eaf39f6b6b | |||
| a3df05d93b | |||
| 2075fa9c15 | |||
| 798e2779f2 | |||
| 1b13df5368 | |||
| b6367f5821 | |||
| d7272f76fb | |||
| 1317c3d178 | |||
| 36432cf4d9 | |||
| 605071e76f | |||
| 94d7c0f7f5 | |||
| 083332f85f | |||
| 6757c2c5a6 | |||
| 0d117312c9 | |||
| 59e2ca16d9 | |||
| 75ed282b20 | |||
| 754956857c | |||
| a4ab60920f | |||
| a574788e89 | |||
| 22dbcf98c5 | |||
| 183bc5c281 | |||
| a1fe8f754f | |||
| dd3398416b | |||
| cf86af96ea | |||
| 780ae864a0 | |||
| 96c99c716a | |||
| 73a17baeec | |||
| c26dd5d7aa | |||
| 954969dd74 | |||
| 43002c0c1d | |||
| e580061b74 | |||
| d7540c9a3c | |||
| bea312bd65 | |||
| 3705648c9b | |||
| 53af811530 | |||
| b58a8729c2 | |||
| ee417048e5 | |||
| a4b21d9e2e | |||
| b321851e53 | |||
| 1d5a528107 | |||
| a68835f7f1 | |||
| f2bec05e6d | |||
| c371df4aa2 | |||
| 9ea8c775f8 | |||
| e8e2197032 | |||
| c4c31f5bba | |||
| 940dc1f2b7 | |||
| f54b230906 | |||
| 3bbc4e44c3 | |||
| 9ad1a84853 | |||
| f5b6bea2d4 | |||
| ce6acd3ecd | |||
| 1c04a5ec47 | |||
| 2fa9bd221d | |||
| 9ca82caeb7 | |||
| 5cf84c3765 | |||
| 3d68b5baa1 | |||
| 8792bddb0a | |||
| e5afa62c3d | |||
| 33e824f5de | |||
| 6820abd67f | |||
| b5c54e447c | |||
| f81370232a | |||
| 85fad1504a | |||
| 1d10d56651 | |||
| ef5d921eac | |||
| 96c71dd3d2 | |||
| 8409aa9eba | |||
| 02d2cc58d7 | |||
| 452f0bb2ab | |||
| 10b482ff1e | |||
| 42742727d6 | |||
| ca9aa180c1 | |||
| ce46cc9852 | |||
| 47cb94e634 | |||
| 39f327acdb | |||
| 80265a0815 | |||
| 6189b47648 | |||
| dd6f5949c2 | |||
| a62539489d | |||
| 70ac734263 | |||
| b24a815ac1 | |||
| d6b2739525 | |||
| 846a500fb4 | |||
| 8b7f805642 | |||
| cc5190eb91 | |||
| 4eff798270 | |||
| 4e40e5bb88 | |||
| 1a27ff4518 | |||
| a456b968cf | |||
| a6387c3012 | |||
| 5f2074d757 | |||
| 2a9c81eb25 | |||
| 65fb8ae33e | |||
| dc88c9f3a2 | |||
| fc3fc6005e | |||
| 27fd913c86 | |||
| e0e828ef5c | |||
| 9992c4d275 | |||
| ab65b9745b | |||
| 4e3ab026fe | |||
| f5b212a9d4 | |||
| e31eb46123 | |||
| 326be0d7ba | |||
| cae2992af1 | |||
| 265cb58750 | |||
| b5610e77a7 | |||
| 48cf103441 | |||
| 82c2aa6e65 | |||
| c54676d625 | |||
| e5c39ed48a | |||
| 0d65397ae7 | |||
| 6c76c8f881 | |||
| a7f30391d0 | |||
| c96850ba59 | |||
| 5459c11e99 | |||
| 93d1785820 | |||
| 801c943009 | |||
| e755a2a6e4 | |||
| 96ee83898d | |||
| 1913482cf5 | |||
| 56eebb926d | |||
| c7d04c6c5c | |||
| 1ba7c728a6 | |||
| 57a30a1dd8 | |||
| 142a07cbbf | |||
| 0e9ac7265d | |||
| 858a7da5c0 | |||
| be9b676db3 | |||
| 82e8657a6d | |||
| 8675a8c743 | |||
| 75a6eaf147 | |||
| 533bfba75c | |||
| 10e1c2b3cd | |||
| a1dd30ed50 | |||
| afa0f80c61 | |||
| 2dd98e7cc6 | |||
| f74f1a94fe | |||
| 96bf26611e | |||
| 841741aa52 | |||
| 596ada51f3 | |||
| 8f15a609af | |||
| 28fd967148 | |||
| 8cdf7bb84b | |||
| 6fb780eae6 | |||
| 858ba6c798 | |||
| 386733aea1 | |||
| 11eafca3e2 | |||
| 5087ff0814 | |||
| 8396ae6e4f | |||
| 5059523937 | |||
| 2da56d5af6 | |||
| b74b05d1b3 | |||
| 0c261acf3a | |||
| 4b298a7460 | |||
| ebc8015638 | |||
| 35c7cab742 | |||
| c1921f1b12 | |||
| 9b978afaa2 | |||
| 6adbbcdde1 | |||
| 92a58a0eae | |||
| bb7cfcbcdb | |||
| 467eb4d240 | |||
| cfb30572cb | |||
| 997ad12730 | |||
| f30eafc9ac | |||
| 13ede34516 | |||
| 777eaa7352 | |||
| e5d7f446d6 | |||
| c72b6b3be8 | |||
| 028ecc6c02 | |||
| 92a015b8bd | |||
| bb61a2547a | |||
| cdaca22511 | |||
| fb96b7da60 | |||
| 5869415a57 | |||
| b5248da826 | |||
| b059a361dd | |||
| dc9e6d3af8 | |||
| 3c99dc96b1 | |||
| dadba232de | |||
| 787f5236a9 | |||
| 31498ebbea | |||
| 9636ffc471 | |||
| b17e1531d2 | |||
| 05dc645b81 | |||
| d4f038dfcc | |||
| eebf0dd7c9 | |||
| c972c94662 | |||
| 33c9d57c6f | |||
| 6b3469268e | |||
| e75576e1ab | |||
| d9be552bbc | |||
| 18c44b2ce8 | |||
| 4531f9f2f4 | |||
| 2c6f1ab57d | |||
| 000110e760 | |||
| 30b16e0a5a | |||
| fa91e4ff27 | |||
| 7a686a0c43 | |||
| d4e3405db2 | |||
| 857b64efef | |||
| 835e4b6de9 | |||
| 0a5301bc5b | |||
| 572af7640f | |||
| cceeca3052 | |||
| 3a4bc0d41e | |||
| d9d8ad20a0 | |||
| eaee63d96b | |||
| cfb02b5370 | |||
| b8175f8976 | |||
| cae2a53563 | |||
| 182f43b6f9 | |||
| 5132102863 | |||
| 4395c1b9f8 | |||
| 6d2a97e954 | |||
| 79dc0ed175 | |||
| b3d201f148 | |||
| 2007e1d8a3 | |||
| c6d2f0399a | |||
| 66e4ace39f | |||
| ce00d38bd9 | |||
| 877de883b0 | |||
| a920ed9e1e | |||
| d9b8a9d90e | |||
| 6c8ec5336f | |||
| 30bf4a5e34 | |||
| 0fda551dbc | |||
| 687fa6a8ca | |||
| 32797515de | |||
| 0f622206e4 | |||
| a724525c00 | |||
| 36d00f0200 | |||
| dbc6fe3a0f | |||
| fbe41703e4 | |||
| 0cd14e3fb4 | |||
| a1816e8c77 | |||
| e6c41f0de6 | |||
| ca55982669 | |||
| ea67060081 | |||
| b4398d62b2 | |||
| fc21b15d6e | |||
| 733fec020b | |||
| a6f9170f10 | |||
| 2dfaad3259 | |||
| 4d0ed5c13c | |||
| fcb56a5460 | |||
| 06ffa408ce | |||
| 98a73de526 | |||
| b669e9f648 | |||
| ebdc870296 | |||
| 34e9d1eb3c | |||
| 3914c17b0d | |||
| c92e0838c1 | |||
| 850053f9ca | |||
| 443fed796a | |||
| 08536943ad | |||
| 8cb8ba7caf | |||
| fa91d621fa | |||
| 2268ed1b6e | |||
| 936523ae52 | |||
| 93ffebc273 | |||
| 7fff245f87 | |||
| 76b6f6b017 | |||
| 6e3ea8b49d | |||
| 220b278575 | |||
| 2b022311a4 | |||
| 853f5111c2 | |||
| 7a884ab6a5 | |||
| 792079ad33 | |||
| a9d77b5c64 | |||
| 65ab6ed59f | |||
| 7767352572 | |||
| aba66352dd | |||
| 389aae59ae | |||
| c9abb823a7 | |||
| 6c444ced08 | |||
| 4e633d1f78 | |||
| e6dd9a78ae | |||
| 012f36e47d | |||
| 1196eb33fc | |||
| 4bea70a64a | |||
| d37164bab6 | |||
| e0c888acf7 | |||
| cc2f8f1778 | |||
| daff6e6484 | |||
| 50bec53afc | |||
| eea0f7fd76 | |||
| 3e0c72ea84 | |||
| 3972c526ce | |||
| 75f67ed207 | |||
| 828091cfbb | |||
| eb981cc7d7 | |||
| 31be03a805 | |||
| 644846c702 | |||
| defeda2f70 | |||
| 4102855edd | |||
| ca3848d773 | |||
| 602989ae9e | |||
| 88f60113a5 | |||
| f50b58b509 | |||
| 223d7cfb38 | |||
| e6d9486a6c | |||
| 9a8e47a766 | |||
| 13f244b6a5 | |||
| 7e2c65ce3c | |||
| b184b19970 | |||
| 28556f1498 | |||
| 55676b7173 | |||
| 92f754c675 | |||
| 0ccd810738 | |||
| aa6e296236 | |||
| 7f608db244 | |||
| d61ad04f11 | |||
| 28a14df26c | |||
| d305fd4fca | |||
| 8486f1b8f0 | |||
| a1bd39441f | |||
| e959f449ae | |||
| e4aea680b9 | |||
| 5d3822f15e | |||
| 9a12aa45ad | |||
| 465ae048a0 | |||
| 2c029aae46 | |||
| 3523e0a56c | |||
| 2933b58a2f | |||
| 1c1d653f3a | |||
| e397434cb6 | |||
| 71009c9b4d | |||
| ad356e3239 | |||
| c8fc8d210b | |||
| 7a3cb2280b | |||
| 8b26906d6d | |||
| dbed39a931 | |||
| 9a76322ef9 | |||
| 0f07edded6 | |||
| d3f75df0a6 | |||
| ea31c09384 | |||
| 971c4ca10b | |||
| 329a1fb781 | |||
| 73f65b1ccf | |||
| 1fbaa48cec | |||
| 043e7e3516 | |||
| 6974fce183 | |||
| d6a8e08acc | |||
| 9c23f2f1a6 | |||
| d8ffddd075 | |||
| a692d87cfb | |||
| 5e9750d1f5 | |||
| e7015f6ae8 | |||
| 9c9fb1c6d0 | |||
| 80c64fce11 | |||
| 237b867721 | |||
| a7dfa261d8 | |||
| 4d1f0ef2d9 | |||
| df6728e64c | |||
| 7a73941f22 | |||
| 6d9e66eca1 | |||
| 2180a67670 | |||
| 365451dab0 | |||
| 1188c6fe14 | |||
| a2e754c136 | |||
| c09a3cf098 | |||
| 842341fc16 | |||
| 32a5e5fae1 | |||
| 85b9960f62 | |||
| 5640b36f6d | |||
| c8e6ce304f | |||
| 1c468add20 | |||
| 5339ef3004 | |||
| 6a2b3c8d4c | |||
| edacd91a27 | |||
| 5dd46b54c1 | |||
| ea502b6e84 | |||
| 24ced3d657 | |||
| c5a5d7eb51 | |||
| ab2c16b2e5 | |||
| 113793fee7 | |||
| 954536073d | |||
| b54a70a538 | |||
| cc45c10f3d | |||
| a66fd527b0 | |||
| 6d2cfac303 | |||
| 13aa23f706 | |||
| f8a27d2603 | |||
| f185640eda | |||
| 78b51fb574 | |||
| 72eccb7694 | |||
| 922d5796b9 | |||
| 803f86b9ca | |||
| 7bac615d8f | |||
| dc3406eed9 | |||
| f0ddc2a53c | |||
| 1cc3f7abbb | |||
| 70177143a7 | |||
| 43d9256096 | |||
| 803ff64b14 | |||
| 824241ad5c | |||
| d5d059690f | |||
| fd832bb57d | |||
| 09cb329d73 | |||
| 4a9291fd89 | |||
| 5677a683a5 | |||
| c813ad5533 | |||
| 0b77600718 | |||
| 5115e5decb | |||
| 429a643f42 | |||
| d2a66d3c99 | |||
| 0f41daeba5 | |||
| 1be75437b7 | |||
| 978ad4981e | |||
| 8c4f886f5f | |||
| 0d63c4c28e | |||
| 6843d368b2 | |||
| 24af70c7e0 | |||
| 1ed9ff17e1 | |||
| 9dc1d388af | |||
| 28cb714a09 | |||
| 91c6d36ff8 | |||
| be76b451cb | |||
| 53785b6ac6 | |||
| 2332fb852d | |||
| f1fdfa1a51 | |||
| 0f3fe957f5 | |||
| 8edff1065a | |||
| 41398987c3 | |||
| de8024ce4a | |||
| 7b9b876726 | |||
| 944710de4e | |||
| 2b3c7490d5 | |||
| 8965f3ae06 | |||
| 5771fd693d | |||
| 1ff11c84ab | |||
| 5faaa28870 | |||
| fc4679d4cf | |||
| 761c269e47 | |||
| 131d199ae3 | |||
| 35c53204cb | |||
| f731515628 | |||
| 4e62900009 | |||
| 7813eef92b | |||
| 59bf2a34fa | |||
| abbb73e894 | |||
| cc10e6b344 | |||
| 11e2a216c5 | |||
| 404893810c | |||
| 53ec8f286b | |||
| 70f2ee917e | |||
| ad93ed720d | |||
| cc3ec5d453 | |||
| 288251e672 | |||
| dada5a422d | |||
| 421fdc0e94 | |||
| c4d434fd6f | |||
| 8bb3d363a4 | |||
| b8aa0cddab | |||
| 50811e04f2 | |||
| 449826288b | |||
| 1522722fab | |||
| 68fe37b008 | |||
| 26ba4f3c1d | |||
| e19b422854 | |||
| 913c4151bf | |||
| 78a802baae | |||
| 9d602f2752 | |||
| 7649e537b7 | |||
| 2faa4cd933 | |||
| 0492301e76 | |||
| 18bf91a08b | |||
| 09ef4c9cff | |||
| 634dd656d5 | |||
| 9d02d42afe | |||
| c716e374c1 | |||
| aeec6e43eb | |||
| 8f1f4273a2 | |||
| 630a94b8b7 | |||
| ceca139f7f | |||
| da5e0ef461 | |||
| 4fa6734320 | |||
| a9c8a526cf | |||
| 0926a84a45 | |||
| 0101fa789c | |||
| 12b3d157a5 | |||
| 60c26f8f1e | |||
| 7294ae0f17 | |||
| 0ffc186680 | |||
| 699db77293 | |||
| 50beef605b | |||
| 068ebe8b4d | |||
| ffaf58349c | |||
| eec468fa13 | |||
| 81c94357e8 | |||
| 042c486b68 | |||
| 6921f967a1 | |||
| 83a0c12144 | |||
| fa8684b5c8 | |||
| 690fb0544c | |||
| 283348afc3 | |||
| ee0c985491 | |||
| b41f38ecc7 | |||
| 682180e0cd | |||
| 1385db48f5 | |||
| 94201b7cf9 | |||
| 15632c6305 | |||
| 6b84990620 | |||
| c9b6b2cf04 | |||
| 617fe2545c | |||
| 93663dc57a | |||
| 28e55dc5f3 | |||
| ae4c72a153 | |||
| 9253e8bda2 | |||
| 0f031b6680 | |||
| 255b20f6de | |||
| ac9ec55b37 | |||
| df4139d373 | |||
| 1059735bfb | |||
| 8f2eb60719 | |||
| a1ffc00ba8 | |||
| 1a81a97e9f | |||
| e6ef9221cb | |||
| ee84ae0551 | |||
| bd04568baf | |||
| ea92c2b1a6 | |||
| 8ecdd215b6 | |||
| 5a3bca8d5c | |||
| 9b9f38afc8 | |||
| 9ac7aea930 | |||
| 5f17cc1abd | |||
| 8f6695acc7 | |||
| 9524abcd28 | |||
| 4fea6179a0 | |||
| 055f177a6a | |||
| 83efde6243 | |||
| 8eb987e393 | |||
| 2c6ab65476 | |||
| 66fdddc339 | |||
| 3c5a6be835 | |||
| 5575171652 | |||
| a8b0db4e5d | |||
| 4b895a4d1f | |||
| e9f99063c7 | |||
| e104fcc000 | |||
| 9f0ff03da5 | |||
| 9ba659af84 | |||
| be989b3b60 | |||
| 0706bd72b8 | |||
| f6dc396a0f | |||
| 48e8e76a34 | |||
| e4f71994c2 | |||
| fae329a0ca | |||
| 29e88e50ff | |||
| 52f52f6786 | |||
| 852f061b26 | |||
| fe56bdeeb9 | |||
| b34d86ca24 | |||
| 24ab751547 | |||
| c8f3579f93 | |||
| f0d277e452 | |||
| 962dc21f2b | |||
| 2e8483bd1c | |||
| 3eec8fd0eb | |||
| 43e66e7ff9 | |||
| ad5898224d | |||
| f8398d80bc | |||
| d8d025c33b | |||
| 8811dabbac | |||
| 9faacfbc0d | |||
| a610be6335 | |||
| 6a5266df79 | |||
| 238a3806b0 | |||
| a07a4cefe1 | |||
| a0211a1c2f | |||
| 47bb09bc4b | |||
| efca746d36 | |||
| 93b0b03447 | |||
| e0f524d3b7 | |||
| d1c842cf29 | |||
| 4d23a5d92d | |||
| 0739d1c2eb | |||
| 475c775b25 | |||
| b7e8ce4523 | |||
| 0a23c1bf11 | |||
| e8fcd721b8 | |||
| ecef7f7930 | |||
| 5db13fe2a7 | |||
| 9932612373 | |||
| 6203c95d31 | |||
| d5d19a9f67 | |||
| ef5579dc86 | |||
| 84ae8097b1 | |||
| f33f236ab6 | |||
| 95b1fe0776 | |||
| 35bee663eb | |||
| 98f6ea0785 | |||
| 295b988657 | |||
| 68942affdb | |||
| e0980c4d73 | |||
| c5920df159 | |||
| 86ddff0b88 | |||
| 908978d00b | |||
| a956732874 | |||
| 879e046b22 | |||
| e0a5824028 | |||
| 5fb0f34e8a | |||
| 861415133e | |||
| 87b1835cb6 | |||
| fce75cd858 | |||
| ec9c53eeff | |||
| b6d5565df1 | |||
| d3eed2cf23 | |||
| 51f7eb3a3c | |||
| b35fbff675 | |||
| 15e9e3304c | |||
| 3961b214f0 | |||
| 53ad291ef1 | |||
| 145d3ba99d | |||
| 8ac7b21716 | |||
| e6171d17f8 | |||
| de54d45afd | |||
| 3cab9e7a9c | |||
| aa1c86f95e | |||
| 699565828d | |||
| b0ad7f759a | |||
| 30597e5c98 | |||
| 38de2a8754 | |||
| 8b661cde15 | |||
| 70f38b4dfa | |||
| d389edd843 | |||
| 27a4e370f9 | |||
| b4fd3e8674 | |||
| 43f889ae1f | |||
| e628fd7bce | |||
| 7d75526373 | |||
| ecc9bd0925 | |||
| d259eb28bb | |||
| 76d4aa0c06 | |||
| 2113818f19 | |||
| 29bee6f07e | |||
| a7b3d2581f | |||
| 3512cb2226 | |||
| 96a50d5eb0 | |||
| 79db32bcd9 | |||
| 808ba552c5 | |||
| 14b438317e | |||
| 6d5f7b72c0 | |||
| cecb878915 | |||
| 29c10b6792 | |||
| 92ec971453 | |||
| 95502242c9 | |||
| 1f88a1af9c | |||
| 65e2961fee | |||
| c5687caf1a | |||
| 5d54def264 | |||
| dbfeb8892d | |||
| 949d7d7d25 | |||
| 451340fd3d | |||
| fdaeb20253 | |||
| 29770e13e8 | |||
| e51d7cb3d8 | |||
| d66f3efd36 | |||
| f512bf7004 | |||
| 63affb2be9 | |||
| 87b1100027 | |||
| a024593fa6 | |||
| 78c500e97a | |||
| a4f53988c4 | |||
| 347e09cd07 | |||
| 095b0d3272 | |||
| 87b5737293 | |||
| b7b82c1cef | |||
| cb5da8983f | |||
| 796795ac89 | |||
| 3e8934dec0 | |||
| 58ac3e09da | |||
| 09fa758725 | |||
| 57ae3ac7a2 | |||
| 6fc855865f | |||
| b80c978f5d | |||
| f4b9acb4db | |||
| acbfd85737 | |||
| 03b3be0f51 | |||
| 38f8fc6c82 | |||
| 7828854c9d | |||
| d7ac4495c3 | |||
| 492ef14550 | |||
| 10ae0c4364 | |||
| be2ccdbf0b | |||
| cb3ae1232b | |||
| e73e393c82 | |||
| 88b04c3cd4 | |||
| 1fb7ee0e16 | |||
| 8f78a1123b | |||
| d7885ed819 | |||
| b9fd5f8186 | |||
| 0c8590027f | |||
| 0a5bd0ac8b | |||
| 2f929376ec | |||
| b01f63835e | |||
| 6d7f5871db | |||
| 30a4e2f7ac | |||
| 8e0781648b | |||
| 89720ae24d | |||
| c331a214d0 | |||
| 9097ccf515 | |||
| dca657a2fd | |||
| c35c5a47df | |||
| 17cc21c9d6 | |||
| 5e241e7c36 | |||
| df8b057b44 | |||
| 64b3c1e691 | |||
| 15aee09c7f | |||
| 92517fa359 | |||
| 80610ca054 | |||
| 95dd4b3f27 | |||
| 87ed12b8f3 | |||
| fd0df5a89b | |||
| b487e2df0b | |||
| c6ed2bf9aa | |||
| 40b1dc12de | |||
| 53bbed89ae | |||
| 8eba3c1e7e | |||
| b50c70bbfa | |||
| 286c2c236b | |||
| af021e79d9 | |||
| 875de75327 | |||
| a39e0daacf | |||
| 73bfe68821 | |||
| f3fae0dae0 | |||
| 4a73b4859f | |||
| f90aea22b1 | |||
| bd98ed46bd | |||
| 8b48c2a10c | |||
| f1f15841d7 | |||
| f5d181db3a | |||
| 80b62a41c6 | |||
| 54279523a3 | |||
| 24e72e151a | |||
| 8a3c394d6a | |||
| ad146e5a6b | |||
| 66d15e89df | |||
| da7e1cfb49 | |||
| d486204a0d | |||
| 07c6b0a8df | |||
| 43b64140ae | |||
| 8e8315abfd | |||
| a18da0c55e | |||
| d621a99e73 | |||
| 107660c7ba | |||
| b33cb2e3f2 | |||
| e70526625f | |||
| 8a328e393d | |||
| 9fae8070dc | |||
| 6ec230480d | |||
| c441ad36c8 | |||
| 59cd636ad7 | |||
| 3f3d805663 | |||
| d74b98c3d9 | |||
| 351ee2e3a5 | |||
| 7f7f30a08b | |||
| e0bfe44cac | |||
| fda99c1c6c | |||
| 71c8de8fa1 | |||
| 27a6be8763 | |||
| acce95f446 | |||
| 10fb88d027 | |||
| a78e5344df | |||
| e5236cecd6 | |||
| 6aff916aa5 | |||
| 4f9db2c03a | |||
| 9988e1b6ee | |||
| afb81ba6e6 | |||
| 0f0a82b619 | |||
| 2cf34c0fe5 | |||
| f826709452 | |||
| f10fd64630 | |||
| 49a1328046 | |||
| 2877f17372 | |||
| 00cbb894ec | |||
| a0f86479e0 | |||
| f9a5c4d181 | |||
| d71812425a | |||
| aa5c45339c | |||
| 1e362ff5c3 | |||
| fc71316690 | |||
| cb7ee27cd9 | |||
| c7cf8fb35c | |||
| 8b0e1c7fcb | |||
| e3af72bb68 | |||
| ec3492a22a | |||
| 07808c8d5d | |||
| 436e330642 | |||
| a11d944f51 | |||
| c85e44697e | |||
| af883e88e1 | |||
| 3dddf703a9 | |||
| 09837928d9 | |||
| f7ccc74e09 | |||
| 546fcd990e | |||
| 5eb295adf3 | |||
| 20bf7b6a79 | |||
| dce4e94f02 | |||
| af769e4ec8 | |||
| ee6415bd1c | |||
| 70a27c7dd6 | |||
| 701760dbeb | |||
| 0f9f2696be | |||
| 65a0587ce8 | |||
| 78835ad87a | |||
| 4e6be21a44 | |||
| f89e4e7dd0 | |||
| dfa8467a08 | |||
| 669ee0415a | |||
| f9c8bb40b1 | |||
| 7d3a1657c9 | |||
| f36790d521 | |||
| 367668710c | |||
| 0f2b535fcc | |||
| e345cb03d5 | |||
| 94dea84915 | |||
| f33cbe94dd | |||
| 9f1218b00b | |||
| e13f6ded7f | |||
| 4b03a4a841 | |||
| bab4f4f5d8 | |||
| a08c6e49b3 | |||
| 50bceea038 | |||
| 9e42204e67 | |||
| c557193b8c | |||
| 3e6b3a6856 | |||
| d52cef1719 | |||
| fcfa488250 | |||
| 0d4fd20a73 | |||
| 2bbe31a8f6 | |||
| 7cdb0eafeb | |||
| 0515f930e8 | |||
| 32a02544de | |||
| 90f47eb952 | |||
| fc1dee685e | |||
| c894fc5bae | |||
| e1ee744e15 | |||
| e86287d8ae | |||
| 15e57d28f5 | |||
| 4c7d521413 | |||
| ade57c8bd0 | |||
| ea43e28a37 | |||
| 532eace7d6 | |||
| d4ac4fcde1 | |||
| 258a769567 | |||
| 7845f6d95c | |||
| be48cdc747 | |||
| 8ef2d19337 | |||
| cecf84410c | |||
| 596a0125ed | |||
| 8a8d07fb17 | |||
| 72f422c7dc | |||
| ca51bbb7ff | |||
| c1db75e0c7 | |||
| 4062ef5fcb | |||
| 1ae477a46d | |||
| 087e9308ec | |||
| d13db35f31 | |||
| b38c50b3d0 | |||
| dd06540e1f | |||
| 50b61668e2 | |||
| 1df84f7246 | |||
| bdc34984f1 | |||
| af0c930e77 | |||
| bb45bf9695 | |||
| 4e0d2a3e6c | |||
| da6d8961fc | |||
| 3e027df583 | |||
| acfdd0e1fc | |||
| 9fb8f6347f | |||
| 7f73b105ca | |||
| ae8dcdf40d | |||
| ee1e1ce377 | |||
| bed388bafb | |||
| 6d165dae5e | |||
| 6477262e63 | |||
| f79599f949 | |||
| c94d75874b | |||
| 21f3987d53 | |||
| 335e61dc47 | |||
| 64380baa85 | |||
| b5eb65e53e | |||
| f1ca05c822 | |||
| 900df21b7d | |||
| 93bad514a8 | |||
| d10a219833 | |||
| bd7bf39b4b | |||
| 472b71ecef | |||
| 4f360f8b1a | |||
| e8d45a9cdd | |||
| d8cd1d8fcc | |||
| ff2eface19 | |||
| 29ce348c4d | |||
| b2a4069f55 | |||
| 4d78342919 | |||
| 1272332ae3 | |||
| b47c9ac643 | |||
| 1c20a7f008 | |||
| 6356403964 | |||
| 6700fdb81f | |||
| 096366738b | |||
| 6a6506b02d | |||
| 59ccf2c9e0 | |||
| 2c42361ecd | |||
| e8a14a775e | |||
| 7b90a1e85a | |||
| 18833d5121 | |||
| 49283ec035 | |||
| f25450791b | |||
| c9faa09d55 | |||
| 1deeca985f | |||
| 6acabd1fd8 | |||
| 5ac9a2a7d0 | |||
| 808c89adc1 | |||
| a527e8cc73 | |||
| 10c570b558 | |||
| 76f47548b3 | |||
| 7d4bb9428b | |||
| 67d46dfc6c | |||
| 3c03fb56e0 | |||
| 378cf2ab63 | |||
| c6f5b013ec | |||
| e593d5bbc5 | |||
| 3f5c3ddd27 | |||
| ab8ba047a5 | |||
| cecc19381f | |||
| 6e84abc746 | |||
| 322c6b1ba4 | |||
| 76eb389761 | |||
| e9a1ccb89a | |||
| 73d44c7881 | |||
| 31fef14d76 | |||
| 7ee69740e8 | |||
| c61bc3a0cb | |||
| db262fa76a | |||
| b24fc6954d | |||
| 828cb4286d | |||
| ee5e0e16d9 | |||
| b907bfe3e7 | |||
| f84eb3dde6 | |||
| b996b618e0 | |||
| 98c5ce9347 | |||
| f89defad5d | |||
| 96f92c6705 | |||
| f0c46a4c74 | |||
| 4e59d6fd12 | |||
| e136c11c7c | |||
| 0e80f56e44 | |||
| 9752d45c87 | |||
| 860ae77ec9 | |||
| 1567a65475 | |||
| d2e08a524e | |||
| 94758c18de | |||
| eff0f9d3f8 | |||
| c1df9ad456 | |||
| 8b197c58e6 | |||
| 781721ca50 | |||
| 603eadfe51 | |||
| b9b66ca437 | |||
| 22cb65ada9 | |||
| e76b375a31 | |||
| 90b8a03a89 | |||
| f056c0f137 | |||
| 9f5f64e14e | |||
| 49e0126b8e | |||
| a24a829490 | |||
| 615883977f | |||
| 216cd7dc61 | |||
| 4910f16f16 | |||
| f2d363feb2 | |||
| 8b2122e12f | |||
| f16f818f5f | |||
| 5b3ac112fe | |||
| a0cff0be94 | |||
| 509de3fa2c | |||
| b00758babe | |||
| 4eb2966559 | |||
| 9f2edc1135 | |||
| a56b221559 | |||
| fb2b26c419 | |||
| 377e51df83 | |||
| 7453a6938a | |||
| 39f5e57321 | |||
| f49f6d52b4 | |||
| 715f23127c | |||
| f0f652f9e9 | |||
| 731aa963bd | |||
| 7e353a1ec5 | |||
| 293facbae7 | |||
| 4fe900c399 | |||
| 5c3880d302 | |||
| 9eaa583bfb | |||
| 6500700d6f | |||
| f95a411ba3 | |||
| 7c8ab271fc | |||
| 70b893333d | |||
| 449696f1e5 | |||
| e0c93bcf6c | |||
| 23022f3ffb | |||
| ac4a6aad15 | |||
| 7d7767ba42 | |||
| 183cfd3a2e | |||
| 9cb3e9abf0 | |||
| 053259fd92 | |||
| b4cea8d6d1 | |||
| 8f57fc93ec | |||
| 9ff4475695 | |||
| 1c73e66edf | |||
| 061149cbbd | |||
| a2daf0c83c | |||
| 2dbb5871e0 | |||
| be08730cd6 | |||
| 3082ea82f9 | |||
| 5131619a1a | |||
| b056ce33aa | |||
| df9efbbd1f | |||
| f2e1710dd5 | |||
| 05830874d7 | |||
| 4fb086d6c3 | |||
| 3ea2586a5a | |||
| 2df0345985 | |||
| da41ac9e60 | |||
| 47e3e89e30 | |||
| 3f302cabb8 | |||
| 8e034053af | |||
| 82c477c9f7 | |||
| 67f79aabdd | |||
| 5aceee5a36 | |||
| 1e1a1855ae | |||
| 2003eb1b9b | |||
| 17196bb4fa | |||
| 7e71b1079e | |||
| 814ebe39ae | |||
| 61c870ae09 | |||
| 6949bc9ef9 | |||
| 7cf52de47e | |||
| 9433784e47 | |||
| ed0e79cb61 | |||
| bb82cdc928 | |||
| db8585701d | |||
| 57bead3a5e | |||
| 28d0e97c09 | |||
| 5d12c070ea | |||
| 5bde800ee3 | |||
| 29a1dc5719 | |||
| dbf3362c4d | |||
| c4e0f4b2b5 | |||
| e90e398e7a | |||
| 4937eeddb5 | |||
| 2988260107 | |||
| 83039c8752 | |||
| 6499263b41 | |||
| 80cab4a163 | |||
| 47202b3349 | |||
| 9076bb6089 | |||
| 89528d7c3a | |||
| 0bef42ba12 | |||
| b41bc0ae59 | |||
| fb1f12021b | |||
| dd8e990451 | |||
| e031bada7d | |||
| 2b7ff90e63 | |||
| b597c87bed | |||
| 0aded5aae6 | |||
| a8e9a3a88d | |||
| d044ac1c66 | |||
| 2f0fc920dd | |||
| 9137e2d635 | |||
| c37d1a53b5 | |||
| 1165fdd0f5 | |||
| 597db69151 | |||
| 9eb79926df | |||
| fa466b022d | |||
| 43820d89b4 | |||
| faa6c4e1e1 | |||
| dd8701c1a0 | |||
| 74cf48b5d7 | |||
| 45b5b3c13a | |||
| 9787ab598b | |||
| 5336b9ad19 | |||
| a16254de2b | |||
| 8a2ce75d96 | |||
| 9c7040802c | |||
| cbb1e867e5 | |||
| 8de08e0463 | |||
| 236f383969 | |||
| 93abdbf25e | |||
| 8f80565d9c | |||
| 391b9586ac | |||
| 4283309daa | |||
| 6e767e2376 | |||
| 0c4d5ffecd | |||
| 28e08ae0bd | |||
| e0603bb45f | |||
| 7d40fcead5 | |||
| 8c7555523b | |||
| b117302bca | |||
| e1205d046a | |||
| dadde75ef0 | |||
| ee743afebe | |||
| 767b31cfbf | |||
| 18abe54497 | |||
| 05f0cb16de | |||
| a4060e15a4 | |||
| 7198b9e461 | |||
| ab9b6e806c | |||
| 270cc3bcbc | |||
| c213a3823e | |||
| 51074b9743 | |||
| 070393dfda | |||
| f4df537e27 | |||
| 905da2994a | |||
| 7e9b5d9e30 | |||
| e526c4bfe4 | |||
| fe806878be | |||
| a2a9a01e05 | |||
| 3d141280aa | |||
| 9df7517dea | |||
| 4560909a5e | |||
| 6c4f618db5 | |||
| f3ee07ca11 | |||
| 7cc84ce8ab | |||
| 40b8ca2eed | |||
| 4dcef28023 | |||
| 0a41b3df45 | |||
| f086fc5b18 | |||
| c473718bc2 | |||
| 1da46fe6fb | |||
| 5b72e83687 | |||
| 78d07e841d | |||
| f38808a39f | |||
| 3f65924c45 | |||
| 540415dc5e | |||
| f0cadaa6e3 | |||
| f058b5fb1e | |||
| 481829a81b | |||
| c9439476da | |||
| 60994389a6 | |||
| b0ee5d9023 | |||
| 84f2f37680 | |||
| d5951bc033 | |||
| a5e8ae2183 | |||
| 1dec480974 | |||
| d6c669f5cf | |||
| 014ae55379 | |||
| 53eb27f508 | |||
| 4a3dfffd46 | |||
| 50751ae6ff | |||
| 10676f86d5 | |||
| 5e31c82b5b | |||
| 4382bdc859 | |||
| dee5f9a67b | |||
| 2b6aa50b81 | |||
| 3c74fde349 | |||
| 6eb8faea85 | |||
| 23fc96e98f | |||
| abceae1ac0 | |||
| eed1130327 | |||
| 41b95cae38 | |||
| de6f0a537d | |||
| 4dc7e617a4 | |||
| 0155851929 | |||
| 71c6cb9c22 | |||
| 2170811e48 | |||
| 9d8495f8b3 | |||
| 5385086fef | |||
| dcc1beb1f8 | |||
| e38ea3a888 | |||
| 33b7028be2 | |||
| 850a8577b2 | |||
| e79c729b20 | |||
| 625d20b9b4 | |||
| 1c75f3d037 | |||
| 9c3ec05825 | |||
| 875f23881f | |||
| d0a3686812 | |||
| c9fe6f1afe | |||
| 2508f7f971 | |||
| 8b5f061dae | |||
| 999aba3807 | |||
| fa66c6b797 | |||
| 82c7ab0231 | |||
| 4c5a86828a | |||
| a7b502f04a | |||
| e4b5e9b9c9 | |||
| e9bb26267e | |||
| d7bd662c95 | |||
| 452fa3011c | |||
| d57e5406f0 | |||
| 2da96be217 | |||
| 7fe0727930 | |||
| 529d38613b | |||
| 88d56dc700 | |||
| 7ba66a1682 | |||
| b6255ab9e7 | |||
| 924ff903ad | |||
| e2b5d11290 | |||
| e41f19d2f3 | |||
| 52b151dceb | |||
| 362d4f5395 | |||
| a29d11240e | |||
| 61d8719b8d | |||
| 0fd74fa177 | |||
| 45677819e8 | |||
| e14b2ba43c | |||
| 43f821afb9 | |||
| 81325a3fa0 | |||
| aa0c6ddb4c | |||
| 5e6a3f1f6c | |||
| 523b6f32ba | |||
| fc59498b2b | |||
| 3b01777c98 | |||
| aa10cdbfa2 | |||
| 06fc77610b | |||
| 019c2f2115 | |||
| 4bc080dc50 | |||
| c7fc563dc0 | |||
| 0bb2c115aa | |||
| ccd2370bb7 | |||
| c0d0cf5e74 | |||
| b09a4a98d4 | |||
| 135ea264ef | |||
| f25a01bb5a | |||
| 6309e28dd0 | |||
| bd8c8e720e | |||
| 9e1b1e5389 | |||
| 36288eebe7 | |||
| a0baae8a55 | |||
| 9a66331984 | |||
| c9fab28214 | |||
| e93e1ba2c9 | |||
| f545aee66d | |||
| 203f95d3be | |||
| b3578710cf | |||
| 117e97adac | |||
| 0c4328fbf3 | |||
| 7ed5d85f25 | |||
| c52b4cf450 | |||
| 481af5c469 | |||
| 3165baa1f1 | |||
| 74da80dbda | |||
| f73eff7517 | |||
| 5557474467 | |||
| 8e24a8b7c0 | |||
| 5a27f7c81f | |||
| 6ce26b72b1 | |||
| 86885c5ed0 | |||
| 2dbaba077a | |||
| 7a2448672c | |||
| 9be3f7d41a | |||
| f40231af5d | |||
| c3a90ccbad | |||
| 145eae321e | |||
| d971678add | |||
| 6c196d3066 | |||
| 346871e27f | |||
| e4b51fa8ad | |||
| 67259d7082 | |||
| 7469981d1a | |||
| db48f7b5d1 | |||
| 9a8a964b69 | |||
| 75ee536d6d | |||
| 0081dc478f | |||
| 17888ce0fd | |||
| 5dc0e51682 | |||
| ba1a6ad4cc | |||
| 051b40f956 | |||
| 34ad9b8a42 | |||
| dbeb4a11be | |||
| b11e22c25b | |||
| 53a475d63c | |||
| e87425f047 | |||
| 67b67003c5 | |||
| 9510551c63 | |||
| cc8db99695 | |||
| b80c7bca0d | |||
| dc27d52221 | |||
| b39cd06249 | |||
| 715f40a48d | |||
| ab8022f74e | |||
| a2bc075924 | |||
| e3dc7e5ec9 | |||
| 46def2fdc1 | |||
| 18bc2a1a93 | |||
| df38624e10 | |||
| 70d6b8774d | |||
| 2195f0cc62 | |||
| fa813d02fa | |||
| ffb9ce8287 | |||
| 8b5e29c234 | |||
| e8e9d1d021 | |||
| e324d2e534 | |||
| 1894f1a37f | |||
| 50c607d206 | |||
| 443670262d | |||
| 4626246087 | |||
| fe20fa8326 | |||
| 387e92353c | |||
| 86c1114463 | |||
| 40b85c1cd9 | |||
| 2047abd9c3 | |||
| 8f7a3b15b2 | |||
| 64f2b1b250 | |||
| eed43a231b | |||
| 8622b1254e | |||
| 5e2c112697 | |||
| ecf4b639e1 | |||
| 577546ccd9 | |||
| db1550a410 | |||
| 9629af1aa9 | |||
| 30d4e0261a | |||
| 001f5faa0d | |||
| a6ad44a7c7 | |||
| bd87eb6e66 | |||
| 2bb5d1bca3 | |||
| 693a7663e7 | |||
| 8f24db048c | |||
| 13a4700084 | |||
| 018eab7040 | |||
| e858c21e1f | |||
| 0d6518aaa0 | |||
| 5fd7cfbcad | |||
| 54e8487f56 | |||
| 1c2ee8a5f1 | |||
| 09c63e4f00 | |||
| f040282bf8 | |||
| 4fe648b15c | |||
| aef16d51ec | |||
| ff3d4d8b7f | |||
| a11ef2650e | |||
| 8c4e0dfd13 | |||
| 49886ebae3 | |||
| d69a327d6d | |||
| ab11b17d4b | |||
| 7d727ac2fb | |||
| 0d249c7448 | |||
| 93f2fd396b | |||
| d068ec3a3d | |||
| 2c291bc2fb | |||
| 95360a5539 | |||
| 8221f57c26 | |||
| c198a35368 | |||
| c0feea50a9 | |||
| 34fc8e9260 | |||
| 390f0a5dcd | |||
| e8a520ed96 | |||
| 0614ee3f95 | |||
| d1a598c652 | |||
| 929d39f69a | |||
| f72633b9f5 | |||
| 486f31fae9 | |||
| c05180ccce | |||
| afa5b0cc93 | |||
| bfc227b8d4 | |||
| cb4b6bb2dc | |||
| d3696f3ad2 | |||
| c64f6b3c22 | |||
| 40765c5f8d | |||
| 9a7f426b7b | |||
| f5ddbbf659 | |||
| a7047dd4b6 | |||
| b46fef327e | |||
| 8620bd5a84 | |||
| 1187a7fa34 | |||
| 7175f257b5 | |||
| 60fa6bea70 | |||
| dd7f88bd68 | |||
| 5e5d997dff | |||
| e0d28aa893 | |||
| 8542887257 | |||
| 749530978c | |||
| 828f33311f | |||
| f3a6ae5f00 | |||
| f581992a62 | |||
| 2e22f8e790 | |||
| 9b0bafb82c | |||
| caa6915b83 | |||
| 7c3090ddcf | |||
| 3cbd2e2764 | |||
| afaf5f940e | |||
| 31a1df0fae | |||
| b0ae357cfb | |||
| 95f948a9e4 | |||
| 4091ced5ab | |||
| 03d3966d15 | |||
| 9492f46d77 | |||
| 6816495bee | |||
| 277e9279cc | |||
| d041b0a599 | |||
| 45dd575ed2 | |||
| b2cff44084 | |||
| 9c2b924dfc | |||
| 2628662586 | |||
| b781ac7346 | |||
| 15130f4f43 | |||
| dcb9bc2544 | |||
| ec30b1294f | |||
| 0560747d3d | |||
| fc35c77f00 | |||
| 04802e41e9 | |||
| ccbc0b91ea | |||
| 80709697e5 | |||
| 3030594665 | |||
| e5991e91f9 | |||
| 1ef3a84cd8 | |||
| 055f33ec46 | |||
| c7183775db | |||
| 0ddc49c313 | |||
| 9ae28415ec | |||
| ec42d87204 | |||
| 40a61ec64e | |||
| 1b53a4fccc | |||
| e657e170eb | |||
| 4bb220bb90 | |||
| be8f5bb420 | |||
| 6912c20380 | |||
| 993981428f | |||
| b229107f8e | |||
| 4ec9afac57 | |||
| e1b3cf5c14 | |||
| 1a872b2f61 | |||
| ab389142af | |||
| bd7bad02a0 | |||
| 90ba69a403 | |||
| 03edddba47 | |||
| dbab7ecac8 | |||
| 1822e85f4a | |||
| d734e83af0 | |||
| 0349e8c9af | |||
| 7d19bd6c19 | |||
| da75e463a8 | |||
| 1bc96e3ed0 | |||
| f185802489 | |||
| 46c508b84f | |||
| 5d68c8dbe7 | |||
| b934702c7f | |||
| 58d47ae9c8 | |||
| 9d91c63502 | |||
| 229e8b1b18 | |||
| 799b4f48e7 | |||
| 9ba9358ecb | |||
| 32bab45f81 | |||
| c94fe0c7e7 | |||
| 83d915eca1 | |||
| 22f435ff4d | |||
| 49321a233c | |||
| 1b27351f45 | |||
| c58cc4c2ff | |||
| ddba772297 | |||
| f96f934426 | |||
| 80770aacd7 | |||
| 133e9f2012 | |||
| 5c80763a71 | |||
| c2d40b465d | |||
| 1207300e01 | |||
| bf87a43185 | |||
| 44572fac44 | |||
| c27b1d93e3 | |||
| 8f28817373 | |||
| d738f56d83 | |||
| c90e65ce4b | |||
| d70e01b635 | |||
| 83ec0f526c | |||
| cd9e43704e | |||
| 5128c1ff1f | |||
| 2e9e71ab9e | |||
| 085be6a445 | |||
| ade21f142e | |||
| 06c1890639 | |||
| 89230fa45b | |||
| 2c3c59d018 | |||
| 549b5df225 | |||
| 58d28061a4 | |||
| faae5edf72 | |||
| 0f298a4203 | |||
| 29421d7def | |||
| 3c24e76018 | |||
| 4384036108 | |||
| adef31097d | |||
| f3cbb0f941 | |||
| ad57750d25 | |||
| 1dfc742f27 | |||
| 0a6d190095 | |||
| 8a17ae29b9 | |||
| 6e4f82d9da | |||
| 4c1c3147d9 | |||
| 2db12e8986 | |||
| ed207d79e7 | |||
| 2d5d98ec0f | |||
| 1923916929 | |||
| 3654fb10d7 | |||
| cf4f6d412e | |||
| e8cb67572a | |||
| 5a706eee8a | |||
| 9b173d317f | |||
| 9622ca0e37 | |||
| 3346a7ac0a | |||
| 39b60f9b17 | |||
| 8307e06c1a | |||
| b3ff29fcf5 | |||
| 895e10c317 | |||
| 6c06fcee61 | |||
| 1a15136536 | |||
| 79af0bfccf | |||
| 5e68f35500 | |||
| 2f9b4439af | |||
| 099eb40ba1 | |||
| 84584002f2 | |||
| 573e790107 | |||
| 2fc713bb94 | |||
| 471c17321f | |||
| e1b96b6d82 | |||
| af5f40a80e | |||
| 53a68783a5 | |||
| 020ad1ac76 | |||
| 35a4551609 | |||
| 76ac7ab4ef | |||
| a00182db8e | |||
| 58c8aefe03 | |||
| ba1bd64bf9 | |||
| d4a8a9ee96 | |||
| db88cd1b25 | |||
| 085b27fc3d | |||
| 86e1f63193 | |||
| e21c01708a | |||
| 0bebe553a8 | |||
| 59fc909d48 | |||
| faafb3152a | |||
| b83bc8b3b0 | |||
| e2c787884d | |||
| 72d3e14e8f | |||
| 9f6108ae7a | |||
| 07dc6d2b45 | |||
| ab2c21e7c1 | |||
| 949067cfbe | |||
| eaf70c7bb3 | |||
| 9fc0cabdf5 | |||
| d6279bfff8 | |||
| 1ba25c5569 | |||
| 45b92aebe5 | |||
| 491e3627b6 | |||
| 936d2963a2 | |||
| ba6b9fd261 | |||
| f0a4ec90b1 | |||
| 4378b4d03d | |||
| 1983991d2f | |||
| 1b517a45ae | |||
| ba5e8befa9 | |||
| 3dd916882a | |||
| 329abb5b64 | |||
| aeed43ec90 | |||
| 6ddef3b7a9 | |||
| bb8ff2c463 | |||
| 7e3490959a | |||
| f3e166c58b | |||
| 336841fa1b | |||
| 3f5347dd7a | |||
| 85668cf5a4 | |||
| ea75e7f00b | |||
| 2c1ce8c0e9 | |||
| ed63c43cda | |||
| f42fca9f49 | |||
| 703f79b757 | |||
| 6582afcdbb | |||
| 9573644387 | |||
| 3104d2f738 | |||
| 9bd5739125 | |||
| e0dbe5cfcc | |||
| 68c92908d5 | |||
| c6a9de812b | |||
| b7a9d966d7 | |||
| f175a04014 | |||
| d02ecff881 | |||
| f8252702a8 | |||
| 777953923e | |||
| f8b75ce455 | |||
| 43177b1f6f | |||
| 78f205ffa5 | |||
| df02fe0615 | |||
| 24bb7b7679 | |||
| b5423f3c7f | |||
| 8356a6b6ab | |||
| 8488f2e265 | |||
| d1d7408a20 | |||
| 9b0ef7bb17 | |||
| 314246d396 | |||
| ed150bd97a | |||
| d9ddca04c1 | |||
| e98da758cc | |||
| c99c3e761e | |||
| 51e543050c | |||
| 9e3b6a228a | |||
| 566cb5e3d8 | |||
| 6f24b81079 | |||
| d2bc7b5a95 | |||
| 9dc2005251 | |||
| ed86bd34b1 | |||
| 352510cc19 | |||
| 959a12cbac | |||
| 1b3e0783f4 | |||
| 70455a959d | |||
| 2025650d50 | |||
| f7ea6b12ea | |||
| ba000bf8ea | |||
| 107b3f328b | |||
| a58c9d4d63 | |||
| 8a767689cf | |||
| 60e5e213fd | |||
| 527696ddf0 | |||
| 4fd17f8b54 | |||
| 115b10ed32 | |||
| f2fbfd7a10 | |||
| a31aff452a | |||
| ed19da21ab | |||
| 777d77848c | |||
| 9ffe4694db | |||
| d381948cee | |||
| e00a58a05f | |||
| ecb4ea8f76 | |||
| a5f68e98f4 | |||
| 000a13b6a3 | |||
| 9fa01a7b70 | |||
| 4ff6a1bc7b | |||
| 8a79b167b8 | |||
| de99f53e94 | |||
| d4a966c7c4 | |||
| 05c1a3d160 | |||
| 788d6a7105 | |||
| 684cf43360 | |||
| 083b08742d | |||
| 80934dc488 | |||
| c67613e0fe | |||
| 65b0b319eb | |||
| 4934f7c5a4 | |||
| e7adce851c | |||
| 7e43a0c2b7 | |||
| 8c349ff8ff | |||
| 8d7ccd29fe | |||
| 87a4f4ab3a | |||
| 71d406b40c | |||
| e785afd356 | |||
| 856a07711b | |||
| 058299cc66 | |||
| 1031dfe4e8 | |||
| 79d41aad64 | |||
| 33212633c0 | |||
| 39e2d64b84 | |||
| 56222f35bb | |||
| 1dc73281f8 | |||
| bf552fdb88 | |||
| 2a330e3006 | |||
| ad3186edb3 | |||
| 8e15c6fd78 | |||
| f708a11f0f | |||
| 677dc802ae | |||
| 57dad685d1 | |||
| dfa04a11bb | |||
| 331af82e6d | |||
| d5b9563263 | |||
| 84b3b5b4a4 | |||
| 637d6b4e36 | |||
| 9166e6052b | |||
| 469dc6ac42 | |||
| 4e83f4c579 | |||
| 0bd33c8d1c | |||
| cd2b188c9a | |||
| ca1975cada | |||
| d72494d09d | |||
| 7773b2b4d6 | |||
| 84db82a329 | |||
| ef2548778c | |||
| 6b581c4e51 | |||
| 576d2dbac0 | |||
| 1e0a60be2a | |||
| 4ec456f0a0 | |||
| 909a25571e | |||
| 5c57e6bdb0 | |||
| 9be80d7b12 | |||
| fc5bba66af | |||
| 80600e5cdc | |||
| a2d6fc7ac0 | |||
| 916f094ce6 | |||
| b0b2d8de44 | |||
| 62513bf20d | |||
| 5ae550c622 | |||
| 1367a58b54 | |||
| ff6ce6cd01 | |||
| 4d7d630e92 | |||
| 4001e310f5 | |||
| e82af627ed | |||
| 44848d3241 | |||
| 65c46d0cc6 | |||
| 643e4f37ba | |||
| 4cbec82ac1 | |||
| 10c9227136 | |||
| 5309832308 | |||
| 65726e4244 | |||
| 9615f8c994 | |||
| b8a6bfb54e | |||
| a312380367 | |||
| dca9ca1cac | |||
| 29b4fd2774 | |||
| f659f80c7f | |||
| a42789f330 | |||
| abce51fb7b | |||
| 7973a2ca1f | |||
| d89fb163c6 | |||
| 7b36e57551 | |||
| 6f675ae75b | |||
| c8b515ea69 | |||
| 52172e6f92 | |||
| d959d7b9f0 | |||
| 705464258e | |||
| 2b4b946689 | |||
| 4e063be421 | |||
| a9bdf75c5b | |||
| d76b41b50e | |||
| 2f9cbc2e57 | |||
| bd77d100e1 | |||
| 12e8e33144 | |||
| 21026bf7cd | |||
| 647eb243ae | |||
| 7ea5029ae5 | |||
| 64a6b12114 | |||
| 4e31015715 | |||
| ad2127765f | |||
| 98d9369a38 | |||
| 3b4a292ca9 | |||
| fa3cb03f62 | |||
| 0477284b0a | |||
| b290bdafb9 | |||
| 97882d03cc | |||
| 29dd115e9e | |||
| 28d4157ea7 | |||
| 5b867b6f1f | |||
| 66ce8cd7ea | |||
| b8b7ca7302 | |||
| b3755ae670 | |||
| 97fec07d96 | |||
| e0fef2bca1 | |||
| 16d6502920 | |||
| ee90a6cbde | |||
| 59b413c8a1 | |||
| 4b2d1aaeea | |||
| 225c75e4a1 | |||
| 7e5581cd86 | |||
| cfaca4327b | |||
| a2d6ee2d31 | |||
| a82e70cd40 | |||
| 670ef403b0 | |||
| 46d85fb558 | |||
| a40354d16f | |||
| b92c3182ab | |||
| 8b6a6d4546 | |||
| 2129db6e91 | |||
| 56ec10bfa2 | |||
| 0b9d075958 | |||
| 59221296c0 | |||
| 533bb89800 | |||
| c80a168d9d | |||
| 62cf71002e | |||
| 30175594e9 | |||
| 7ae83df8aa | |||
| 47134fa1b4 | |||
| 512632e574 | |||
| 4ef6c91583 | |||
| 779a42678d | |||
| 10ba6a93a6 | |||
| c917be2189 | |||
| c6aa97c9aa | |||
| 250941bd47 | |||
| 5b17a60dde | |||
| b07f772f36 | |||
| d4688e6474 | |||
| e7e29cb63c | |||
| ca922443db | |||
| 2385a5870e | |||
| e567135ed3 | |||
| 98c8584b88 | |||
| 2b2fa58f97 | |||
| 2d54fed3cc | |||
| 964a4d75b4 | |||
| 070ec313f2 | |||
| 73f4907dc0 | |||
| 333973b846 | |||
| d2d9fd6945 | |||
| fa4b9e80e2 | |||
| 5e03011496 | |||
| a68ffc81da | |||
| 1ba72ca0d3 | |||
| 68db42e9be | |||
| 567ae61e78 | |||
| 86488ac1bc | |||
| c0d6f3d23e | |||
| b76ce0e0a4 | |||
| b82bec88d9 | |||
| 784c8436fd | |||
| 7dc162cb42 | |||
| 474a23bda5 | |||
| a2c7afad77 | |||
| e172935658 | |||
| 709cf5d038 | |||
| 72cb06abf0 | |||
| fa5a6bfa02 | |||
| 0d9c63744e | |||
| 20334e3f09 | |||
| 19de675a4e | |||
| 8ceb6f2279 | |||
| a22ee76b45 | |||
| 854ab48de0 | |||
| 8dacbe7584 | |||
| 6a15910f0f | |||
| 29869c5b91 | |||
| b6d45b9743 | |||
| 569011a121 | |||
| 4617758053 | |||
| f0d22dabea | |||
| 26a8ab5719 | |||
| d2cff38db6 | |||
| 3c936ddcf9 | |||
| 47e476c9cd | |||
| 814b78dad8 | |||
| 02eab9ed72 | |||
| 6b4fcd5f73 | |||
| fbdcc0e8e4 | |||
| ade29fc6c9 | |||
| 15837b43ca | |||
| 73ca194313 | |||
| 23d866ad40 | |||
| 24bd44f088 | |||
| b88609a921 | |||
| c17ce1a0af | |||
| 875b4e212a | |||
| a87a5dfdb3 | |||
| e20fb7f429 | |||
| e27ae6483a | |||
| 5b79e5b130 | |||
| 0093eb4768 | |||
| dd243067e5 | |||
| 4990506948 | |||
| 6abfc6761e | |||
| 7818071ba2 | |||
| 82ba3ac894 | |||
| f93c1b942a | |||
| 628f04ae96 | |||
| c2fb4debc5 | |||
| 9ca3dec127 | |||
| 8f7e7cd343 | |||
| 4668836071 | |||
| 9d589379ec | |||
| 3870891d2d | |||
| d294e9d62a | |||
| d57e5c31c0 | |||
| 45a69ebec8 | |||
| eb2c9f1519 | |||
| ccd16f107d | |||
| 65d816c3b5 | |||
| ef1aaf12c9 | |||
| 7bc980edaf | |||
| 8c1d8eccdd | |||
| f95e91e2bc | |||
| 3c4f1b0a8f | |||
| 4cd21a26f6 | |||
| 82d2a0873d | |||
| 53944cbebb | |||
| 9558a35cde | |||
| f6e299b58b | |||
| eae3ed0c08 | |||
| 8d8f3bca6f | |||
| d5afa8943b | |||
| 619e4c94d5 | |||
| 099a16bd86 | |||
| 818a91f4f7 | |||
| 598039c0ed | |||
| dbcb454917 | |||
| 6f69800d0c | |||
| e8a67de0d2 | |||
| 82fd00af99 | |||
| 8fce25d788 | |||
| 2fb4812f6d | |||
| 0d646490f5 | |||
| 7252319966 | |||
| 5195a738ac | |||
| a885480c9e | |||
| d3aeb45400 | |||
| 1b7aa92eb6 | |||
| 8c4b5b6a70 | |||
| 177be2adda | |||
| 6d83a80385 | |||
| e28cc973bf | |||
| 3b15f3e3b9 | |||
| 439072a2a6 | |||
| 7f63b31ca8 | |||
| 7dc88f26f2 | |||
| 87498bc6d4 | |||
| 8a0cc5009e | |||
| 0ede1b5b22 | |||
| d800a0bd32 | |||
| cfdffdd519 | |||
| 25be4186bc | |||
| 39f15be59e | |||
| 6c8014e7d1 | |||
| d7e9201434 | |||
| 2bd4f2c3a6 | |||
| a8eb3e1b29 | |||
| 4a0fa57614 | |||
| 4df4a37b11 | |||
| 1ca7ae9630 | |||
| e741b71dac | |||
| 225bae1387 | |||
| 4d0dd3e509 | |||
| 3314966acb | |||
| 1060c0f439 | |||
| bdbd0129af | |||
| 0854dc3320 | |||
| 8f0669c300 | |||
| a91953b15c | |||
| 5d36ee2fe7 | |||
| 9111538bfb | |||
| 0587f92d96 | |||
| 773877cd12 | |||
| 6bd80ba71b | |||
| 84980741a8 | |||
| 167034fb04 | |||
| e039fc3a63 | |||
| 2f3a9ba1d4 | |||
| 1097d0e810 | |||
| 284e5231c5 | |||
| 6b041c8aeb | |||
| 8388b630ac | |||
| 03eb463f1c | |||
| 75b5e3fa64 | |||
| c37d9573fc | |||
| 3a5f431236 | |||
| f87a0dd6a7 | |||
| c14578649d | |||
| 687ccdf8db | |||
| a4b9ce764c | |||
| e9b033ef3a | |||
| 5da7805623 | |||
| 7d8f1dde26 | |||
| 24e2e0d3f9 | |||
| 017c217bb0 | |||
| f4c4b01455 | |||
| 08941b7890 | |||
| 7ee217285b | |||
| 9e0dee1259 | |||
| d1311518a3 | |||
| 6e13ffe162 | |||
| 00fff3a85d | |||
| f441515357 | |||
| 333e53eee8 | |||
| 7f9253ea0a | |||
| 24acbecd33 | |||
| 70607ce311 | |||
| 7972f47ed4 | |||
| a8f86af633 | |||
| 38d73123c1 | |||
| e06d1e8083 | |||
| 300797d4a3 | |||
| c6cf7f8080 | |||
| cd4b748b44 | |||
| fdd83e5027 | |||
| d9f720a679 | |||
| e8fe6ee4e3 | |||
| ddf6bc86a7 | |||
| 4378e8fcc0 | |||
| 06babf90a5 | |||
| f4e5d777e8 | |||
| 6c25351049 | |||
| e1b66ffd01 | |||
| 2dff9f4c6d | |||
| b390e86b12 | |||
| 08e0c69dbf | |||
| 91c35a7d01 | |||
| 0366c1b093 | |||
| fed22f2f5c | |||
| 9fd32ca5ac | |||
| 176fe6e50e | |||
| 6c051a55e5 | |||
| 90e1e41f5a | |||
| 22ecdd16ef | |||
| 2dac35a97d | |||
| 069f9add80 | |||
| 74c2f8cecf | |||
| 70b6c1f29e | |||
| b6d3657f82 | |||
| 1949412979 | |||
| 4f597f6c06 | |||
| 47dea29e4e | |||
| 41f8e788b2 | |||
| 7afaaef0eb | |||
| dd259503c1 | |||
| 5a79b90ade | |||
| 182b52d23d | |||
| 85db11b70d | |||
| 1e808a495d | |||
| 64916d3d83 | |||
| c727e8a4d0 | |||
| c11eaeec49 | |||
| 8a8523d4f3 | |||
| 9749afb116 | |||
| d68466bb6a | |||
| ab110c0ad1 | |||
| 8781ee971c | |||
| cc06935a10 | |||
| f3a9f13cb4 | |||
| eb3969e244 | |||
| ee1ac1140d | |||
| 94c8e59bbe | |||
| 7e9578789b | |||
| 2f0060e399 | |||
| 7fd53f6ca2 | |||
| 538fd42363 | |||
| 0792ef8789 | |||
| 5bf7f09ac1 | |||
| 2244f1722c | |||
| ab20d2a3fc | |||
| 69a8f110b6 | |||
| 9457bf10ab | |||
| d810c73396 | |||
| 5b868ccd82 | |||
| 687394fa07 | |||
| 5b6ee79cd6 | |||
| 8bb787cdf8 | |||
| 130546e1d9 | |||
| f8061ba3c8 | |||
| bf5f7380cf | |||
| 0f01b40dd5 | |||
| 8edc2e5aaf | |||
| 21d9c47bd0 | |||
| c790299906 | |||
| 514f4193db | |||
| 0a61ebdd66 | |||
| 640d77be25 | |||
| 49dd0305f2 | |||
| 1393fd9e8e | |||
| 3202062e77 | |||
| 265f335dae | |||
| e283a75a19 | |||
| 7bbe002a2f | |||
| 09f0ecdf7a | |||
| 1ae02c0cc4 | |||
| 9079d9ce17 | |||
| dc1d9ae973 | |||
| c219f97f48 | |||
| e1c3237532 | |||
| ee180d5b41 | |||
| a9f3a7de39 | |||
| 5e1a656bbb | |||
| f2440ceae6 | |||
| 8e4fe30db6 | |||
| e8d94ea87c | |||
| 667f5b655a | |||
| 0d2cee45e8 | |||
| d1cecb0f0f | |||
| f2ec7eeb37 | |||
| e869bb6b05 | |||
| fe97dc67dc | |||
| 560ca8c5aa | |||
| d59a520c9a | |||
| 97c1f09961 | |||
| ec0bb66e5e | |||
| fda7bb95d0 | |||
| 546f1d9f15 | |||
| 90ff900387 | |||
| ed96279920 | |||
| b1fc7d46a5 | |||
| e79be78ef4 | |||
| 4a6d582f2e | |||
| e969f184e1 | |||
| a9ebc61f2a | |||
| 1b83bc48a1 | |||
| 5c66ce7f29 | |||
| da6dc6774b | |||
| 20f5fa8e3e | |||
| 76c40e8f0d | |||
| a838a97092 | |||
| ef937dd676 | |||
| 586625f8ba | |||
| 0b4428e92f | |||
| 8fd1bbde76 | |||
| ca9af20179 | |||
| 0f1e193193 | |||
| 7c855aa3e1 | |||
| 24bed38c2b | |||
| f0c0e0c6fa | |||
| 6ffc48769a | |||
| 4a74408eee | |||
| c729fbd652 | |||
| 608968aa83 | |||
| 5caf6244a3 | |||
| eaaba6462e | |||
| 92e9d4ec3a | |||
| fbb2cabe77 | |||
| 3fd2384b81 | |||
| e851a41d78 | |||
| 5e0f95b948 | |||
| f7aa2e0d44 | |||
| a11b7a8293 | |||
| e6062532fa | |||
| e7d35d51fa | |||
| c524f669c7 | |||
| 203ac0f818 | |||
| eab556e1e0 | |||
| 9819ebc095 | |||
| fb6db3dcfc | |||
| 7601c21612 | |||
| cb9b08eca1 | |||
| 48b8aa51cd | |||
| 6e8241b78d | |||
| f61076a5d8 | |||
| 5f5fcef962 | |||
| 12ce6b5c15 | |||
| 27b1f8f446 | |||
| c6e1e3acdc | |||
| 53661d55ae | |||
| 120b7a61c3 | |||
| 470d34ddbb | |||
| a0c2718adb | |||
| a836892edb | |||
| 25518a12f1 | |||
| 2aa15ab3ff | |||
| 807ec00b85 | |||
| 53305d4a7e | |||
| 2863f950d6 | |||
| 12d2bd4adb | |||
| 24ee7b5080 | |||
| aab390c51d | |||
| 8b4871a28d | |||
| cf31243c74 | |||
| 88b689bcf1 | |||
| f589237e23 | |||
| 7da6e9086c | |||
| 68043f4de9 | |||
| c0eaff3608 | |||
| bcce25900b | |||
| 34ba32ff27 | |||
| 857007372d | |||
| 6a661e1e28 | |||
| cc5a6f3b86 | |||
| aa7a964139 | |||
| 73a8369631 | |||
| 6a8f57e5d7 | |||
| eb94dfb442 | |||
| 7be0c78533 | |||
| 97d9ea00fe | |||
| 491502a349 | |||
| 0e4eed0ba1 | |||
| 8ffcc76011 | |||
| c020a7bb67 | |||
| e268fdc0ed | |||
| bb925fe488 | |||
| 1dbdb1cfc9 | |||
| 30b33a4413 | |||
| 945ad277ea | |||
| 6f4e35cc0e | |||
| df8f61877e | |||
| ddb482b14a | |||
| f378f1d585 | |||
| 36f11a54e1 | |||
| f8d0d6365e | |||
| cff79609c8 | |||
| c434198ee5 | |||
| ef70b0baa4 | |||
| b4ddf3d8c5 | |||
| 42b25d747b | |||
| a66b5e2c13 | |||
| 8f0b72be9e | |||
| 15dc6f70dc | |||
| 95014f311d | |||
| 6dfd7e3da2 | |||
| cfe84b953c | |||
| f78b9468dd | |||
| 034dc3b0dd | |||
| 80d1f2ddfa | |||
| d05714995c | |||
| 252e871a8b | |||
| 59b91d6c31 | |||
| 5992c46606 | |||
| 00d2f34888 | |||
| a91a11e533 | |||
| 2423cddb00 | |||
| eb54e5c55c | |||
| 514e6df460 | |||
| 94253e8b83 | |||
| a6baedd02c | |||
| c63092781a | |||
| 2d1350a9d6 | |||
| 2200e13c71 | |||
| 633b0e56a5 | |||
| 8393d755f6 | |||
| 7474ad81d9 | |||
| e805a55a5b | |||
| 14032c6653 | |||
| 17233c687e | |||
| 57cbde3393 | |||
| 579781e35e | |||
| 66f3c1ae79 | |||
| 1ad814a191 | |||
| 221342fb25 | |||
| 5718d09e39 | |||
| b67523550f | |||
| 5a791e6e06 | |||
| 61e76e767d | |||
| 51b5fdba25 | |||
| 379ea15d16 | |||
| 4437e0c3b9 | |||
| fad3a6bf15 | |||
| ab0f0f26a1 | |||
| b7ad95beaa | |||
| 2c8da29f3a | |||
| efd3fafa25 | |||
| d61528b2d5 | |||
| e8b2c5682e | |||
| ce2a65db85 | |||
| 2f3d4df2f2 | |||
| 6205981235 | |||
| 28a78003f0 | |||
| e2a99d24ec | |||
| 601e3aaf98 | |||
| dd2fd39c05 | |||
| 84887d3011 | |||
| 9e298ea1bb | |||
| 65ba2e0adf | |||
| 42e1fe301c | |||
| 7fe97376c2 | |||
| 03407a9da0 | |||
| d56b2b56fb | |||
| d47b1f3b70 | |||
| 090ee46f4a | |||
| dbb57cd0ae | |||
| 0c07836fba | |||
| 835acd3f31 | |||
| f8b03d4a4b | |||
| 413fba14ab | |||
| 44d7435a48 | |||
| f77f2876ff | |||
| 914f57f28d | |||
| ed94136548 | |||
| c973aaabc5 | |||
| 3267fb90c6 | |||
| b10fedde56 | |||
| 8817907647 | |||
| 398ebbac98 | |||
| c43498c6ad | |||
| 389fa5d38e | |||
| 2a1f46c42d | |||
| e225850cc6 | |||
| 10e1de74d2 | |||
| 292dfc2d72 | |||
| b085158d59 | |||
| 904640c9ae | |||
| 06455fc0cd | |||
| 3b191bf2dd | |||
| 56bcdfd7d9 | |||
| 14089b1e7c | |||
| 5f6077bc62 | |||
| 19a914be16 | |||
| f1c91a8d34 | |||
| 5a71f4a0ca | |||
| a449731a57 | |||
| e801e336ed | |||
| 0d01b97b75 | |||
| 7fedfa0380 | |||
| 4a297a2443 | |||
| 108d07c655 | |||
| 34a9ce6eb3 | |||
| f1e50ecab3 | |||
| a0ce12f8ba | |||
| 3d6659112f | |||
| 1055f9d208 | |||
| 403c3c3d03 | |||
| 877b175565 | |||
| 82f889d9b8 | |||
| 7eb37bd1dd | |||
| 384fa95680 | |||
| 2266a8c85f | |||
| 83761d5f8e | |||
| ecbd5b0574 | |||
| c8d8b1fbcd | |||
| 92fb3fb33f | |||
| 02bc17be6f | |||
| 534dcbe017 | |||
| 12cd3b55ec | |||
| bbfa239036 | |||
| c96630c9f0 | |||
| 60f1c9dcdf | |||
| 82aff110b7 | |||
| 26321795f7 | |||
| f780ee12a0 | |||
| e56d6054aa | |||
| 36222c9eed | |||
| 8436dac090 | |||
| 713ec7be45 | |||
| 42569cfd61 | |||
| 7c8a3da0ac | |||
| 9d25bd583f | |||
| 85af8735ab | |||
| ccea0a831a | |||
| 65a6674c6e | |||
| 9698b93d10 | |||
| 78ce5b815d | |||
| 6aec71d7ee | |||
| 83b16ab7b7 | |||
| 54c81cbde4 | |||
| 3cf535926a | |||
| 35738bcadd | |||
| 184862582c | |||
| c4f9ff0285 | |||
| a75840d19c | |||
| f06c44f1f1 | |||
| 844f1d0281 | |||
| a2e9bfbaf4 | |||
| 2e45095e8d | |||
| 027da35c33 | |||
| 2c1161a6f9 | |||
| 5f4b48da34 | |||
| 4e1d396ce1 | |||
| 98bd0a06dc | |||
| f57630d92b | |||
| ae2e4af4a1 | |||
| cb66f82c1d | |||
| 1389fd67ab | |||
| 7a4c5e9421 | |||
| cf1ba0c4e1 | |||
| ebdb0eb0c1 | |||
| 4d80419f29 | |||
| 32d71cf85f | |||
| 2876670de3 | |||
| 36d4c29b11 | |||
| c8930cc279 | |||
| 01f4a173ab | |||
| daf3368d2e | |||
| f6fd3abd31 | |||
| f1c52e426b | |||
| 203dc3bb48 | |||
| 7b8ab4e5c6 | |||
| 73891d619a | |||
| fe4fbc2c3b | |||
| 2ebf4e084a | |||
| df22bafe6d | |||
| c49d5d5252 | |||
| 104502c5be | |||
| 7d6cf66303 | |||
| d1b08486ae | |||
| 205022ceee | |||
| 47998c03f8 | |||
| 27cddfb8e9 | |||
| 3f116468c6 | |||
| 8c2563be41 | |||
| 2493083935 | |||
| e15928b49e | |||
| df434298b8 | |||
| c401168bea | |||
| 0b1f626efd | |||
| 74367093c8 | |||
| 7a472d85ef | |||
| 81c5fae56f | |||
| 9e9926a2f0 | |||
| 6e5da9dbe3 | |||
| b97b650ab3 | |||
| a1d2258ac3 | |||
| 8f04c8b16c | |||
| 2d674fc151 | |||
| 479179638e | |||
| a3d74704e5 | |||
| 90aac764dd | |||
| 46470d92a0 | |||
| a5cd62f7bf | |||
| 12ea8477a3 | |||
| 87db636c61 | |||
| c5c620bab0 | |||
| d84c7e5143 | |||
| 8ba88892d7 | |||
| eb2901bd69 | |||
| c89ae6e537 | |||
| 25c36fb05f | |||
| 71ba54b2f4 | |||
| 18ce529256 | |||
| 26e0f408f0 | |||
| fe494297e4 | |||
| c3569211d5 | |||
| dcc5a2cb22 | |||
| 67842df9e2 | |||
| 8226bd25c4 | |||
| 8efe7bafaa | |||
| 2124361ff7 | |||
| 42459cad02 | |||
| 0def2dbb73 | |||
| 1b0ff57562 | |||
| 95ce21d407 | |||
| ec353dbdda | |||
| f056e713c3 | |||
| 4046d9f850 | |||
| aa55cdb735 | |||
| ec8d39d059 | |||
| d1a3b530be | |||
| a55aed5f42 | |||
| b067e0ca5d | |||
| 85e133a051 | |||
| 4a086cf517 | |||
| fb22028be3 | |||
| 6728b40ad3 | |||
| e77af4ae33 | |||
| 7bc017601f | |||
| decf6cab5e | |||
| 2b635edce6 | |||
| 2aa18ca3e9 | |||
| 4dc788ff84 | |||
| cec700525c | |||
| 20b3261204 | |||
| ab8cf31ae9 | |||
| c0ae812aa2 | |||
| 8b87c4b96a | |||
| cbb21f3cf2 | |||
| 4189214d04 | |||
| e6ed853905 | |||
| 59915a3fc9 | |||
| 22816a4c43 | |||
| 4d84999452 | |||
| 6d4b778303 | |||
| df0b83332d | |||
| be1207e5e4 | |||
| 1255bd8d4b | |||
| f5d9a2a9c1 | |||
| edcbbee979 | |||
| 70ff4af4fa | |||
| 6a395d88ff | |||
| 1f4fdfd599 | |||
| 0c00652f6b | |||
| 91e10a3105 | |||
| 08086178bd | |||
| 839cffdefe | |||
| a362fd80df | |||
| 1237faef80 | |||
| a0d9d6db5b | |||
| 8533b45ce9 | |||
| dcd4f8f5db | |||
| 0cad2d2a83 | |||
| 73316e10a0 | |||
| 69cd9cc1a6 | |||
| 594a93316c | |||
| c6d9ce8fd3 | |||
| 9deaddcdff | |||
| 98b6e1d5fe | |||
| 57dc28fe99 | |||
| c8794c89c7 | |||
| 18edd917e3 | |||
| 6032d86e23 | |||
| 64a9e92390 | |||
| b6075e11b8 | |||
| c19764e557 | |||
| 71768de939 | |||
| f943261847 | |||
| 7763b58a60 | |||
| 6f8be3f693 | |||
| 6113dc1b99 | |||
| 4d4f291553 | |||
| 29faf164b9 | |||
| 435a3e337b | |||
| f92e880d3d | |||
| 8a76fadaa3 | |||
| be5247921d | |||
| e3b42bf93b | |||
| f34a0a874a | |||
| c71dc78cd4 | |||
| f3dde79ed6 | |||
| da0904df2d | |||
| c08a0edea1 | |||
| 27b55ea761 | |||
| 8943441115 | |||
| 6674a024fc | |||
| ee35263e48 | |||
| 84596bff09 | |||
| e3a6d74945 | |||
| dd3c1d3b8c | |||
| 3a5cd12dee | |||
| 2d2499f610 | |||
| c11895f529 | |||
| 004a1cd64a | |||
| d0b2e60edc | |||
| 8e1f31f543 | |||
| a2869109f0 | |||
| 431b3b4323 | |||
| 9966903ae1 | |||
| 8a67858068 | |||
| f5862dacb6 | |||
| 67f9406cbe | |||
| f99a135eda | |||
| e1ec45c948 | |||
| 8acd05f12a | |||
| be01ea734d | |||
| d01a2038ae | |||
| 0e6dd32858 | |||
| bc7923e382 | |||
| c608c232a2 | |||
| 5f9bb6249e | |||
| b76a691bcf | |||
| bc6a355370 | |||
| 37911e60d8 | |||
| c92aa95726 | |||
| 59c6661db0 | |||
| f0453bd853 | |||
| 116c8d0ddf | |||
| 16821b877c | |||
| 45c5f0a549 | |||
| f46eff4eb0 | |||
| 1073175c77 | |||
| 34bfd7ef51 | |||
| 94b236872c | |||
| 7abaae39ec | |||
| 940a90130d | |||
| a42ca2eeb3 | |||
| bf80c94125 | |||
| d0580df339 | |||
| ea5a3e557f | |||
| 22576f4dfe | |||
| 4ca89db22d | |||
| dc88a2bcf2 | |||
| 71f4281080 | |||
| 4bd1e3dcbd | |||
| 30373d2566 | |||
| 914d9662d3 | |||
| ad23c10600 | |||
| a50a355e63 | |||
| 7d67d60fb1 | |||
| fc1d85bf59 | |||
| 125f9f0be1 | |||
| 8e7af7f089 | |||
| a65b5df5da | |||
| 2370c8a058 | |||
| 2b3c140f04 | |||
| ec32022bdf | |||
| 898ca38257 | |||
| 5aac909046 | |||
| 592f8d8c1b | |||
| a9807d8f54 | |||
| d9c0231475 | |||
| f0b606ff77 | |||
| 3542c98d45 | |||
| 00f03c5739 | |||
| 4f6c493b87 | |||
| 73c2a12449 | |||
| 99a9c10b57 | |||
| 9b131b5f7e | |||
| 5232ea1ee6 | |||
| d8d4ea857a | |||
| f3880c60a6 | |||
| 6045608330 | |||
| 0a4b1b8d68 | |||
| 25c17b107e | |||
| 2938860b3f | |||
| 2e33844f0d | |||
| 1e4395a8e1 | |||
| 70c605a03d | |||
| 84e2fa79a0 | |||
| a8844de7b5 | |||
| 0369431ebd | |||
| 50e8f91064 | |||
| fd0ac962fb | |||
| fc8e848a54 | |||
| 26d288bd11 | |||
| adf43e7d2a | |||
| 047764f476 | |||
| 6d4f66472e | |||
| eba176c299 | |||
| 00e43a9022 | |||
| 9148a37624 | |||
| 019b7c5a66 | |||
| 59e825ee02 | |||
| bcc669f3f7 | |||
| e5313246a7 | |||
| 97af608030 | |||
| 181b448c4d | |||
| 289a8da39e | |||
| b85c77283b | |||
| 0742e12f0b | |||
| 9b659736da | |||
| 69a6765bf7 | |||
| 3f68d6d8a7 | |||
| 83b8cd0152 | |||
| 4e542a65a3 | |||
| aa46e31c6d | |||
| ddbd074678 | |||
| 5fdb42a7c9 | |||
| 6c252d8cdc | |||
| 636b7ec0c4 | |||
| 534645a12f | |||
| 09c84a0164 | |||
| cd1c8693d8 | |||
| 325cbd7c84 | |||
| b19cd93738 | |||
| 602b08d9c7 | |||
| 019162486c | |||
| fe7b3f1228 | |||
| 1bc1f3d311 | |||
| a8a51db42b | |||
| 70d49446e9 | |||
| a2620f72c7 | |||
| 50d44e06e3 | |||
| c5fc8e03ff | |||
| 0aa5e43a14 | |||
| 235889ddbb | |||
| c67e75b68f | |||
| 047ad4ff71 | |||
| ae8bb718cd | |||
| 7bbe1a53cf | |||
| b6fe4cc807 | |||
| eecb64a973 | |||
| e72a053cca | |||
| e43997dbb5 | |||
| 813ff37967 | |||
| b8a24b36ce | |||
| d2f13a8259 | |||
| 94d84c5fad | |||
| 1eb2fa9efb | |||
| 7e48fa58eb | |||
| 59ec224009 | |||
| 0ed2cbc931 | |||
| 1ff33e6e4d | |||
| b450811e4b | |||
| 87160cb297 | |||
| dcdd6af5a8 | |||
| badc3bd312 | |||
| b1ed8bc0d1 | |||
| 3b84acfc48 | |||
| 436d7e4eaf | |||
| 910d7dab1f | |||
| b0e9d76ced | |||
| 05b259fe2e | |||
| 6aabd6cc7a | |||
| 19c914db51 | |||
| c057d29192 | |||
| e29de5dd2b | |||
| 1654dfe3a9 | |||
| d3a124c820 | |||
| 86cc4f3aa4 | |||
| 9de87d96cc | |||
| 65f502bc99 | |||
| fcb537bacd | |||
| 3dbf392d48 | |||
| 2b43d4f477 | |||
| cac4a7e5b5 | |||
| 3fddce67c6 | |||
| a5c04baec1 | |||
| 361bb1197f | |||
| 0b33eb0929 | |||
| 8ed1a274e1 | |||
| 70e1b4ddf0 | |||
| bab86d65cb | |||
| aef3019152 | |||
| 28b19d6e3e | |||
| e728ffd5bf | |||
| 4b1455579f | |||
| 1033f2b1bd | |||
| 0a439570a0 | |||
| 50365b7741 | |||
| 62359f70ff | |||
| c5ed507737 | |||
| 7d4a67f2a8 | |||
| d5f152494b | |||
| 1b8acd662f | |||
| 7ad308ea47 | |||
| 6df8ac0342 | |||
| 08112f3821 | |||
| 18ff806d5b | |||
| d0684ac139 | |||
| a8ae9cab08 | |||
| 84535a60f2 | |||
| ca1a0a1108 | |||
| 7d18f49a49 | |||
| 0da947e6b3 | |||
| 6cedc82799 | |||
| b417fb0939 | |||
| cd4176104d | |||
| 5c709f4aaa | |||
| ae5e1f8ece | |||
| a9de6900e5 | |||
| 83b5b86f7d | |||
| ca46171246 | |||
| d4e2e6279c | |||
| 197078e331 | |||
| d0d2faf551 | |||
| a4b5eabccf | |||
| 7b701fee60 | |||
| 99183e98d3 | |||
| c231472ad6 | |||
| 9930076dc5 | |||
| ecb6bcf2e0 | |||
| 74f1295756 | |||
| 3966595f9a | |||
| 0fcc6f5d60 | |||
| 3e45795232 | |||
| 51cb56ef2c | |||
| f39ee9c6a1 | |||
| 84ee4d701a | |||
| 267c5a747b | |||
| edadcfa7d9 | |||
| 62ed6cdc74 | |||
| ce20efb8e7 | |||
| 825b14278e | |||
| 8d4777c81d | |||
| c0b6061a5e | |||
| 2324674dfb | |||
| 53b5afbba9 | |||
| d48d2d7fe2 | |||
| b0bce60c16 | |||
| eff42f6387 | |||
| 5404930112 | |||
| e49febb70f | |||
| 7e680bd9ff | |||
| 766a0c0f25 | |||
| 9fa505027a | |||
| 61c2f094b9 | |||
| 558b17dede | |||
| 86b128dbb3 | |||
| 5560db73bf | |||
| 7349b8f5ce | |||
| 88507fa051 | |||
| 9665dde678 | |||
| 768f4cb7bc | |||
| b15bc194ef | |||
| be4fa03fac | |||
| 164a77e7ad | |||
| 6174f62710 | |||
| d715badbde | |||
| 912de363f4 | |||
| 66e09bc9a4 | |||
| cd7526c973 | |||
| c24f10d647 | |||
| 4bee238cf8 | |||
| f503515082 | |||
| e307065c8e | |||
| 6185f7209e | |||
| a2811d93dd | |||
| 9c5b231b2d | |||
| f2070c9f5d | |||
| 34e414dc31 | |||
| 92d23fb1a8 | |||
| f8b14a1612 | |||
| 8f1345091e | |||
| 17dcf0e82d | |||
| d329674f68 | |||
| cadd1a0074 | |||
| 1625ffa2cf | |||
| 72de03d749 | |||
| 0be1bf551b | |||
| ef0650179b | |||
| 38c62f6461 | |||
| 6fb9d42c3f | |||
| ef04ca9e0f | |||
| 6074f92d48 | |||
| 0b688cd23f | |||
| 59cbaca4d3 | |||
| 66feea6cac | |||
| 7707c9bfba | |||
| 85b1c4060c | |||
| 07bec6bdcd | |||
| 159ea22b6b | |||
| 682bd2eedf | |||
| d8a737b4b0 | |||
| af1ea1f7ac | |||
| 3a8a73ef6c | |||
| 4781f0a337 | |||
| 4b8275061e | |||
| 7933fff0dd | |||
| 2c4d3d92c7 | |||
| 15b909e80b | |||
| a82d2363f4 | |||
| 13c4a02157 | |||
| 0042bacd88 | |||
| ffe49bdebe | |||
| 4d721e368a | |||
| 7b7033ac60 | |||
| 552c3ba869 | |||
| 5b41599911 | |||
| b833d512ec | |||
| 5ce38e516e | |||
| 611cf8d86f | |||
| df5ec54fb8 | |||
| a3ec2ac3c5 | |||
| 69830b1851 | |||
| bbbec300a6 | |||
| 6d06fcb414 | |||
| 2aa380752c | |||
| 03850008b9 | |||
| fc9e031454 | |||
| 74d321d901 | |||
| 7bfb38055c | |||
| 81519537ae | |||
| 0f12351a41 | |||
| 7aadbc9607 | |||
| ce65975625 | |||
| a25c443d1f | |||
| c2c7333107 | |||
| cb9e110adb | |||
| 0595ab3eef | |||
| 800294ad4b | |||
| ac58405a71 | |||
| 9bf6ec6fe1 | |||
| 7ae19467b5 | |||
| fe95d5a720 | |||
| 0105518422 | |||
| 22c0bb7dc9 | |||
| b19f81b35b | |||
| 28717d0437 | |||
| 5ea50d1e8d | |||
| e703c3090a | |||
| a79d0e19ad | |||
| 872500c4a5 | |||
| 7eb1065944 | |||
| cdc2aca2cc | |||
| cc2ee923e4 | |||
| f5dba12762 | |||
| 86ff4a1ccf | |||
| 614e254331 | |||
| 6fe6436162 | |||
| 29e4a4940d | |||
| f7913e2c84 | |||
| 73ac5321f5 | |||
| 2e56a47f8c | |||
| 666fc0ba69 | |||
| cfd845ac07 | |||
| 2a8344f75b | |||
| 762138e77e | |||
| d381e499ea | |||
| 0ed3209b00 | |||
| bc547c4290 | |||
| 9e4a8a31e1 | |||
| b900496c40 | |||
| abad8977b6 | |||
| 6c135261b2 | |||
| a44573c43b | |||
| cd689c640d | |||
| 378e05c16b | |||
| 486cfd1040 | |||
| 3c795a0dab | |||
| 6fbf0758bc | |||
| 89d855c0b7 | |||
| 1f465a0ef9 | |||
| a47fbd2610 | |||
| 99ed085752 | |||
| c95bc0c7fd | |||
| 11ddb9332c | |||
| 606a5fd537 | |||
| c4b158ff91 | |||
| ec076bfba3 | |||
| 92be112388 | |||
| a83c12c3d5 | |||
| 7f554f3cc4 | |||
| 92b35e6758 | |||
| 91c1d7697f | |||
| 5b27fb506a | |||
| f2b3e5f517 | |||
| 807f5e33ad | |||
| 11330b9253 | |||
| 2af6f68452 | |||
| c38620e966 | |||
| 8254169cf5 | |||
| b6abf0d3f9 | |||
| bd6a6690f2 | |||
| cdbbccbef8 | |||
| cbf2b51e40 | |||
| 13f374660f | |||
| e34b64c979 | |||
| c180047bc1 | |||
| f071a48ec7 | |||
| a1479cc2c1 | |||
| 2feb0c2f61 | |||
| 107582c767 | |||
| 636d6368ee | |||
| 04edc8fe3a | |||
| 559235ac74 | |||
| 5d369afe27 | |||
| 49a5280198 | |||
| e5d1790b7b | |||
| 5b17410f7c | |||
| fed2a277e0 | |||
| d59472bf40 | |||
| 6f48dc2482 | |||
| 8082011546 | |||
| 7628c143f4 | |||
| 5d0a8d2aaf | |||
| 019de554a0 | |||
| 3ee8079f35 | |||
| e4aa2ccd66 | |||
| f37f4cf3b4 | |||
| e7d62d6ef3 | |||
| b29893b938 | |||
| 1c88a566e0 | |||
| 3f37be5a30 | |||
| 9db5cbf9a4 | |||
| 8e6280fc8e | |||
| f8ad289311 | |||
| a9b5233f67 | |||
| e57f22a386 | |||
| 12662e064b | |||
| 1c46034166 | |||
| 2178c5e95e | |||
| b3018ba89e | |||
| e75056a084 | |||
| 51fc891a5c | |||
| 0f34628af7 | |||
| c3cced0f89 | |||
| 397b57dd72 | |||
| 01b581048d | |||
| 438e456ce9 | |||
| b389c1cfe7 | |||
| f19f2bbcde | |||
| f6d927ef3b | |||
| 75b980ac64 | |||
| f723cede2e | |||
| 6c5dd5cf6d | |||
| 3a09da71d8 | |||
| 3cbe60cca2 | |||
| 2674c6b5e0 | |||
| 45d11dde57 | |||
| c7f1843584 | |||
| b1d208891b | |||
| 017a38a54e | |||
| b45403ed75 | |||
| f50ec229de | |||
| 3e33820ee5 | |||
| 73d4f12c14 | |||
| 20c08eab73 | |||
| eb136ebba6 | |||
| 1a9d8e9447 | |||
| 0eb1bfa874 | |||
| 5ebb234746 | |||
| 394101d6ed | |||
| 3c6983a2bd | |||
| 56bda8917d | |||
| 6936ec7dbd | |||
| e730048f69 | |||
| 751cee8e67 | |||
| 0608227e10 | |||
| 2210ed4fdd | |||
| 65061948af | |||
| 55dabd2858 | |||
| 88e6daa315 | |||
| baff521b63 | |||
| bbba9ac121 | |||
| 1fbdca83f5 | |||
| 3a0039d204 | |||
| aa70199ce1 | |||
| fcdd833059 | |||
| ba940dec38 | |||
| 42f449880c | |||
| 2610a47c89 | |||
| 55260a8d3c | |||
| 43e4e1b624 | |||
| e89501a3ad | |||
| 992a81dcaa | |||
| 2e772510ea | |||
| c6fb99357c | |||
| 7190028b23 | |||
| bafdc44d37 | |||
| 1af16afb89 | |||
| b9cf65e905 | |||
| 8a3a75cc16 | |||
| fbe18e80f6 | |||
| 06bda58a2c | |||
| e89ae986fa | |||
| 8f99083726 | |||
| 51cef2651e | |||
| 0205238dca | |||
| a0c658b012 | |||
| 22dfc1daf1 | |||
| e51a8e047c | |||
| 0a7c60b439 | |||
| a0e1def83b | |||
| 2fc1edfc96 | |||
| 3921fab285 | |||
| 48ed769b18 | |||
| bffe254a81 | |||
| 63fb79b519 | |||
| c51567ae45 | |||
| 97181a90ba | |||
| 981009ac1f | |||
| 96aebbe7f9 | |||
| ed71f62181 | |||
| 888d0cda40 | |||
| 4085bbf758 | |||
| 49f214b275 | |||
| 8e21f808be | |||
| ac22d3c817 | |||
| afa633b7bc | |||
| 62737c777c | |||
| 42d942e19c | |||
| 7267e94be7 | |||
| 184daa155f | |||
| d7a1d2230f | |||
| 9c4f0a984f | |||
| 8fb48c09f7 | |||
| 6e4f9433d0 | |||
| c624967049 | |||
| 20a2dc6ac5 | |||
| b1b2528e50 | |||
| 1bd865120c | |||
| bacc96f4e8 | |||
| cc3f9323bb | |||
| c964aa3333 | |||
| f9ac1665b6 | |||
| 942672ad91 | |||
| 9cceccd645 | |||
| 47ae5197a9 | |||
| c9c759f700 | |||
| 7db612a545 | |||
| 18a4ced07a | |||
| b9b553b8bc | |||
| 0c79f4a00f | |||
| cc626a3b5a | |||
| 14af2a0c0c | |||
| bc348eb8ab | |||
| 6e4dacc0b3 | |||
| e1ebc4e991 | |||
| 67acfc6e25 | |||
| 87984f2c6a | |||
| 15df161b22 | |||
| 988a5626f6 | |||
| 22496742b4 | |||
| bc9c9abab0 | |||
| c6fc7ccb5e | |||
| 93813fec6e | |||
| 7809c4156f | |||
| 37d99201ca | |||
| 5feb1c94a7 | |||
| fd1eb63fee | |||
| cd428fb798 | |||
| 476c513447 | |||
| 639b800787 | |||
| 712689e81a | |||
| 03cefa7bfe | |||
| 2dc76d5009 | |||
| def444d99f | |||
| 5f80e42dac | |||
| 7b0d2d189f | |||
| e0e40405ed | |||
| ff037ebe5f | |||
| 91c0b13743 | |||
| eb9fcf4f08 | |||
| 1f214d232d | |||
| ede39b85f6 | |||
| ff190b1ef4 | |||
| 1a495a5817 | |||
| 09d283a39d | |||
| 8b1b126e3e | |||
| 5384d2f090 | |||
| b4813e6bdf | |||
| 4b52b8df34 | |||
| 60cbc46da1 | |||
| 9e6ef99422 | |||
| 58a83e99c0 | |||
| cc9ab7e582 | |||
| bc93775385 | |||
| b4367c92f3 | |||
| 825c0ffdb4 | |||
| 69f2590359 | |||
| 7060ee4d00 | |||
| 390be6d5b5 | |||
| a385fff3bf | |||
| 7b8fb64f21 | |||
| 0c291c7768 | |||
| 5bf39ceb5d | |||
| 48e07437f0 | |||
| e5766513a4 | |||
| 9cdeb6dfbf | |||
| f9aa411c92 | |||
| 436a1f72a5 | |||
| 7e3e9144de | |||
| c704942b8a | |||
| acedb4a579 | |||
| db0a159229 | |||
| 2eb61a4a99 | |||
| 868ad16041 | |||
| 21c8e6d02d | |||
| a871f9e4f7 | |||
| fb5cd42c6b | |||
| a36ebaecdc | |||
| bf418ba342 | |||
| be9767e014 | |||
| ab5e09e428 | |||
| 607231641f | |||
| 91323549f4 | |||
| 9e9881aacc | |||
| 734ea77c9a | |||
| d96cac1341 | |||
| 0622146a93 | |||
| db980b0eca | |||
| d1c5e79ec3 | |||
| cca99bf824 | |||
| dcaad315e7 | |||
| 08a5fe3661 | |||
| c95f3eff6e | |||
| 9ae86a922c | |||
| 276459e57e | |||
| 223830a5ee | |||
| 410d44d67d | |||
| d7cbe6e947 | |||
| ad051cdd99 | |||
| b1fe298764 | |||
| a6c02af099 | |||
| c97c1a2454 | |||
| 9b1b281c7b | |||
| 185faf99bd | |||
| b903ff8992 | |||
| face2ea612 | |||
| 3fd03964a3 | |||
| ccea108806 | |||
| 8d5a5d5ceb | |||
| a3a446c197 | |||
| c63b4433f4 | |||
| 505c90e104 | |||
| 97b8a089c7 | |||
| 69e5ac6f02 | |||
| 3da9598add | |||
| 437da0a3d9 | |||
| d026d7dcfb | |||
| 110af09bf9 | |||
| 73af899b7c | |||
| 2d8f2c2aea | |||
| b066dd36ff | |||
| 1563300197 | |||
| 2914443685 | |||
| fef1f9b0a7 | |||
| 2808bea7fa | |||
| d30a0c6f03 | |||
| 0246cffc34 | |||
| 22dece8146 | |||
| 4566105578 | |||
| fee2049642 | |||
| e2499e5b2f | |||
| 60bcb16ca8 | |||
| 2a781bb616 | |||
| 4eb9f175a4 | |||
| b2b56b6896 | |||
| 5ed354221c | |||
| 827c7515c9 | |||
| 23f26fb4a8 | |||
| d4ef5bc16a | |||
| 26fe8bd4f2 | |||
| 4857cae6ed | |||
| 1ba29cc95d | |||
| df5b2224d7 | |||
| f1fe873375 | |||
| b0c6bd0a5b | |||
| 4ae30ecdd9 | |||
| 937b8e4277 | |||
| e356ca2369 | |||
| e955bcb872 | |||
| 88225eb65e | |||
| ec24091578 | |||
| 024be9b8c9 | |||
| af9c8377eb | |||
| 29c186a022 | |||
| baf9e32af3 | |||
| 8b168175ec | |||
| 83655ba9be | |||
| 0873ebb9b0 | |||
| 5e82c98a9f | |||
| babd21c764 | |||
| 47e1133e71 | |||
| a972f0d4ea | |||
| f7175f5050 | |||
| 1ea1ff197d | |||
| 5ea8ea440b | |||
| 050916fd6b | |||
| ada753a54c | |||
| a96c5b5d90 | |||
| b2d8e8c508 | |||
| b2673a19cf | |||
| 905a9dada2 | |||
| 3935e13603 | |||
| af8ed9d09f | |||
| 638a91f92f | |||
| 3562a05d90 | |||
| 6c1247b38c | |||
| b7ff9ddcdd | |||
| 25161fc56f | |||
| 0739f28e56 | |||
| 046045239c | |||
| 7d55c09a9f | |||
| 0be1f4a573 | |||
| af4d6f34d8 | |||
| bd6fb497bc | |||
| 949ec486c5 | |||
| 556768ead1 | |||
| 2cfe29276e | |||
| 752f232335 | |||
| 92a0808379 | |||
| 3ae7515955 | |||
| ecc34dc521 | |||
| eabf728682 | |||
| 29b0ef44aa | |||
| 3010cc5971 | |||
| bfb12acde6 | |||
| 44699c59b3 | |||
| fee87ea3f7 | |||
| 6a80834ed4 | |||
| 593329401a | |||
| ef332dc550 | |||
| 746d5f5021 | |||
| cb5bc1832b | |||
| 5a22d81fe5 | |||
| 0a19b07055 | |||
| dbe9ee0924 | |||
| 4b968d1fe2 | |||
| d077778074 | |||
| e615fafe2d | |||
| e4aa39f9e5 | |||
| 8ac2c5d620 | |||
| 6be25727ec | |||
| 04b4495493 | |||
| 9661d60f74 | |||
| 8a05c195f7 | |||
| 2c1b4f5711 | |||
| ffb9554787 | |||
| b638aa74d7 | |||
| fdc4344acb | |||
| 421c5dee12 | |||
| d25ee8a273 | |||
| 6c6900a6cd | |||
| 21bd834a59 | |||
| b969d86415 | |||
| fe58b58937 | |||
| 87595a6b3a | |||
| b9f94c9315 | |||
| 56fe2dc1ed | |||
| e268606e26 | |||
| 0d979a741b | |||
| 9a2317e063 | |||
| d99ced6ec8 | |||
| 9ff33dacfc | |||
| a6f5e1f0ca | |||
| 08515281b9 | |||
| f7d85bfed8 | |||
| 3250f11f0c | |||
| d068e27420 | |||
| 18bc4db75c | |||
| bc18fb481f | |||
| 5f6ce6f4b0 | |||
| 558e4d9c2d | |||
| 440e8d4efa | |||
| bc7f649d68 | |||
| ad8bbaf008 | |||
| ed397cfbea | |||
| 5669ee815b | |||
| 2a21c10837 | |||
| 800da724a3 | |||
| 0136711cf4 | |||
| 2a2537725a | |||
| 49afb28738 | |||
| ab748188b1 | |||
| e340ff9c3a | |||
| 629a06d9b6 | |||
| f646f61dad | |||
| ca9a3af704 | |||
| eca5906a75 | |||
| b872d14376 | |||
| d3e3d0996c | |||
| 20c11d3b7b | |||
| 089aac61f3 | |||
| 1f18282f04 | |||
| 529632f8d0 | |||
| a13cbced2e | |||
| a9effeeb35 | |||
| 69103a9fab | |||
| a729f985fd | |||
| d43087cafe | |||
| 0bf823e1eb | |||
| 39ee07b8f6 | |||
| e187219699 | |||
| a56d7592f0 | |||
| 5e93c82023 | |||
| a6d634b5b8 | |||
| af8fc3e209 | |||
| 22467599c4 | |||
| 68cc2e292d | |||
| 45365e4df1 | |||
| 139b32734e | |||
| 488d4df520 | |||
| 5f6fb16fda | |||
| 06d22af2bf | |||
| 6e593cd1f0 | |||
| 386f402e0c | |||
| 9efb24943e | |||
| 55b7073aae | |||
| bf6548dc1a | |||
| 0f0f5652fb | |||
| d4c905bf77 | |||
| 7ff294dbe6 | |||
| 332588fcee | |||
| 2fd0229493 | |||
| 18c1e32047 | |||
| 315dac4878 | |||
| c58152d94b | |||
| a0d7cf89f2 | |||
| 7475d23fec | |||
| 3dee92ec50 | |||
| 587df6d942 | |||
| 513c2b92a4 | |||
| 84cec17913 | |||
| e8ee284710 | |||
| ea2c13c91e | |||
| f57106b00a | |||
| ef8c919e3f | |||
| d9107601c3 | |||
| a08044d6f2 | |||
| aea25e7f90 | |||
| 89b6e68e1e | |||
| 62c4cf3ac6 | |||
| 945706a8e8 | |||
| 78788e1efb | |||
| b143f7100a | |||
| 5a9461056b | |||
| 08b5dc64af | |||
| 8f05af8d05 | |||
| e932160a8d | |||
| 39e742765a | |||
| 50aa4f8887 | |||
| c67ad49378 | |||
| b8af7c5f86 | |||
| 3f794cd951 | |||
| 222149b9c6 | |||
| 22fcbaed64 | |||
| a0d3d11470 | |||
| f1695bdc38 | |||
| c39b4b8be1 | |||
| 242cf538b4 | |||
| 4059f8b3a3 | |||
| 9a70fd0123 | |||
| 17a85b16fc | |||
| 50b651655d | |||
| cc547e8260 | |||
| bb679f978d | |||
| 2ad27f5757 | |||
| 8a31a37434 | |||
| bf718b0865 | |||
| 2d813910de | |||
| 3b993431be | |||
| c57aef75de | |||
| e70b75b51a | |||
| 8755a19e02 | |||
| bdd8cc697a | |||
| 2c7a123ed8 | |||
| a936ec325b | |||
| e5890fc92a | |||
| 1283d62e49 | |||
| d9ab31490c | |||
| 6a5298a532 | |||
| 8129f5378f | |||
| fb8143d55d | |||
| fd20529686 | |||
| 92deccbf41 | |||
| 48c4bea57c | |||
| 2e68f89225 | |||
| 2d0611bc01 | |||
| fa109b94d9 | |||
| ca245e995a | |||
| 0624411875 | |||
| 63584bc4d0 | |||
| f7df5dd32c | |||
| 70c5d69640 | |||
| e012ccda4a | |||
| f4136679ea | |||
| 3358b8910b | |||
| 73298ea875 | |||
| bd8e6b7e14 | |||
| 6757101f55 | |||
| 37ba1d6f2d | |||
| 7ec59fc097 | |||
| 0e44ad5543 | |||
| 4196543cd5 | |||
| 6da62f56fa | |||
| 99fae8146f | |||
| 2f0036c918 | |||
| 9dea296241 | |||
| 2566ef3515 | |||
| d891e9b1d8 | |||
| 8646d5fb84 | |||
| d343a58580 | |||
| ed3d2cd122 | |||
| 6bf8fe815d | |||
| a391871cce | |||
| 41b23fde9f | |||
| 48cc1b351d | |||
| 5707304777 | |||
| cb0d695984 | |||
| d60de63fa0 | |||
| a90a93b454 | |||
| 6857870412 | |||
| 3c229aa2eb | |||
| 62df5e8c8b | |||
| 4435ec5f26 | |||
| b421ebef86 | |||
| 701c7e5685 | |||
| 0ce7c33bc8 | |||
| 7dc6b1d7d4 | |||
| 58b890b9f7 | |||
| 6639348c5e | |||
| 9640bbe76d | |||
| 7d168d3d6f | |||
| 32bb71d686 | |||
| 822d33d64b | |||
| d547c6b1a2 | |||
| 31348f8c30 | |||
| bc09d1ba3b | |||
| f1aa180a40 | |||
| 8c7f19850f | |||
| da257f3397 | |||
| 622318aeae | |||
| b8b5d83ad0 | |||
| 93c3f20deb | |||
| 258b13f2e0 | |||
| 42cd061af0 | |||
| f6daaccccf | |||
| 18ca3d1e62 | |||
| 2457bfc1e3 | |||
| f6a165d10f | |||
| 92093a6e6c | |||
| f1e8aa70a0 | |||
| d25344c257 | |||
| 62ee92e3e2 | |||
| 375ec5ed7e | |||
| 758f914249 | |||
| 121fa04906 | |||
| 5ea1c72291 | |||
| f5dff87242 | |||
| f0ef7bd149 | |||
| 0e6c335077 | |||
| ce41a15437 | |||
| d9e364f31f | |||
| 32bf712102 | |||
| 98e0d13f99 | |||
| c9d3c0f206 | |||
| 9e381d0782 | |||
| 169add5aa6 | |||
| 597b3f4456 | |||
| 26ad229bd6 | |||
| 45afd29b72 | |||
| 954e2f9b9c | |||
| 13317bdfda | |||
| c4c1e94088 | |||
| 30ff197f78 | |||
| 8877e3aedb | |||
| 9c973144d8 | |||
| 576a85368d | |||
| 2d34443834 | |||
| f8598e173b | |||
| d63f698cbe | |||
| 44b75eb116 | |||
| 248e2c7d47 | |||
| 37ab318657 | |||
| cad7c4d51d | |||
| fda1e76776 | |||
| eeba5c3603 | |||
| 3eb9a655c7 | |||
| d25cbaaba8 | |||
| 4970a56341 | |||
| f080d9390a | |||
| f4265d251a | |||
| f2105419fa | |||
| 89bb028bfc | |||
| c92c99ed0b | |||
| 570083fb9f | |||
| b32685c714 | |||
| 2ac57a2b1f | |||
| b05789ff0b | |||
| 572a7bf6ce | |||
| 200c8a0d3a | |||
| 4832c24ef7 | |||
| 8b094755fa | |||
| 1caca2112b | |||
| 42fbbfecc6 | |||
| 46a668c565 | |||
| 164a41b399 | |||
| 791a11f949 | |||
| 334241d82e | |||
| 7791839f22 | |||
| 2f94637899 | |||
| 936234d5b1 | |||
| e1b102e9a6 | |||
| 72001dc13c | |||
| 3df41b3263 | |||
| 7b4f323b8b | |||
| ee6aacee9c | |||
| 62c6656130 | |||
| 4acdcfd008 | |||
| 273add5d5d | |||
| f7a273cfb3 | |||
| d57321f7c1 | |||
| 146be78390 | |||
| cc17400849 | |||
| 1114cbf671 | |||
| 82ad0749af | |||
| 0451629e22 | |||
| 86b55b3923 | |||
| 01519313d7 | |||
| 7e12c879c2 | |||
| d0f902053f | |||
| da208216ee | |||
| 235b00b6ee | |||
| e8caa9b5c0 | |||
| 05b99a4dde | |||
| e6ee800fde | |||
| 72f789bf34 | |||
| f6265500fb | |||
| b1f46b6d69 | |||
| d991054202 | |||
| 0c4e294504 | |||
| 5c572ffa1f | |||
| cae467cda0 | |||
| 3e9a659f4c | |||
| 33ba7867f6 | |||
| 80519a0278 | |||
| d743a4c969 | |||
| 02d98d3242 | |||
| efa0e75eac | |||
| e1ab227b6d | |||
| 7067c1597d | |||
| a0e26817e2 | |||
| dde04d5d3e | |||
| 91ef0b9537 | |||
| 964dda2ef2 | |||
| e3b12bdb59 | |||
| 3571e8f263 | |||
| 91e56abcf1 | |||
| 4ee3034496 | |||
| 034aaa7a70 | |||
| 8f05126619 | |||
| 6531fd142c | |||
| 518c6ae8c6 | |||
| 048feeb3f0 | |||
| b00dff83de | |||
| 4a81492b68 | |||
| d861c03366 | |||
| 52a60526f1 | |||
| ee26889205 | |||
| 537ab13842 | |||
| 01acb08c7b | |||
| 11fa0094ff | |||
| 5c43a394c5 | |||
| 183081ccd3 | |||
| 897b071b97 | |||
| 6258ff36bc | |||
| c7516b840a | |||
| 8ffa29473f | |||
| e0ff5106d3 | |||
| 603fa03ac6 | |||
| 8a094a5f54 | |||
| ef7833a271 | |||
| da3da84a20 | |||
| b18983a005 | |||
| bee5cb504b | |||
| 717b2f496f | |||
| a2f7132648 | |||
| 7555ab194f | |||
| 91f680aff6 | |||
| 3202bbe17c | |||
| bc3280d64d | |||
| 8e7e24ac80 | |||
| cc5da83474 | |||
| c515e878ab | |||
| d195f2775a | |||
| b7fa6d84bc | |||
| 9c14a2f0aa | |||
| e80766abf0 | |||
| 25a4559565 | |||
| dcfc1fe17e | |||
| 63cd581d75 | |||
| c48807c383 | |||
| d0509f6702 | |||
| 1fc9425bb1 | |||
| 8285924cf3 | |||
| 97aaaf50b8 | |||
| c5f2170ce8 | |||
| 6fc5697950 | |||
| aacae20657 | |||
| c9fe702671 | |||
| 7123d9c376 | |||
| a893b147dc | |||
| a57718e1ac | |||
| 8b1146deb2 | |||
| 97ec91ad67 | |||
| f6deaf5f2a | |||
| 1e3052d3cd | |||
| b67c64e2c8 | |||
| 301ab43897 | |||
| a710317aa0 | |||
| 8f301151e4 | |||
| 688fcf14f3 | |||
| f0fb665407 | |||
| e74c475162 | |||
| cc5b99c236 | |||
| af09cb2834 | |||
| 5adc0bf3a7 | |||
| 58dc58aa51 | |||
| 2eb3c02059 | |||
| 179ef0a975 | |||
| ea6fe71a50 | |||
| 76f7fb5231 | |||
| 54f0616a13 | |||
| f694192878 | |||
| ea4bcadb38 | |||
| 9b173e2db1 | |||
| 89172c08a2 | |||
| 336996152a | |||
| 588ca5d126 | |||
| a2120263de | |||
| 8c84763ed3 | |||
| 87a98e4562 | |||
| e63d3dd25f | |||
| b6949c5088 | |||
| 870d9502bb | |||
| d5e64f4eb2 | |||
| 3b38eeaccf | |||
| 2b8f888ea4 | |||
| 316fb26f5b | |||
| a835517049 | |||
| 5c325466e0 | |||
| 98db804541 | |||
| 71e1889825 | |||
| 4e28c00e7b | |||
| a5b5684670 | |||
| 78a310630f | |||
| 999f41fb4f | |||
| 3a8dbebd37 | |||
| 0d854db361 | |||
| fdb3d4ff60 | |||
| 9e5c9dad55 | |||
| e7b9cfa8f2 | |||
| 1d4a29f149 | |||
| e5f129424c | |||
| 66b0651607 | |||
| 803274e207 | |||
| b7ff13b603 | |||
| 9e239c7a1e | |||
| 19270103ec | |||
| 7f1114d935 | |||
| bdcb81e81e | |||
| d1e7a7e06b | |||
| 6b2510d312 | |||
| a048cb9f0d | |||
| 87598c8749 | |||
| ca9a88785e | |||
| 2072168a1c | |||
| 6ff9fc67bb | |||
| 800f656402 | |||
| e2bfd1a036 | |||
| 7f9fe6f1f2 | |||
| ef2b73043d | |||
| 7a10369f4b | |||
| 14b76a5bca | |||
| 8bb3863f52 | |||
| fa288af58b | |||
| 0e7edca7e3 | |||
| 9e5a8ba9f5 | |||
| c9fb1434c0 | |||
| a5ea5888b8 | |||
| 2c7a15b195 | |||
| 0ebabe17df | |||
| 5ada462773 | |||
| 69e19b88c2 | |||
| 41519d3ac0 | |||
| 9a10bdbae5 | |||
| 4bbe67451d | |||
| 651a1d2869 | |||
| 7c334f45c6 | |||
| 0f8faa3441 | |||
| 5e68b28ad3 | |||
| aa54acd54d | |||
| 87c27a074d | |||
| 4af3ca4e4d | |||
| 953160ddd6 | |||
| 5c961169cc | |||
| 94dbc35d92 | |||
| ad2e864a9a | |||
| e0489cb4a6 | |||
| 922ac1a1ec | |||
| c95a97389d | |||
| 2a8322ddbb | |||
| cfb964834c | |||
| 73c3d14a66 | |||
| f6ceeaa2e5 | |||
| 6847cc9f1c | |||
| 411d36ff13 | |||
| 63ae5f00b1 | |||
| 43e0912516 | |||
| 64533009b3 | |||
| 8aca8d90d6 | |||
| 9ca39821c8 | |||
| 2e608b1c97 | |||
| dcc63d7408 | |||
| 5e32de8173 | |||
| 5375a77f84 | |||
| 2f4a3e40eb | |||
| 15aa0df23c | |||
| 3166d0c667 | |||
| 339793143c | |||
| 8be1ba708e | |||
| 0bd357e7ec | |||
| cfe849bd43 | |||
| d8c70e2e73 | |||
| 03bf0a89b5 | |||
| 1ce9ffcc7f | |||
| b1ef44b1ac | |||
| da0a36c323 | |||
| 8d6b8b45b6 | |||
| 5d699e9ba5 | |||
| 321c0ec533 | |||
| 4ad45af53f | |||
| 37a7e08b38 | |||
| bab4bc0968 | |||
| f6c4901b8f | |||
| bb6496d9e5 | |||
| c2de5cf735 | |||
| 2959e7aba9 | |||
| ce1cc352d9 | |||
| 350d483a70 | |||
| d34eec3ab3 | |||
| 2be955a0ef | |||
| 830bff1241 | |||
| 16fb74425e | |||
| 3786d30320 | |||
| adb62403ec | |||
| 50b9a5afa9 | |||
| 230f22b1cd | |||
| 06a9c16961 | |||
| d22506092e | |||
| 728bd68977 | |||
| 65519ab786 | |||
| 886b1f39d9 | |||
| cbced23de4 | |||
| e58a778bd5 | |||
| 1c49796e8e | |||
| 6b0661cca1 | |||
| 46f05f2db6 | |||
| 15a6586062 | |||
| bdb6b45c91 | |||
| 1170d74868 | |||
| 6ae5a9f07a | |||
| cc1a95d161 | |||
| fffd0f5b68 | |||
| 89480801b8 | |||
| 9deb206e74 | |||
| 27cf941284 | |||
| 04cd09a30a | |||
| 3ea889050b | |||
| b46e741c95 | |||
| 34f9c039c5 | |||
| d35422b523 | |||
| d61f5d160d | |||
| 68ef903a7c | |||
| 06407b4d14 | |||
| 12213f9985 | |||
| caa5e3b4c5 | |||
| 2e17251160 | |||
| 3f102e5d3a | |||
| aad6d28e13 | |||
| 1650c664bc | |||
| d17b099994 | |||
| 1516103a15 | |||
| bf0173bf38 | |||
| b4e300b78b | |||
| 402a77e7f7 | |||
| 2ca561f104 | |||
| 174cb06a7a | |||
| 583b327523 | |||
| 1081cee35f | |||
| 69fd57bc96 | |||
| 8e6e05ed3f | |||
| c512bf6c66 | |||
| bcff9fd067 | |||
| 0d7aeacc34 | |||
| 3515f6ec33 | |||
| 602f047fe8 | |||
| 7f3eea6325 | |||
| 878a6906cc | |||
| 0194d5a2d5 | |||
| d219709cfa | |||
| c2e281f8cf | |||
| 07334bc25c | |||
| 94fdd45b75 | |||
| 70ff3804e9 | |||
| 8741d97a4f | |||
| 432d0fd707 | |||
| e45d5446f2 | |||
| 0f91faddae | |||
| 5e6e12600f | |||
| 92f182bc3b | |||
| bc3c7e80a6 | |||
| 32683ee6e0 | |||
| 544eb4be1f | |||
| d9e092325b | |||
| ec7ce81401 | |||
| 5bc291937f | |||
| 9313978f61 | |||
| ce6b06efb9 | |||
| f01c029446 | |||
| 928552ac9e | |||
| ab58cac236 | |||
| 71496e3be4 | |||
| e63d628677 | |||
| dcb3c4ff1e | |||
| 488b5d95dc | |||
| 22f12dc93c | |||
| ad183481c0 | |||
| 08c94aa5c0 | |||
| 1989bc33a7 | |||
| 46bee83005 | |||
| 2360291c3e | |||
| 12ed7ca63e | |||
| e8357c0544 | |||
| ca479c3f5b | |||
| 02829f73e0 | |||
| a44c0fd51f | |||
| 773365405f | |||
| cb0a61b9ba | |||
| 8a9a9403a3 | |||
| 7d1140340e | |||
| 862242aa8d | |||
| 1ff6c758ec | |||
| 6ba22dea46 | |||
| 70b984434d | |||
| e5ed9cc612 | |||
| 1fbf914348 | |||
| 09436df1ad | |||
| 4bb4a349c9 | |||
| b4716b1d92 | |||
| acc8589083 | |||
| c0dc2f2bb3 | |||
| 66ab4e15db | |||
| c10d08f795 | |||
| 4b75be801e | |||
| ac64713881 | |||
| c455fc0334 | |||
| 42c0914382 | |||
| 49e1f6b161 | |||
| 1a4c22fc46 | |||
| 5f4c7372c0 | |||
| d07eb9ad60 | |||
| 5a54acef4e | |||
| e5fbb4f5d2 | |||
| 11626fe32c | |||
| 63e89bc326 | |||
| 96a3c7954d | |||
| 25af743902 | |||
| 6d1cdcf601 | |||
| dc59476c34 | |||
| 4e39d0371d | |||
| 11feae6631 | |||
| eef78f5664 | |||
| 9ef742bbf4 | |||
| 928bfe0b93 | |||
| 86e8a105a5 | |||
| a586ef725c | |||
| fe7fd4c312 | |||
| 0488d9bdb2 | |||
| 431e2e6d68 | |||
| 9439872a62 | |||
| f6dd549e58 | |||
| 454bc7a674 | |||
| 8f4b534937 | |||
| e251ed7773 | |||
| 0e6ebafdb3 | |||
| 7d17d20dce | |||
| 1d2baf0bd3 | |||
| 10e6491c22 | |||
| 95a438d233 | |||
| 4238add35b | |||
| f448d75aa8 | |||
| 19c9174543 | |||
| 4784c7be5f | |||
| c3e6de293f | |||
| 544908d06c | |||
| 520da7aaaf | |||
| bb0f9d6bc4 | |||
| df7fb00c21 | |||
| fa17267e05 | |||
| ed4de20fd1 | |||
| 9b9e685dbc | |||
| 49bb0bf9c8 | |||
| d6c5e18e24 | |||
| 617e6b4cc9 | |||
| a683a496ea | |||
| 5ebfb52a4a | |||
| 6dd9e18b2e | |||
| 5b833db558 | |||
| fce018e7a9 | |||
| e7cc2eea1d | |||
| 7c65f7ef11 | |||
| a4a47b538c | |||
| d098048aba | |||
| 309c962169 | |||
| e7d5dbfec0 | |||
| ed9564106c | |||
| 600b7a30e6 | |||
| b32d914aab | |||
| 526d1d6db1 | |||
| aa621d6f3c | |||
| 704c688225 | |||
| 6c71988c54 | |||
| 82811d0706 | |||
| c5b5d5c8d3 | |||
| cc862e996e | |||
| 635342ab73 | |||
| 98c78e0acd | |||
| 6833b46a05 | |||
| 0ef5c8c541 | |||
| 359bd21bd7 | |||
| fadf25acd6 | |||
| 77264dcca9 | |||
| 5448d9186a | |||
| 2a2a1dc5b4 | |||
| 4d0f789e0a | |||
| d3c14ce3ea | |||
| 42936d3227 | |||
| 3681dcef1a | |||
| b3f5e3bf94 | |||
| b66c349bba | |||
| c45d3568ae | |||
| 6a6222d21c | |||
| 880052d3f3 | |||
| 85afbd409b | |||
| 03c3e0edcf | |||
| 4f558e8b89 | |||
| 6512a4b7e3 | |||
| 582bb3c311 | |||
| d53a5210a8 | |||
| 1ed9a58b64 | |||
| d0ab595f52 | |||
| 5a4f2b5d27 |
@@ -0,0 +1,31 @@
|
||||
# https://editorconfig.org/
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[{CMakeLists.*,*.cmake}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
[*.{bat,cmd,cmd.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.{ps1,ps1.*}]
|
||||
end_of_line = crlf
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
[*.{md,markdown}]
|
||||
indent_size = 2
|
||||
@@ -43,6 +43,8 @@
|
||||
|
||||
# reST underlines/overlines can look like conflict markers
|
||||
*.rst text conflict-marker-size=80
|
||||
# Markdown heading markers can look like conflict markers
|
||||
*.md text conflict-marker-size=200
|
||||
|
||||
*.cmake text whitespace=tabwidth=2
|
||||
*.cmakein text whitespace=tabwidth=2
|
||||
@@ -79,6 +81,8 @@ org.eclipse.jdt.core.prefs -text whitespace=cr-at-eol merge=union
|
||||
*.cmd text eol=crlf
|
||||
*.cmd.tmpl text eol=crlf
|
||||
*.dsp text eol=crlf -whitespace
|
||||
*.ps1 text eol=crlf
|
||||
*.ps1.in text eol=crlf
|
||||
*.sln text eol=crlf -whitespace
|
||||
*.vcproj text eol=crlf -whitespace merge=union
|
||||
*.vcxproj text eol=crlf -whitespace merge=union
|
||||
|
||||
@@ -2,6 +2,14 @@
|
||||
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.
|
||||
-->
|
||||
|
||||
@@ -27,4 +35,4 @@ This is a template helping you to create an issue which can be processed as quic
|
||||
// C++ code example
|
||||
```
|
||||
or attach as .txt or .zip file
|
||||
-->
|
||||
-->
|
||||
|
||||
+4
-4
@@ -1,10 +1,11 @@
|
||||
# ignore dot files/directories
|
||||
.*
|
||||
!.gitignore
|
||||
|
||||
*.autosave
|
||||
*.pyc
|
||||
*.user
|
||||
*~
|
||||
.*.swp
|
||||
.DS_Store
|
||||
.sw[a-z]
|
||||
Thumbs.db
|
||||
tags
|
||||
tegra/
|
||||
@@ -21,4 +22,3 @@ bin/
|
||||
*.log
|
||||
*.tlog
|
||||
build
|
||||
.cache
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
[tgit]
|
||||
icon = doc/opencv.ico
|
||||
Vendored
-2
@@ -37,6 +37,4 @@ if(WITH_NEON)
|
||||
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
||||
endif()
|
||||
|
||||
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
|
||||
|
||||
Vendored
+8
-9
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
|
||||
|
||||
@@ -14,18 +12,20 @@ elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*")
|
||||
set(AARCH64 TRUE)
|
||||
endif()
|
||||
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-function)
|
||||
|
||||
set(TEGRA_COMPILER_FLAGS "")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
# Generate unwind information even for functions that can't throw/propagate exceptions.
|
||||
# This lets debuggers and such get non-broken backtraces for such functions, even without debugging symbols.
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -funwind-tables)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
if(X86 OR ARMEABI_V6 OR (MIPS AND ANDROID_COMPILER_VERSION VERSION_LESS "4.6"))
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched-stalled-insns-dep=100 -fsched-stalled-insns=2)
|
||||
elseif(CMAKE_COMPILER_IS_CLANGCXX)
|
||||
elseif(CV_CLANG)
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fwrapv)
|
||||
else()
|
||||
list(APPEND TEGRA_COMPILER_FLAGS -fweb -fwrapv -frename-registers -fsched2-use-superblocks -fsched2-use-traces
|
||||
@@ -42,7 +42,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEGRA_COMPILER_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEGRA_COMPILER_FLAGS}")
|
||||
|
||||
if(ARMEABI_V7A)
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC OR CV_CLANG)
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-tree-vectorize" )
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-tree-vectorize" )
|
||||
endif()
|
||||
@@ -55,7 +55,7 @@ endif()
|
||||
set(CAROTENE_NS "carotene_o4t" CACHE STRING "" FORCE)
|
||||
|
||||
function(compile_carotene)
|
||||
if(ENABLE_NEON)
|
||||
if(";${CPU_BASELINE_FINAL};" MATCHES ";NEON;")
|
||||
set(WITH_NEON ON)
|
||||
endif()
|
||||
|
||||
@@ -85,7 +85,7 @@ include_directories("${CAROTENE_DIR}/include")
|
||||
get_target_property(carotene_defs carotene_objs INTERFACE_COMPILE_DEFINITIONS)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(CV_GCC)
|
||||
# allow more inlines - these parameters improve performance for:
|
||||
# matchTemplate about 5-10%
|
||||
# goodFeaturesToTrack 10-20%
|
||||
@@ -95,7 +95,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
||||
endif()
|
||||
|
||||
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
|
||||
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
||||
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
|
||||
Vendored
+10
-10
@@ -67,7 +67,7 @@
|
||||
size_t src2_step;
|
||||
|
||||
#define DST_ARG1 DT * dst1_data_, size_t dst1_step_,
|
||||
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
|
||||
#define DST_STORE1 dst1_data(dst1_data_), dst1_step(dst1_step_),
|
||||
#define DST_VAR1 DT * dst1_data; \
|
||||
size_t dst1_step;
|
||||
|
||||
@@ -1073,7 +1073,7 @@ struct FilterCtx
|
||||
inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height,
|
||||
int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace)
|
||||
{
|
||||
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
|
||||
if(!context || !kernel_data || allowSubmatrix || allowInplace ||
|
||||
src_type != CV_8UC1 || dst_type != CV_8UC1 ||
|
||||
delta != 0 || anchor_x != kernel_width / 2 || anchor_y != kernel_height / 2 )
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1105,7 +1105,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
|
||||
if(!CAROTENE_NS::isConvolutionSupported(CAROTENE_NS::Size2D(max_width, max_height), ctx->ksize, ctx->border))
|
||||
{
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1212,7 +1212,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
|
||||
if(!CAROTENE_NS::isSeparableFilter3x3Supported(CAROTENE_NS::Size2D(16, 16), ctx->border, 3, 3))
|
||||
{
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
@@ -1341,8 +1341,8 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
||||
ctx->anchor_y = anchor_y;
|
||||
switch(operation)
|
||||
{
|
||||
case MORPH_ERODE:
|
||||
case MORPH_DILATE:
|
||||
case CV_HAL_MORPH_ERODE:
|
||||
case CV_HAL_MORPH_DILATE:
|
||||
ctx->operation = operation;
|
||||
break;
|
||||
default:
|
||||
@@ -1355,7 +1355,7 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
||||
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
|
||||
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
|
||||
{
|
||||
if( operation == MORPH_ERODE )
|
||||
if( operation == CV_HAL_MORPH_ERODE )
|
||||
for(int i = 0; i < ctx->channels; ++i)
|
||||
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
|
||||
else
|
||||
@@ -1404,14 +1404,14 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
|
||||
( \
|
||||
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
|
||||
context && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||
((MorphCtx*)context)->operation == MORPH_ERODE ? \
|
||||
((MorphCtx*)context)->operation == CV_HAL_MORPH_ERODE ? \
|
||||
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||
src_data, src_step, dst_data, dst_step, \
|
||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
|
||||
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
|
||||
CV_HAL_ERROR_OK : \
|
||||
((MorphCtx*)context)->operation == MORPH_DILATE ? \
|
||||
((MorphCtx*)context)->operation == CV_HAL_MORPH_DILATE ? \
|
||||
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||
src_data, src_step, dst_data, dst_step, \
|
||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||
@@ -1531,7 +1531,7 @@ class TegraCvtColor_##name##_Invoker : public cv::ParallelLoopBody \
|
||||
public: \
|
||||
TegraCvtColor_##name##_Invoker(const uchar * src_data_, size_t src_step_, uchar * dst_data_, size_t dst_step_, int width_, int height_) : \
|
||||
cv::ParallelLoopBody(), src_data(src_data_), src_step(src_step_), dst_data(dst_data_), dst_step(dst_step_), width(width_), height(height_) {} \
|
||||
virtual void operator()(const cv::Range& range) const \
|
||||
virtual void operator()(const cv::Range& range) const CV_OVERRIDE \
|
||||
{ \
|
||||
CAROTENE_NS::func(CAROTENE_NS::Size2D(width, range.end-range.start), __VA_ARGS__); \
|
||||
} \
|
||||
|
||||
+8
-8
@@ -49,7 +49,7 @@ void extract2(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -60,7 +60,7 @@ void extract2(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 64, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -101,7 +101,7 @@ void extract3(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -112,7 +112,7 @@ void extract3(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 96, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -153,7 +153,7 @@ void extract4(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -164,7 +164,7 @@ void extract4(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; dj < roiw32; sj += 128, dj += 32)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
|
||||
srcStride == dst2Stride && \
|
||||
srcStride == dst3Stride &&
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
|
||||
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
|
||||
@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
|
||||
} \
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define ALPHA_QUAD(sgn, bits) { \
|
||||
internal::prefetch(src + sj); \
|
||||
|
||||
+5
-5
@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
|
||||
dstStride == src2Stride && \
|
||||
dstStride == src3Stride &&
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define MERGE_ASM2(sgn, bits) __asm__ ( \
|
||||
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
|
||||
@@ -240,7 +240,7 @@ void combineYUYV(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -253,7 +253,7 @@ void combineYUYV(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||
{
|
||||
internal::prefetch(srcy + syj);
|
||||
@@ -317,7 +317,7 @@ void combineUYVY(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -330,7 +330,7 @@ void combineUYVY(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||
{
|
||||
internal::prefetch(srcy + syj);
|
||||
|
||||
+62
-62
@@ -49,12 +49,12 @@ namespace {
|
||||
|
||||
enum
|
||||
{
|
||||
SHIFT = 14,
|
||||
SHIFT = 15,
|
||||
SHIFT_DELTA = 1 << (SHIFT - 1),
|
||||
|
||||
R2Y_BT601 = 4899,
|
||||
G2Y_BT601 = 9617,
|
||||
B2Y_BT601 = 1868,
|
||||
R2Y_BT601 = 9798,
|
||||
G2Y_BT601 = 19235,
|
||||
B2Y_BT601 = 3735,
|
||||
|
||||
R2Y_BT709 = 3483,
|
||||
G2Y_BT709 = 11718,
|
||||
@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 24, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 32, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 24, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||
@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
for (; dj < roiw8; sj += 32, dj += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
|
||||
for (; sj < roiw16; sj += 16, dj += 48)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||
"vmov.8 q1, q0 \n\t"
|
||||
@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
|
||||
|
||||
if (sj < roiw8)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0}, [%[in]] \n\t"
|
||||
"vmov.8 d1, d0 \n\t"
|
||||
@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
|
||||
#else
|
||||
uint8x16x4_t vRgba;
|
||||
@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
|
||||
for (; sj < roiw16; sj += 16, dj += 64)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||
"vmov.8 q1, q0 \n\t"
|
||||
@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
|
||||
|
||||
if (sj < roiw8)
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d5}, [%[in]] \n\t"
|
||||
"vmov.8 d6, d5 \n\t"
|
||||
@@ -672,7 +672,7 @@ void rgb2rgbx(const Size2D &size,
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
|
||||
#else
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
@@ -688,7 +688,7 @@ void rgb2rgbx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -742,7 +742,7 @@ void rgbx2rgb(const Size2D &size,
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
|
||||
union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
|
||||
@@ -754,7 +754,7 @@ void rgbx2rgb(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -805,7 +805,7 @@ void rgb2bgr(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -817,7 +817,7 @@ void rgb2bgr(const Size2D &size,
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -874,7 +874,7 @@ void rgbx2bgrx(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -885,7 +885,7 @@ void rgbx2bgrx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -943,7 +943,7 @@ void rgbx2bgr(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -954,7 +954,7 @@ void rgbx2bgr(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -1010,7 +1010,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
{
|
||||
internal::assertSupportedConfiguration();
|
||||
#ifdef CAROTENE_NEON
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
|
||||
#else
|
||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
|
||||
@@ -1019,7 +1019,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
vals8.v4.val[3] = vmov_n_u8(255);
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUC__) || !defined(__arm__)
|
||||
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
@@ -1030,7 +1030,7 @@ void rgb2bgrx(const Size2D &size,
|
||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0u, dj = 0u, j = 0u;
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
@@ -1087,12 +1087,12 @@ inline uint8x8x3_t convertToHSV(const uint8x8_t vR, const uint8x8_t vG, const ui
|
||||
const s32 hrange )
|
||||
{
|
||||
const s32 hsv_shift = 12;
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
register const s32 v0 = s32(0);
|
||||
register const s32 vshift = s32(1 << (hsv_shift-1));
|
||||
register const s32 v6 = s32(6);
|
||||
const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
const s32 vhrange = hrange;
|
||||
const s32 v0 = s32(0);
|
||||
const s32 vshift = s32(1 << (hsv_shift-1));
|
||||
const s32 v6 = s32(6);
|
||||
|
||||
uint8x8_t vMin = vmin_u8(vR, vG);
|
||||
uint8x8_t vMax = vmax_u8(vR, vG);
|
||||
@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
|
||||
"d24","d25","d26","d27","d28","d29","d30","d31" \
|
||||
);
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
|
||||
#define YCRCB_CONSTS \
|
||||
register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
|
||||
@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
|
||||
#define COEFF_G ( 8663)
|
||||
#define COEFF_B (-17705)
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
#define YUV420ALPHA3_CONST
|
||||
#define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
|
||||
#define YUV420ALPHA3_CONVERT
|
||||
@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
|
||||
#else
|
||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||
@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
|
||||
#ifdef CAROTENE_NEON
|
||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||
const s32 hsv_shift = 12;
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||
register const s32 vhrange = hrange;
|
||||
@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
|
||||
#else
|
||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||
@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||
"vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||
"vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||
"vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
|
||||
@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
|
||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||
"vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||
@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
|
||||
#else
|
||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||
@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
|
||||
#else
|
||||
uint8x8x4_t vRgba = vld4_u8(src + sj);
|
||||
@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
|
||||
#else
|
||||
uint8x8x3_t vBgr = vld3_u8(src + sj);
|
||||
@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
|
||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||
{
|
||||
internal::prefetch(src + sj);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
|
||||
#else
|
||||
uint8x8x4_t vBgra = vld4_u8(src + sj);
|
||||
@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d1, d0, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d1, d0, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d0, d1, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d0, d1, q5, q6)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d1, d0, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d1, d0, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(3, d0, d1, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
|
||||
internal::prefetch(uv + j);
|
||||
internal::prefetch(y1 + j);
|
||||
internal::prefetch(y2 + j);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CONVERTYUV420TORGB(4, d0, d1, q6, q5)
|
||||
#else
|
||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||
|
||||
Vendored
+27
-27
@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
|
||||
}
|
||||
})
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u8, u16, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||
{
|
||||
@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u8, s32, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
|
||||
register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
|
||||
@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u8, f32, 16,
|
||||
,
|
||||
{
|
||||
@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
|
||||
}
|
||||
})
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s8, u16, 16,
|
||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||
{
|
||||
@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s8, s16, 16,
|
||||
,
|
||||
{
|
||||
@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s8, s32, 16,
|
||||
,
|
||||
{
|
||||
@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s8, f32, 16,
|
||||
,
|
||||
{
|
||||
@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, u8, 16,
|
||||
,
|
||||
{
|
||||
@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s8, 16,
|
||||
register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
|
||||
{
|
||||
@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s16, 8,
|
||||
register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
|
||||
{
|
||||
@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(u16, s32, 8,
|
||||
register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
|
||||
{
|
||||
@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(u16, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, u8, 16,
|
||||
,
|
||||
{
|
||||
@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, s8, 16,
|
||||
,
|
||||
{
|
||||
@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVT_FUNC(s16, u16, 8,
|
||||
register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
|
||||
{
|
||||
@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, s32, 8,
|
||||
,
|
||||
{
|
||||
@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s16, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, u8, 8,
|
||||
,
|
||||
{
|
||||
@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, s8, 8,
|
||||
,
|
||||
{
|
||||
@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, u16, 8,
|
||||
,
|
||||
{
|
||||
@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, s16, 8,
|
||||
,
|
||||
{
|
||||
@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(s32, f32, 8,
|
||||
,
|
||||
{
|
||||
@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, u8, 8,
|
||||
register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
|
||||
register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
|
||||
@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s8, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, u16, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s16, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
CVT_FUNC(f32, s32, 8,
|
||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||
{
|
||||
|
||||
+36
-36
@@ -135,7 +135,7 @@ namespace CAROTENE_NS {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC1(u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -220,7 +220,7 @@ CVTS_FUNC1(u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -305,7 +305,7 @@ CVTS_FUNC(u8, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -389,7 +389,7 @@ CVTS_FUNC(u8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(u8, s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u8, s32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u8, f32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -643,7 +643,7 @@ CVTS_FUNC(u8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -728,7 +728,7 @@ CVTS_FUNC(s8, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC1(s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -813,7 +813,7 @@ CVTS_FUNC1(s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -899,7 +899,7 @@ CVTS_FUNC(s8, u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
CVTS_FUNC(s8, s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s8, s32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s8, f32, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(u16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(u16, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, u8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, s8, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(s16, 16,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s16, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, u8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, s8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(s32, f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, u8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
|
||||
@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s8, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, u16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s16, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC(f32, s32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||
@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
|
||||
})
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
CVTS_FUNC1(f32, 8,
|
||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||
|
||||
Vendored
+22
-36
@@ -151,6 +151,10 @@ void div(const Size2D &size,
|
||||
typedef typename internal::VecTraits<T>::vec128 vec128;
|
||||
typedef typename internal::VecTraits<T>::vec64 vec64;
|
||||
|
||||
#if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
|
||||
static_assert(std::numeric_limits<T>::is_integer, "template implementation is for integer types only");
|
||||
#endif
|
||||
|
||||
if (scale == 0.0f ||
|
||||
(std::numeric_limits<T>::is_integer &&
|
||||
(scale * std::numeric_limits<T>::max()) < 1.0f &&
|
||||
@@ -311,6 +315,10 @@ void recip(const Size2D &size,
|
||||
typedef typename internal::VecTraits<T>::vec128 vec128;
|
||||
typedef typename internal::VecTraits<T>::vec64 vec64;
|
||||
|
||||
#if defined(__GNUC__) && (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
|
||||
static_assert(std::numeric_limits<T>::is_integer, "template implementation is for integer types only");
|
||||
#endif
|
||||
|
||||
if (scale == 0.0f ||
|
||||
(std::numeric_limits<T>::is_integer &&
|
||||
scale < 1.0f &&
|
||||
@@ -463,8 +471,6 @@ void div(const Size2D &size,
|
||||
return;
|
||||
}
|
||||
|
||||
float32x4_t v_zero = vdupq_n_f32(0.0f);
|
||||
|
||||
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
|
||||
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
|
||||
|
||||
@@ -485,9 +491,7 @@ void div(const Size2D &size,
|
||||
float32x4_t v_src0 = vld1q_f32(src0 + j);
|
||||
float32x4_t v_src1 = vld1q_f32(src1 + j);
|
||||
|
||||
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
|
||||
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
|
||||
vreinterpretq_u32_f32(vmulq_f32(v_src0, internal::vrecpq_f32(v_src1))), v_mask)));
|
||||
vst1q_f32(dst + j, vmulq_f32(v_src0, internal::vrecpq_f32(v_src1)));
|
||||
}
|
||||
|
||||
for (; j < roiw64; j += 2)
|
||||
@@ -495,14 +499,12 @@ void div(const Size2D &size,
|
||||
float32x2_t v_src0 = vld1_f32(src0 + j);
|
||||
float32x2_t v_src1 = vld1_f32(src1 + j);
|
||||
|
||||
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
|
||||
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
|
||||
vreinterpret_u32_f32(vmul_f32(v_src0, internal::vrecp_f32(v_src1))), v_mask)));
|
||||
vst1_f32(dst + j, vmul_f32(v_src0, internal::vrecp_f32(v_src1)));
|
||||
}
|
||||
|
||||
for (; j < size.width; j++)
|
||||
{
|
||||
dst[j] = src1[j] ? src0[j] / src1[j] : 0.0f;
|
||||
dst[j] = src0[j] / src1[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -523,10 +525,8 @@ void div(const Size2D &size,
|
||||
float32x4_t v_src0 = vld1q_f32(src0 + j);
|
||||
float32x4_t v_src1 = vld1q_f32(src1 + j);
|
||||
|
||||
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
|
||||
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
|
||||
vreinterpretq_u32_f32(vmulq_f32(vmulq_n_f32(v_src0, scale),
|
||||
internal::vrecpq_f32(v_src1))), v_mask)));
|
||||
vst1q_f32(dst + j, vmulq_f32(vmulq_n_f32(v_src0, scale),
|
||||
internal::vrecpq_f32(v_src1)));
|
||||
}
|
||||
|
||||
for (; j < roiw64; j += 2)
|
||||
@@ -534,15 +534,13 @@ void div(const Size2D &size,
|
||||
float32x2_t v_src0 = vld1_f32(src0 + j);
|
||||
float32x2_t v_src1 = vld1_f32(src1 + j);
|
||||
|
||||
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
|
||||
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
|
||||
vreinterpret_u32_f32(vmul_f32(vmul_n_f32(v_src0, scale),
|
||||
internal::vrecp_f32(v_src1))), v_mask)));
|
||||
vst1_f32(dst + j, vmul_f32(vmul_n_f32(v_src0, scale),
|
||||
internal::vrecp_f32(v_src1)));
|
||||
}
|
||||
|
||||
for (; j < size.width; j++)
|
||||
{
|
||||
dst[j] = src1[j] ? src0[j] * scale / src1[j] : 0.0f;
|
||||
dst[j] = src0[j] * scale / src1[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -620,8 +618,6 @@ void reciprocal(const Size2D &size,
|
||||
return;
|
||||
}
|
||||
|
||||
float32x4_t v_zero = vdupq_n_f32(0.0f);
|
||||
|
||||
size_t roiw128 = size.width >= 3 ? size.width - 3 : 0;
|
||||
size_t roiw64 = size.width >= 1 ? size.width - 1 : 0;
|
||||
|
||||
@@ -639,23 +635,19 @@ void reciprocal(const Size2D &size,
|
||||
|
||||
float32x4_t v_src1 = vld1q_f32(src1 + j);
|
||||
|
||||
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
|
||||
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
|
||||
vreinterpretq_u32_f32(internal::vrecpq_f32(v_src1)), v_mask)));
|
||||
vst1q_f32(dst + j, internal::vrecpq_f32(v_src1));
|
||||
}
|
||||
|
||||
for (; j < roiw64; j += 2)
|
||||
{
|
||||
float32x2_t v_src1 = vld1_f32(src1 + j);
|
||||
|
||||
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
|
||||
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
|
||||
vreinterpret_u32_f32(internal::vrecp_f32(v_src1)), v_mask)));
|
||||
vst1_f32(dst + j, internal::vrecp_f32(v_src1));
|
||||
}
|
||||
|
||||
for (; j < size.width; j++)
|
||||
{
|
||||
dst[j] = src1[j] ? 1.0f / src1[j] : 0;
|
||||
dst[j] = 1.0f / src1[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -673,25 +665,19 @@ void reciprocal(const Size2D &size,
|
||||
|
||||
float32x4_t v_src1 = vld1q_f32(src1 + j);
|
||||
|
||||
uint32x4_t v_mask = vceqq_f32(v_src1,v_zero);
|
||||
vst1q_f32(dst + j, vreinterpretq_f32_u32(vbicq_u32(
|
||||
vreinterpretq_u32_f32(vmulq_n_f32(internal::vrecpq_f32(v_src1),
|
||||
scale)),v_mask)));
|
||||
vst1q_f32(dst + j, vmulq_n_f32(internal::vrecpq_f32(v_src1), scale));
|
||||
}
|
||||
|
||||
for (; j < roiw64; j += 2)
|
||||
{
|
||||
float32x2_t v_src1 = vld1_f32(src1 + j);
|
||||
|
||||
uint32x2_t v_mask = vceq_f32(v_src1,vget_low_f32(v_zero));
|
||||
vst1_f32(dst + j, vreinterpret_f32_u32(vbic_u32(
|
||||
vreinterpret_u32_f32(vmul_n_f32(internal::vrecp_f32(v_src1),
|
||||
scale)), v_mask)));
|
||||
vst1_f32(dst + j, vmul_n_f32(internal::vrecp_f32(v_src1), scale));
|
||||
}
|
||||
|
||||
for (; j < size.width; j++)
|
||||
{
|
||||
dst[j] = src1[j] ? scale / src1[j] : 0;
|
||||
dst[j] = scale / src1[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -105,12 +105,12 @@ void flip3(const Size2D & size,
|
||||
{
|
||||
using namespace internal;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
typedef typename VecTraits<T, 3>::vec128 vec128;
|
||||
#endif
|
||||
typedef typename VecTraits<T, 3>::vec64 vec64;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
|
||||
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
|
||||
#endif
|
||||
@@ -123,7 +123,7 @@ void flip3(const Size2D & size,
|
||||
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
|
||||
size_t j = 0, js = 0, jd = size.width * 3;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
|
||||
{
|
||||
prefetch(src + js);
|
||||
@@ -139,7 +139,7 @@ void flip3(const Size2D & size,
|
||||
|
||||
vst3q(dst + jd - step_base3, v_dst);
|
||||
}
|
||||
#endif // ANDROID
|
||||
#endif // __ANDROID__
|
||||
|
||||
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
|
||||
{
|
||||
|
||||
+3
-3
@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*2;
|
||||
u16* lidx3 = lane + x + 1*2;
|
||||
u16* lidx4 = lane + x + 2*2;
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ __volatile__ (
|
||||
"vld2.16 {d0, d2}, [%[in0]]! \n\t"
|
||||
"vld2.16 {d1, d3}, [%[in0]] \n\t"
|
||||
@@ -398,7 +398,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*3;
|
||||
u16* lidx3 = lane + x + 1*3;
|
||||
u16* lidx4 = lane + x + 2*3;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ __volatile__ (
|
||||
"vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
|
||||
"vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
|
||||
@@ -482,7 +482,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
||||
u16* lidx1 = lane + x - 1*4;
|
||||
u16* lidx3 = lane + x + 1*4;
|
||||
u16* lidx4 = lane + x + 2*4;
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ __volatile__ (
|
||||
"vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
|
||||
"vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
|
||||
|
||||
Vendored
+15
-15
@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw8; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld2.16 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.16 {d4-d7}, [%[in4]] \n\t"
|
||||
@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw4; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.32 {d4-d7}, [%[in4]] \n\t"
|
||||
@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
|
||||
f32* lane = internal::alignPtr(&_buf[2*cn], 32);
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
|
||||
register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
|
||||
|
||||
@@ -680,12 +680,12 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
register float32x4_t vc4d64f32 asm ("q14") = vmovq_n_f32(0.0625f); //4/4/16
|
||||
register float32x4_t vc6d64f32 asm ("q15") = vmovq_n_f32(0.09375f); //6/4/16
|
||||
#else
|
||||
register float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
||||
register float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
||||
float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
||||
float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
||||
|
||||
register float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
||||
register float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
||||
register float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
||||
float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
||||
float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
||||
float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < dstSize.height; ++i)
|
||||
@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
||||
for (; x < roiw4; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + 2 * x);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ __volatile__ (
|
||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||
"vld2.32 {d8-d11}, [%[in4]] \n\t"
|
||||
@@ -932,7 +932,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -973,7 +973,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 24)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vmov.u16 q9, #6 \n\t"
|
||||
"vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||
@@ -1064,7 +1064,7 @@ pyrUp8uHorizontalConvolution:
|
||||
for (; x < lim; x += 8)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -1210,7 +1210,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
@@ -1251,7 +1251,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 12)
|
||||
{
|
||||
internal::prefetch(lane + x + 3);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vmov.s32 q9, #6 \n\t"
|
||||
"vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||
@@ -1343,7 +1343,7 @@ pyrUp16sHorizontalConvolution:
|
||||
for (; x < lim; x += 4)
|
||||
{
|
||||
internal::prefetch(lane + x);
|
||||
#if defined(__GNUC__) && defined(__arm__)
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||
__asm__ (
|
||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||
|
||||
Vendored
+15
-13
@@ -106,8 +106,10 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
|
||||
&& !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF)// Restrict image size since internal index evaluation
|
||||
// is performed with u32
|
||||
#endif
|
||||
&& dsize.width >= 2 && dsize.height >= 8)
|
||||
&& dsize.width >= 2 && dsize.height >= 8
|
||||
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
|
||||
return isSupportedConfiguration();
|
||||
return false;
|
||||
default:
|
||||
return false;
|
||||
};
|
||||
@@ -359,7 +361,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
|
||||
#endif
|
||||
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
|
||||
@@ -373,7 +375,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw16; dj += 16, sj += 64)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -450,7 +452,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
{
|
||||
if ((wr == 2.0f) && (hr == 2.0f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
|
||||
#endif
|
||||
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
|
||||
@@ -462,7 +464,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw4; dj += 16, sj += 32)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -537,7 +539,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
|
||||
#endif
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
|
||||
@@ -549,7 +551,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw32; dj += 128, sj += 64)
|
||||
{
|
||||
internal::prefetch(src_row + sj);
|
||||
@@ -758,7 +760,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
{
|
||||
if ((wr == 2.0f) && (wr == 2.0f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||
#endif
|
||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||
@@ -770,7 +772,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw16; dj += 48, sj += 96)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
@@ -856,7 +858,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
|
||||
#endif
|
||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||
@@ -868,7 +870,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw32; dj += 96, sj += 48)
|
||||
{
|
||||
internal::prefetch(src_row + sj);
|
||||
@@ -928,7 +930,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
}
|
||||
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
|
||||
{
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||
#endif
|
||||
|
||||
@@ -941,7 +943,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||
size_t sj = 0, dj = 0;
|
||||
|
||||
#ifndef ANDROID
|
||||
#ifndef __ANDROID__
|
||||
for ( ; dj < roiw8; dj += 24, sj += 96)
|
||||
{
|
||||
internal::prefetch(src0_row + sj);
|
||||
|
||||
+2
-2
@@ -72,11 +72,11 @@ __declspec(naked) static void vcvtr_s32_f64_imp(f64 d)
|
||||
|
||||
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
|
||||
# define CAROTENE_ROUND_FLT(value) { \
|
||||
register union { f32 f; s32 i; } result; \
|
||||
union { f32 f; s32 i; } result; \
|
||||
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
|
||||
return result.i; }
|
||||
# define CAROTENE_ROUND_DBL(value) { \
|
||||
register union {f32 f; s32 i;} __tegra_result; \
|
||||
union {f32 f; s32 i;} __tegra_result; \
|
||||
asm ( \
|
||||
"ftosid %0, %P1\n" \
|
||||
: "=w" (__tegra_result.f) \
|
||||
|
||||
Vendored
+2
-2
@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
||||
internal::prefetch(srow0 + x);
|
||||
internal::prefetch(srow1 + x);
|
||||
internal::prefetch(srow2 + x);
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.8 {d0}, [%[src0]] \n\t"
|
||||
"vld1.8 {d2}, [%[src2]] \n\t"
|
||||
@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
||||
x = 0;
|
||||
for( ; x < roiw8; x += 8 )
|
||||
{
|
||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
||||
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||
__asm__ (
|
||||
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
|
||||
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
|
||||
|
||||
Vendored
+9
-5
@@ -2,19 +2,21 @@ if(NOT ANDROID)
|
||||
message("cpufeatures is ANDROID project")
|
||||
endif()
|
||||
|
||||
ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
|
||||
|
||||
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
|
||||
|
||||
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
|
||||
set(CPUFEATURES_LIBRARIES cpufeatures CACHE INTERNAL "")
|
||||
set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
|
||||
|
||||
if(NOT DEFINED CPUFEATURES_SOURCES)
|
||||
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
|
||||
endif()
|
||||
|
||||
include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
||||
add_library(cpufeatures STATIC ${CPUFEATURES_SOURCES})
|
||||
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
|
||||
|
||||
set_target_properties(cpufeatures
|
||||
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
|
||||
PROPERTIES OUTPUT_NAME cpufeatures
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME cpufeatures
|
||||
@@ -23,9 +25,11 @@ set_target_properties(cpufeatures
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(cpufeatures PROPERTIES FOLDER "3rdparty")
|
||||
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(cpufeatures EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(cpufeatures LICENSE README.md)
|
||||
|
||||
Vendored
+1
@@ -30,6 +30,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_ffmpeg_64.dll"
|
||||
$expected_md5 = "@FFMPEG_FILE_HASH_BIN64@"
|
||||
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSION@_64.dll"
|
||||
|
||||
Write-Output ("=" * 120)
|
||||
try {
|
||||
Get-content -Path "$PSScriptRoot\@OPENCV_LICENSES_INSTALL_PATH@\ffmpeg-readme.txt" -ErrorAction 'Stop'
|
||||
} catch {
|
||||
Write-Output "Refer to OpenCV FFmpeg wrapper readme notes about library usage / licensing details."
|
||||
}
|
||||
Write-Output ("=" * 120)
|
||||
Write-Output ""
|
||||
|
||||
if(![System.IO.File]::Exists($output)) {
|
||||
try {
|
||||
Write-Output ("Downloading: " + $output)
|
||||
Import-Module BitsTransfer
|
||||
$start_time = Get-Date
|
||||
Start-BitsTransfer -Source $url -Destination $output -ErrorAction 'Stop'
|
||||
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
|
||||
} catch {
|
||||
$_ # Dump error
|
||||
try {
|
||||
Write-Output ("Downloading (second attempt): " + $output)
|
||||
$start_time = Get-Date
|
||||
Invoke-WebRequest -Uri $url -OutFile $output
|
||||
Write-Output "Downloaded in $((Get-Date).Subtract($start_time).Seconds) seconds"
|
||||
} catch {
|
||||
Write-Output ("Can't download file: " + $output)
|
||||
Write-Output ("URL: " + $url)
|
||||
Write-Output "You need to download this file manually. Stop"
|
||||
Pause
|
||||
Exit
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Output ("File exists: " + $output)
|
||||
Write-Output ("Downloading is skipped. Remove this file and re-run this script to force downloading.")
|
||||
}
|
||||
|
||||
if(![System.IO.File]::Exists($output)) {
|
||||
Write-Output ("Destination file not found: " + $output)
|
||||
Write-Output "Stop"
|
||||
Pause
|
||||
Exit
|
||||
}
|
||||
|
||||
try {
|
||||
$hash = Get-FileHash $output -Algorithm MD5 -ErrorAction 'Stop'
|
||||
|
||||
if($hash.Hash -eq $expected_md5) {
|
||||
Write-Output "MD5 check passed"
|
||||
} else {
|
||||
Write-Output ("MD5 : " + $hash.Hash.toLower())
|
||||
Write-Output ("Expected: " + $expected_md5)
|
||||
Write-Output "MD5 hash mismatch"
|
||||
}
|
||||
} catch {
|
||||
$_ # Dump error
|
||||
Write-Output "Can't check MD5 hash (requires PowerShell 4+)"
|
||||
}
|
||||
Pause
|
||||
Write-Output "Exit"
|
||||
Vendored
+13
-6
@@ -1,9 +1,9 @@
|
||||
# Binary branch name: ffmpeg/master_20170418
|
||||
# Binaries were created for OpenCV: b993b9b7c7f6f5f37d10acacb2962812228410ba
|
||||
set(FFMPEG_BINARIES_COMMIT "86c4a841055f2612774e85b4292bb20e5fe8a783")
|
||||
set(FFMPEG_FILE_HASH_BIN32 "3dea5f7f009b44601fe95728328e0f9e")
|
||||
set(FFMPEG_FILE_HASH_BIN64 "9debe701975ef074bd6661981f3f0716")
|
||||
set(FFMPEG_FILE_HASH_CMAKE "208c00f03d2f6f39fa6262649e0bfc8d")
|
||||
# Binaries branch name: ffmpeg/master_20181106
|
||||
# Binaries were created for OpenCV: 2c6f1ab57d4250ee46e32d1b51c056431965b470
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "759a23e24ab787a0979f8a93103dcc3105ec10c1")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "849286ccc527c99e5a218b67f13c6e8c")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "96444a4645753aaafa296479665c9185")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "f710891525a04586d565d0e700e62a9c")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
set(${script_var} "" PARENT_SCOPE)
|
||||
@@ -35,3 +35,10 @@ function(download_win_ffmpeg script_var)
|
||||
set(${script_var} "${FFMPEG_DOWNLOAD_DIR}/ffmpeg_version.cmake" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
if(OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT)
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/ffmpeg-download.ps1.in" "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" @ONLY)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/win-install/ffmpeg-download.ps1" DESTINATION "." COMPONENT libs)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ffmpeg license.txt readme.txt)
|
||||
|
||||
Vendored
+4
-5
@@ -16,19 +16,18 @@
|
||||
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
||||
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
||||
|
||||
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
|
||||
|
||||
The pre-built opencv_ffmpeg*.dll is:
|
||||
* LGPL library, not BSD libraries.
|
||||
* Loaded at runtime by opencv_videoio module.
|
||||
If it succeeds, ffmpeg can be used to decode/encode videos;
|
||||
otherwise, other API is used.
|
||||
|
||||
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
|
||||
FFMPEG build includes support for H264 encoder based on the OpenH264 library.
|
||||
OpenH264 Video Codec provided by Cisco Systems, Inc.
|
||||
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
|
||||
Downloaded binary file can be placed into global system path (System32 or SysWOW64) or near application binaries.
|
||||
You can also specify location of binary file via OPENH264_LIBRARY_PATH environment variable.
|
||||
OpenH264 library should be installed separatelly. Downloaded binary file can be placed into global system path
|
||||
(System32 or SysWOW64) or near application binaries (check documentation of "LoadLibrary" Win32 function from MSDN).
|
||||
Or you can specify location of binary file via OPENH264_LIBRARY environment variable.
|
||||
|
||||
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
|
||||
opencv_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
|
||||
|
||||
-110
@@ -1,110 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSSTRUCT) && \
|
||||
!defined(NONAMELESSUNION)
|
||||
#define NONAMELESSUNION 1
|
||||
#endif
|
||||
#if defined(NONAMELESSUNION) && \
|
||||
!defined(NONAMELESSSTRUCT)
|
||||
#define NONAMELESSSTRUCT 1
|
||||
#endif
|
||||
|
||||
#ifndef __ANONYMOUS_DEFINED
|
||||
#define __ANONYMOUS_DEFINED
|
||||
#if defined(__GNUC__) || defined(__GNUG__)
|
||||
#define _ANONYMOUS_UNION __extension__
|
||||
#define _ANONYMOUS_STRUCT __extension__
|
||||
#else
|
||||
#define _ANONYMOUS_UNION
|
||||
#define _ANONYMOUS_STRUCT
|
||||
#endif
|
||||
#ifndef NONAMELESSUNION
|
||||
#define _UNION_NAME(x)
|
||||
#define _STRUCT_NAME(x)
|
||||
#else /* NONAMELESSUNION */
|
||||
#define _UNION_NAME(x) x
|
||||
#define _STRUCT_NAME(x) x
|
||||
#endif
|
||||
#endif /* __ANONYMOUS_DEFINED */
|
||||
|
||||
#ifndef DUMMYUNIONNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME u
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2 u2
|
||||
# define DUMMYUNIONNAME3 u3
|
||||
# define DUMMYUNIONNAME4 u4
|
||||
# define DUMMYUNIONNAME5 u5
|
||||
# define DUMMYUNIONNAME6 u6
|
||||
# define DUMMYUNIONNAME7 u7
|
||||
# define DUMMYUNIONNAME8 u8
|
||||
# define DUMMYUNIONNAME9 u9
|
||||
# else /* NONAMELESSUNION */
|
||||
# define DUMMYUNIONNAME
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# define DUMMYUNIONNAME2
|
||||
# define DUMMYUNIONNAME3
|
||||
# define DUMMYUNIONNAME4
|
||||
# define DUMMYUNIONNAME5
|
||||
# define DUMMYUNIONNAME6
|
||||
# define DUMMYUNIONNAME7
|
||||
# define DUMMYUNIONNAME8
|
||||
# define DUMMYUNIONNAME9
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME */
|
||||
|
||||
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||
# else
|
||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||
# endif
|
||||
#endif /* DUMMYUNIONNAME1 */
|
||||
|
||||
#ifndef DUMMYSTRUCTNAME
|
||||
# ifdef NONAMELESSUNION
|
||||
# define DUMMYSTRUCTNAME s
|
||||
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2 s2
|
||||
# define DUMMYSTRUCTNAME3 s3
|
||||
# define DUMMYSTRUCTNAME4 s4
|
||||
# define DUMMYSTRUCTNAME5 s5
|
||||
# else
|
||||
# define DUMMYSTRUCTNAME
|
||||
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
|
||||
# define DUMMYSTRUCTNAME2
|
||||
# define DUMMYSTRUCTNAME3
|
||||
# define DUMMYSTRUCTNAME4
|
||||
# define DUMMYSTRUCTNAME5
|
||||
# endif
|
||||
#endif /* DUMMYSTRUCTNAME */
|
||||
|
||||
/* These are for compatibility with the Wine source tree */
|
||||
|
||||
#ifndef WINELIB_NAME_AW
|
||||
# ifdef __MINGW_NAME_AW
|
||||
# define WINELIB_NAME_AW __MINGW_NAME_AW
|
||||
# else
|
||||
# ifdef UNICODE
|
||||
# define WINELIB_NAME_AW(func) func##W
|
||||
# else
|
||||
# define WINELIB_NAME_AW(func) func##A
|
||||
# endif
|
||||
# endif
|
||||
#endif /* WINELIB_NAME_AW */
|
||||
|
||||
#ifndef DECL_WINELIB_TYPE_AW
|
||||
# ifdef __MINGW_TYPEDEF_AW
|
||||
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
|
||||
# else
|
||||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||
# endif
|
||||
#endif /* DECL_WINELIB_TYPE_AW */
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
#if !defined(_INC_CRT_UNICODE_MACROS)
|
||||
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
|
||||
|
||||
#if defined(UNICODE)
|
||||
# define _INC_CRT_UNICODE_MACROS 1
|
||||
# define __MINGW_NAME_AW(func) func##W
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_W
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
|
||||
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "W"
|
||||
#else
|
||||
# define _INC_CRT_UNICODE_MACROS 2
|
||||
# define __MINGW_NAME_AW(func) func##A
|
||||
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
|
||||
# define __MINGW_NAME_UAW(func) func##_A
|
||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
|
||||
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
|
||||
# define __MINGW_PROCNAMEEXT_AW "A"
|
||||
#endif
|
||||
|
||||
#define __MINGW_TYPEDEF_AW(type) \
|
||||
typedef __MINGW_NAME_AW(type) type;
|
||||
#define __MINGW_TYPEDEF_UAW(type) \
|
||||
typedef __MINGW_NAME_UAW(type) type;
|
||||
|
||||
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
|
||||
Vendored
-1290
File diff suppressed because it is too large
Load Diff
Vendored
-31
@@ -1,31 +0,0 @@
|
||||
#ifndef _AUDEVCOD_H
|
||||
#define _AUDEVCOD_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum _tagSND_DEVICE_ERROR {
|
||||
SNDDEV_ERROR_Open = 1,
|
||||
SNDDEV_ERROR_Close = 2,
|
||||
SNDDEV_ERROR_GetCaps = 3,
|
||||
SNDDEV_ERROR_PrepareHeader = 4,
|
||||
SNDDEV_ERROR_UnprepareHeader = 5,
|
||||
SNDDEV_ERROR_Reset = 6,
|
||||
SNDDEV_ERROR_Restart = 7,
|
||||
SNDDEV_ERROR_GetPosition = 8,
|
||||
SNDDEV_ERROR_Write = 9,
|
||||
SNDDEV_ERROR_Pause = 10,
|
||||
SNDDEV_ERROR_Stop = 11,
|
||||
SNDDEV_ERROR_Start = 12,
|
||||
SNDDEV_ERROR_AddBuffer = 13,
|
||||
SNDDEV_ERROR_Query = 14
|
||||
} SNDDEV_ERR;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
#ifndef _BDATYPES_H
|
||||
#define _BDATYPES_H
|
||||
#if __GNUC__ >= 3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - DirectShow Enumerated Types */
|
||||
typedef enum {
|
||||
MEDIA_TRANSPORT_PACKET,
|
||||
MEDIA_ELEMENTARY_STREAM,
|
||||
MEDIA_MPEG2_PSI,
|
||||
MEDIA_TRANSPORT_PAYLOAD
|
||||
} MEDIA_SAMPLE_CONTENT;
|
||||
/*--- DirectShow Reference - DirectShow Structures */
|
||||
typedef struct {
|
||||
DWORD dwOffset;
|
||||
DWORD dwPacketLength;
|
||||
DWORD dwStride;
|
||||
} MPEG2_TRANSPORT_STRIDE;
|
||||
typedef struct {
|
||||
ULONG ulPID;
|
||||
MEDIA_SAMPLE_CONTENT MediaSampleContent ;
|
||||
} PID_MAP;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-1467
File diff suppressed because it is too large
Load Diff
Vendored
-2712
File diff suppressed because it is too large
Load Diff
Vendored
-61
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002 Alexandre Julliard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __DSHOW_INCLUDED__
|
||||
#define __DSHOW_INCLUDED__
|
||||
|
||||
#define AM_NOVTABLE
|
||||
|
||||
#ifndef __WINESRC__
|
||||
# include <windows.h>
|
||||
# include <windowsx.h>
|
||||
#else
|
||||
# include <windef.h>
|
||||
# include <wingdi.h>
|
||||
# include <objbase.h>
|
||||
#endif
|
||||
#include <olectl.h>
|
||||
#include <dshow/ddraw.h>
|
||||
#include <mmsystem.h>
|
||||
/* FIXME: #include <strsafe.h>*/
|
||||
|
||||
#ifndef NUMELMS
|
||||
#define NUMELMS(array) (sizeof(array)/sizeof((array)[0]))
|
||||
#endif
|
||||
|
||||
#include <dshow/strmif.h>
|
||||
#include <dshow/amvideo.h>
|
||||
#ifdef DSHOW_USE_AMAUDIO
|
||||
/* FIXME: #include <amaudio.h>*/
|
||||
#endif
|
||||
#include <dshow/control.h>
|
||||
#include <dshow/evcode.h>
|
||||
#include <dshow/uuids.h>
|
||||
#include <dshow/errors.h>
|
||||
/* FIXME: #include <edevdefs.h> */
|
||||
#include <dshow/audevcod.h>
|
||||
/* FIXME: #include <dvdevcod.h> */
|
||||
|
||||
#ifndef OATRUE
|
||||
#define OATRUE (-1)
|
||||
#endif
|
||||
#ifndef OAFALSE
|
||||
#define OAFALSE (0)
|
||||
#endif
|
||||
|
||||
#endif /* __DSHOW_INCLUDED__ */
|
||||
Vendored
-1199
File diff suppressed because it is too large
Load Diff
Vendored
-75
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Maarten Lankhorst
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __DVDMEDIA_H__
|
||||
#define __DVDMEDIA_H__
|
||||
|
||||
#define AMCONTROL_USED 0x00000001
|
||||
#define AMCONTROL_PAD_TO_4x3 0x00000002
|
||||
#define AMCONTROL_PAD_TO_16x9 0x00000004
|
||||
|
||||
enum AM_MPEG2Level {
|
||||
AM_MPEG2Level_Low = 1,
|
||||
AM_MPEG2Level_Main,
|
||||
AM_MPEG2Level_High1440,
|
||||
AM_MPEG2Level_High
|
||||
};
|
||||
enum AM_MPEG2Profile {
|
||||
AM_MPEG2Profile_Simple = 1,
|
||||
AM_MPEG2Profile_Main,
|
||||
AM_MPEG2Profile_SNRScalable,
|
||||
AM_MPEG2Profile_SpatiallyScalable,
|
||||
AM_MPEG2Profile_High
|
||||
};
|
||||
typedef enum {
|
||||
AM_RATE_ChangeRate = 1,
|
||||
AM_RATE_FullDataRateMax = 2,
|
||||
AM_RATE_ReverseDecode = 3,
|
||||
AM_RATE_DecoderPosition = 4,
|
||||
AM_RATE_DecoderVersion = 5
|
||||
} AM_PROPERTY_DVD_RATE_CHANGE;
|
||||
|
||||
typedef struct tagVIDEOINFOHEADER2 {
|
||||
RECT rcSource;
|
||||
RECT rcTarget;
|
||||
DWORD dwBitRate;
|
||||
DWORD dwBitErrorRate;
|
||||
REFERENCE_TIME AvgTimePerFrame;
|
||||
DWORD dwInterlaceFlags;
|
||||
DWORD dwCopyProtectFlags;
|
||||
DWORD dwPictAspectRatioX;
|
||||
DWORD dwPictAspectRatioY;
|
||||
union {
|
||||
DWORD dwControlFlags;
|
||||
DWORD dwReserved1;
|
||||
} DUMMYUNIONNAME;
|
||||
DWORD dwReserved2;
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
} VIDEOINFOHEADER2;
|
||||
|
||||
typedef struct tagMPEG2VIDEOINFO {
|
||||
VIDEOINFOHEADER2 hdr;
|
||||
DWORD dwStartTimeCode;
|
||||
DWORD cbSequenceHeader;
|
||||
DWORD dwProfile;
|
||||
DWORD dwLevel;
|
||||
DWORD dwFlags;
|
||||
DWORD dwSequenceHeader[1];
|
||||
} MPEG2VIDEOINFO;
|
||||
|
||||
#endif /* __DVDMEDIA_H__ */
|
||||
Vendored
-169
@@ -1,169 +0,0 @@
|
||||
#ifndef _ERRORS_H
|
||||
#define _ERRORS_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - Constants and GUIDs - Error and Success Codes */
|
||||
#define VFW_S_NO_MORE_ITEMS 0x00040103
|
||||
#define VFW_S_DUPLICATE_NAME 0x0004022D
|
||||
#define VFW_S_STATE_INTERMEDIATE 0x00040237
|
||||
#define VFW_S_PARTIAL_RENDER 0x00040242
|
||||
#define VFW_S_SOME_DATA_IGNORED 0x00040245
|
||||
#define VFW_S_CONNECTIONS_DEFERRED 0x00040246
|
||||
#define VFW_S_RESOURCE_NOT_NEEDED 0x00040250
|
||||
#define VFW_S_MEDIA_TYPE_IGNORED 0x00040254
|
||||
#define VFW_S_VIDEO_NOT_RENDERED 0x00040257
|
||||
#define VFW_S_AUDIO_NOT_RENDERED 0x00040258
|
||||
#define VFW_S_RPZA 0x0004025A
|
||||
#define VFW_S_ESTIMATED 0x00040260
|
||||
#define VFW_S_RESERVED 0x00040263
|
||||
#define VFW_S_STREAM_OFF 0x00040267
|
||||
#define VFW_S_CANT_CUE 0x00040268
|
||||
#define VFW_S_NOPREVIEWPIN 0x0004027E
|
||||
#define VFW_S_DVD_NON_ONE_SEQUENTIAL 0x00040280
|
||||
#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE 0x0004028C
|
||||
#define VFW_S_DVD_NOT_ACCURATE 0x0004028D
|
||||
#define VFW_E_INVALIDMEDIATYPE 0x80040200
|
||||
#define VFW_E_INVALIDSUBTYPE 0x80040201
|
||||
#define VFW_E_NEED_OWNER 0x80040202
|
||||
#define VFW_E_ENUM_OUT_OF_SYNC 0x80040203
|
||||
#define VFW_E_ALREADY_CONNECTED 0x80040204
|
||||
#define VFW_E_FILTER_ACTIVE 0x80040205
|
||||
#define VFW_E_NO_TYPES 0x80040206
|
||||
#define VFW_E_NO_ACCEPTABLE_TYPES 0x80040207
|
||||
#define VFW_E_INVALID_DIRECTION 0x80040208
|
||||
#define VFW_E_NOT_CONNECTED 0x80040209
|
||||
#define VFW_E_NO_ALLOCATOR 0x8004020A
|
||||
#define VFW_E_RUNTIME_ERROR 0x8004020B
|
||||
#define VFW_E_BUFFER_NOTSET 0x8004020C
|
||||
#define VFW_E_BUFFER_OVERFLOW 0x8004020D
|
||||
#define VFW_E_BADALIGN 0x8004020E
|
||||
#define VFW_E_ALREADY_COMMITTED 0x8004020F
|
||||
#define VFW_E_BUFFERS_OUTSTANDING 0x80040210
|
||||
#define VFW_E_NOT_COMMITTED 0x80040211
|
||||
#define VFW_E_SIZENOTSET 0x80040212
|
||||
#define VFW_E_NO_CLOCK 0x80040213
|
||||
#define VFW_E_NO_SINK 0x80040214
|
||||
#define VFW_E_NO_INTERFACE 0x80040215
|
||||
#define VFW_E_NOT_FOUND 0x80040216
|
||||
#define VFW_E_CANNOT_CONNECT 0x80040217
|
||||
#define VFW_E_CANNOT_RENDER 0x80040218
|
||||
#define VFW_E_CHANGING_FORMAT 0x80040219
|
||||
#define VFW_E_NO_COLOR_KEY_SET 0x8004021A
|
||||
#define VFW_E_NOT_OVERLAY_CONNECTION 0x8004021B
|
||||
#define VFW_E_NOT_SAMPLE_CONNECTION 0x8004021C
|
||||
#define VFW_E_PALETTE_SET 0x8004021D
|
||||
#define VFW_E_COLOR_KEY_SET 0x8004021E
|
||||
#define VFW_E_NO_COLOR_KEY_FOUND 0x8004021F
|
||||
#define VFW_E_NO_PALETTE_AVAILABLE 0x80040220
|
||||
#define VFW_E_NO_DISPLAY_PALETTE 0x80040221
|
||||
#define VFW_E_TOO_MANY_COLORS 0x80040222
|
||||
#define VFW_E_STATE_CHANGED 0x80040223
|
||||
#define VFW_E_NOT_STOPPED 0x80040224
|
||||
#define VFW_E_NOT_PAUSED 0x80040225
|
||||
#define VFW_E_NOT_RUNNING 0x80040226
|
||||
#define VFW_E_WRONG_STATE 0x80040227
|
||||
#define VFW_E_START_TIME_AFTER_END 0x80040228
|
||||
#define VFW_E_INVALID_RECT 0x80040229
|
||||
#define VFW_E_TYPE_NOT_ACCEPTED 0x8004022A
|
||||
#define VFW_E_SAMPLE_REJECTED 0x8004022B
|
||||
#define VFW_E_SAMPLE_REJECTED_EOS 0x8004022C
|
||||
#define VFW_E_DUPLICATE_NAME 0x8004022D
|
||||
#define VFW_E_TIMEOUT 0x8004022E
|
||||
#define VFW_E_INVALID_FILE_FORMAT 0x8004022F
|
||||
#define VFW_E_ENUM_OUT_OF_RANGE 0x80040230
|
||||
#define VFW_E_CIRCULAR_GRAPH 0x80040231
|
||||
#define VFW_E_NOT_ALLOWED_TO_SAVE 0x80040232
|
||||
#define VFW_E_TIME_ALREADY_PASSED 0x80040233
|
||||
#define VFW_E_ALREADY_CANCELLED 0x80040234
|
||||
#define VFW_E_CORRUPT_GRAPH_FILE 0x80040235
|
||||
#define VFW_E_ADVISE_ALREADY_SET 0x80040236
|
||||
#define VFW_E_NO_MODEX_AVAILABLE 0x80040238
|
||||
#define VFW_E_NO_ADVISE_SET 0x80040239
|
||||
#define VFW_E_NO_FULLSCREEN 0x8004023A
|
||||
#define VFW_E_IN_FULLSCREEN_MODE 0x8004023B
|
||||
#define VFW_E_UNKNOWN_FILE_TYPE 0x80040240
|
||||
#define VFW_E_CANNOT_LOAD_SOURCE_FILTER 0x80040241
|
||||
#define VFW_E_FILE_TOO_SHORT 0x80040243
|
||||
#define VFW_E_INVALID_FILE_VERSION 0x80040244
|
||||
#define VFW_E_INVALID_CLSID 0x80040247
|
||||
#define VFW_E_INVALID_MEDIA_TYPE 0x80040248
|
||||
#define VFW_E_SAMPLE_TIME_NOT_SET 0x80040249
|
||||
#define VFW_E_MEDIA_TIME_NOT_SET 0x80040251
|
||||
#define VFW_E_NO_TIME_FORMAT_SET 0x80040252
|
||||
#define VFW_E_MONO_AUDIO_HW 0x80040253
|
||||
#define VFW_E_NO_DECOMPRESSOR 0x80040255
|
||||
#define VFW_E_NO_AUDIO_HARDWARE 0x80040256
|
||||
#define VFW_E_RPZA 0x80040259
|
||||
#define VFW_E_PROCESSOR_NOT_SUITABLE 0x8004025B
|
||||
#define VFW_E_UNSUPPORTED_AUDIO 0x8004025C
|
||||
#define VFW_E_UNSUPPORTED_VIDEO 0x8004025D
|
||||
#define VFW_E_MPEG_NOT_CONSTRAINED 0x8004025E
|
||||
#define VFW_E_NOT_IN_GRAPH 0x8004025F
|
||||
#define VFW_E_NO_TIME_FORMAT 0x80040261
|
||||
#define VFW_E_READ_ONLY 0x80040262
|
||||
#define VFW_E_BUFFER_UNDERFLOW 0x80040264
|
||||
#define VFW_E_UNSUPPORTED_STREAM 0x80040265
|
||||
#define VFW_E_NO_TRANSPORT 0x80040266
|
||||
#define VFW_E_BAD_VIDEOCD 0x80040269
|
||||
#define VFW_S_NO_STOP_TIME 0x80040270
|
||||
#define VFW_E_OUT_OF_VIDEO_MEMORY 0x80040271
|
||||
#define VFW_E_VP_NEGOTIATION_FAILED 0x80040272
|
||||
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE 0x80040273
|
||||
#define VFW_E_NO_VP_HARDWARE 0x80040274
|
||||
#define VFW_E_NO_CAPTURE_HARDWARE 0x80040275
|
||||
#define VFW_E_DVD_OPERATION_INHIBITED 0x80040276
|
||||
#define VFW_E_DVD_INVALIDDOMAIN 0x80040277
|
||||
#define VFW_E_DVD_NO_BUTTON 0x80040278
|
||||
#define VFW_E_DVD_GRAPHNOTREADY 0x80040279
|
||||
#define VFW_E_DVD_RENDERFAIL 0x8004027A
|
||||
#define VFW_E_DVD_DECNOTENOUGH 0x8004027B
|
||||
#define VFW_E_DDRAW_VERSION_NOT_SUITABLE 0x8004027C
|
||||
#define VFW_E_COPYPROT_FAILED 0x8004027D
|
||||
#define VFW_E_TIME_EXPIRED 0x8004027F
|
||||
#define VFW_E_DVD_WRONG_SPEED 0x80040281
|
||||
#define VFW_E_DVD_MENU_DOES_NOT_EXIST 0x80040282
|
||||
#define VFW_E_DVD_CMD_CANCELLED 0x80040283
|
||||
#define VFW_E_DVD_STATE_WRONG_VERSION 0x80040284
|
||||
#define VFW_E_DVD_STATE_CORRUPT 0x80040285
|
||||
#define VFW_E_DVD_STATE_WRONG_DISC 0x80040286
|
||||
#define VFW_E_DVD_INCOMPATIBLE_REGION 0x80040287
|
||||
#define VFW_E_DVD_NO_ATTRIBUTES 0x80040288
|
||||
#define VFW_E_DVD_NO_GOUP_PGC 0x80040289
|
||||
#define VFW_E_DVD_LOW_PARENTAL_LEVEL 0x8004028A
|
||||
#define VFW_E_DVD_NOT_IN_KARAOKE_MODE 0x8004028B
|
||||
#define VFW_E_FRAME_STEP_UNSUPPORTED 0x8004028E
|
||||
#define VFW_E_DVD_STREAM_DISABLED 0x8004028F
|
||||
#define VFW_E_DVD_TITLE_UNKNOWN 0x80040290
|
||||
#define VFW_E_DVD_INVALID_DISC 0x80040291
|
||||
#define VFW_E_DVD_NO_RESUME_INFORMATION 0x80040292
|
||||
#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD 0x80040293
|
||||
#define VFW_E_PIN_ALREADY_BLOCKED 0x80040294
|
||||
#define VFW_E_CERTIFICATION_FAILURE 0x80040295
|
||||
#define VFW_E_VMR_NOT_IN_MIXER_MODE 0x80040296
|
||||
#define VFW_E_VMR_NO_AP_SUPPLIED 0x80040297
|
||||
#define VFW_E_VMR_NO_DEINTERLACE_HW 0x80040298
|
||||
#define VFW_E_VMR_NO_PROCAMP_HW 0x80040299
|
||||
#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC 0x8004029A
|
||||
#define VFW_E_NO_COPP_HW 0x8004029B
|
||||
#define VFW_E_BAD_KEY 0x800403F2
|
||||
/*--- DirectShow Reference - Functions */
|
||||
#define MAX_ERROR_TEXT_LEN 160
|
||||
/*--- DirectShow Reference - Functions */
|
||||
DWORD WINAPI AMGetErrorTextA(HRESULT,CHAR*,DWORD);
|
||||
DWORD WINAPI AMGetErrorTextW(HRESULT,WCHAR*,DWORD);
|
||||
#ifdef UNICODE
|
||||
#define AMGetErrorText AMGetErrorTextW
|
||||
#else
|
||||
#define AMGetErrorText AMGetErrorTextA
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-68
@@ -1,68 +0,0 @@
|
||||
#ifndef _EVCODE_H
|
||||
#define _EVCODE_H
|
||||
#if __GNUC__ >=3
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*--- DirectShow Reference - Constants and GUIDs - Event Notification Codes */
|
||||
#define EC_ACTIVATE 0x0013
|
||||
#define EC_BUFFERING_DATA 0x0011
|
||||
#define EC_BUILT 0x0300
|
||||
#define EC_CLOCK_CHANGED 0x000D
|
||||
#define EC_CLOCK_UNSET 0x0051
|
||||
#define EC_CODECAPI_EVENT 0x0057
|
||||
#define EC_COMPLETE 0x0001
|
||||
#define EC_DEVICE_LOST 0x001F
|
||||
#define EC_DISPLAY_CHANGED 0x0016
|
||||
#define EC_END_OF_SEGMENT 0x001C
|
||||
#define EC_ERROR_STILLPLAYING 0x0008
|
||||
#define EC_ERRORABORT 0x0003
|
||||
#define EC_EXTDEVICE_MODE_CHANGE 0x0031
|
||||
#define EC_FULLSCREEN_LOST 0x0012
|
||||
#define EC_GRAPH_CHANGED 0x0050
|
||||
#define EC_LENGTH_CHANGED 0x001E
|
||||
#define EC_NEED_RESTART 0x0014
|
||||
#define EC_NOTIFY_WINDOW 0x0019
|
||||
#define EC_OLE_EVENT 0x0018
|
||||
#define EC_OPENING_FILE 0x0010
|
||||
#define EC_PALETTE_CHANGED 0x0009
|
||||
#define EC_PAUSED 0x000E
|
||||
#define EC_PREPROCESS_COMPLETE 0x0056
|
||||
#define EC_QUALITY_CHANGE 0x000B
|
||||
#define EC_REPAINT 0x0005
|
||||
#define EC_SEGMENT_STARTED 0x001D
|
||||
#define EC_SHUTTING_DOWN 0x000C
|
||||
#define EC_SNDDEV_IN_ERROR 0x0200
|
||||
#define EC_SNDDEV_OUT_ERROR 0x0201
|
||||
#define EC_STARVATION 0x0017
|
||||
#define EC_STATE_CHANGE 0x0032
|
||||
#define EC_STEP_COMPLETE 0x0024
|
||||
#define EC_STREAM_CONTROL_STARTED 0x001B
|
||||
#define EC_STREAM_CONTROL_STOPPED 0x001A
|
||||
#define EC_STREAM_ERROR_STILLPLAYING 0x0007
|
||||
#define EC_STREAM_ERROR_STOPPED 0x0006
|
||||
#define EC_TIMECODE_AVAILABLE 0x0030
|
||||
#define EC_UNBUILT 0x0301
|
||||
#define EC_USERABORT 0x0002
|
||||
#define EC_VIDEO_SIZE_CHANGED 0x000A
|
||||
#define EC_VMR_RENDERDEVICE_SET 0x0053
|
||||
#define EC_VMR_SURFACE_FLIPPED 0x0054
|
||||
#define EC_VMR_RECONNECTION_FAILED 0x0055
|
||||
#define EC_WINDOW_DESTROYED 0x0015
|
||||
#define EC_WMT_EVENT 0x0252
|
||||
#define EC_WMT_INDEX_EVENT 0x0251
|
||||
#define EC_USER 0x8000
|
||||
/*--- DirectShow Reference - DirectShow Structures */
|
||||
typedef struct {
|
||||
HRESULT hrStatus;
|
||||
void *pData;
|
||||
} AM_WMT_EVENT_DATA;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Vendored
-191
@@ -1,191 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK,
|
||||
0x36523B13,0x8EE5,0x11d1,0x8C,0xA3,0x00,0x60,0xB0,0x57,0x66,0x4A)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES,
|
||||
0xe06d8020,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_WMDRM_TRANSPORT,
|
||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO,
|
||||
0xe06d8026,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO,
|
||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_VIDEOINFO2,
|
||||
0xf72a76A0L,0xeb0a,0x11d0,0xac,0xe4,0x0,0x0,0xc0,0xcc,0x16,0xba)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM,
|
||||
0xe06d8022,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT,
|
||||
0xe06d8023,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO,
|
||||
0xe06d802b,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3,
|
||||
0xe06d802c,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE,
|
||||
0xe06d802d,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO,
|
||||
0xe06d8032,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK,
|
||||
0xed0b916a,0x044d,0x11d1,0xaa,0x78,0x00,0xc0,0x04f,0xc3,0x1d,0x60)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION,
|
||||
0xe06d802e,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI,
|
||||
0xe06d802f,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI,
|
||||
0xe06d8030,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER,
|
||||
0xe06d8031,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2Video,
|
||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_DolbyAC3,
|
||||
0xe06d80e4,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_MPEG2Audio,
|
||||
0xe06d80e5,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio,
|
||||
0xe06d80e6,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_AC3,
|
||||
0xBFABE720,0x6E1F,0x11D0,0xBC,0xF2,0x44,0x45,0x53,0x54,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic,
|
||||
0xac390460,0x43af,0x11d0,0xbd,0x6a,0x00,0x35,0x05,0xc1,0x03,0xa9)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt,
|
||||
0x0E8A0A40,0x6AEF,0x11D0,0x9E,0xD0,0x00,0xA0,0x24,0xCA,0x19,0xB3)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange,
|
||||
0xa503c5c0,0x1d1d,0x11d1,0xad,0x80,0x44,0x45,0x53,0x54,0x0,0x0)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_MPEG4_MediaType_Attributes,
|
||||
0xff6c4bfa,0x7a9,0x4c7b,0xa2,0x37,0x67,0x2f,0x9d,0x68,0x6,0x5f)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE,
|
||||
0x65E8773DL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER,
|
||||
0x65E8773EL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR,
|
||||
0x1E84C900L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO,
|
||||
0x6994AD04L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO,
|
||||
0x6994AD05L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER,
|
||||
0xa799a800L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR,
|
||||
0xa799a801L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO,
|
||||
0xa799a802L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC,
|
||||
0x07dad660L,0x22f1,0x11d1,0xa9,0xf4,0x00,0xc0,0x4f,0xbb,0xde,0x8f)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER,
|
||||
0x0A4252A0L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsInterfaceHandler,
|
||||
0xD3ABC7E0L,0x9A61,0x11D0,0xA4,0x0D,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsDataTypeHandler,
|
||||
0x5FFBAA02L,0x49A3,0x11D0,0x9F,0x36,0x00,0xAA,0x00,0xA2,0x16,0xA1)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsPin,
|
||||
0xb61178d1L,0xa2d9,0x11cf,0x9e,0x53,0x00,0xaa,0x00,0xa2,0x16,0xa1)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsControl,
|
||||
0x28F54685L,0x06FD,0x11D2,0xB2,0x7A,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(IID_IKsPinFactory,
|
||||
0xCD5EBE6BL,0x8B6E,0x11D1,0x8A,0xE0,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
||||
|
||||
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard,
|
||||
0x1A8766A0L,0x62CE,0x11CF,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
|
||||
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_SECTIONS,
|
||||
0x455f176c,0x4b06,0x47ce,0x9a,0xef,0x8c,0xae,0xf7,0x3d,0xf7,0xb5)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VERSIONED_TABLES,
|
||||
0x1ed988b0,0x3ffc,0x4523,0x87,0x25,0x34,0x7b,0xee,0xc1,0xa8,0xa0)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI,
|
||||
0xb3c7397c,0xd303,0x414d,0xb3,0x3c,0x4e,0xd2,0xc9,0xd2,0x97,0x33)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI,
|
||||
0xe9dd31a3,0x221d,0x4adb,0x85,0x32,0x9a,0xf3,0x9,0xc1,0xa4,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ISDB_SI,
|
||||
0xe89ad298,0x3601,0x4b06,0xaa,0xec,0x9d,0xde,0xed,0xcc,0x5b,0xd0)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TIF_SI,
|
||||
0xec232eb2,0xcb96,0x4191,0xb2,0x26,0xe,0xa1,0x29,0xf3,0x82,0x50)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA,
|
||||
0xc892e55b,0x252d,0x42b5,0xa3,0x16,0xd9,0x97,0xe7,0xa5,0xd9,0x95)
|
||||
#endif
|
||||
/* ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) ||
|
||||
(NTDDI_VERSION >= NTDDI_WS03SP1) */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE,
|
||||
0x138aa9a4,0x1ee2,0x4c5b,0x98,0x8e,0x19,0xab,0xfd,0xbc,0x8a,0x11)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_UDCR_TRANSPORT,
|
||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_RAW,
|
||||
0x0d7aed42,0xcb9a,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_PROCESSED,
|
||||
0xaf748dd4,0xd80,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DTS,
|
||||
0xe06d8033,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS,
|
||||
0xe06d8034,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange,
|
||||
0x3577eb09,0x9582,0x477f,0xb2,0x9c,0xb0,0xc4,0x52,0xa4,0xff,0x9a)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke,
|
||||
0xae4720ae,0xaa71,0x42d8,0xb8,0x2a,0xff,0xfd,0xf5,0x8b,0x76,0xfd)
|
||||
|
||||
OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep,
|
||||
0xc830acbd,0xab07,0x492f,0x88,0x52,0x45,0xb6,0x98,0x7c,0x29,0x79)
|
||||
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
|
||||
|
||||
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC_MI,
|
||||
0x9c24a977,0x951,0x451a,0x80,0x6,0xe,0x49,0xbd,0x28,0xcd,0x5f)
|
||||
#endif /* NTDDI_VERSION >= NTDDI_WS03SP1 */
|
||||
|
||||
Vendored
-9392
File diff suppressed because it is too large
Load Diff
Vendored
-368
@@ -1,368 +0,0 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
*/
|
||||
#ifndef OUR_GUID_ENTRY
|
||||
#define OUR_GUID_ENTRY(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8);
|
||||
#endif
|
||||
|
||||
#define MEDIATYPE_NULL GUID_NULL
|
||||
#define MEDIASUBTYPE_NULL GUID_NULL
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_None,0xe436eb8e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Video,0x73646976,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Audio,0x73647561,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Text,0x73747874,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Midi,0x7364696D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Stream,0xe436eb83,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Interleaved,0x73766169,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_File,0x656c6966,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand,0x73636d64,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data,0x670aea80,0x3a82,0x11d0,0xb7,0x9b,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_VBI,0xf72a76e1,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_Timecode,0x482dee3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_LMRT,0x74726c6d,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM,0x736c7275,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL,0x4C504C43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV,0x56595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV,0x56555949,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9,0x39555659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y411,0x31313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P,0x50313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2,0x32595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU,0x55595659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY,0x59565955,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y211,0x31313259,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR,0x524a4c43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IF09,0x39304649,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA,0x414c5043,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG,0x47504A4D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ,0x4A4D5654,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE,0x454B4157,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC,0x43434643,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG,0x47504A49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Plum,0x6D756C50,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS,0x53435644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD,0x44535644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF,0x4656444D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1,0xe436eb78,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4,0xe436eb79,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8,0xe436eb7a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565,0xe436eb7b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555,0xe436eb7c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32,0xe436eb7e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555,0x297c55af,0xe209,0x4cb3,0xb7,0x57,0xc7,0x6d,0x6b,0x9c,0x88,0xa8)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444,0x6e6415e6,0x5c24,0x425f,0x93,0xcd,0x80,0x10,0x2b,0x3d,0x1c,0xca)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32,0x773c9ac0,0x3274,0x11d0,0xb7,0x24,0x0,0xaa,0x0,0x6c,0x1a,0x1)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2R10G10B10,0x2f8bb76d,0xb644,0x4550,0xac,0xf3,0xd3,0x0c,0xaa,0x65,0xd5,0xc5)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2B10G10R10,0x576f7893,0xbdf6,0x48c4,0x87,0x5f,0xae,0x7b,0x81,0x83,0x45,0x67)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV,0x56555941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AI44,0x34344941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IA44,0x34344149,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT,0x32335237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT,0x36315237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT,0x38384137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT,0x34344137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT,0x35314137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX9_RT,0x32335239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX9_RT,0x36315239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX9_RT,0x38384139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX9_RT,0x34344139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX9_RT,0x35314139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
|
||||
#define MEDIASUBTYPE_HASALPHA(mt) (((mt).subtype==MEDIASUBTYPE_ARGB4444) || ((mt).subtype==MEDIASUBTYPE_ARGB32) || ((mt).subtype==MEDIASUBTYPE_AYUV) || ((mt).subtype==MEDIASUBTYPE_AI44) || ((mt).subtype==MEDIASUBTYPE_IA44) || ((mt).subtype==MEDIASUBTYPE_ARGB1555) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
||||
#define MEDIASUBTYPE_HASALPHA7(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT))
|
||||
#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX7_RT))
|
||||
#define MEDIASUBTYPE_HASALPHA9(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
||||
#define MEDIASUBTYPE_D3D_DX9_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX9_RT))
|
||||
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90,0x9412,0x11d1,0xad,0xed,0x0,0x0,0xf8,0x75,0x4b,0x99)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576,0x8E7A,0x466F,0x9E,0x90,0x5D,0x3F,0x30,0x83,0x73,0x8B)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620,0x9792,0x4d8d,0x81,0xa4,0x86,0xaf,0x25,0x77,0x20,0x90)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo,0xa0af4f81,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio,0xa0af4f82,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo,0x5a9b6a40,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI,0x5a9b6a41,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder,0xBF87B6E0,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2,0xBF87B6E1,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
||||
OUR_GUID_ENTRY(CLSID_ProtoFilterGraph,0xe436ebb0,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_SystemClock,0xe436ebb1,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterMapper,0xe436ebb2,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterGraph,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_FilterGraphNoThread,0xe436ebb8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1Doc,0xe4bbd160,0x4269,0x11ce,0x83,0x8d,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_FileSource,0x701722e0,0x8ae3,0x11ce,0xa8,0x5c,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer,0x26c25940,0x4ca9,0x11ce,0xa8,0x28,0x0,0xaa,0x0,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG1Splitter,0x336475d0,0x942a,0x11ce,0xa8,0x70,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
||||
OUR_GUID_ENTRY(CLSID_CMpegVideoCodec,0xfeb50740,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
||||
OUR_GUID_ENTRY(CLSID_CMpegAudioCodec,0x4a2286e0,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
||||
OUR_GUID_ENTRY(CLSID_TextRender,0xe30629d3,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_InfTee,0xf8388a40,0xd5bb,0x11d0,0xbe,0x5a,0x0,0x80,0xc7,0x6,0x56,0x8e)
|
||||
OUR_GUID_ENTRY(CLSID_AviSplitter,0x1b544c20,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_AviReader,0x1b544c21,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_VfwCapture,0x1b544c22,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
||||
OUR_GUID_ENTRY(CLSID_CaptureProperties,0x1B544c22,0xFD0B,0x11ce,0x8C,0x63,0x00,0xAA,0x00,0x44,0xB5,0x1F)
|
||||
OUR_GUID_ENTRY(CLSID_FGControl,0xe436ebb4,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_MOVReader,0x44584800,0xf8ee,0x11ce,0xb2,0xd4,0x00,0xdd,0x1,0x10,0x1b,0x85)
|
||||
OUR_GUID_ENTRY(CLSID_QuickTimeParser,0xd51bd5a0,0x7548,0x11cf,0xa5,0x20,0x0,0x80,0xc7,0x7e,0xf5,0x8a)
|
||||
OUR_GUID_ENTRY(CLSID_QTDec,0xfdfe9681,0x74a3,0x11d0,0xaf,0xa7,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDoc,0xd3588ab0,0x0781,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0xb,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_VideoRenderer,0x70e102b0,0x5556,0x11ce,0x97,0xc0,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_Colour,0x1643e180,0x90f5,0x11ce,0x97,0xd5,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_Dither,0x1da08500,0x9edc,0x11cf,0xbc,0x10,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(CLSID_ModexRenderer,0x7167665,0x5011,0x11cf,0xbf,0x33,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRender,0xe30629d1,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_AudioProperties,0x05589faf,0xc356,0x11ce,0xbf,0x01,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_DSoundRender,0x79376820,0x07D0,0x11CF,0xA2,0x4D,0x0,0x20,0xAF,0xD7,0x97,0x67)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRecord,0xe30629d2,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
||||
OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties,0x2ca8ca52,0x3c3f,0x11d2,0xb7,0x3d,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDec,0xcf49d4e0,0x1115,0x11ce,0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_AVIDraw,0xa888df60,0x1e90,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
||||
OUR_GUID_ENTRY(CLSID_ACMWrapper,0x6a08cf80,0x0e18,0x11cf,0xa2,0x4d,0x0,0x20,0xaf,0xd7,0x97,0x67)
|
||||
OUR_GUID_ENTRY(CLSID_AsyncReader,0xe436ebb5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_URLReader,0xe436ebb6,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_PersistMonikerPID,0xe436ebb7,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
||||
OUR_GUID_ENTRY(CLSID_AVICo,0xd76e2820,0x1563,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
||||
OUR_GUID_ENTRY(CLSID_FileWriter,0x8596e5f0,0xda5,0x11d0,0xbd,0x21,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AviDest,0xe2510970,0xf137,0x11ce,0x8b,0x67,0x0,0xaa,0x0,0xa3,0xf1,0xa6)
|
||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage,0xc647b5c0,0x157c,0x11d0,0xbd,0x23,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1,0xa9ae910,0x85c0,0x11d0,0xbd,0x42,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AVIMIDIRender,0x07b65360,0xc445,0x11ce,0xaf,0xde,0x00,0xaa,0x00,0x6c,0x14,0xf4)
|
||||
OUR_GUID_ENTRY(CLSID_WMAsfReader,0x187463a0,0x5bb7,0x11d3,0xac,0xbe,0x0,0x80,0xc7,0x5e,0x24,0x6e)
|
||||
OUR_GUID_ENTRY(CLSID_WMAsfWriter,0x7c23220e,0x55bb,0x11d3,0x8b,0x16,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
||||
OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer,0xafb6c280,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a)
|
||||
OUR_GUID_ENTRY(CLSID_MMSPLITTER,0x3ae86b20,0x7be8,0x11d1,0xab,0xe6,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferSink,0x2db47ae5,0xcf39,0x43c2,0xb4,0xd6,0xc,0xd8,0xd9,0x9,0x46,0xf4)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferSource,0xc9f5fe02,0xf851,0x4eb5,0x99,0xee,0xad,0x60,0x2a,0xf1,0xe6,0x19)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferConfig,0xfa8a68b2,0xc864,0x4ba2,0xad,0x53,0xd3,0x87,0x6a,0x87,0x49,0x4b)
|
||||
OUR_GUID_ENTRY(CLSID_Mpeg2VideoStreamAnalyzer,0x6cfad761,0x735d,0x4aa5,0x8a,0xfc,0xaf,0x91,0xa7,0xd6,0x1e,0xba)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferRecordingAttributes,0xccaa63ac,0x1057,0x4778,0xae,0x92,0x12,0x6,0xab,0x9a,0xce,0xe6)
|
||||
OUR_GUID_ENTRY(CLSID_StreamBufferComposeRecording,0xd682c4ba,0xa90a,0x42fe,0xb9,0xe1,0x3,0x10,0x98,0x49,0xc4,0x23)
|
||||
OUR_GUID_ENTRY(CLSID_DVVideoCodec,0xb1b77c00,0xc3e4,0x11cf,0xaf,0x79,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVVideoEnc,0x13aa3650,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVSplitter,0x4eb31670,0x9fc6,0x11cf,0xaf,0x6e,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVMux,0x129d7e40,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_SeekingPassThru,0x60af76c,0x68dd,0x11d0,0x8f,0xc1,0x0,0xc0,0x4f,0xd9,0x18,0x9d)
|
||||
OUR_GUID_ENTRY(CLSID_Line21Decoder,0x6e8d4a20,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(CLSID_Line21Decoder2,0xe4206432,0x01a1,0x4bee,0xb3,0xe1,0x37,0x02,0xc8,0xed,0xc5,0x74)
|
||||
OUR_GUID_ENTRY(CLSID_OverlayMixer,0xcd8743a1,0x3736,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(CLSID_VBISurfaces,0x814b9800,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(CLSID_WSTDecoder,0x70bc06e0,0x5666,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(CLSID_MjpegDec,0x301056d0,0x6dff,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
||||
OUR_GUID_ENTRY(CLSID_MJPGEnc,0xb80ab0a0,0x7416,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
||||
OUR_GUID_ENTRY(CLSID_SystemDeviceEnum,0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CDeviceMoniker,0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CVidCapClassManager,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CQzFilterClassManager,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_VideoCompressorCategory,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CIcmCoClassManager,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioCompressorCategory,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CAcmCoClassManager,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CWaveinClassManager,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRendererCategory,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_CWaveOutClassManager,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_MidiRendererCategory,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
||||
OUR_GUID_ENTRY(CLSID_CMidiOutClassManager,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
||||
OUR_GUID_ENTRY(CLSID_TransmitCategory,0xcc7bfb41,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
||||
OUR_GUID_ENTRY(CLSID_DeviceControlCategory,0xcc7bfb46,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
||||
OUR_GUID_ENTRY(CLSID_ActiveMovieCategories,0xda4e3da0,0xd07d,0x11d0,0xbd,0x50,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory,0x2721AE20,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
||||
OUR_GUID_ENTRY(CLSID_MediaEncoderCategory,0x7D22E920,0x5CA9,0x4787,0x8C,0x2B,0xA6,0x77,0x9B,0xD1,0x17,0x81)
|
||||
OUR_GUID_ENTRY(CLSID_MediaMultiplexerCategory,0x236C9559,0xADCE,0x4736,0xBF,0x72,0xBA,0xB3,0x4E,0x39,0x21,0x96)
|
||||
OUR_GUID_ENTRY(CLSID_FilterMapper2,0xcda42200,0xbd88,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_MemoryAllocator,0x1e651cc0,0xb199,0x11d0,0x82,0x12,0x00,0xc0,0x4f,0xc3,0x2c,0x45)
|
||||
OUR_GUID_ENTRY(CLSID_MediaPropertyBag,0xcdbd8d00,0xc193,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
||||
OUR_GUID_ENTRY(CLSID_DvdGraphBuilder,0xFCC152B7,0xF372,0x11d0,0x8E,0x00,0x00,0xC0,0x4F,0xD7,0xC0,0x8B)
|
||||
OUR_GUID_ENTRY(CLSID_DVDNavigator,0x9b8c4620,0x2c1a,0x11d0,0x84,0x93,0x0,0xa0,0x24,0x38,0xad,0x48)
|
||||
OUR_GUID_ENTRY(CLSID_DVDState,0xf963c5cf,0xa659,0x4a93,0x96,0x38,0xca,0xf3,0xcd,0x27,0x7d,0x13)
|
||||
OUR_GUID_ENTRY(CLSID_SmartTee,0xcc58e280,0x8aa1,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(FORMAT_None,0x0F6417D6,0xc318,0x11d0,0xa4,0x3f,0x00,0xa0,0xc9,0x22,0x31,0x96)
|
||||
OUR_GUID_ENTRY(FORMAT_VideoInfo,0x05589f80,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_VideoInfo2,0xf72a76A0,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(FORMAT_WaveFormatEx,0x05589f81,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_MPEGVideo,0x05589f82,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_MPEGStreams,0x05589f83,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(FORMAT_DvInfo,0x05589f84,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_DirectDrawProperties,0x944d4c00,0xdd52,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(CLSID_PerformanceProperties,0x59ce6880,0xacf8,0x11cf,0xb5,0x6e,0x00,0x80,0xc7,0xc4,0xb6,0x8a)
|
||||
OUR_GUID_ENTRY(CLSID_QualityProperties,0x418afb70,0xf8b8,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
||||
OUR_GUID_ENTRY(IID_IBaseVideoMixer,0x61ded640,0xe912,0x11ce,0xa0,0x99,0x00,0xaa,0x00,0x47,0x9a,0x58)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawVideo,0x36d39eb0,0xdd75,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IQualProp,0x1bd0ecb0,0xf8e2,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
||||
OUR_GUID_ENTRY(CLSID_VPObject,0xce292861,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPObject,0xce292862,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPControl,0x25df12c1,0x3de0,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(CLSID_VPVBIObject,0x814b9801,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPVBIObject,0x814b9802,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPConfig,0xbc29a660,0x30e3,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPNotify,0xc76794a1,0xd6c5,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPNotify2,0xebf47183,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IVPVBIConfig,0xec529b00,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IVPVBINotify,0xec529b01,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
||||
OUR_GUID_ENTRY(IID_IMixerPinConfig,0x593cdde1,0x759,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IMixerPinConfig2,0xebf47182,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
||||
#ifndef __DDRAW_INCLUDED__
|
||||
OUR_GUID_ENTRY(CLSID_DirectDraw,0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35)
|
||||
OUR_GUID_ENTRY(CLSID_DirectDrawClipper,0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56)
|
||||
OUR_GUID_ENTRY(IID_IDirectDraw,0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface,0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface2,0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface3,0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface4,0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface7,0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawPalette,0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawClipper,0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
#endif
|
||||
#ifndef __DVP_INCLUDED__
|
||||
OUR_GUID_ENTRY(IID_IDDVideoPortContainer,0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
||||
#endif
|
||||
#ifndef __DDKM_INCLUDED__
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawKernel,0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel,0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
||||
#endif
|
||||
OUR_GUID_ENTRY(CLSID_ModexProperties,0x0618aa30,0x6bc4,0x11cf,0xbf,0x36,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IFullScreenVideo,0xdd1d7110,0x7836,0x11cf,0xbf,0x47,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
||||
OUR_GUID_ENTRY(IID_IFullScreenVideoEx,0x53479470,0xf1dd,0x11cf,0xbc,0x42,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage,0x101193c0,0xbfe,0x11d0,0xaf,0x91,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage,0x4150f050,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage,0x4db880e0,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
||||
OUR_GUID_ENTRY(IID_IAMDirectSound,0x546f4260,0xd53e,0x11cf,0xb3,0xf0,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(IID_IMpegAudioDecoder,0xb45dd570,0x3c77,0x11d1,0xab,0xe1,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
||||
OUR_GUID_ENTRY(IID_IAMLine21Decoder,0x6e8d4a21,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
||||
OUR_GUID_ENTRY(IID_IAMWstDecoder,0xc056de21,0x75c2,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage,0x4e27f80,0x91e4,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
||||
OUR_GUID_ENTRY(FORMAT_AnalogVideo,0x482dde0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo,0x482dde1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M,0x482dde2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B,0x482dde5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D,0x482dde6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G,0x482dde7,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H,0x482dde8,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I,0x482dde9,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M,0x482ddea,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N,0x482ddeb,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO,0x482ddec,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B,0x482ddf0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D,0x482ddf1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G,0x482ddf2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H,0x482ddf3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K,0x482ddf4,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1,0x482ddf5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L,0x482ddf6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio,0x482dee1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
|
||||
#include "dshow/ksuuids.h"
|
||||
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_NONE,0L,0,0,0,0,0,0,0,0,0,0)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_FRAME,0x7b785570,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_BYTE,0x7b785571,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE,0x7b785572,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_FIELD,0x7b785573,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME,0x7b785574,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
||||
OUR_GUID_ENTRY(AMPROPSETID_Pin,0x9b00f101,0x1567,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE,0xfb6c4281,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW,0xfb6c4282,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN,0xfb6c4283,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VBI,0xfb6c4284,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT,0xfb6c4285,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_NABTS,0xfb6c4286,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_EDS,0xfb6c4287,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT,0xfb6c4288,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_CC,0xfb6c4289,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_STILL,0xfb6c428a,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE,0xfb6c428b,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI,0xfb6c428c,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
||||
OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY,0xac798be1,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
||||
OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage,0x266eee41,0x6c63,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
||||
OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage,0x71f96461,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage,0x71f96463,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage,0x71f96464,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage,0x71f96465,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage,0x71f96466,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage,0x71f96467,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
||||
OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties,0x37e92a92,0xd9aa,0x11d2,0xbf,0x84,0x8e,0xf2,0xb1,0x55,0x5a,0xed)
|
||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,0xB87BEB7B,0x8D29,0x423f,0xAE,0x4D,0x65,0x82,0xC1,0x01,0x75,0xAC)
|
||||
OUR_GUID_ENTRY(CLSID_VideoRendererDefault,0x6BC1CFFA,0x8FC1,0x4261,0xAC,0x22,0xCF,0xB4,0xCC,0x38,0xDB,0x50)
|
||||
OUR_GUID_ENTRY(CLSID_AllocPresenter,0x99d54f63,0x1a69,0x41ae,0xaa,0x4d,0xc9,0x76,0xeb,0x3f,0x07,0x13)
|
||||
OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode,0x4444ac9e,0x242e,0x471b,0xa3,0xc7,0x45,0xdc,0xd4,0x63,0x52,0xbc)
|
||||
OUR_GUID_ENTRY(CLSID_VideoPortManager,0x6f26a6cd,0x967b,0x47fd,0x87,0x4a,0x7a,0xed,0x2c,0x9d,0x25,0xa2)
|
||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9,0x51b4abf3,0x748f,0x4e3b,0xa2,0x76,0xc8,0x28,0x33,0x0e,0x92,0x6a)
|
||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider,0x0dad2fdd,0x5fd7,0x11d3,0x8f,0x50,0x00,0xc0,0x4f,0x79,0x71,0xe2)
|
||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage,0xe3444d16,0x5ac4,0x4386,0x88,0xdf,0x13,0xfd,0x23,0x0e,0x1d,0xda)
|
||||
OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider,0xfa4b375a,0x45b4,0x4d45,0x84,0x40,0x26,0x39,0x57,0xb1,0x16,0x23)
|
||||
OUR_GUID_ENTRY(CLSID_DVBTNetworkProvider,0x216c62df,0x6d7f,0x4e9a,0x85,0x71,0x5,0xf1,0x4e,0xdb,0x76,0x6a)
|
||||
OUR_GUID_ENTRY(CLSID_DVBCNetworkProvider,0xdc0c0fe7,0x485,0x4266,0xb9,0x3f,0x68,0xfb,0xf8,0xe,0xd8,0x34)
|
||||
OUR_GUID_ENTRY(CLSID_DShowTVEFilter,0x05500280,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties,0x05500281,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties,0x05500282,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties,0x05500283,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderProxy,0xb43c4eec,0x8c32,0x4791,0x91,0x2,0x50,0x8a,0xda,0x5e,0xe8,0xe7)
|
||||
OUR_GUID_ENTRY(CLSID_ICodecAPIProxy,0x7ff0997a,0x1999,0x4286,0xa7,0x3c,0x62,0x2b,0x88,0x14,0xe7,0xeb)
|
||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderCodecAPIProxy,0xb05dabd9,0x56e5,0x4fdc,0xaf,0xa4,0x8a,0x47,0xe9,0x1f,0x1c,0x9c)
|
||||
|
||||
#ifndef __ENCODER_API_GUIDS__
|
||||
#define __ENCODER_API_GUIDS__
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE,0x49cc4c43,0xca83,0x4ad4,0xa9,0xaf,0xf3,0x69,0x6a,0xf6,0x66,0xdf)
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_PEAK_BITRATE,0x703f16a9,0x3d48,0x44a1,0xb0,0x77,0x1,0x8d,0xff,0x91,0x5d,0x19)
|
||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE_MODE,0xee5fb25c,0xc713,0x40d1,0x9d,0x58,0xc0,0xd7,0x24,0x1e,0x25,0xf)
|
||||
OUR_GUID_ENTRY(CODECAPI_CHANGELISTS,0x62b12acf,0xf6b0,0x47d9,0x94,0x56,0x96,0xf2,0x2c,0x4e,0x0b,0x9d)
|
||||
OUR_GUID_ENTRY(CODECAPI_VIDEO_ENCODER,0x7112e8e1,0x3d03,0x47ef,0x8e,0x60,0x03,0xf1,0xcf,0x53,0x73,0x01)
|
||||
OUR_GUID_ENTRY(CODECAPI_AUDIO_ENCODER,0xb9d19a3e,0xf897,0x429c,0xbc,0x46,0x81,0x38,0xb7,0x27,0x2b,0x2d)
|
||||
OUR_GUID_ENTRY(CODECAPI_SETALLDEFAULTS,0x6c5e6a7c,0xacf8,0x4f55,0xa9,0x99,0x1a,0x62,0x81,0x09,0x05,0x1b)
|
||||
OUR_GUID_ENTRY(CODECAPI_ALLSETTINGS,0x6a577e92,0x83e1,0x4113,0xad,0xc2,0x4f,0xce,0xc3,0x2f,0x83,0xa1)
|
||||
OUR_GUID_ENTRY(CODECAPI_SUPPORTSEVENTS,0x0581af97,0x7693,0x4dbd,0x9d,0xca,0x3f,0x9e,0xbd,0x65,0x85,0xa1)
|
||||
OUR_GUID_ENTRY(CODECAPI_CURRENTCHANGELIST,0x1cb14e83,0x7d72,0x4657,0x83,0xfd,0x47,0xa2,0xc5,0xb9,0xd1,0x3d)
|
||||
#endif
|
||||
|
||||
#undef OUR_GUID_ENTRY
|
||||
Vendored
-301
@@ -1,301 +0,0 @@
|
||||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 _MSC_VER // [
|
||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||
#endif // _MSC_VER ]
|
||||
|
||||
#ifndef _MSC_INTTYPES_H_ // [
|
||||
#define _MSC_INTTYPES_H_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <msc_stdint.h>
|
||||
|
||||
// 7.8 Format conversion of integer types
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
// 7.8.1 Macros for format specifiers
|
||||
|
||||
// The fprintf macros for signed integers are:
|
||||
#define PRId8 "d"
|
||||
#define PRIi8 "i"
|
||||
#define PRIdLEAST8 "d"
|
||||
#define PRIiLEAST8 "i"
|
||||
#define PRIdFAST8 "d"
|
||||
#define PRIiFAST8 "i"
|
||||
|
||||
#define PRId16 "hd"
|
||||
#define PRIi16 "hi"
|
||||
#define PRIdLEAST16 "hd"
|
||||
#define PRIiLEAST16 "hi"
|
||||
#define PRIdFAST16 "hd"
|
||||
#define PRIiFAST16 "hi"
|
||||
|
||||
#define PRId32 "I32d"
|
||||
#define PRIi32 "I32i"
|
||||
#define PRIdLEAST32 "I32d"
|
||||
#define PRIiLEAST32 "I32i"
|
||||
#define PRIdFAST32 "I32d"
|
||||
#define PRIiFAST32 "I32i"
|
||||
|
||||
#define PRId64 "I64d"
|
||||
#define PRIi64 "I64i"
|
||||
#define PRIdLEAST64 "I64d"
|
||||
#define PRIiLEAST64 "I64i"
|
||||
#define PRIdFAST64 "I64d"
|
||||
#define PRIiFAST64 "I64i"
|
||||
|
||||
#define PRIdMAX "I64d"
|
||||
#define PRIiMAX "I64i"
|
||||
|
||||
#define PRIdPTR "Id"
|
||||
#define PRIiPTR "Ii"
|
||||
|
||||
// The fprintf macros for unsigned integers are:
|
||||
#define PRIo8 "o"
|
||||
#define PRIu8 "u"
|
||||
#define PRIx8 "x"
|
||||
#define PRIX8 "X"
|
||||
#define PRIoLEAST8 "o"
|
||||
#define PRIuLEAST8 "u"
|
||||
#define PRIxLEAST8 "x"
|
||||
#define PRIXLEAST8 "X"
|
||||
#define PRIoFAST8 "o"
|
||||
#define PRIuFAST8 "u"
|
||||
#define PRIxFAST8 "x"
|
||||
#define PRIXFAST8 "X"
|
||||
|
||||
#define PRIo16 "ho"
|
||||
#define PRIu16 "hu"
|
||||
#define PRIx16 "hx"
|
||||
#define PRIX16 "hX"
|
||||
#define PRIoLEAST16 "ho"
|
||||
#define PRIuLEAST16 "hu"
|
||||
#define PRIxLEAST16 "hx"
|
||||
#define PRIXLEAST16 "hX"
|
||||
#define PRIoFAST16 "ho"
|
||||
#define PRIuFAST16 "hu"
|
||||
#define PRIxFAST16 "hx"
|
||||
#define PRIXFAST16 "hX"
|
||||
|
||||
#define PRIo32 "I32o"
|
||||
#define PRIu32 "I32u"
|
||||
#define PRIx32 "I32x"
|
||||
#define PRIX32 "I32X"
|
||||
#define PRIoLEAST32 "I32o"
|
||||
#define PRIuLEAST32 "I32u"
|
||||
#define PRIxLEAST32 "I32x"
|
||||
#define PRIXLEAST32 "I32X"
|
||||
#define PRIoFAST32 "I32o"
|
||||
#define PRIuFAST32 "I32u"
|
||||
#define PRIxFAST32 "I32x"
|
||||
#define PRIXFAST32 "I32X"
|
||||
|
||||
#define PRIo64 "I64o"
|
||||
#define PRIu64 "I64u"
|
||||
#define PRIx64 "I64x"
|
||||
#define PRIX64 "I64X"
|
||||
#define PRIoLEAST64 "I64o"
|
||||
#define PRIuLEAST64 "I64u"
|
||||
#define PRIxLEAST64 "I64x"
|
||||
#define PRIXLEAST64 "I64X"
|
||||
#define PRIoFAST64 "I64o"
|
||||
#define PRIuFAST64 "I64u"
|
||||
#define PRIxFAST64 "I64x"
|
||||
#define PRIXFAST64 "I64X"
|
||||
|
||||
#define PRIoMAX "I64o"
|
||||
#define PRIuMAX "I64u"
|
||||
#define PRIxMAX "I64x"
|
||||
#define PRIXMAX "I64X"
|
||||
|
||||
#define PRIoPTR "Io"
|
||||
#define PRIuPTR "Iu"
|
||||
#define PRIxPTR "Ix"
|
||||
#define PRIXPTR "IX"
|
||||
|
||||
// The fscanf macros for signed integers are:
|
||||
#define SCNd8 "d"
|
||||
#define SCNi8 "i"
|
||||
#define SCNdLEAST8 "d"
|
||||
#define SCNiLEAST8 "i"
|
||||
#define SCNdFAST8 "d"
|
||||
#define SCNiFAST8 "i"
|
||||
|
||||
#define SCNd16 "hd"
|
||||
#define SCNi16 "hi"
|
||||
#define SCNdLEAST16 "hd"
|
||||
#define SCNiLEAST16 "hi"
|
||||
#define SCNdFAST16 "hd"
|
||||
#define SCNiFAST16 "hi"
|
||||
|
||||
#define SCNd32 "ld"
|
||||
#define SCNi32 "li"
|
||||
#define SCNdLEAST32 "ld"
|
||||
#define SCNiLEAST32 "li"
|
||||
#define SCNdFAST32 "ld"
|
||||
#define SCNiFAST32 "li"
|
||||
|
||||
#define SCNd64 "I64d"
|
||||
#define SCNi64 "I64i"
|
||||
#define SCNdLEAST64 "I64d"
|
||||
#define SCNiLEAST64 "I64i"
|
||||
#define SCNdFAST64 "I64d"
|
||||
#define SCNiFAST64 "I64i"
|
||||
|
||||
#define SCNdMAX "I64d"
|
||||
#define SCNiMAX "I64i"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNdPTR "I64d"
|
||||
# define SCNiPTR "I64i"
|
||||
#else // _WIN64 ][
|
||||
# define SCNdPTR "ld"
|
||||
# define SCNiPTR "li"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// The fscanf macros for unsigned integers are:
|
||||
#define SCNo8 "o"
|
||||
#define SCNu8 "u"
|
||||
#define SCNx8 "x"
|
||||
#define SCNX8 "X"
|
||||
#define SCNoLEAST8 "o"
|
||||
#define SCNuLEAST8 "u"
|
||||
#define SCNxLEAST8 "x"
|
||||
#define SCNXLEAST8 "X"
|
||||
#define SCNoFAST8 "o"
|
||||
#define SCNuFAST8 "u"
|
||||
#define SCNxFAST8 "x"
|
||||
#define SCNXFAST8 "X"
|
||||
|
||||
#define SCNo16 "ho"
|
||||
#define SCNu16 "hu"
|
||||
#define SCNx16 "hx"
|
||||
#define SCNX16 "hX"
|
||||
#define SCNoLEAST16 "ho"
|
||||
#define SCNuLEAST16 "hu"
|
||||
#define SCNxLEAST16 "hx"
|
||||
#define SCNXLEAST16 "hX"
|
||||
#define SCNoFAST16 "ho"
|
||||
#define SCNuFAST16 "hu"
|
||||
#define SCNxFAST16 "hx"
|
||||
#define SCNXFAST16 "hX"
|
||||
|
||||
#define SCNo32 "lo"
|
||||
#define SCNu32 "lu"
|
||||
#define SCNx32 "lx"
|
||||
#define SCNX32 "lX"
|
||||
#define SCNoLEAST32 "lo"
|
||||
#define SCNuLEAST32 "lu"
|
||||
#define SCNxLEAST32 "lx"
|
||||
#define SCNXLEAST32 "lX"
|
||||
#define SCNoFAST32 "lo"
|
||||
#define SCNuFAST32 "lu"
|
||||
#define SCNxFAST32 "lx"
|
||||
#define SCNXFAST32 "lX"
|
||||
|
||||
#define SCNo64 "I64o"
|
||||
#define SCNu64 "I64u"
|
||||
#define SCNx64 "I64x"
|
||||
#define SCNX64 "I64X"
|
||||
#define SCNoLEAST64 "I64o"
|
||||
#define SCNuLEAST64 "I64u"
|
||||
#define SCNxLEAST64 "I64x"
|
||||
#define SCNXLEAST64 "I64X"
|
||||
#define SCNoFAST64 "I64o"
|
||||
#define SCNuFAST64 "I64u"
|
||||
#define SCNxFAST64 "I64x"
|
||||
#define SCNXFAST64 "I64X"
|
||||
|
||||
#define SCNoMAX "I64o"
|
||||
#define SCNuMAX "I64u"
|
||||
#define SCNxMAX "I64x"
|
||||
#define SCNXMAX "I64X"
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define SCNoPTR "I64o"
|
||||
# define SCNuPTR "I64u"
|
||||
# define SCNxPTR "I64x"
|
||||
# define SCNXPTR "I64X"
|
||||
#else // _WIN64 ][
|
||||
# define SCNoPTR "lo"
|
||||
# define SCNuPTR "lu"
|
||||
# define SCNxPTR "lx"
|
||||
# define SCNXPTR "lX"
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.8.2 Functions for greatest-width integer types
|
||||
|
||||
// 7.8.2.1 The imaxabs function
|
||||
#define imaxabs _abs64
|
||||
|
||||
// 7.8.2.2 The imaxdiv function
|
||||
|
||||
// This is modified version of div() function from Microsoft's div.c found
|
||||
// in %MSVC.NET%\crt\src\div.c
|
||||
#ifdef STATIC_IMAXDIV // [
|
||||
static
|
||||
#else // STATIC_IMAXDIV ][
|
||||
_inline
|
||||
#endif // STATIC_IMAXDIV ]
|
||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
||||
{
|
||||
imaxdiv_t result;
|
||||
|
||||
result.quot = numer / denom;
|
||||
result.rem = numer % denom;
|
||||
|
||||
if (numer < 0 && result.rem > 0) {
|
||||
// did division wrong; must fix up
|
||||
++result.quot;
|
||||
result.rem -= denom;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
||||
#define strtoimax _strtoi64
|
||||
#define strtoumax _strtoui64
|
||||
|
||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
||||
#define wcstoimax _wcstoi64
|
||||
#define wcstoumax _wcstoui64
|
||||
|
||||
|
||||
#endif // _MSC_INTTYPES_H_ ]
|
||||
Vendored
-219
@@ -1,219 +0,0 @@
|
||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 _MSC_STDINT_H_ // [
|
||||
#define _MSC_STDINT_H_
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
|
||||
// or compiler give many errors like this:
|
||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
extern "C++" {
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined __GNUC__ || _MSC_VER >= 1600
|
||||
#include "stdint.h"
|
||||
#else
|
||||
|
||||
// 7.18.1 Integer types
|
||||
|
||||
// 7.18.1.1 Exact-width integer types
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
// 7.18.1.2 Minimum-width integer types
|
||||
typedef int8_t int_least8_t;
|
||||
typedef int16_t int_least16_t;
|
||||
typedef int32_t int_least32_t;
|
||||
typedef int64_t int_least64_t;
|
||||
typedef uint8_t uint_least8_t;
|
||||
typedef uint16_t uint_least16_t;
|
||||
typedef uint32_t uint_least32_t;
|
||||
typedef uint64_t uint_least64_t;
|
||||
|
||||
// 7.18.1.3 Fastest minimum-width integer types
|
||||
typedef int8_t int_fast8_t;
|
||||
typedef int16_t int_fast16_t;
|
||||
typedef int32_t int_fast32_t;
|
||||
typedef int64_t int_fast64_t;
|
||||
typedef uint8_t uint_fast8_t;
|
||||
typedef uint16_t uint_fast16_t;
|
||||
typedef uint32_t uint_fast32_t;
|
||||
typedef uint64_t uint_fast64_t;
|
||||
|
||||
// 7.18.1.4 Integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
typedef __int64 intptr_t;
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else // _WIN64 ][
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.1.5 Greatest-width integer types
|
||||
typedef int64_t intmax_t;
|
||||
typedef uint64_t uintmax_t;
|
||||
|
||||
|
||||
// 7.18.2 Limits of specified-width integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||
|
||||
// 7.18.2.1 Limits of exact-width integer types
|
||||
#define INT8_MIN _I8_MIN
|
||||
#define INT8_MAX _I8_MAX
|
||||
#define INT16_MIN _I16_MIN
|
||||
#define INT16_MAX _I16_MAX
|
||||
#define INT32_MIN _I32_MIN
|
||||
#define INT32_MAX _I32_MAX
|
||||
#define INT64_MIN _I64_MIN
|
||||
#define INT64_MAX _I64_MAX
|
||||
#define UINT8_MAX _UI8_MAX
|
||||
#define UINT16_MAX _UI16_MAX
|
||||
#define UINT32_MAX _UI32_MAX
|
||||
#define UINT64_MAX _UI64_MAX
|
||||
|
||||
// 7.18.2.2 Limits of minimum-width integer types
|
||||
#define INT_LEAST8_MIN INT8_MIN
|
||||
#define INT_LEAST8_MAX INT8_MAX
|
||||
#define INT_LEAST16_MIN INT16_MIN
|
||||
#define INT_LEAST16_MAX INT16_MAX
|
||||
#define INT_LEAST32_MIN INT32_MIN
|
||||
#define INT_LEAST32_MAX INT32_MAX
|
||||
#define INT_LEAST64_MIN INT64_MIN
|
||||
#define INT_LEAST64_MAX INT64_MAX
|
||||
#define UINT_LEAST8_MAX UINT8_MAX
|
||||
#define UINT_LEAST16_MAX UINT16_MAX
|
||||
#define UINT_LEAST32_MAX UINT32_MAX
|
||||
#define UINT_LEAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||
#define INT_FAST8_MIN INT8_MIN
|
||||
#define INT_FAST8_MAX INT8_MAX
|
||||
#define INT_FAST16_MIN INT16_MIN
|
||||
#define INT_FAST16_MAX INT16_MAX
|
||||
#define INT_FAST32_MIN INT32_MIN
|
||||
#define INT_FAST32_MAX INT32_MAX
|
||||
#define INT_FAST64_MIN INT64_MIN
|
||||
#define INT_FAST64_MAX INT64_MAX
|
||||
#define UINT_FAST8_MAX UINT8_MAX
|
||||
#define UINT_FAST16_MAX UINT16_MAX
|
||||
#define UINT_FAST32_MAX UINT32_MAX
|
||||
#define UINT_FAST64_MAX UINT64_MAX
|
||||
|
||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||
#ifdef _WIN64 // [
|
||||
# define INTPTR_MIN INT64_MIN
|
||||
# define INTPTR_MAX INT64_MAX
|
||||
# define UINTPTR_MAX UINT64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define INTPTR_MIN INT32_MIN
|
||||
# define INTPTR_MAX INT32_MAX
|
||||
# define UINTPTR_MAX UINT32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
// 7.18.2.5 Limits of greatest-width integer types
|
||||
#define INTMAX_MIN INT64_MIN
|
||||
#define INTMAX_MAX INT64_MAX
|
||||
#define UINTMAX_MAX UINT64_MAX
|
||||
|
||||
// 7.18.3 Limits of other integer types
|
||||
|
||||
#ifdef _WIN64 // [
|
||||
# define PTRDIFF_MIN _I64_MIN
|
||||
# define PTRDIFF_MAX _I64_MAX
|
||||
#else // _WIN64 ][
|
||||
# define PTRDIFF_MIN _I32_MIN
|
||||
# define PTRDIFF_MAX _I32_MAX
|
||||
#endif // _WIN64 ]
|
||||
|
||||
#define SIG_ATOMIC_MIN INT_MIN
|
||||
#define SIG_ATOMIC_MAX INT_MAX
|
||||
|
||||
#ifndef SIZE_MAX // [
|
||||
# ifdef _WIN64 // [
|
||||
# define SIZE_MAX _UI64_MAX
|
||||
# else // _WIN64 ][
|
||||
# define SIZE_MAX _UI32_MAX
|
||||
# endif // _WIN64 ]
|
||||
#endif // SIZE_MAX ]
|
||||
|
||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||
#ifndef WCHAR_MIN // [
|
||||
# define WCHAR_MIN 0
|
||||
#endif // WCHAR_MIN ]
|
||||
#ifndef WCHAR_MAX // [
|
||||
# define WCHAR_MAX _UI16_MAX
|
||||
#endif // WCHAR_MAX ]
|
||||
|
||||
#define WINT_MIN 0
|
||||
#define WINT_MAX _UI16_MAX
|
||||
|
||||
#endif // __STDC_LIMIT_MACROS ]
|
||||
|
||||
|
||||
// 7.18.4 Limits of other integer types
|
||||
|
||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||
|
||||
// 7.18.4.1 Macros for minimum-width integer constants
|
||||
|
||||
#define INT8_C(val) val
|
||||
#define INT16_C(val) val
|
||||
#define INT32_C(val) val##L
|
||||
#define INT64_C(val) val##i64
|
||||
|
||||
#define UINT8_C(val) val
|
||||
#define UINT16_C(val) val
|
||||
#define UINT32_C(val) val##UL
|
||||
#define UINT64_C(val) val##Ui64
|
||||
|
||||
// 7.18.4.2 Macros for greatest-width integer constants
|
||||
#define INTMAX_C INT64_C
|
||||
#define UINTMAX_C UINT64_C
|
||||
|
||||
#endif // __STDC_CONSTANT_MACROS ]
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _MSC_STDINT_H_ ]
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
Copyright (c) 2008-2015 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Materials.
|
||||
|
||||
MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
|
||||
KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
|
||||
SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
|
||||
https://www.khronos.org/registry/
|
||||
|
||||
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
//
|
||||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright (c) 2014-2017 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.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef VK_PLATFORM_H_
|
||||
#define VK_PLATFORM_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif // __cplusplus
|
||||
|
||||
/*
|
||||
***************************************************************************************************
|
||||
* Platform-specific directives and type declarations
|
||||
***************************************************************************************************
|
||||
*/
|
||||
|
||||
/* Platform-specific calling convention macros.
|
||||
*
|
||||
* Platforms should define these so that Vulkan clients call Vulkan commands
|
||||
* with the same calling conventions that the Vulkan implementation expects.
|
||||
*
|
||||
* VKAPI_ATTR - Placed before the return type in function declarations.
|
||||
* Useful for C++11 and GCC/Clang-style function attribute syntax.
|
||||
* VKAPI_CALL - Placed after the return type in function declarations.
|
||||
* Useful for MSVC-style calling convention syntax.
|
||||
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
|
||||
*
|
||||
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
|
||||
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
// On Windows, Vulkan commands use the stdcall convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
// is true even if the rest of the application passes floats on the stack,
|
||||
// as it does by default when compiling for the armeabi-v7a NDK ABI.
|
||||
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR VKAPI_ATTR
|
||||
#else
|
||||
// On other platforms, use the default calling convention
|
||||
#define VKAPI_ATTR
|
||||
#define VKAPI_CALL
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
typedef signed __int8 int8_t;
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef signed __int16 int16_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef signed __int32 int32_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef signed __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#endif // !defined(VK_NO_STDINT_H)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
#ifndef VULKAN_H_
|
||||
#define VULKAN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
#include "vk_platform.h"
|
||||
#include "vulkan_core.h"
|
||||
|
||||
#ifdef VK_USE_PLATFORM_ANDROID_KHR
|
||||
#include "vulkan_android.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_FUCHSIA
|
||||
#include <zircon/types.h>
|
||||
#include "vulkan_fuchsia.h"
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_IOS_MVK
|
||||
#include "vulkan_ios.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MACOS_MVK
|
||||
#include "vulkan_macos.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MIR_KHR
|
||||
#include <mir_toolkit/client_types.h>
|
||||
#include "vulkan_mir.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_VI_NN
|
||||
#include "vulkan_vi.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include <wayland-client.h>
|
||||
#include "vulkan_wayland.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
#include <windows.h>
|
||||
#include "vulkan_win32.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XCB_KHR
|
||||
#include <xcb/xcb.h>
|
||||
#include "vulkan_xcb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
||||
#include <X11/Xlib.h>
|
||||
#include "vulkan_xlib.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include "vulkan_xlib_xrandr.h"
|
||||
#endif
|
||||
|
||||
#endif // VULKAN_H_
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
#ifndef VULKAN_ANDROID_H_
|
||||
#define VULKAN_ANDROID_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_android_surface 1
|
||||
struct ANativeWindow;
|
||||
|
||||
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
|
||||
|
||||
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkAndroidSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkAndroidSurfaceCreateFlagsKHR flags;
|
||||
struct ANativeWindow* window;
|
||||
} VkAndroidSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
#define VK_ANDROID_external_memory_android_hardware_buffer 1
|
||||
struct AHardwareBuffer;
|
||||
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
|
||||
|
||||
typedef struct VkAndroidHardwareBufferUsageANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint64_t androidHardwareBufferUsage;
|
||||
} VkAndroidHardwareBufferUsageANDROID;
|
||||
|
||||
typedef struct VkAndroidHardwareBufferPropertiesANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkDeviceSize allocationSize;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkAndroidHardwareBufferPropertiesANDROID;
|
||||
|
||||
typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFormat format;
|
||||
uint64_t externalFormat;
|
||||
VkFormatFeatureFlags formatFeatures;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkAndroidHardwareBufferFormatPropertiesANDROID;
|
||||
|
||||
typedef struct VkImportAndroidHardwareBufferInfoANDROID {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
struct AHardwareBuffer* buffer;
|
||||
} VkImportAndroidHardwareBufferInfoANDROID;
|
||||
|
||||
typedef struct VkMemoryGetAndroidHardwareBufferInfoANDROID {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
} VkMemoryGetAndroidHardwareBufferInfoANDROID;
|
||||
|
||||
typedef struct VkExternalFormatANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint64_t externalFormat;
|
||||
} VkExternalFormatANDROID;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
|
||||
VkDevice device,
|
||||
const struct AHardwareBuffer* buffer,
|
||||
VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
|
||||
VkDevice device,
|
||||
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
|
||||
struct AHardwareBuffer** pBuffer);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+8524
File diff suppressed because it is too large
Load Diff
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef VULKAN_FUCHSIA_H_
|
||||
#define VULKAN_FUCHSIA_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_FUCHSIA_imagepipe_surface 1
|
||||
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
|
||||
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
|
||||
|
||||
typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
|
||||
|
||||
typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImagePipeSurfaceCreateFlagsFUCHSIA flags;
|
||||
zx_handle_t imagePipeHandle;
|
||||
} VkImagePipeSurfaceCreateInfoFUCHSIA;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
|
||||
VkInstance instance,
|
||||
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef VULKAN_IOS_H_
|
||||
#define VULKAN_IOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_MVK_ios_surface 1
|
||||
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
|
||||
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
|
||||
|
||||
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkIOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkIOSSurfaceCreateFlagsMVK flags;
|
||||
const void* pView;
|
||||
} VkIOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
|
||||
VkInstance instance,
|
||||
const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef VULKAN_MACOS_H_
|
||||
#define VULKAN_MACOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_MVK_macos_surface 1
|
||||
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
|
||||
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
|
||||
|
||||
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkMacOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMacOSSurfaceCreateFlagsMVK flags;
|
||||
const void* pView;
|
||||
} VkMacOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
|
||||
VkInstance instance,
|
||||
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
#ifndef VULKAN_MIR_H_
|
||||
#define VULKAN_MIR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_mir_surface 1
|
||||
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
|
||||
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
|
||||
|
||||
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkMirSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMirSurfaceCreateFlagsKHR flags;
|
||||
MirConnection* connection;
|
||||
MirSurface* mirSurface;
|
||||
} VkMirSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
MirConnection* connection);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef VULKAN_VI_H_
|
||||
#define VULKAN_VI_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_NN_vi_surface 1
|
||||
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
|
||||
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
|
||||
|
||||
typedef VkFlags VkViSurfaceCreateFlagsNN;
|
||||
|
||||
typedef struct VkViSurfaceCreateInfoNN {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkViSurfaceCreateFlagsNN flags;
|
||||
void* window;
|
||||
} VkViSurfaceCreateInfoNN;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
|
||||
VkInstance instance,
|
||||
const VkViSurfaceCreateInfoNN* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
#ifndef VULKAN_WAYLAND_H_
|
||||
#define VULKAN_WAYLAND_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_wayland_surface 1
|
||||
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
|
||||
|
||||
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWaylandSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkWaylandSurfaceCreateFlagsKHR flags;
|
||||
struct wl_display* display;
|
||||
struct wl_surface* surface;
|
||||
} VkWaylandSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
struct wl_display* display);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
#ifndef VULKAN_WIN32_H_
|
||||
#define VULKAN_WIN32_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_win32_surface 1
|
||||
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
|
||||
|
||||
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWin32SurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkWin32SurfaceCreateFlagsKHR flags;
|
||||
HINSTANCE hinstance;
|
||||
HWND hwnd;
|
||||
} VkWin32SurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex);
|
||||
#endif
|
||||
|
||||
#define VK_KHR_external_memory_win32 1
|
||||
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
HANDLE handle;
|
||||
LPCWSTR name;
|
||||
} VkImportMemoryWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkExportMemoryWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const SECURITY_ATTRIBUTES* pAttributes;
|
||||
DWORD dwAccess;
|
||||
LPCWSTR name;
|
||||
} VkExportMemoryWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkMemoryWin32HandlePropertiesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkMemoryWin32HandlePropertiesKHR;
|
||||
|
||||
typedef struct VkMemoryGetWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
|
||||
VkDevice device,
|
||||
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
||||
HANDLE* pHandle);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
|
||||
VkDevice device,
|
||||
VkExternalMemoryHandleTypeFlagBits handleType,
|
||||
HANDLE handle,
|
||||
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
#endif
|
||||
|
||||
#define VK_KHR_win32_keyed_mutex 1
|
||||
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
||||
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
|
||||
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t acquireCount;
|
||||
const VkDeviceMemory* pAcquireSyncs;
|
||||
const uint64_t* pAcquireKeys;
|
||||
const uint32_t* pAcquireTimeouts;
|
||||
uint32_t releaseCount;
|
||||
const VkDeviceMemory* pReleaseSyncs;
|
||||
const uint64_t* pReleaseKeys;
|
||||
} VkWin32KeyedMutexAcquireReleaseInfoKHR;
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_external_semaphore_win32 1
|
||||
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
|
||||
|
||||
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkSemaphoreImportFlags flags;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
HANDLE handle;
|
||||
LPCWSTR name;
|
||||
} VkImportSemaphoreWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkExportSemaphoreWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const SECURITY_ATTRIBUTES* pAttributes;
|
||||
DWORD dwAccess;
|
||||
LPCWSTR name;
|
||||
} VkExportSemaphoreWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkD3D12FenceSubmitInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t waitSemaphoreValuesCount;
|
||||
const uint64_t* pWaitSemaphoreValues;
|
||||
uint32_t signalSemaphoreValuesCount;
|
||||
const uint64_t* pSignalSemaphoreValues;
|
||||
} VkD3D12FenceSubmitInfoKHR;
|
||||
|
||||
typedef struct VkSemaphoreGetWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
} VkSemaphoreGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
|
||||
VkDevice device,
|
||||
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
|
||||
VkDevice device,
|
||||
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
#define VK_KHR_external_fence_win32 1
|
||||
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
|
||||
|
||||
typedef struct VkImportFenceWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkFence fence;
|
||||
VkFenceImportFlags flags;
|
||||
VkExternalFenceHandleTypeFlagBits handleType;
|
||||
HANDLE handle;
|
||||
LPCWSTR name;
|
||||
} VkImportFenceWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkExportFenceWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const SECURITY_ATTRIBUTES* pAttributes;
|
||||
DWORD dwAccess;
|
||||
LPCWSTR name;
|
||||
} VkExportFenceWin32HandleInfoKHR;
|
||||
|
||||
typedef struct VkFenceGetWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkFence fence;
|
||||
VkExternalFenceHandleTypeFlagBits handleType;
|
||||
} VkFenceGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
|
||||
VkDevice device,
|
||||
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
|
||||
VkDevice device,
|
||||
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
#define VK_NV_external_memory_win32 1
|
||||
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
||||
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExternalMemoryHandleTypeFlagsNV handleType;
|
||||
HANDLE handle;
|
||||
} VkImportMemoryWin32HandleInfoNV;
|
||||
|
||||
typedef struct VkExportMemoryWin32HandleInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const SECURITY_ATTRIBUTES* pAttributes;
|
||||
DWORD dwAccess;
|
||||
} VkExportMemoryWin32HandleInfoNV;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
|
||||
VkDevice device,
|
||||
VkDeviceMemory memory,
|
||||
VkExternalMemoryHandleTypeFlagsNV handleType,
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
#define VK_NV_win32_keyed_mutex 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
|
||||
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t acquireCount;
|
||||
const VkDeviceMemory* pAcquireSyncs;
|
||||
const uint64_t* pAcquireKeys;
|
||||
const uint32_t* pAcquireTimeoutMilliseconds;
|
||||
uint32_t releaseCount;
|
||||
const VkDeviceMemory* pReleaseSyncs;
|
||||
const uint64_t* pReleaseKeys;
|
||||
} VkWin32KeyedMutexAcquireReleaseInfoNV;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+66
@@ -0,0 +1,66 @@
|
||||
#ifndef VULKAN_XCB_H_
|
||||
#define VULKAN_XCB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_xcb_surface 1
|
||||
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
|
||||
|
||||
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXcbSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkXcbSurfaceCreateFlagsKHR flags;
|
||||
xcb_connection_t* connection;
|
||||
xcb_window_t window;
|
||||
} VkXcbSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
xcb_connection_t* connection,
|
||||
xcb_visualid_t visual_id);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
#ifndef VULKAN_XLIB_H_
|
||||
#define VULKAN_XLIB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_xlib_surface 1
|
||||
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
|
||||
|
||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXlibSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkXlibSurfaceCreateFlagsKHR flags;
|
||||
Display* dpy;
|
||||
Window window;
|
||||
} VkXlibSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
Display* dpy,
|
||||
VisualID visualID);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
#ifndef VULKAN_XLIB_XRANDR_H_
|
||||
#define VULKAN_XLIB_XRANDR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_EXT_acquire_xlib_display 1
|
||||
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
|
||||
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
Display* dpy,
|
||||
VkDisplayKHR display);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
Display* dpy,
|
||||
RROutput rrOutput,
|
||||
VkDisplayKHR* pDisplay);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+6
-3
@@ -6,7 +6,7 @@ project(${IPP_IW_LIBRARY})
|
||||
|
||||
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
|
||||
add_definitions(-DIW_BUILD)
|
||||
if(HAVE_IPP_ICV_ONLY)
|
||||
if(HAVE_IPP_ICV)
|
||||
add_definitions(-DICV_BASE)
|
||||
endif()
|
||||
|
||||
@@ -20,8 +20,11 @@ file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IP
|
||||
add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-function")
|
||||
if(CV_GCC OR CV_CLANG OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
|
||||
endif()
|
||||
if(CV_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+13
-13
@@ -2,37 +2,37 @@ function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "a62e20676a60ee0ad6581e217fe7e4bada3b95db")
|
||||
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_intel64_20170418.tgz")
|
||||
set(OPENCV_ICV_HASH "0c25953c99dbb499ff502485a9356d8d")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_ia32_20170418.tgz")
|
||||
set(OPENCV_ICV_HASH "5f225948f3f64067c681293c098d50d8")
|
||||
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"))
|
||||
set(OPENCV_ICV_PLATFORM "linux")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_intel64_20170418.tgz")
|
||||
set(OPENCV_ICV_HASH "87cbdeb627415d8e4bc811156289fa3a")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_ia32_20170418.tgz")
|
||||
set(OPENCV_ICV_HASH "f2cece00d802d4dea86df52ed095257e")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
|
||||
endif()
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(OPENCV_ICV_PLATFORM "windows")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_win_intel64_20170418.zip")
|
||||
set(OPENCV_ICV_HASH "75060a0c662c0800f48995b7e9b085f6")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_intel64_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2017u2_win_ia32_20170418.zip")
|
||||
set(OPENCV_ICV_HASH "60fcf3ccd9a2ebc9e432ffb5cb91638b")
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
|
||||
Vendored
+4
-6
@@ -15,6 +15,8 @@ if(NOT WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wimplicit-fallthrough)
|
||||
|
||||
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
set(ITT_INCLUDE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
@@ -43,12 +45,6 @@ if(NOT WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${ITT_LIBRARY} PROPERTIES
|
||||
OUTPUT_NAME ${ITT_LIBRARY}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
@@ -66,3 +62,5 @@ endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
|
||||
+1
-1
@@ -335,7 +335,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
#ifdef SDL_STRNCPY_S
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
|
||||
#else
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, l)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
|
||||
#endif /* SDL_STRNCPY_S */
|
||||
|
||||
#define __itt_fstrdup(s) strdup(s)
|
||||
|
||||
Vendored
+7
-8
@@ -25,16 +25,13 @@ endif(WIN32 AND NOT MINGW)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
||||
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
||||
-Wsign-compare -Wstrict-overflow)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||
-Wsign-compare -Wstrict-overflow -Wpointer-compare
|
||||
-Wabsolute-value # clang on Linux
|
||||
-Wimplicit-fallthrough
|
||||
)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
||||
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set_target_properties(${JASPER_LIBRARY}
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ${JASPER_LIBRARY}
|
||||
@@ -51,3 +48,5 @@ endif()
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JASPER_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(jasper LICENSE README copyright)
|
||||
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
project(${JPEG_LIBRARY} C)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 0)
|
||||
set(VERSION_REVISION 2)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(BUILD "${BUILD}-debug")
|
||||
endif()
|
||||
|
||||
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
|
||||
|
||||
if(SIZEOF_SIZE_T EQUAL SIZEOF_UNSIGNED_LONG)
|
||||
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
|
||||
HAVE_BUILTIN_CTZL)
|
||||
endif()
|
||||
if(MSVC)
|
||||
check_include_files("intrin.h" HAVE_INTRIN_H)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
# Check for headers
|
||||
check_include_files(locale.h HAVE_LOCALE_H)
|
||||
check_include_files(stddef.h HAVE_STDDEF_H)
|
||||
check_include_files(stdlib.h HAVE_STDLIB_H)
|
||||
check_include_files(sys/types.h NEED_SYS_TYPES_H)
|
||||
|
||||
# Other predefines
|
||||
# undef NEED_BSD_STRINGS
|
||||
ocv_update(HAVE_UNSIGNED_CHAR 1)
|
||||
ocv_update(HAVE_UNSIGNED_SHORT 1)
|
||||
# undef INCOMPLETE_TYPES_BROKEN
|
||||
ocv_update(RIGHT_SHIFT_IS_UNSIGNED 0)
|
||||
ocv_update(__CHAR_UNSIGNED__ 0)
|
||||
endif()
|
||||
|
||||
|
||||
set(BITS_IN_JSAMPLE 8)
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(D_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB_VERSION 62)
|
||||
|
||||
# OpenCV
|
||||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-W3 -wd4996 -wd4018)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
configure_file(jconfig.h.win.in jconfig.h)
|
||||
else()
|
||||
configure_file(jconfig.h.in jconfig.h)
|
||||
endif()
|
||||
configure_file(jconfigint.h.in jconfigint.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||
endif()
|
||||
|
||||
# No SIMD
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
|
||||
|
||||
ocv_list_add_prefix(JPEG_SOURCES src/)
|
||||
|
||||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||
COMPILE_PDB_NAME ${JPEG_LIBRARY}
|
||||
COMPILE_PDB_NAME_DEBUG "${JPEG_LIBRARY}${OPENCV_DEBUG_POSTFIX}"
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg)
|
||||
Vendored
+132
@@ -0,0 +1,132 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
||||
|
||||
- The IJG (Independent JPEG Group) License, which is listed in
|
||||
[README.ijg](README.ijg)
|
||||
|
||||
This license applies to the libjpeg API library and associated programs
|
||||
(any code inherited from libjpeg, and any modifications to that code.)
|
||||
|
||||
- The Modified (3-clause) BSD License, which is listed below
|
||||
|
||||
This license covers the TurboJPEG API library and associated programs, as
|
||||
well as the build system.
|
||||
|
||||
- The [zlib License](https://opensource.org/licenses/Zlib)
|
||||
|
||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||
SIMD extensions.
|
||||
|
||||
|
||||
Complying with the libjpeg-turbo Licenses
|
||||
=========================================
|
||||
|
||||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
|
||||
best of our understanding.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
|
||||
1. You cannot alter or remove any existing copyright or license notices
|
||||
from the source.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 1 of the Modified BSD License
|
||||
- Clauses 1 and 3 of the zlib License
|
||||
|
||||
2. You must add your own copyright notice to the header of each source
|
||||
file you modified, so others can tell that you modified that file (if
|
||||
there is not an existing copyright header in that file, then you can
|
||||
simply add a notice stating that you modified the file.)
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
- Clause 2 of the zlib License
|
||||
|
||||
3. You must include the IJG README file, and you must not alter any of the
|
||||
copyright or license text in that file.
|
||||
|
||||
**Origin**
|
||||
- Clause 1 of the IJG License
|
||||
|
||||
2. If you are distributing only libjpeg-turbo binaries without the source, or
|
||||
if you are distributing an application that statically links with
|
||||
libjpeg-turbo, then:
|
||||
|
||||
1. Your product documentation must include a message stating:
|
||||
|
||||
This software is based in part on the work of the Independent JPEG
|
||||
Group.
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the IJG license
|
||||
|
||||
2. If your binary distribution includes or uses the TurboJPEG API, then
|
||||
your product documentation must include the text of the Modified BSD
|
||||
License (see below.)
|
||||
|
||||
**Origin**
|
||||
- Clause 2 of the Modified BSD License
|
||||
|
||||
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the
|
||||
contributors thereof in advertising, publicity, etc.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Clause 3 of the Modified BSD License
|
||||
|
||||
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be
|
||||
free of defects, nor do we accept any liability for undesirable
|
||||
consequences resulting from your use of the software.
|
||||
|
||||
**Origin**
|
||||
- IJG License
|
||||
- Modified BSD License
|
||||
- zlib License
|
||||
|
||||
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)2009-2019 D. R. Commander. All Rights Reserved.
|
||||
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of the libjpeg-turbo Project nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS",
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Why Three Licenses?
|
||||
===================
|
||||
|
||||
The zlib License could have been used instead of the Modified (3-clause) BSD
|
||||
License, and since the IJG License effectively subsumes the distribution
|
||||
conditions of the zlib License, this would have effectively placed
|
||||
libjpeg-turbo binary distributions under the IJG License. However, the IJG
|
||||
License specifically refers to the Independent JPEG Group and does not extend
|
||||
attribution and endorsement protections to other entities. Thus, it was
|
||||
desirable to choose a license that granted us the same protections for new code
|
||||
that were granted to the IJG for code derived from their software.
|
||||
Vendored
+277
@@ -0,0 +1,277 @@
|
||||
libjpeg-turbo note: This file has been modified by The libjpeg-turbo Project
|
||||
to include only information relevant to libjpeg-turbo, to wordsmith certain
|
||||
sections, and to remove impolitic language that existed in the libjpeg v8
|
||||
README. It is included only for reference. Please see README.md for
|
||||
information specific to libjpeg-turbo.
|
||||
|
||||
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
This distribution contains a release of the Independent JPEG Group's free JPEG
|
||||
software. You are welcome to redistribute this software and 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,
|
||||
Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
|
||||
Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
||||
and other members of the Independent JPEG Group.
|
||||
|
||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||
(also known as JPEG, together with ITU-T SG16).
|
||||
|
||||
|
||||
DOCUMENTATION ROADMAP
|
||||
=====================
|
||||
|
||||
This file contains the following sections:
|
||||
|
||||
OVERVIEW General description of JPEG and the IJG software.
|
||||
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
|
||||
REFERENCES Where to learn more about JPEG.
|
||||
ARCHIVE LOCATIONS Where to find newer versions of this software.
|
||||
FILE FORMAT WARS Software *not* to get.
|
||||
TO DO Plans for future IJG releases.
|
||||
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.txt Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
|
||||
Please read at least usage.txt. Some information can also be found in the JPEG
|
||||
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
|
||||
out where to obtain the FAQ article.
|
||||
|
||||
If you want to understand how the JPEG code works, we suggest reading one or
|
||||
more of the REFERENCES, then looking at the documentation files (in roughly
|
||||
the order listed) before diving into the code.
|
||||
|
||||
|
||||
OVERVIEW
|
||||
========
|
||||
|
||||
This package contains C software to implement JPEG image encoding, decoding,
|
||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||
method for full-color and grayscale images. JPEG's strong suit is compressing
|
||||
photographic images or other types of images that have smooth color and
|
||||
brightness transitions between neighboring pixels. Images with sharp lines or
|
||||
other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
images.
|
||||
|
||||
JPEG is lossy, meaning that the output pixels are not necessarily identical to
|
||||
the input pixels. However, on photographic content and other "smooth" images,
|
||||
very good compression ratios can be obtained with no visible compression
|
||||
artifacts, and extremely high compression ratios are possible if you are
|
||||
willing to sacrifice image quality (by reducing the "quality" setting in the
|
||||
compressor.)
|
||||
|
||||
This software implements JPEG baseline, extended-sequential, and progressive
|
||||
compression processes. Provision is made for supporting all variants of these
|
||||
processes, although some uncommon parameter settings aren't implemented yet.
|
||||
We have made no provision for supporting the hierarchical or lossless
|
||||
processes defined in the standard.
|
||||
|
||||
We provide a set of library routines for reading and writing JPEG image files,
|
||||
plus two sample applications "cjpeg" and "djpeg", which use the library to
|
||||
perform conversion between JPEG and some other popular image file formats.
|
||||
The library is intended to be reused in other applications.
|
||||
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats or
|
||||
colormapped displays. These extra functions can be compiled out of the
|
||||
library if not required for a particular application.
|
||||
|
||||
We have also included "jpegtran", a utility for lossless transcoding between
|
||||
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
|
||||
applications for inserting and extracting textual comments in JFIF files.
|
||||
|
||||
The emphasis in designing this software has been on achieving portability and
|
||||
flexibility, while also making it fast enough to be useful. In particular,
|
||||
the software is not intended to be read as a tutorial on JPEG. (See the
|
||||
REFERENCES section for introductory material.) Rather, it is intended to
|
||||
be reliable, portable, industrial-strength code. We do not claim to have
|
||||
achieved that goal in every aspect of the software, but we strive for it.
|
||||
|
||||
We welcome the use of this software as a component of commercial products.
|
||||
No royalty is required, but we do ask for an acknowledgement in product
|
||||
documentation, as described under LEGAL ISSUES.
|
||||
|
||||
|
||||
LEGAL ISSUES
|
||||
============
|
||||
|
||||
In plain English:
|
||||
|
||||
1. We don't promise that this software works. (But if you find any bugs,
|
||||
please let us know!)
|
||||
2. You can use this software for whatever you want. You don't have to pay us.
|
||||
3. You may not pretend that you wrote this software. If you use it in a
|
||||
program, you must acknowledge somewhere in your documentation that
|
||||
you've used the IJG code.
|
||||
|
||||
In legalese:
|
||||
|
||||
The authors make NO WARRANTY or representation, either express or implied,
|
||||
with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
software (or portions thereof) for any purpose, without fee, subject to these
|
||||
conditions:
|
||||
(1) If any part of the source code for this software is distributed, then this
|
||||
README file must be included, with this copyright and no-warranty notice
|
||||
unaltered; and any additions, deletions, or changes to the original files
|
||||
must be clearly indicated in accompanying documentation.
|
||||
(2) If only executable code is distributed, then the accompanying
|
||||
documentation must state that "this software is based in part on the work of
|
||||
the Independent JPEG Group".
|
||||
(3) Permission for use of this software is granted only if the user accepts
|
||||
full responsibility for any undesirable consequences; the authors accept
|
||||
NO LIABILITY for damages of any kind.
|
||||
|
||||
These conditions apply to any software derived from or based on the IJG code,
|
||||
not just to the unmodified library. If you use our work, you ought to
|
||||
acknowledge us.
|
||||
|
||||
Permission is NOT granted for the use of any IJG author's name or company name
|
||||
in advertising or publicity relating to this software or products derived from
|
||||
it. This software may be referred to only as "the Independent JPEG Group's
|
||||
software".
|
||||
|
||||
We specifically permit and encourage the use of this software as the basis of
|
||||
commercial products, provided that all warranty or liability claims are
|
||||
assumed by the product vendor.
|
||||
|
||||
|
||||
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.
|
||||
|
||||
We are required to state that
|
||||
"The Graphics Interchange Format(c) is the Copyright property of
|
||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of
|
||||
CompuServe Incorporated."
|
||||
|
||||
|
||||
REFERENCES
|
||||
==========
|
||||
|
||||
We recommend reading one or more of these references before trying to
|
||||
understand the innards of the JPEG software.
|
||||
|
||||
The best short technical introduction to the JPEG compression algorithm is
|
||||
Wallace, Gregory K. "The JPEG Still Picture Compression Standard",
|
||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||
handy, a PDF file containing a revised version of Wallace's article is
|
||||
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
|
||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||
omits the sample images that appeared in CACM, but it includes corrections
|
||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||
and it may not be used for commercial purposes.
|
||||
|
||||
A somewhat less technical, more leisurely introduction to JPEG can be found in
|
||||
"The Data Compression Book" by Mark Nelson and Jean-loup Gailly, published by
|
||||
M&T Books (New York), 2nd ed. 1996, ISBN 1-55851-434-1. This book provides
|
||||
good explanations and example C code for a multitude of compression methods
|
||||
including JPEG. It is an excellent source if you are comfortable reading C
|
||||
code but don't know much about data compression in general. The book's JPEG
|
||||
sample code is far from industrial-strength, but when you are ready to look
|
||||
at a full implementation, you've got one here...
|
||||
|
||||
The best currently available description of JPEG is the textbook "JPEG Still
|
||||
Image Data Compression Standard" by William B. Pennebaker and Joan L.
|
||||
Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
|
||||
Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
|
||||
standards (DIS 10918-1 and draft DIS 10918-2).
|
||||
|
||||
The original JPEG standard is divided into two parts, Part 1 being the actual
|
||||
specification, while Part 2 covers compliance testing methods. Part 1 is
|
||||
titled "Digital Compression and Coding of Continuous-tone Still Images,
|
||||
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
|
||||
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
|
||||
Continuous-tone Still Images, Part 2: Compliance testing" and has document
|
||||
numbers ISO/IEC IS 10918-2, ITU-T T.83.
|
||||
|
||||
The JPEG standard does not specify all details of an interchangeable file
|
||||
format. For the omitted details, we follow the "JFIF" conventions, revision
|
||||
1.02. JFIF version 1 has been adopted as ISO/IEC 10918-5 (05/2013) and
|
||||
Recommendation ITU-T T.871 (05/2011): Information technology - Digital
|
||||
compression and coding of continuous-tone still images: JPEG File Interchange
|
||||
Format (JFIF). It is available as a free download in PDF file format from
|
||||
https://www.iso.org/standard/54989.html and http://www.itu.int/rec/T-REC-T.871.
|
||||
A PDF file of the older JFIF 1.02 specification is available at
|
||||
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||
|
||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||
found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
|
||||
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
|
||||
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
|
||||
(Compression tag 7). Copies of this Note can be obtained from
|
||||
http://www.ijg.org/files/. It is expected that the next revision
|
||||
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
|
||||
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
|
||||
uses our library to implement TIFF/JPEG per the Note.
|
||||
|
||||
|
||||
ARCHIVE LOCATIONS
|
||||
=================
|
||||
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files".
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
It is available on the World Wide Web at http://www.faqs.org/faqs/jpeg-faq/
|
||||
and other news.answers archive sites, including the official news.answers
|
||||
archive at rtfm.mit.edu: ftp://rtfm.mit.edu/pub/usenet/news.answers/jpeg-faq/.
|
||||
If you don't have Web or FTP access, send e-mail to mail-server@rtfm.mit.edu
|
||||
with body
|
||||
send usenet/news.answers/jpeg-faq/part1
|
||||
send usenet/news.answers/jpeg-faq/part2
|
||||
|
||||
|
||||
FILE FORMAT COMPATIBILITY
|
||||
=========================
|
||||
|
||||
This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
|
||||
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
|
||||
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
|
||||
a subset thereof, but there are other formats containing the name "JPEG" that
|
||||
are incompatible with the DCT-based JPEG standard or with JFIF (for instance,
|
||||
JPEG 2000 and JPEG XR). This software therefore does not support these
|
||||
formats. Indeed, one of the original reasons for developing this free software
|
||||
was to help force convergence on a common, interoperable format standard for
|
||||
JPEG files.
|
||||
|
||||
JFIF is a minimal or "low end" representation. TIFF/JPEG (TIFF revision 6.0 as
|
||||
modified by TIFF Technical Note #2) can be used for "high end" applications
|
||||
that need to record a lot of additional data about an image.
|
||||
|
||||
|
||||
TO DO
|
||||
=====
|
||||
|
||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||
Vendored
+346
@@ -0,0 +1,346 @@
|
||||
Background
|
||||
==========
|
||||
|
||||
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
AVX2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression
|
||||
on x86, x86-64, ARM, and PowerPC systems, as well as progressive JPEG
|
||||
compression on x86 and x86-64 systems. On such systems, libjpeg-turbo is
|
||||
generally 2-6x as fast as libjpeg, all else being equal. On other types of
|
||||
systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by
|
||||
virtue of its highly-optimized Huffman coding routines. In many cases, the
|
||||
performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs.
|
||||
|
||||
libjpeg-turbo implements both the traditional libjpeg API as well as the less
|
||||
powerful but more straightforward TurboJPEG API. libjpeg-turbo also features
|
||||
colorspace extensions that allow it to compress from/decompress to 32-bit and
|
||||
big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java
|
||||
interface.
|
||||
|
||||
libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated
|
||||
derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses.
|
||||
Refer to [LICENSE.md](LICENSE.md) for a roll-up of license terms.
|
||||
|
||||
|
||||
Building libjpeg-turbo
|
||||
======================
|
||||
|
||||
Refer to [BUILDING.md](BUILDING.md) for complete instructions.
|
||||
|
||||
|
||||
Using libjpeg-turbo
|
||||
===================
|
||||
|
||||
libjpeg-turbo includes two APIs that can be used to compress and decompress
|
||||
JPEG images:
|
||||
|
||||
- **TurboJPEG API**<br>
|
||||
This API provides an easy-to-use interface for compressing and decompressing
|
||||
JPEG images in memory. It also provides some functionality that would not be
|
||||
straightforward to achieve using the underlying libjpeg API, such as
|
||||
generating planar YUV images and performing multiple simultaneous lossless
|
||||
transforms on an image. The Java interface for libjpeg-turbo is written on
|
||||
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
|
||||
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
|
||||
[TJExample.java](java/TJExample.java) for examples of its usage and to
|
||||
<http://libjpeg-turbo.org/Documentation/Documentation> for API documentation.
|
||||
|
||||
- **libjpeg API**<br>
|
||||
This is the de facto industry-standard API for compressing and decompressing
|
||||
JPEG images. It is more difficult to use than the TurboJPEG API but also
|
||||
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
|
||||
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
|
||||
Colorspace Extensions
|
||||
---------------------
|
||||
|
||||
libjpeg-turbo includes extensions that allow JPEG images to be compressed
|
||||
directly from (and decompressed directly to) buffers that use BGR, BGRX,
|
||||
RGBX, XBGR, and XRGB pixel ordering. This is implemented with ten new
|
||||
colorspace constants:
|
||||
|
||||
JCS_EXT_RGB /* red/green/blue */
|
||||
JCS_EXT_RGBX /* red/green/blue/x */
|
||||
JCS_EXT_BGR /* blue/green/red */
|
||||
JCS_EXT_BGRX /* blue/green/red/x */
|
||||
JCS_EXT_XBGR /* x/blue/green/red */
|
||||
JCS_EXT_XRGB /* x/red/green/blue */
|
||||
JCS_EXT_RGBA /* red/green/blue/alpha */
|
||||
JCS_EXT_BGRA /* blue/green/red/alpha */
|
||||
JCS_EXT_ABGR /* alpha/blue/green/red */
|
||||
JCS_EXT_ARGB /* alpha/red/green/blue */
|
||||
|
||||
Setting `cinfo.in_color_space` (compression) or `cinfo.out_color_space`
|
||||
(decompression) to one of these values will cause libjpeg-turbo to read the
|
||||
red, green, and blue values from (or write them to) the appropriate position in
|
||||
the pixel when compressing from/decompressing to an RGB buffer.
|
||||
|
||||
Your application can check for the existence of these extensions at compile
|
||||
time with:
|
||||
|
||||
#ifdef JCS_EXTENSIONS
|
||||
|
||||
At run time, attempting to use these extensions with a libjpeg implementation
|
||||
that does not support them will result in a "Bogus input colorspace" error.
|
||||
Applications can trap this error in order to test whether run-time support is
|
||||
available for the colorspace extensions.
|
||||
|
||||
When using the RGBX, BGRX, XBGR, and XRGB colorspaces during decompression, the
|
||||
X byte is undefined, and in order to ensure the best performance, libjpeg-turbo
|
||||
can set that byte to whatever value it wishes. If an application expects the X
|
||||
byte to be used as an alpha channel, then it should specify `JCS_EXT_RGBA`,
|
||||
`JCS_EXT_BGRA`, `JCS_EXT_ABGR`, or `JCS_EXT_ARGB`. When these colorspace
|
||||
constants are used, the X byte is guaranteed to be 0xFF, which is interpreted
|
||||
as opaque.
|
||||
|
||||
Your application can check for the existence of the alpha channel colorspace
|
||||
extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
|
||||
how to check for the existence of the colorspace extensions at compile time and
|
||||
run time.
|
||||
|
||||
libjpeg v7 and v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
|
||||
With libjpeg v7 and v8, new features were added that necessitated extending the
|
||||
compression and decompression structures. Unfortunately, due to the exposed
|
||||
nature of those structures, extending them also necessitated breaking backward
|
||||
ABI compatibility with previous libjpeg releases. Thus, programs that were
|
||||
built to use libjpeg v7 or v8 did not work with libjpeg-turbo, since it is
|
||||
based on the libjpeg v6b code base. Although libjpeg v7 and v8 are not
|
||||
as widely used as v6b, enough programs (including a few Linux distros) made
|
||||
the switch that there was a demand to emulate the libjpeg v7 and v8 ABIs
|
||||
in libjpeg-turbo. It should be noted, however, that this feature was added
|
||||
primarily so that applications that had already been compiled to use libjpeg
|
||||
v7+ could take advantage of accelerated baseline JPEG encoding/decoding
|
||||
without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
cases (see below.)
|
||||
|
||||
By passing an argument of `--with-jpeg7` or `--with-jpeg8` to `configure`, or
|
||||
an argument of `-DWITH_JPEG7=1` or `-DWITH_JPEG8=1` to `cmake`, you can build a
|
||||
version of libjpeg-turbo that emulates the libjpeg v7 or v8 ABI, so that
|
||||
programs that are built against libjpeg v7 or v8 can be run with libjpeg-turbo.
|
||||
The following section describes which libjpeg v7+ features are supported and
|
||||
which aren't.
|
||||
|
||||
### Support for libjpeg v7 and v8 Features
|
||||
|
||||
#### Fully supported
|
||||
|
||||
- **libjpeg: IDCT scaling extensions in decompressor**<br>
|
||||
libjpeg-turbo supports IDCT scaling with scaling factors of 1/8, 1/4, 3/8,
|
||||
1/2, 5/8, 3/4, 7/8, 9/8, 5/4, 11/8, 3/2, 13/8, 7/4, 15/8, and 2/1 (only 1/4
|
||||
and 1/2 are SIMD-accelerated.)
|
||||
|
||||
- **libjpeg: Arithmetic coding**
|
||||
|
||||
- **libjpeg: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
Note that the libpjeg v7+ API was extended to accommodate this feature only
|
||||
for convenience purposes. It has always been possible to implement this
|
||||
feature with libjpeg v6b (see rdswitch.c for an example.)
|
||||
|
||||
- **cjpeg: 32-bit BMP support**
|
||||
|
||||
- **cjpeg: `-rgb` option**
|
||||
|
||||
- **jpegtran: Lossless cropping**
|
||||
|
||||
- **jpegtran: `-perfect` option**
|
||||
|
||||
- **jpegtran: Forcing width/height when performing lossless crop**
|
||||
|
||||
- **rdjpgcom: `-raw` option**
|
||||
|
||||
- **rdjpgcom: Locale awareness**
|
||||
|
||||
|
||||
#### Not supported
|
||||
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. The reader is invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw his/her own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
There is no technical reason why DCT scaling could not be supported when
|
||||
emulating the libjpeg v7+ API/ABI, but without the SmartScale extension (see
|
||||
below), only scaling factors of 1/2, 8/15, 4/7, 8/13, 2/3, 8/11, 4/5, and
|
||||
8/9 would be available, which is of limited usefulness.
|
||||
|
||||
- **libjpeg: SmartScale**<br>
|
||||
`cinfo.block_size` is silently ignored.
|
||||
SmartScale is an extension to the JPEG format that allows for DCT block
|
||||
sizes other than 8x8. Providing support for this new format would be
|
||||
feasible (particularly without full acceleration.) However, until/unless
|
||||
the format becomes either an official industry standard or, at minimum, an
|
||||
accepted solution in the community, we are hesitant to implement it, as
|
||||
there is no sense of whether or how it might change in the future. It is
|
||||
our belief that SmartScale has not demonstrated sufficient usefulness as a
|
||||
lossless format nor as a means of quality enhancement, and thus our primary
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
- **jpegtran: Scaling**<br>
|
||||
This requires both the DCT scaling and SmartScale features, which are not
|
||||
supported.
|
||||
|
||||
- **Lossless RGB JPEG files**<br>
|
||||
This requires the SmartScale feature, which is not supported.
|
||||
|
||||
### What About libjpeg v9?
|
||||
|
||||
libjpeg v9 introduced yet another field to the JPEG compression structure
|
||||
(`color_transform`), thus making the ABI backward incompatible with that of
|
||||
libjpeg v8. This new field was introduced solely for the purpose of supporting
|
||||
lossless SmartScale encoding. Furthermore, there was actually no reason to
|
||||
extend the API in this manner, as the color transform could have just as easily
|
||||
been activated by way of a new JPEG colorspace constant, thus preserving
|
||||
backward ABI compatibility.
|
||||
|
||||
Our research (see link above) has shown that lossless SmartScale does not
|
||||
generally accomplish anything that can't already be accomplished better with
|
||||
existing, standard lossless formats. Therefore, at this time it is our belief
|
||||
that there is not sufficient technical justification for software projects to
|
||||
upgrade from libjpeg v8 to libjpeg v9, and thus there is not sufficient
|
||||
technical justification for us to emulate the libjpeg v9 ABI.
|
||||
|
||||
In-Memory Source/Destination Managers
|
||||
-------------------------------------
|
||||
|
||||
By default, libjpeg-turbo 1.3 and later includes the `jpeg_mem_src()` and
|
||||
`jpeg_mem_dest()` functions, even when not emulating the libjpeg v8 API/ABI.
|
||||
Previously, it was necessary to build libjpeg-turbo from source with libjpeg v8
|
||||
API/ABI emulation in order to use the in-memory source/destination managers,
|
||||
but several projects requested that those functions be included when emulating
|
||||
the libjpeg v6b API/ABI as well. This allows the use of those functions by
|
||||
programs that need them, without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of `--without-mem-srcdst` to `configure` or
|
||||
an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to building
|
||||
libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||
libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.1.0 to 62.2.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.1.0 to 7.2.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
`jpeg_mem_dest()`, that program will not fail if run against an older version
|
||||
of libjpeg-turbo or against libjpeg v7- until the program actually tries to
|
||||
call `jpeg_mem_src()` or `jpeg_mem_dest()`. Such is not the case on Windows.
|
||||
If a program is built against the libjpeg-turbo 1.3+ DLL and uses
|
||||
`jpeg_mem_src()` or `jpeg_mem_dest()`, then it must use the libjpeg-turbo 1.3+
|
||||
DLL at run time.
|
||||
|
||||
Both cjpeg and djpeg have been extended to allow testing the in-memory
|
||||
source/destination manager functions. See their respective man pages for more
|
||||
details.
|
||||
|
||||
|
||||
Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
|
||||
following reasons:
|
||||
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
|
||||
slightly more accurate than the implementation in libjpeg v6b, but not by
|
||||
any amount perceptible to human vision (generally in the range of 0.01 to
|
||||
0.08 dB gain in PNSR.)
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the slow integer IDCT. The floating
|
||||
point DCT/IDCT algorithms are mainly a legacy feature, and they do not
|
||||
produce significantly more accuracy than the slow integer algorithms (to put
|
||||
numbers on this, the typical difference in PNSR between the two algorithms
|
||||
is less than 0.10 dB, whereas changing the quality level by 1 in the upper
|
||||
range of the quality scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
cases in which libjpeg-turbo cannot be expected to produce the same output as
|
||||
libjpeg v8:
|
||||
|
||||
- When decompressing using scaling factors of 1/2 and 1/4, because libjpeg v8
|
||||
implements those scaling algorithms differently than libjpeg v6b does, and
|
||||
libjpeg-turbo's SIMD extensions are based on the libjpeg v6b behavior.
|
||||
|
||||
- When using chrominance subsampling, because libjpeg v8 implements this
|
||||
with its DCT/IDCT scaling algorithms rather than with a separate
|
||||
downsampling/upsampling algorithm. In our testing, the subsampled/upsampled
|
||||
output of libjpeg v8 is less accurate than that of libjpeg v6b for this
|
||||
reason.
|
||||
|
||||
- When decompressing using a scaling factor > 1 and merged (AKA "non-fancy" or
|
||||
"non-smooth") chrominance upsampling, because libjpeg v8 does not support
|
||||
merged upsampling with scaling factors > 1.
|
||||
|
||||
|
||||
Performance Pitfalls
|
||||
====================
|
||||
|
||||
Restart Markers
|
||||
---------------
|
||||
|
||||
The optimized Huffman decoder in libjpeg-turbo does not handle restart markers
|
||||
in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
has restart markers. This can cause the decompression performance to drop by
|
||||
as much as 20%, but the performance will still be much greater than that of
|
||||
libjpeg. Many consumer packages, such as PhotoShop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
Fast Integer Forward DCT at High Quality Levels
|
||||
-----------------------------------------------
|
||||
|
||||
The algorithm used by the SIMD-accelerated quantization function cannot produce
|
||||
correct results whenever the fast integer forward DCT is used along with a JPEG
|
||||
quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
Vendored
+73
@@ -0,0 +1,73 @@
|
||||
/* Version ID for the JPEG library.
|
||||
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 60".
|
||||
*/
|
||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||
|
||||
/* libjpeg-turbo version */
|
||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||
|
||||
/* libjpeg-turbo version in integer form */
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you need to include <sys/types.h> to get size_t. */
|
||||
#cmakedefine NEED_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
|
||||
memset/memcpy in <string.h>. */
|
||||
#cmakedefine NEED_BSD_STRINGS 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned char'. */
|
||||
#cmakedefine HAVE_UNSIGNED_CHAR 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned short'. */
|
||||
#cmakedefine HAVE_UNSIGNED_SHORT 1
|
||||
|
||||
/* Compiler does not support pointers to undefined structures. */
|
||||
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
|
||||
|
||||
/* Define if your (broken) compiler shifts signed values as if they were
|
||||
unsigned. */
|
||||
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
|
||||
|
||||
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#cmakedefine __CHAR_UNSIGNED__ 1
|
||||
#endif
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
#cmakedefine WITH_SIMD
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
#undef __CHAR_UNSIGNED__
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/* libjpeg-turbo build number */
|
||||
#define BUILD "@BUILD@"
|
||||
|
||||
/* Compiler's inline keyword */
|
||||
#undef inline
|
||||
|
||||
/* How to obtain function inlining. */
|
||||
#ifndef INLINE
|
||||
#if defined(__GNUC__)
|
||||
#define INLINE inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define INLINE __forceinline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "@CMAKE_PROJECT_NAME@"
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "@VERSION@"
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||
|
||||
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
|
||||
#cmakedefine HAVE_BUILTIN_CTZL
|
||||
|
||||
/* Define to 1 if you have the <intrin.h> header file. */
|
||||
#cmakedefine HAVE_INTRIN_H
|
||||
|
||||
#if defined(_MSC_VER) && defined(HAVE_INTRIN_H)
|
||||
#if (SIZEOF_SIZE_T == 8)
|
||||
#define HAVE_BITSCANFORWARD64
|
||||
#elif (SIZEOF_SIZE_T == 4)
|
||||
#define HAVE_BITSCANFORWARD
|
||||
#endif
|
||||
#endif
|
||||
Vendored
+157
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* jaricom.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, 2018, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains probability estimation tables for common use in
|
||||
* arithmetic entropy encoding and decoding routines.
|
||||
*
|
||||
* This data represents Table D.2 in
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994 and Table 24 in
|
||||
* Recommendation ITU-T T.82 (1993) | ISO/IEC 11544:1993.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
/* The following #define specifies the packing of the four components
|
||||
* into the compact JLONG representation.
|
||||
* Note that this formula must match the actual arithmetic encoder
|
||||
* and decoder implementation. The implementation has to be changed
|
||||
* if this formula is changed.
|
||||
* The current organization is leaned on Markus Kuhn's JBIG
|
||||
* implementation (jbig_tab.c).
|
||||
*/
|
||||
|
||||
#define V(i, a, b, c, d) \
|
||||
(((JLONG)a << 16) | ((JLONG)c << 8) | ((JLONG)d << 7) | b)
|
||||
|
||||
const JLONG jpeg_aritab[113 + 1] = {
|
||||
/*
|
||||
* Index, Qe_Value, Next_Index_LPS, Next_Index_MPS, Switch_MPS
|
||||
*/
|
||||
V( 0, 0x5a1d, 1, 1, 1 ),
|
||||
V( 1, 0x2586, 14, 2, 0 ),
|
||||
V( 2, 0x1114, 16, 3, 0 ),
|
||||
V( 3, 0x080b, 18, 4, 0 ),
|
||||
V( 4, 0x03d8, 20, 5, 0 ),
|
||||
V( 5, 0x01da, 23, 6, 0 ),
|
||||
V( 6, 0x00e5, 25, 7, 0 ),
|
||||
V( 7, 0x006f, 28, 8, 0 ),
|
||||
V( 8, 0x0036, 30, 9, 0 ),
|
||||
V( 9, 0x001a, 33, 10, 0 ),
|
||||
V( 10, 0x000d, 35, 11, 0 ),
|
||||
V( 11, 0x0006, 9, 12, 0 ),
|
||||
V( 12, 0x0003, 10, 13, 0 ),
|
||||
V( 13, 0x0001, 12, 13, 0 ),
|
||||
V( 14, 0x5a7f, 15, 15, 1 ),
|
||||
V( 15, 0x3f25, 36, 16, 0 ),
|
||||
V( 16, 0x2cf2, 38, 17, 0 ),
|
||||
V( 17, 0x207c, 39, 18, 0 ),
|
||||
V( 18, 0x17b9, 40, 19, 0 ),
|
||||
V( 19, 0x1182, 42, 20, 0 ),
|
||||
V( 20, 0x0cef, 43, 21, 0 ),
|
||||
V( 21, 0x09a1, 45, 22, 0 ),
|
||||
V( 22, 0x072f, 46, 23, 0 ),
|
||||
V( 23, 0x055c, 48, 24, 0 ),
|
||||
V( 24, 0x0406, 49, 25, 0 ),
|
||||
V( 25, 0x0303, 51, 26, 0 ),
|
||||
V( 26, 0x0240, 52, 27, 0 ),
|
||||
V( 27, 0x01b1, 54, 28, 0 ),
|
||||
V( 28, 0x0144, 56, 29, 0 ),
|
||||
V( 29, 0x00f5, 57, 30, 0 ),
|
||||
V( 30, 0x00b7, 59, 31, 0 ),
|
||||
V( 31, 0x008a, 60, 32, 0 ),
|
||||
V( 32, 0x0068, 62, 33, 0 ),
|
||||
V( 33, 0x004e, 63, 34, 0 ),
|
||||
V( 34, 0x003b, 32, 35, 0 ),
|
||||
V( 35, 0x002c, 33, 9, 0 ),
|
||||
V( 36, 0x5ae1, 37, 37, 1 ),
|
||||
V( 37, 0x484c, 64, 38, 0 ),
|
||||
V( 38, 0x3a0d, 65, 39, 0 ),
|
||||
V( 39, 0x2ef1, 67, 40, 0 ),
|
||||
V( 40, 0x261f, 68, 41, 0 ),
|
||||
V( 41, 0x1f33, 69, 42, 0 ),
|
||||
V( 42, 0x19a8, 70, 43, 0 ),
|
||||
V( 43, 0x1518, 72, 44, 0 ),
|
||||
V( 44, 0x1177, 73, 45, 0 ),
|
||||
V( 45, 0x0e74, 74, 46, 0 ),
|
||||
V( 46, 0x0bfb, 75, 47, 0 ),
|
||||
V( 47, 0x09f8, 77, 48, 0 ),
|
||||
V( 48, 0x0861, 78, 49, 0 ),
|
||||
V( 49, 0x0706, 79, 50, 0 ),
|
||||
V( 50, 0x05cd, 48, 51, 0 ),
|
||||
V( 51, 0x04de, 50, 52, 0 ),
|
||||
V( 52, 0x040f, 50, 53, 0 ),
|
||||
V( 53, 0x0363, 51, 54, 0 ),
|
||||
V( 54, 0x02d4, 52, 55, 0 ),
|
||||
V( 55, 0x025c, 53, 56, 0 ),
|
||||
V( 56, 0x01f8, 54, 57, 0 ),
|
||||
V( 57, 0x01a4, 55, 58, 0 ),
|
||||
V( 58, 0x0160, 56, 59, 0 ),
|
||||
V( 59, 0x0125, 57, 60, 0 ),
|
||||
V( 60, 0x00f6, 58, 61, 0 ),
|
||||
V( 61, 0x00cb, 59, 62, 0 ),
|
||||
V( 62, 0x00ab, 61, 63, 0 ),
|
||||
V( 63, 0x008f, 61, 32, 0 ),
|
||||
V( 64, 0x5b12, 65, 65, 1 ),
|
||||
V( 65, 0x4d04, 80, 66, 0 ),
|
||||
V( 66, 0x412c, 81, 67, 0 ),
|
||||
V( 67, 0x37d8, 82, 68, 0 ),
|
||||
V( 68, 0x2fe8, 83, 69, 0 ),
|
||||
V( 69, 0x293c, 84, 70, 0 ),
|
||||
V( 70, 0x2379, 86, 71, 0 ),
|
||||
V( 71, 0x1edf, 87, 72, 0 ),
|
||||
V( 72, 0x1aa9, 87, 73, 0 ),
|
||||
V( 73, 0x174e, 72, 74, 0 ),
|
||||
V( 74, 0x1424, 72, 75, 0 ),
|
||||
V( 75, 0x119c, 74, 76, 0 ),
|
||||
V( 76, 0x0f6b, 74, 77, 0 ),
|
||||
V( 77, 0x0d51, 75, 78, 0 ),
|
||||
V( 78, 0x0bb6, 77, 79, 0 ),
|
||||
V( 79, 0x0a40, 77, 48, 0 ),
|
||||
V( 80, 0x5832, 80, 81, 1 ),
|
||||
V( 81, 0x4d1c, 88, 82, 0 ),
|
||||
V( 82, 0x438e, 89, 83, 0 ),
|
||||
V( 83, 0x3bdd, 90, 84, 0 ),
|
||||
V( 84, 0x34ee, 91, 85, 0 ),
|
||||
V( 85, 0x2eae, 92, 86, 0 ),
|
||||
V( 86, 0x299a, 93, 87, 0 ),
|
||||
V( 87, 0x2516, 86, 71, 0 ),
|
||||
V( 88, 0x5570, 88, 89, 1 ),
|
||||
V( 89, 0x4ca9, 95, 90, 0 ),
|
||||
V( 90, 0x44d9, 96, 91, 0 ),
|
||||
V( 91, 0x3e22, 97, 92, 0 ),
|
||||
V( 92, 0x3824, 99, 93, 0 ),
|
||||
V( 93, 0x32b4, 99, 94, 0 ),
|
||||
V( 94, 0x2e17, 93, 86, 0 ),
|
||||
V( 95, 0x56a8, 95, 96, 1 ),
|
||||
V( 96, 0x4f46, 101, 97, 0 ),
|
||||
V( 97, 0x47e5, 102, 98, 0 ),
|
||||
V( 98, 0x41cf, 103, 99, 0 ),
|
||||
V( 99, 0x3c3d, 104, 100, 0 ),
|
||||
V( 100, 0x375e, 99, 93, 0 ),
|
||||
V( 101, 0x5231, 105, 102, 0 ),
|
||||
V( 102, 0x4c0f, 106, 103, 0 ),
|
||||
V( 103, 0x4639, 107, 104, 0 ),
|
||||
V( 104, 0x415e, 103, 99, 0 ),
|
||||
V( 105, 0x5627, 105, 106, 1 ),
|
||||
V( 106, 0x50e7, 108, 107, 0 ),
|
||||
V( 107, 0x4b85, 109, 103, 0 ),
|
||||
V( 108, 0x5597, 110, 109, 0 ),
|
||||
V( 109, 0x504f, 111, 107, 0 ),
|
||||
V( 110, 0x5a10, 110, 111, 1 ),
|
||||
V( 111, 0x5522, 112, 109, 0 ),
|
||||
V( 112, 0x59eb, 112, 111, 1 ),
|
||||
/*
|
||||
* This last entry is used for fixed probability estimate of 0.5
|
||||
* as recommended in Section 10.3 Table 5 of ITU-T Rec. T.851.
|
||||
*/
|
||||
V( 113, 0x5a1d, 113, 113, 0 )
|
||||
};
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
* jcapimin.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the compression half
|
||||
* of the JPEG library. These are the "minimum" API routines that may be
|
||||
* needed in either the normal full-compression case or the transcoding-only
|
||||
* case.
|
||||
*
|
||||
* Most of the routines intended to be called directly by an application
|
||||
* are in this file or in jcapistd.c. But also see jcparam.c for
|
||||
* parameter-setup helper routines, jcomapi.c for routines shared by
|
||||
* compression and decompression, and jctrans.c for the transcoding case.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Initialization of a JPEG compression object.
|
||||
* The error manager must already be set up (in case memory manager fails).
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_CreateCompress(j_compress_ptr cinfo, int version, size_t structsize)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Guard against version mismatches between library and caller. */
|
||||
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
|
||||
if (version != JPEG_LIB_VERSION)
|
||||
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
|
||||
if (structsize != sizeof(struct jpeg_compress_struct))
|
||||
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
|
||||
(int)sizeof(struct jpeg_compress_struct), (int)structsize);
|
||||
|
||||
/* For debugging purposes, we zero the whole master structure.
|
||||
* But the application has already set the err pointer, and may have set
|
||||
* client_data, so we have to save and restore those fields.
|
||||
* Note: if application hasn't set client_data, tools like Purify may
|
||||
* complain here.
|
||||
*/
|
||||
{
|
||||
struct jpeg_error_mgr *err = cinfo->err;
|
||||
void *client_data = cinfo->client_data; /* ignore Purify complaint here */
|
||||
MEMZERO(cinfo, sizeof(struct jpeg_compress_struct));
|
||||
cinfo->err = err;
|
||||
cinfo->client_data = client_data;
|
||||
}
|
||||
cinfo->is_decompressor = FALSE;
|
||||
|
||||
/* Initialize a memory manager instance for this object */
|
||||
jinit_memory_mgr((j_common_ptr)cinfo);
|
||||
|
||||
/* Zero out pointers to permanent structures. */
|
||||
cinfo->progress = NULL;
|
||||
cinfo->dest = NULL;
|
||||
|
||||
cinfo->comp_info = NULL;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
cinfo->quant_tbl_ptrs[i] = NULL;
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
cinfo->q_scale_factor[i] = 100;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||
cinfo->dc_huff_tbl_ptrs[i] = NULL;
|
||||
cinfo->ac_huff_tbl_ptrs[i] = NULL;
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80
|
||||
/* Must do it here for emit_dqt in case jpeg_write_tables is used */
|
||||
cinfo->block_size = DCTSIZE;
|
||||
cinfo->natural_order = jpeg_natural_order;
|
||||
cinfo->lim_Se = DCTSIZE2 - 1;
|
||||
#endif
|
||||
|
||||
cinfo->script_space = NULL;
|
||||
|
||||
cinfo->input_gamma = 1.0; /* in case application forgets */
|
||||
|
||||
/* OK, I'm ready */
|
||||
cinfo->global_state = CSTATE_START;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destruction of a JPEG compression object
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_destroy_compress(j_compress_ptr cinfo)
|
||||
{
|
||||
jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Abort processing of a JPEG compression operation,
|
||||
* but don't destroy the object itself.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_abort_compress(j_compress_ptr cinfo)
|
||||
{
|
||||
jpeg_abort((j_common_ptr)cinfo); /* use common routine */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Forcibly suppress or un-suppress all quantization and Huffman tables.
|
||||
* Marks all currently defined tables as already written (if suppress)
|
||||
* or not written (if !suppress). This will control whether they get emitted
|
||||
* by a subsequent jpeg_start_compress call.
|
||||
*
|
||||
* This routine is exported for use by applications that want to produce
|
||||
* abbreviated JPEG datastreams. It logically belongs in jcparam.c, but
|
||||
* since it is called by jpeg_start_compress, we put it here --- otherwise
|
||||
* jcparam.o would be linked whether the application used it or not.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_suppress_tables(j_compress_ptr cinfo, boolean suppress)
|
||||
{
|
||||
int i;
|
||||
JQUANT_TBL *qtbl;
|
||||
JHUFF_TBL *htbl;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
if ((qtbl = cinfo->quant_tbl_ptrs[i]) != NULL)
|
||||
qtbl->sent_table = suppress;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||
if ((htbl = cinfo->dc_huff_tbl_ptrs[i]) != NULL)
|
||||
htbl->sent_table = suppress;
|
||||
if ((htbl = cinfo->ac_huff_tbl_ptrs[i]) != NULL)
|
||||
htbl->sent_table = suppress;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finish JPEG compression.
|
||||
*
|
||||
* If a multipass operating mode was selected, this may do a great deal of
|
||||
* work including most of the actual output.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_finish_compress(j_compress_ptr cinfo)
|
||||
{
|
||||
JDIMENSION iMCU_row;
|
||||
|
||||
if (cinfo->global_state == CSTATE_SCANNING ||
|
||||
cinfo->global_state == CSTATE_RAW_OK) {
|
||||
/* Terminate first pass */
|
||||
if (cinfo->next_scanline < cinfo->image_height)
|
||||
ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
|
||||
(*cinfo->master->finish_pass) (cinfo);
|
||||
} else if (cinfo->global_state != CSTATE_WRCOEFS)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
/* Perform any remaining passes */
|
||||
while (!cinfo->master->is_last_pass) {
|
||||
(*cinfo->master->prepare_for_pass) (cinfo);
|
||||
for (iMCU_row = 0; iMCU_row < cinfo->total_iMCU_rows; iMCU_row++) {
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)iMCU_row;
|
||||
cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
/* We bypass the main controller and invoke coef controller directly;
|
||||
* all work is being done from the coefficient buffer.
|
||||
*/
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, (JSAMPIMAGE)NULL))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
(*cinfo->master->finish_pass) (cinfo);
|
||||
}
|
||||
/* Write EOI, do final cleanup */
|
||||
(*cinfo->marker->write_file_trailer) (cinfo);
|
||||
(*cinfo->dest->term_destination) (cinfo);
|
||||
/* We can use jpeg_abort to release memory and reset global_state */
|
||||
jpeg_abort((j_common_ptr)cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write a special marker.
|
||||
* This is only recommended for writing COM or APPn markers.
|
||||
* Must be called after jpeg_start_compress() and before
|
||||
* first call to jpeg_write_scanlines() or jpeg_write_raw_data().
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr,
|
||||
unsigned int datalen)
|
||||
{
|
||||
void (*write_marker_byte) (j_compress_ptr info, int val);
|
||||
|
||||
if (cinfo->next_scanline != 0 ||
|
||||
(cinfo->global_state != CSTATE_SCANNING &&
|
||||
cinfo->global_state != CSTATE_RAW_OK &&
|
||||
cinfo->global_state != CSTATE_WRCOEFS))
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
|
||||
write_marker_byte = cinfo->marker->write_marker_byte; /* copy for speed */
|
||||
while (datalen--) {
|
||||
(*write_marker_byte) (cinfo, *dataptr);
|
||||
dataptr++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Same, but piecemeal. */
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
|
||||
{
|
||||
if (cinfo->next_scanline != 0 ||
|
||||
(cinfo->global_state != CSTATE_SCANNING &&
|
||||
cinfo->global_state != CSTATE_RAW_OK &&
|
||||
cinfo->global_state != CSTATE_WRCOEFS))
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
(*cinfo->marker->write_marker_header) (cinfo, marker, datalen);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
|
||||
{
|
||||
(*cinfo->marker->write_marker_byte) (cinfo, val);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Alternate compression function: just write an abbreviated table file.
|
||||
* Before calling this, all parameters and a data destination must be set up.
|
||||
*
|
||||
* To produce a pair of files containing abbreviated tables and abbreviated
|
||||
* image data, one would proceed as follows:
|
||||
*
|
||||
* initialize JPEG object
|
||||
* set JPEG parameters
|
||||
* set destination to table file
|
||||
* jpeg_write_tables(cinfo);
|
||||
* set destination to image file
|
||||
* jpeg_start_compress(cinfo, FALSE);
|
||||
* write data...
|
||||
* jpeg_finish_compress(cinfo);
|
||||
*
|
||||
* jpeg_write_tables has the side effect of marking all tables written
|
||||
* (same as jpeg_suppress_tables(..., TRUE)). Thus a subsequent start_compress
|
||||
* will not re-emit the tables unless it is passed write_all_tables=TRUE.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_tables(j_compress_ptr cinfo)
|
||||
{
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* (Re)initialize error mgr and destination modules */
|
||||
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
|
||||
(*cinfo->dest->init_destination) (cinfo);
|
||||
/* Initialize the marker writer ... bit of a crock to do it here. */
|
||||
jinit_marker_writer(cinfo);
|
||||
/* Write them tables! */
|
||||
(*cinfo->marker->write_tables_only) (cinfo);
|
||||
/* And clean up. */
|
||||
(*cinfo->dest->term_destination) (cinfo);
|
||||
/*
|
||||
* In library releases up through v6a, we called jpeg_abort() here to free
|
||||
* any working memory allocated by the destination manager and marker
|
||||
* writer. Some applications had a problem with that: they allocated space
|
||||
* of their own from the library memory manager, and didn't want it to go
|
||||
* away during write_tables. So now we do nothing. This will cause a
|
||||
* memory leak if an app calls write_tables repeatedly without doing a full
|
||||
* compression cycle or otherwise resetting the JPEG object. However, that
|
||||
* seems less bad than unexpectedly freeing memory in the normal case.
|
||||
* An app that prefers the old behavior can call jpeg_abort for itself after
|
||||
* each call to jpeg_write_tables().
|
||||
*/
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* jcapistd.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the compression half
|
||||
* of the JPEG library. These are the "standard" API routines that are
|
||||
* used in the normal full-compression case. They are not used by a
|
||||
* transcoding-only application. Note that if an application links in
|
||||
* jpeg_start_compress, it will end up linking in the entire compressor.
|
||||
* We thus must separate this file from jcapimin.c to avoid linking the
|
||||
* whole compression library into a transcoder.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Compression initialization.
|
||||
* Before calling this, all parameters and a data destination must be set up.
|
||||
*
|
||||
* We require a write_all_tables parameter as a failsafe check when writing
|
||||
* multiple datastreams from the same compression object. Since prior runs
|
||||
* will have left all the tables marked sent_table=TRUE, a subsequent run
|
||||
* would emit an abbreviated stream (no tables) by default. This may be what
|
||||
* is wanted, but for safety's sake it should not be the default behavior:
|
||||
* programmers should have to make a deliberate choice to emit abbreviated
|
||||
* images. Therefore the documentation and examples should encourage people
|
||||
* to pass write_all_tables=TRUE; then it will take active thought to do the
|
||||
* wrong thing.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_start_compress(j_compress_ptr cinfo, boolean write_all_tables)
|
||||
{
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
if (write_all_tables)
|
||||
jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */
|
||||
|
||||
/* (Re)initialize error mgr and destination modules */
|
||||
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
|
||||
(*cinfo->dest->init_destination) (cinfo);
|
||||
/* Perform master selection of active modules */
|
||||
jinit_compress_master(cinfo);
|
||||
/* Set up for the first pass */
|
||||
(*cinfo->master->prepare_for_pass) (cinfo);
|
||||
/* Ready for application to drive first pass through jpeg_write_scanlines
|
||||
* or jpeg_write_raw_data.
|
||||
*/
|
||||
cinfo->next_scanline = 0;
|
||||
cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write some scanlines of data to the JPEG compressor.
|
||||
*
|
||||
* The return value will be the number of lines actually written.
|
||||
* This should be less than the supplied num_lines only in case that
|
||||
* the data destination module has requested suspension of the compressor,
|
||||
* or if more than image_height scanlines are passed in.
|
||||
*
|
||||
* Note: we warn about excess calls to jpeg_write_scanlines() since
|
||||
* this likely signals an application programmer error. However,
|
||||
* excess scanlines passed in the last valid call are *silently* ignored,
|
||||
* so that the application need not adjust num_lines for end-of-image
|
||||
* when using a multiple-scanline buffer.
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_write_scanlines(j_compress_ptr cinfo, JSAMPARRAY scanlines,
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION row_ctr, rows_left;
|
||||
|
||||
if (cinfo->global_state != CSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->next_scanline >= cinfo->image_height)
|
||||
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
||||
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)cinfo->next_scanline;
|
||||
cinfo->progress->pass_limit = (long)cinfo->image_height;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
|
||||
/* Give master control module another chance if this is first call to
|
||||
* jpeg_write_scanlines. This lets output of the frame/scan headers be
|
||||
* delayed so that application can write COM, etc, markers between
|
||||
* jpeg_start_compress and jpeg_write_scanlines.
|
||||
*/
|
||||
if (cinfo->master->call_pass_startup)
|
||||
(*cinfo->master->pass_startup) (cinfo);
|
||||
|
||||
/* Ignore any extra scanlines at bottom of image. */
|
||||
rows_left = cinfo->image_height - cinfo->next_scanline;
|
||||
if (num_lines > rows_left)
|
||||
num_lines = rows_left;
|
||||
|
||||
row_ctr = 0;
|
||||
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines);
|
||||
cinfo->next_scanline += row_ctr;
|
||||
return row_ctr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Alternate entry point to write raw data.
|
||||
* Processes exactly one iMCU row per call, unless suspended.
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_write_raw_data(j_compress_ptr cinfo, JSAMPIMAGE data,
|
||||
JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION lines_per_iMCU_row;
|
||||
|
||||
if (cinfo->global_state != CSTATE_RAW_OK)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->next_scanline >= cinfo->image_height) {
|
||||
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)cinfo->next_scanline;
|
||||
cinfo->progress->pass_limit = (long)cinfo->image_height;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
|
||||
/* Give master control module another chance if this is first call to
|
||||
* jpeg_write_raw_data. This lets output of the frame/scan headers be
|
||||
* delayed so that application can write COM, etc, markers between
|
||||
* jpeg_start_compress and jpeg_write_raw_data.
|
||||
*/
|
||||
if (cinfo->master->call_pass_startup)
|
||||
(*cinfo->master->pass_startup) (cinfo);
|
||||
|
||||
/* Verify that at least one iMCU row has been passed. */
|
||||
lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
|
||||
if (num_lines < lines_per_iMCU_row)
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
|
||||
/* Directly compress the row. */
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, data)) {
|
||||
/* If compressor did not consume the whole row, suspend processing. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* OK, we processed one iMCU row. */
|
||||
cinfo->next_scanline += lines_per_iMCU_row;
|
||||
return lines_per_iMCU_row;
|
||||
}
|
||||
Vendored
+932
@@ -0,0 +1,932 @@
|
||||
/*
|
||||
* jcarith.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, 2018, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
|
||||
*
|
||||
* Both sequential and progressive modes are supported in this single module.
|
||||
*
|
||||
* Suspension is not currently supported in this module.
|
||||
*
|
||||
* NOTE: All referenced figures are from
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* Expanded entropy encoder object for arithmetic encoding. */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_entropy_encoder pub; /* public fields */
|
||||
|
||||
JLONG c; /* C register, base of coding interval, layout as in sec. D.1.3 */
|
||||
JLONG a; /* A register, normalized size of coding interval */
|
||||
JLONG sc; /* counter for stacked 0xFF values which might overflow */
|
||||
JLONG zc; /* counter for pending 0x00 output values which might *
|
||||
* be discarded at the end ("Pacman" termination) */
|
||||
int ct; /* bit shift counter, determines when next byte will be written */
|
||||
int buffer; /* buffer for most recent output byte != 0xFF */
|
||||
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
|
||||
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
int next_restart_num; /* next restart number to write (0-7) */
|
||||
|
||||
/* Pointers to statistics areas (these workspaces have image lifespan) */
|
||||
unsigned char *dc_stats[NUM_ARITH_TBLS];
|
||||
unsigned char *ac_stats[NUM_ARITH_TBLS];
|
||||
|
||||
/* Statistics bin for coding with fixed probability 0.5 */
|
||||
unsigned char fixed_bin[4];
|
||||
} arith_entropy_encoder;
|
||||
|
||||
typedef arith_entropy_encoder *arith_entropy_ptr;
|
||||
|
||||
/* The following two definitions specify the allocation chunk size
|
||||
* for the statistics area.
|
||||
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
|
||||
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
|
||||
*
|
||||
* We use a compact representation with 1 byte per statistics bin,
|
||||
* thus the numbers directly represent byte sizes.
|
||||
* This 1 byte per statistics bin contains the meaning of the MPS
|
||||
* (more probable symbol) in the highest bit (mask 0x80), and the
|
||||
* index into the probability estimation state machine table
|
||||
* in the lower bits (mask 0x7F).
|
||||
*/
|
||||
|
||||
#define DC_STAT_BINS 64
|
||||
#define AC_STAT_BINS 256
|
||||
|
||||
/* NOTE: Uncomment the following #define if you want to use the
|
||||
* given formula for calculating the AC conditioning parameter Kx
|
||||
* for spectral selection progressive coding in section G.1.3.2
|
||||
* of the spec (Kx = Kmin + SRL (8 + Se - Kmin) 4).
|
||||
* Although the spec and P&M authors claim that this "has proven
|
||||
* to give good results for 8 bit precision samples", I'm not
|
||||
* convinced yet that this is really beneficial.
|
||||
* Early tests gave only very marginal compression enhancements
|
||||
* (a few - around 5 or so - bytes even for very large files),
|
||||
* which would turn out rather negative if we'd suppress the
|
||||
* DAC (Define Arithmetic Conditioning) marker segments for
|
||||
* the default parameters in the future.
|
||||
* Note that currently the marker writing module emits 12-byte
|
||||
* DAC segments for a full-component scan in a color image.
|
||||
* This is not worth worrying about IMHO. However, since the
|
||||
* spec defines the default values to be used if the tables
|
||||
* are omitted (unlike Huffman tables, which are required
|
||||
* anyway), one might optimize this behaviour in the future,
|
||||
* and then it would be disadvantageous to use custom tables if
|
||||
* they don't provide sufficient gain to exceed the DAC size.
|
||||
*
|
||||
* On the other hand, I'd consider it as a reasonable result
|
||||
* that the conditioning has no significant influence on the
|
||||
* compression performance. This means that the basic
|
||||
* statistical model is already rather stable.
|
||||
*
|
||||
* Thus, at the moment, we use the default conditioning values
|
||||
* anyway, and do not use the custom formula.
|
||||
*
|
||||
#define CALCULATE_SPECTRAL_CONDITIONING
|
||||
*/
|
||||
|
||||
/* IRIGHT_SHIFT is like RIGHT_SHIFT, but works on int rather than JLONG.
|
||||
* We assume that int right shift is unsigned if JLONG right shift is,
|
||||
* which should be safe.
|
||||
*/
|
||||
|
||||
#ifdef RIGHT_SHIFT_IS_UNSIGNED
|
||||
#define ISHIFT_TEMPS int ishift_temp;
|
||||
#define IRIGHT_SHIFT(x, shft) \
|
||||
((ishift_temp = (x)) < 0 ? \
|
||||
(ishift_temp >> (shft)) | ((~0) << (16 - (shft))) : \
|
||||
(ishift_temp >> (shft)))
|
||||
#else
|
||||
#define ISHIFT_TEMPS
|
||||
#define IRIGHT_SHIFT(x, shft) ((x) >> (shft))
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_byte(int val, j_compress_ptr cinfo)
|
||||
/* Write next output byte; we do not support suspension in this module. */
|
||||
{
|
||||
struct jpeg_destination_mgr *dest = cinfo->dest;
|
||||
|
||||
*dest->next_output_byte++ = (JOCTET)val;
|
||||
if (--dest->free_in_buffer == 0)
|
||||
if (!(*dest->empty_output_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finish up at the end of an arithmetic-compressed scan.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
finish_pass(j_compress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
|
||||
JLONG temp;
|
||||
|
||||
/* Section D.1.8: Termination of encoding */
|
||||
|
||||
/* Find the e->c in the coding interval with the largest
|
||||
* number of trailing zero bits */
|
||||
if ((temp = (e->a - 1 + e->c) & 0xFFFF0000UL) < e->c)
|
||||
e->c = temp + 0x8000L;
|
||||
else
|
||||
e->c = temp;
|
||||
/* Send remaining bytes to output */
|
||||
e->c <<= e->ct;
|
||||
if (e->c & 0xF8000000UL) {
|
||||
/* One final overflow has to be handled */
|
||||
if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer + 1, cinfo);
|
||||
if (e->buffer + 1 == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
|
||||
e->sc = 0;
|
||||
} else {
|
||||
if (e->buffer == 0)
|
||||
++e->zc;
|
||||
else if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer, cinfo);
|
||||
}
|
||||
if (e->sc) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do {
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
} while (--e->sc);
|
||||
}
|
||||
}
|
||||
/* Output final bytes only if they are not 0x00 */
|
||||
if (e->c & 0x7FFF800L) {
|
||||
if (e->zc) /* output final pending zero bytes */
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte((e->c >> 19) & 0xFF, cinfo);
|
||||
if (((e->c >> 19) & 0xFF) == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
if (e->c & 0x7F800L) {
|
||||
emit_byte((e->c >> 11) & 0xFF, cinfo);
|
||||
if (((e->c >> 11) & 0xFF) == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The core arithmetic encoding routine (common in JPEG and JBIG).
|
||||
* This needs to go as fast as possible.
|
||||
* Machine-dependent optimization facilities
|
||||
* are not utilized in this portable implementation.
|
||||
* However, this code should be fairly efficient and
|
||||
* may be a good base for further optimizations anyway.
|
||||
*
|
||||
* Parameter 'val' to be encoded may be 0 or 1 (binary decision).
|
||||
*
|
||||
* Note: I've added full "Pacman" termination support to the
|
||||
* byte output routines, which is equivalent to the optional
|
||||
* Discard_final_zeros procedure (Figure D.15) in the spec.
|
||||
* Thus, we always produce the shortest possible output
|
||||
* stream compliant to the spec (no trailing zero bytes,
|
||||
* except for FF stuffing).
|
||||
*
|
||||
* I've also introduced a new scheme for accessing
|
||||
* the probability estimation state machine table,
|
||||
* derived from Markus Kuhn's JBIG implementation.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
arith_encode(j_compress_ptr cinfo, unsigned char *st, int val)
|
||||
{
|
||||
register arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
|
||||
register unsigned char nl, nm;
|
||||
register JLONG qe, temp;
|
||||
register int sv;
|
||||
|
||||
/* Fetch values from our compact representation of Table D.2:
|
||||
* Qe values and probability estimation state machine
|
||||
*/
|
||||
sv = *st;
|
||||
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
|
||||
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
|
||||
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
|
||||
|
||||
/* Encode & estimation procedures per sections D.1.4 & D.1.5 */
|
||||
e->a -= qe;
|
||||
if (val != (sv >> 7)) {
|
||||
/* Encode the less probable symbol */
|
||||
if (e->a >= qe) {
|
||||
/* If the interval size (qe) for the less probable symbol (LPS)
|
||||
* is larger than the interval size for the MPS, then exchange
|
||||
* the two symbols for coding efficiency, otherwise code the LPS
|
||||
* as usual: */
|
||||
e->c += e->a;
|
||||
e->a = qe;
|
||||
}
|
||||
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
|
||||
} else {
|
||||
/* Encode the more probable symbol */
|
||||
if (e->a >= 0x8000L)
|
||||
return; /* A >= 0x8000 -> ready, no renormalization required */
|
||||
if (e->a < qe) {
|
||||
/* If the interval size (qe) for the less probable symbol (LPS)
|
||||
* is larger than the interval size for the MPS, then exchange
|
||||
* the two symbols for coding efficiency: */
|
||||
e->c += e->a;
|
||||
e->a = qe;
|
||||
}
|
||||
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
|
||||
}
|
||||
|
||||
/* Renormalization & data output per section D.1.6 */
|
||||
do {
|
||||
e->a <<= 1;
|
||||
e->c <<= 1;
|
||||
if (--e->ct == 0) {
|
||||
/* Another byte is ready for output */
|
||||
temp = e->c >> 19;
|
||||
if (temp > 0xFF) {
|
||||
/* Handle overflow over all stacked 0xFF bytes */
|
||||
if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer + 1, cinfo);
|
||||
if (e->buffer + 1 == 0xFF)
|
||||
emit_byte(0x00, cinfo);
|
||||
}
|
||||
e->zc += e->sc; /* carry-over converts stacked 0xFF bytes to 0x00 */
|
||||
e->sc = 0;
|
||||
/* Note: The 3 spacer bits in the C register guarantee
|
||||
* that the new buffer byte can't be 0xFF here
|
||||
* (see page 160 in the P&M JPEG book). */
|
||||
e->buffer = temp & 0xFF; /* new output byte, might overflow later */
|
||||
} else if (temp == 0xFF) {
|
||||
++e->sc; /* stack 0xFF byte (which might overflow later) */
|
||||
} else {
|
||||
/* Output all stacked 0xFF bytes, they will not overflow any more */
|
||||
if (e->buffer == 0)
|
||||
++e->zc;
|
||||
else if (e->buffer >= 0) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
emit_byte(e->buffer, cinfo);
|
||||
}
|
||||
if (e->sc) {
|
||||
if (e->zc)
|
||||
do emit_byte(0x00, cinfo);
|
||||
while (--e->zc);
|
||||
do {
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(0x00, cinfo);
|
||||
} while (--e->sc);
|
||||
}
|
||||
e->buffer = temp & 0xFF; /* new output byte (can still overflow) */
|
||||
}
|
||||
e->c &= 0x7FFFFL;
|
||||
e->ct += 8;
|
||||
}
|
||||
} while (e->a < 0x8000L);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Emit a restart marker & resynchronize predictions.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
emit_restart(j_compress_ptr cinfo, int restart_num)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
finish_pass(cinfo);
|
||||
|
||||
emit_byte(0xFF, cinfo);
|
||||
emit_byte(JPEG_RST0 + restart_num, cinfo);
|
||||
|
||||
/* Re-initialize statistics areas */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
|
||||
/* Reset DC predictions to 0 */
|
||||
entropy->last_dc_val[ci] = 0;
|
||||
entropy->dc_context[ci] = 0;
|
||||
}
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->progressive_mode == 0 || cinfo->Se) {
|
||||
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset arithmetic encoding variables */
|
||||
entropy->c = 0;
|
||||
entropy->a = 0x10000L;
|
||||
entropy->sc = 0;
|
||||
entropy->zc = 0;
|
||||
entropy->ct = 11;
|
||||
entropy->buffer = -1; /* empty */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU encoding for DC initial scan (either spectral selection,
|
||||
* or first pass of successive approximation).
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
encode_mcu_DC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int blkn, ci, tbl;
|
||||
int v, v2, m;
|
||||
ISHIFT_TEMPS
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
emit_restart(cinfo, entropy->next_restart_num);
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num++;
|
||||
entropy->next_restart_num &= 7;
|
||||
}
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
block = MCU_data[blkn];
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
|
||||
|
||||
/* Compute the DC value after the required point transform by Al.
|
||||
* This is simply an arithmetic right shift.
|
||||
*/
|
||||
m = IRIGHT_SHIFT((int)((*block)[0]), cinfo->Al);
|
||||
|
||||
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
|
||||
|
||||
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
|
||||
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
|
||||
|
||||
/* Figure F.4: Encode_DC_DIFF */
|
||||
if ((v = m - entropy->last_dc_val[ci]) == 0) {
|
||||
arith_encode(cinfo, st, 0);
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
} else {
|
||||
entropy->last_dc_val[ci] = m;
|
||||
arith_encode(cinfo, st, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
}
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU encoding for AC initial scan (either spectral selection,
|
||||
* or first pass of successive approximation).
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
encode_mcu_AC_first(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int tbl, k, ke;
|
||||
int v, v2, m;
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
emit_restart(cinfo, entropy->next_restart_num);
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num++;
|
||||
entropy->next_restart_num &= 7;
|
||||
}
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
/* Encode the MCU data block */
|
||||
block = MCU_data[0];
|
||||
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
||||
|
||||
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
|
||||
|
||||
/* Establish EOB (end-of-block) index */
|
||||
for (ke = cinfo->Se; ke > 0; ke--)
|
||||
/* We must apply the point transform by Al. For AC coefficients this
|
||||
* is an integer division with rounding towards 0. To do this portably
|
||||
* in C, we shift after obtaining the absolute value.
|
||||
*/
|
||||
if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {
|
||||
if (v >>= cinfo->Al) break;
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) break;
|
||||
}
|
||||
|
||||
/* Figure F.5: Encode_AC_Coefficients */
|
||||
for (k = cinfo->Ss; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
for (;;) {
|
||||
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
st += 2;
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
if (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
/* Encode EOB decision only if k <= cinfo->Se */
|
||||
if (k <= cinfo->Se) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 1);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU encoding for DC successive approximation refinement scan.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
encode_mcu_DC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
unsigned char *st;
|
||||
int Al, blkn;
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
emit_restart(cinfo, entropy->next_restart_num);
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num++;
|
||||
entropy->next_restart_num &= 7;
|
||||
}
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
st = entropy->fixed_bin; /* use fixed probability estimation */
|
||||
Al = cinfo->Al;
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
/* We simply emit the Al'th bit of the DC coefficient value. */
|
||||
arith_encode(cinfo, st, (MCU_data[blkn][0][0] >> Al) & 1);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU encoding for AC successive approximation refinement scan.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
encode_mcu_AC_refine(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int tbl, k, ke, kex;
|
||||
int v;
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
emit_restart(cinfo, entropy->next_restart_num);
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num++;
|
||||
entropy->next_restart_num &= 7;
|
||||
}
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
/* Encode the MCU data block */
|
||||
block = MCU_data[0];
|
||||
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
||||
|
||||
/* Section G.1.3.3: Encoding of AC coefficients */
|
||||
|
||||
/* Establish EOB (end-of-block) index */
|
||||
for (ke = cinfo->Se; ke > 0; ke--)
|
||||
/* We must apply the point transform by Al. For AC coefficients this
|
||||
* is an integer division with rounding towards 0. To do this portably
|
||||
* in C, we shift after obtaining the absolute value.
|
||||
*/
|
||||
if ((v = (*block)[jpeg_natural_order[ke]]) >= 0) {
|
||||
if (v >>= cinfo->Al) break;
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) break;
|
||||
}
|
||||
|
||||
/* Establish EOBx (previous stage end-of-block) index */
|
||||
for (kex = ke; kex > 0; kex--)
|
||||
if ((v = (*block)[jpeg_natural_order[kex]]) >= 0) {
|
||||
if (v >>= cinfo->Ah) break;
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Ah) break;
|
||||
}
|
||||
|
||||
/* Figure G.10: Encode_AC_Coefficients_SA */
|
||||
for (k = cinfo->Ss; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
if (k > kex)
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
for (;;) {
|
||||
if ((v = (*block)[jpeg_natural_order[k]]) >= 0) {
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
v = -v;
|
||||
if (v >>= cinfo->Al) {
|
||||
if (v >> 1) /* previously nonzero coef */
|
||||
arith_encode(cinfo, st + 2, (v & 1));
|
||||
else { /* newly nonzero coef */
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
}
|
||||
/* Encode EOB decision only if k <= cinfo->Se */
|
||||
if (k <= cinfo->Se) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 1);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Encode and output one MCU's worth of arithmetic-compressed coefficients.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
encode_mcu(j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
jpeg_component_info *compptr;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int blkn, ci, tbl, k, ke;
|
||||
int v, v2, m;
|
||||
|
||||
/* Emit restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0) {
|
||||
emit_restart(cinfo, entropy->next_restart_num);
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num++;
|
||||
entropy->next_restart_num &= 7;
|
||||
}
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
/* Encode the MCU data blocks */
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
block = MCU_data[blkn];
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
|
||||
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
|
||||
|
||||
tbl = compptr->dc_tbl_no;
|
||||
|
||||
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
|
||||
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
|
||||
|
||||
/* Figure F.4: Encode_DC_DIFF */
|
||||
if ((v = (*block)[0] - entropy->last_dc_val[ci]) == 0) {
|
||||
arith_encode(cinfo, st, 0);
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
} else {
|
||||
entropy->last_dc_val[ci] = (*block)[0];
|
||||
arith_encode(cinfo, st, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, st + 1, 0); /* Table F.4: SS = S0 + 1 */
|
||||
st += 2; /* Table F.4: SP = S0 + 2 */
|
||||
entropy->dc_context[ci] = 4; /* small positive diff category */
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, st + 1, 1); /* Table F.4: SS = S0 + 1 */
|
||||
st += 3; /* Table F.4: SN = S0 + 3 */
|
||||
entropy->dc_context[ci] = 8; /* small negative diff category */
|
||||
}
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] += 8; /* large diff category */
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
|
||||
/* Sections F.1.4.2 & F.1.4.4.2: Encoding of AC coefficients */
|
||||
|
||||
tbl = compptr->ac_tbl_no;
|
||||
|
||||
/* Establish EOB (end-of-block) index */
|
||||
for (ke = DCTSIZE2 - 1; ke > 0; ke--)
|
||||
if ((*block)[jpeg_natural_order[ke]]) break;
|
||||
|
||||
/* Figure F.5: Encode_AC_Coefficients */
|
||||
for (k = 1; k <= ke; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 0); /* EOB decision */
|
||||
while ((v = (*block)[jpeg_natural_order[k]]) == 0) {
|
||||
arith_encode(cinfo, st + 1, 0); st += 3; k++;
|
||||
}
|
||||
arith_encode(cinfo, st + 1, 1);
|
||||
/* Figure F.6: Encoding nonzero value v */
|
||||
/* Figure F.7: Encoding the sign of v */
|
||||
if (v > 0) {
|
||||
arith_encode(cinfo, entropy->fixed_bin, 0);
|
||||
} else {
|
||||
v = -v;
|
||||
arith_encode(cinfo, entropy->fixed_bin, 1);
|
||||
}
|
||||
st += 2;
|
||||
/* Figure F.8: Encoding the magnitude category of v */
|
||||
m = 0;
|
||||
if (v -= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m = 1;
|
||||
v2 = v;
|
||||
if (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (v2 >>= 1) {
|
||||
arith_encode(cinfo, st, 1);
|
||||
m <<= 1;
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
arith_encode(cinfo, st, 0);
|
||||
/* Figure F.9: Encoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
arith_encode(cinfo, st, (m & v) ? 1 : 0);
|
||||
}
|
||||
/* Encode EOB decision only if k <= DCTSIZE2 - 1 */
|
||||
if (k <= DCTSIZE2 - 1) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
arith_encode(cinfo, st, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for an arithmetic-compressed scan.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass(j_compress_ptr cinfo, boolean gather_statistics)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
int ci, tbl;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (gather_statistics)
|
||||
/* Make sure to avoid that in the master control logic!
|
||||
* We are fully adaptive here and need no extra
|
||||
* statistics gathering pass!
|
||||
*/
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
|
||||
/* We assume jcmaster.c already validated the progressive scan parameters. */
|
||||
|
||||
/* Select execution routines */
|
||||
if (cinfo->progressive_mode) {
|
||||
if (cinfo->Ah == 0) {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_first;
|
||||
else
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_first;
|
||||
} else {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.encode_mcu = encode_mcu_DC_refine;
|
||||
else
|
||||
entropy->pub.encode_mcu = encode_mcu_AC_refine;
|
||||
}
|
||||
} else
|
||||
entropy->pub.encode_mcu = encode_mcu;
|
||||
|
||||
/* Allocate & initialize requested statistics areas */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->progressive_mode == 0 || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
tbl = compptr->dc_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->dc_stats[tbl] == NULL)
|
||||
entropy->dc_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
|
||||
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
|
||||
/* Initialize DC predictions to 0 */
|
||||
entropy->last_dc_val[ci] = 0;
|
||||
entropy->dc_context[ci] = 0;
|
||||
}
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->progressive_mode == 0 || cinfo->Se) {
|
||||
tbl = compptr->ac_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->ac_stats[tbl] == NULL)
|
||||
entropy->ac_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
|
||||
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
|
||||
#ifdef CALCULATE_SPECTRAL_CONDITIONING
|
||||
if (cinfo->progressive_mode)
|
||||
/* Section G.1.3.2: Set appropriate arithmetic conditioning value Kx */
|
||||
cinfo->arith_ac_K[tbl] = cinfo->Ss +
|
||||
((8 + cinfo->Se - cinfo->Ss) >> 4);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize arithmetic encoding variables */
|
||||
entropy->c = 0;
|
||||
entropy->a = 0x10000L;
|
||||
entropy->sc = 0;
|
||||
entropy->zc = 0;
|
||||
entropy->ct = 11;
|
||||
entropy->buffer = -1; /* empty */
|
||||
|
||||
/* Initialize restart stuff */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
entropy->next_restart_num = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Module initialization routine for arithmetic entropy encoding.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_arith_encoder(j_compress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr entropy;
|
||||
int i;
|
||||
|
||||
entropy = (arith_entropy_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(arith_entropy_encoder));
|
||||
cinfo->entropy = (struct jpeg_entropy_encoder *)entropy;
|
||||
entropy->pub.start_pass = start_pass;
|
||||
entropy->pub.finish_pass = finish_pass;
|
||||
|
||||
/* Mark tables unallocated */
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
entropy->dc_stats[i] = NULL;
|
||||
entropy->ac_stats[i] = NULL;
|
||||
}
|
||||
|
||||
/* Initialize index for fixed probability estimation */
|
||||
entropy->fixed_bin[0] = 113;
|
||||
}
|
||||
+449
@@ -0,0 +1,449 @@
|
||||
/*
|
||||
* jccoefct.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code and
|
||||
* information relevant to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the coefficient buffer controller for compression.
|
||||
* This controller is the top level of the JPEG compressor proper.
|
||||
* The coefficient buffer lies between forward-DCT and entropy encoding steps.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* We use a full-image coefficient buffer when doing Huffman optimization,
|
||||
* and also for writing multiple-scan JPEG files. In all cases, the DCT
|
||||
* step is run during the first pass, and subsequent passes need only read
|
||||
* the buffered coefficients.
|
||||
*/
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
#define FULL_COEF_BUFFER_SUPPORTED
|
||||
#else
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
#define FULL_COEF_BUFFER_SUPPORTED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_c_coef_controller pub; /* public fields */
|
||||
|
||||
JDIMENSION iMCU_row_num; /* iMCU row # within image */
|
||||
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
|
||||
int MCU_vert_offset; /* counts MCU rows within iMCU row */
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
|
||||
/* For single-pass compression, it's sufficient to buffer just one MCU
|
||||
* (although this may prove a bit slow in practice). We allocate a
|
||||
* workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
|
||||
* MCU constructed and sent. In multi-pass modes, this array points to the
|
||||
* current MCU's blocks within the virtual arrays.
|
||||
*/
|
||||
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
|
||||
|
||||
/* In multi-pass modes, we need a virtual block array for each component. */
|
||||
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
|
||||
} my_coef_controller;
|
||||
|
||||
typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(boolean) compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||
METHODDEF(boolean) compress_first_pass(j_compress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf);
|
||||
METHODDEF(boolean) compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf);
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
start_iMCU_row(j_compress_ptr cinfo)
|
||||
/* Reset within-iMCU-row counters for a new row */
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
/* In an interleaved scan, an MCU row is the same as an iMCU row.
|
||||
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
|
||||
* But at the bottom of the image, process only what's left.
|
||||
*/
|
||||
if (cinfo->comps_in_scan > 1) {
|
||||
coef->MCU_rows_per_iMCU_row = 1;
|
||||
} else {
|
||||
if (coef->iMCU_row_num < (cinfo->total_iMCU_rows - 1))
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
|
||||
else
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
|
||||
}
|
||||
|
||||
coef->mcu_ctr = 0;
|
||||
coef->MCU_vert_offset = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
coef->iMCU_row_num = 0;
|
||||
start_iMCU_row(cinfo);
|
||||
|
||||
switch (pass_mode) {
|
||||
case JBUF_PASS_THRU:
|
||||
if (coef->whole_image[0] != NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
coef->pub.compress_data = compress_data;
|
||||
break;
|
||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||
case JBUF_SAVE_AND_PASS:
|
||||
if (coef->whole_image[0] == NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
coef->pub.compress_data = compress_first_pass;
|
||||
break;
|
||||
case JBUF_CRANK_DEST:
|
||||
if (coef->whole_image[0] == NULL)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
coef->pub.compress_data = compress_output;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process some data in the single-pass case.
|
||||
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
|
||||
* per call, ie, v_samp_factor block rows for each component in the image.
|
||||
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
|
||||
*
|
||||
* NB: input_buf contains a plane for each component in image,
|
||||
* which we index according to the component's SOF position.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_data(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
int blkn, bi, ci, yindex, yoffset, blockcnt;
|
||||
JDIMENSION ypos, xpos;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Loop to write as much as one whole iMCU row */
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
|
||||
MCU_col_num++) {
|
||||
/* Determine where data comes from in input_buf and do the DCT thing.
|
||||
* Each call on forward_DCT processes a horizontal row of DCT blocks
|
||||
* as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
|
||||
* sequentially. Dummy blocks at the right or bottom edge are filled in
|
||||
* specially. The data in them does not matter for image reconstruction,
|
||||
* so we fill them with values that will encode to the smallest amount of
|
||||
* data, viz: all zeroes in the AC entries, DC entries equal to previous
|
||||
* block's DC value. (Thanks to Thomas Kinsman for this idea.)
|
||||
*/
|
||||
blkn = 0;
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
|
||||
compptr->last_col_width;
|
||||
xpos = MCU_col_num * compptr->MCU_sample_width;
|
||||
ypos = yoffset * DCTSIZE; /* ypos == (yoffset+yindex) * DCTSIZE */
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
if (coef->iMCU_row_num < last_iMCU_row ||
|
||||
yoffset + yindex < compptr->last_row_height) {
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[compptr->component_index],
|
||||
coef->MCU_buffer[blkn],
|
||||
ypos, xpos, (JDIMENSION)blockcnt);
|
||||
if (blockcnt < compptr->MCU_width) {
|
||||
/* Create some dummy blocks at the right edge of the image. */
|
||||
jzero_far((void *)coef->MCU_buffer[blkn + blockcnt],
|
||||
(compptr->MCU_width - blockcnt) * sizeof(JBLOCK));
|
||||
for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn + bi][0][0] =
|
||||
coef->MCU_buffer[blkn + bi - 1][0][0];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Create a row of dummy blocks at the bottom of the image. */
|
||||
jzero_far((void *)coef->MCU_buffer[blkn],
|
||||
compptr->MCU_width * sizeof(JBLOCK));
|
||||
for (bi = 0; bi < compptr->MCU_width; bi++) {
|
||||
coef->MCU_buffer[blkn + bi][0][0] =
|
||||
coef->MCU_buffer[blkn - 1][0][0];
|
||||
}
|
||||
}
|
||||
blkn += compptr->MCU_width;
|
||||
ypos += DCTSIZE;
|
||||
}
|
||||
}
|
||||
/* Try to write the MCU. In event of a suspension failure, we will
|
||||
* re-DCT the MCU on restart (a bit inefficient, could be fixed...)
|
||||
*/
|
||||
if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
coef->mcu_ctr = 0;
|
||||
}
|
||||
/* Completed the iMCU row, advance counters for next one */
|
||||
coef->iMCU_row_num++;
|
||||
start_iMCU_row(cinfo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||
|
||||
/*
|
||||
* Process some data in the first pass of a multi-pass case.
|
||||
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
|
||||
* per call, ie, v_samp_factor block rows for each component in the image.
|
||||
* This amount of data is read from the source buffer, DCT'd and quantized,
|
||||
* and saved into the virtual arrays. We also generate suitable dummy blocks
|
||||
* as needed at the right and lower edges. (The dummy blocks are constructed
|
||||
* in the virtual arrays, which have been padded appropriately.) This makes
|
||||
* it possible for subsequent passes not to worry about real vs. dummy blocks.
|
||||
*
|
||||
* We must also emit the data to the entropy encoder. This is conveniently
|
||||
* done by calling compress_output() after we've loaded the current strip
|
||||
* of the virtual arrays.
|
||||
*
|
||||
* NB: input_buf contains a plane for each component in image. All
|
||||
* components are DCT'd and loaded into the virtual arrays in this pass.
|
||||
* However, it may be that only a subset of the components are emitted to
|
||||
* the entropy encoder during this first pass; be careful about looking
|
||||
* at the scan-dependent variables (MCU dimensions, etc).
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_first_pass(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
JDIMENSION blocks_across, MCUs_across, MCUindex;
|
||||
int bi, ci, h_samp_factor, block_row, block_rows, ndummy;
|
||||
JCOEF lastDC;
|
||||
jpeg_component_info *compptr;
|
||||
JBLOCKARRAY buffer;
|
||||
JBLOCKROW thisblockrow, lastblockrow;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* Align the virtual buffer for this component. */
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
coef->iMCU_row_num * compptr->v_samp_factor,
|
||||
(JDIMENSION)compptr->v_samp_factor, TRUE);
|
||||
/* Count non-dummy DCT block rows in this iMCU row. */
|
||||
if (coef->iMCU_row_num < last_iMCU_row)
|
||||
block_rows = compptr->v_samp_factor;
|
||||
else {
|
||||
/* NB: can't use last_row_height here, since may not be set! */
|
||||
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
|
||||
if (block_rows == 0) block_rows = compptr->v_samp_factor;
|
||||
}
|
||||
blocks_across = compptr->width_in_blocks;
|
||||
h_samp_factor = compptr->h_samp_factor;
|
||||
/* Count number of dummy blocks to be added at the right margin. */
|
||||
ndummy = (int)(blocks_across % h_samp_factor);
|
||||
if (ndummy > 0)
|
||||
ndummy = h_samp_factor - ndummy;
|
||||
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
|
||||
* on forward_DCT processes a complete horizontal row of DCT blocks.
|
||||
*/
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
(*cinfo->fdct->forward_DCT) (cinfo, compptr,
|
||||
input_buf[ci], thisblockrow,
|
||||
(JDIMENSION)(block_row * DCTSIZE),
|
||||
(JDIMENSION)0, blocks_across);
|
||||
if (ndummy > 0) {
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
thisblockrow += blocks_across; /* => first dummy block */
|
||||
jzero_far((void *)thisblockrow, ndummy * sizeof(JBLOCK));
|
||||
lastDC = thisblockrow[-1][0];
|
||||
for (bi = 0; bi < ndummy; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* If at end of image, create dummy block rows as needed.
|
||||
* The tricky part here is that within each MCU, we want the DC values
|
||||
* of the dummy blocks to match the last real block's DC value.
|
||||
* This squeezes a few more bytes out of the resulting file...
|
||||
*/
|
||||
if (coef->iMCU_row_num == last_iMCU_row) {
|
||||
blocks_across += ndummy; /* include lower right corner */
|
||||
MCUs_across = blocks_across / h_samp_factor;
|
||||
for (block_row = block_rows; block_row < compptr->v_samp_factor;
|
||||
block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
lastblockrow = buffer[block_row - 1];
|
||||
jzero_far((void *)thisblockrow,
|
||||
(size_t)(blocks_across * sizeof(JBLOCK)));
|
||||
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
|
||||
lastDC = lastblockrow[h_samp_factor - 1][0];
|
||||
for (bi = 0; bi < h_samp_factor; bi++) {
|
||||
thisblockrow[bi][0] = lastDC;
|
||||
}
|
||||
thisblockrow += h_samp_factor; /* advance to next MCU in row */
|
||||
lastblockrow += h_samp_factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* NB: compress_output will increment iMCU_row_num if successful.
|
||||
* A suspension return will result in redoing all the work above next time.
|
||||
*/
|
||||
|
||||
/* Emit data to the entropy encoder, sharing code with subsequent passes */
|
||||
return compress_output(cinfo, input_buf);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process some data in subsequent passes of a multi-pass case.
|
||||
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
|
||||
* per call, ie, v_samp_factor block rows for each component in the scan.
|
||||
* The data is obtained from the virtual arrays and fed to the entropy coder.
|
||||
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
|
||||
*
|
||||
* NB: input_buf is ignored; it is likely to be a NULL pointer.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
int blkn, ci, xindex, yindex, yoffset;
|
||||
JDIMENSION start_col;
|
||||
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
|
||||
JBLOCKROW buffer_ptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Align the virtual buffers for the components used in this scan.
|
||||
* NB: during first pass, this is safe only because the buffers will
|
||||
* already be aligned properly, so jmemmgr.c won't need to do any I/O.
|
||||
*/
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
buffer[ci] = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
|
||||
coef->iMCU_row_num * compptr->v_samp_factor,
|
||||
(JDIMENSION)compptr->v_samp_factor, FALSE);
|
||||
}
|
||||
|
||||
/* Loop to process one whole iMCU row */
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
|
||||
MCU_col_num++) {
|
||||
/* Construct list of pointers to DCT blocks belonging to this MCU */
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
start_col = MCU_col_num * compptr->MCU_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
|
||||
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
|
||||
coef->MCU_buffer[blkn++] = buffer_ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Try to write the MCU. */
|
||||
if (!(*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
coef->mcu_ctr = 0;
|
||||
}
|
||||
/* Completed the iMCU row, advance counters for next one */
|
||||
coef->iMCU_row_num++;
|
||||
start_iMCU_row(cinfo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* FULL_COEF_BUFFER_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize coefficient buffer controller.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_c_coef_controller(j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_coef_ptr coef;
|
||||
|
||||
coef = (my_coef_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_coef_controller));
|
||||
cinfo->coef = (struct jpeg_c_coef_controller *)coef;
|
||||
coef->pub.start_pass = start_pass_coef;
|
||||
|
||||
/* Create the coefficient buffer. */
|
||||
if (need_full_buffer) {
|
||||
#ifdef FULL_COEF_BUFFER_SUPPORTED
|
||||
/* Allocate a full-image virtual array for each component, */
|
||||
/* padded to a multiple of samp_factor DCT blocks in each direction. */
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE,
|
||||
(JDIMENSION)jround_up((long)compptr->width_in_blocks,
|
||||
(long)compptr->h_samp_factor),
|
||||
(JDIMENSION)jround_up((long)compptr->height_in_blocks,
|
||||
(long)compptr->v_samp_factor),
|
||||
(JDIMENSION)compptr->v_samp_factor);
|
||||
}
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
#endif
|
||||
} else {
|
||||
/* We only need a single-MCU buffer. */
|
||||
JBLOCKROW buffer;
|
||||
int i;
|
||||
|
||||
buffer = (JBLOCKROW)
|
||||
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
|
||||
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
|
||||
coef->MCU_buffer[i] = buffer + i;
|
||||
}
|
||||
coef->whole_image[0] = NULL; /* flag for no virtual arrays */
|
||||
}
|
||||
}
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* jccolext.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains input colorspace conversion routines.
|
||||
*/
|
||||
|
||||
|
||||
/* This file is included by jccolor.c */
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
*
|
||||
* Note that we change from the application's interleaved-pixel format
|
||||
* to our internal noninterleaved, one-plane-per-component format.
|
||||
* The 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
|
||||
* can easily adjust the passed input_buf value to accommodate any row
|
||||
* offset required on that side.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_ycc_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register JLONG *ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
* Hence the value being shifted is never negative, and we don't
|
||||
* need the general RIGHT_SHIFT macro.
|
||||
*/
|
||||
/* Y */
|
||||
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
/* Cb */
|
||||
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
|
||||
ctab[b + B_CB_OFF]) >> SCALEBITS);
|
||||
/* Cr */
|
||||
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
|
||||
ctab[b + B_CR_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************** Cases other than RGB -> YCbCr **************/
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
* This version handles RGB->grayscale conversion, which is the same
|
||||
* as the RGB->Y portion of RGB->YCbCr.
|
||||
* We assume rgb_ycc_start has been called (we only use the Y tables).
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_gray_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register JLONG *ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr[RGB_RED]);
|
||||
g = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
b = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
inptr += RGB_PIXELSIZE;
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
* This version handles extended RGB->plain RGB conversion
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb_convert_internal(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr0[col] = GETJSAMPLE(inptr[RGB_RED]);
|
||||
outptr1[col] = GETJSAMPLE(inptr[RGB_GREEN]);
|
||||
outptr2[col] = GETJSAMPLE(inptr[RGB_BLUE]);
|
||||
inptr += RGB_PIXELSIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+710
@@ -0,0 +1,710 @@
|
||||
/*
|
||||
* jccolor.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009-2012, 2015, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains input colorspace conversion routines.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_color_converter pub; /* public fields */
|
||||
|
||||
/* Private state for RGB->YCC conversion */
|
||||
JLONG *rgb_ycc_tab; /* => table for RGB to YCbCr conversion */
|
||||
} my_color_converter;
|
||||
|
||||
typedef my_color_converter *my_cconvert_ptr;
|
||||
|
||||
|
||||
/**************** RGB -> YCbCr conversion: most common case **************/
|
||||
|
||||
/*
|
||||
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
|
||||
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
||||
* The conversion equations to be implemented are therefore
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
|
||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
|
||||
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
|
||||
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
|
||||
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
|
||||
* negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
|
||||
* were not represented exactly. Now we sacrifice exact representation of
|
||||
* maximum red and maximum blue in order to get exact grayscales.
|
||||
*
|
||||
* To avoid floating-point arithmetic, we represent the fractional constants
|
||||
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
|
||||
* the products by 2^16, with appropriate rounding, to get the correct answer.
|
||||
*
|
||||
* For even more speed, we avoid doing any multiplications in the inner loop
|
||||
* by precalculating the constants times R,G,B for all possible values.
|
||||
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
||||
* for 12-bit samples it is still acceptable. It's not very reasonable for
|
||||
* 16-bit samples, but if you want lossless storage you shouldn't be changing
|
||||
* colorspace anyway.
|
||||
* The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
|
||||
* in the tables to save adding them separately in the inner loop.
|
||||
*/
|
||||
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define CBCR_OFFSET ((JLONG)CENTERJSAMPLE << SCALEBITS)
|
||||
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
|
||||
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
|
||||
|
||||
/* We allocate one big table and divide it up into eight parts, instead of
|
||||
* doing eight alloc_small requests. This lets us use a single table base
|
||||
* address, which can be held in a register in the inner loops on many
|
||||
* machines (more than can hold all eight addresses, anyway).
|
||||
*/
|
||||
|
||||
#define R_Y_OFF 0 /* offset to R => Y section */
|
||||
#define G_Y_OFF (1 * (MAXJSAMPLE + 1)) /* offset to G => Y section */
|
||||
#define B_Y_OFF (2 * (MAXJSAMPLE + 1)) /* etc. */
|
||||
#define R_CB_OFF (3 * (MAXJSAMPLE + 1))
|
||||
#define G_CB_OFF (4 * (MAXJSAMPLE + 1))
|
||||
#define B_CB_OFF (5 * (MAXJSAMPLE + 1))
|
||||
#define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */
|
||||
#define G_CR_OFF (6 * (MAXJSAMPLE + 1))
|
||||
#define B_CR_OFF (7 * (MAXJSAMPLE + 1))
|
||||
#define TABLE_SIZE (8 * (MAXJSAMPLE + 1))
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions */
|
||||
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extrgb_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extrgb_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extrgb_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extrgbx_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extbgr_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extbgr_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extbgr_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extbgrx_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extxbgr_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal
|
||||
#define rgb_gray_convert_internal extxrgb_gray_convert_internal
|
||||
#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal
|
||||
#include "jccolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef rgb_ycc_convert_internal
|
||||
#undef rgb_gray_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for RGB->YCC colorspace conversion.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_ycc_start(j_compress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
JLONG *rgb_ycc_tab;
|
||||
JLONG i;
|
||||
|
||||
/* Allocate and fill in the conversion tables. */
|
||||
cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(TABLE_SIZE * sizeof(JLONG)));
|
||||
|
||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||
rgb_ycc_tab[i + R_Y_OFF] = FIX(0.29900) * i;
|
||||
rgb_ycc_tab[i + G_Y_OFF] = FIX(0.58700) * i;
|
||||
rgb_ycc_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
|
||||
rgb_ycc_tab[i + R_CB_OFF] = (-FIX(0.16874)) * i;
|
||||
rgb_ycc_tab[i + G_CB_OFF] = (-FIX(0.33126)) * i;
|
||||
/* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
|
||||
* This ensures that the maximum output will round to MAXJSAMPLE
|
||||
* not MAXJSAMPLE+1, and thus that we don't have to range-limit.
|
||||
*/
|
||||
rgb_ycc_tab[i + B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1;
|
||||
/* B=>Cb and R=>Cr tables are the same
|
||||
rgb_ycc_tab[i + R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1;
|
||||
*/
|
||||
rgb_ycc_tab[i + G_CR_OFF] = (-FIX(0.41869)) * i;
|
||||
rgb_ycc_tab[i + B_CR_OFF] = (-FIX(0.08131)) * i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************** Cases other than RGB -> YCbCr **************/
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Extended RGB to plain RGB conversion
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
* This version handles Adobe-style CMYK->YCCK conversion,
|
||||
* where we convert R=1-C, G=1-M, and B=1-Y to YCbCr using the same
|
||||
* conversion as above, while passing K (black) unchanged.
|
||||
* We assume rgb_ycc_start has been called.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register JLONG *ctab = cconvert->rgb_ycc_tab;
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr0, outptr1, outptr2, outptr3;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
outptr3 = output_buf[3][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = MAXJSAMPLE - GETJSAMPLE(inptr[0]);
|
||||
g = MAXJSAMPLE - GETJSAMPLE(inptr[1]);
|
||||
b = MAXJSAMPLE - GETJSAMPLE(inptr[2]);
|
||||
/* K passes through as-is */
|
||||
outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */
|
||||
inptr += 4;
|
||||
/* If the inputs are 0..MAXJSAMPLE, the outputs of these equations
|
||||
* must be too; we do not need an explicit range-limiting operation.
|
||||
* Hence the value being shifted is never negative, and we don't
|
||||
* need the general RIGHT_SHIFT macro.
|
||||
*/
|
||||
/* Y */
|
||||
outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
/* Cb */
|
||||
outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] +
|
||||
ctab[b + B_CB_OFF]) >> SCALEBITS);
|
||||
/* Cr */
|
||||
outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] +
|
||||
ctab[b + B_CR_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
* This version handles grayscale output with no conversion.
|
||||
* The source can be either plain grayscale or YCbCr (since Y == gray).
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
int instride = cinfo->input_components;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */
|
||||
inptr += instride;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the JPEG colorspace.
|
||||
* This version handles multi-component colorspaces without conversion.
|
||||
* We assume input_components == num_components.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr;
|
||||
register JSAMPROW outptr, outptr0, outptr1, outptr2, outptr3;
|
||||
register JDIMENSION col;
|
||||
register int ci;
|
||||
int nc = cinfo->num_components;
|
||||
JDIMENSION num_cols = cinfo->image_width;
|
||||
|
||||
if (nc == 3) {
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr0[col] = *inptr++;
|
||||
outptr1[col] = *inptr++;
|
||||
outptr2[col] = *inptr++;
|
||||
}
|
||||
}
|
||||
} else if (nc == 4) {
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
outptr3 = output_buf[3][output_row];
|
||||
output_row++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr0[col] = *inptr++;
|
||||
outptr1[col] = *inptr++;
|
||||
outptr2[col] = *inptr++;
|
||||
outptr3[col] = *inptr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while (--num_rows >= 0) {
|
||||
/* It seems fastest to make a separate pass for each component. */
|
||||
for (ci = 0; ci < nc; ci++) {
|
||||
inptr = *input_buf;
|
||||
outptr = output_buf[ci][output_row];
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */
|
||||
inptr += nc;
|
||||
}
|
||||
}
|
||||
input_buf++;
|
||||
output_row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Empty method for start_pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
null_method(j_compress_ptr cinfo)
|
||||
{
|
||||
/* no work needed */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Module initialization routine for input colorspace conversion.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_color_converter(j_compress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert;
|
||||
|
||||
cconvert = (my_cconvert_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_color_converter));
|
||||
cinfo->cconvert = (struct jpeg_color_converter *)cconvert;
|
||||
/* set start_pass to null method until we find out differently */
|
||||
cconvert->pub.start_pass = null_method;
|
||||
|
||||
/* Make sure input_components agrees with in_color_space */
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
if (cinfo->input_components != 1)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_RGBA:
|
||||
case JCS_EXT_BGRA:
|
||||
case JCS_EXT_ABGR:
|
||||
case JCS_EXT_ARGB:
|
||||
if (cinfo->input_components != rgb_pixelsize[cinfo->in_color_space])
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
|
||||
case JCS_YCbCr:
|
||||
if (cinfo->input_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
case JCS_YCCK:
|
||||
if (cinfo->input_components != 4)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
|
||||
default: /* JCS_UNKNOWN can be anything */
|
||||
if (cinfo->input_components < 1)
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check num_components, set conversion method based on requested space */
|
||||
switch (cinfo->jpeg_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
if (cinfo->num_components != 1)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_GRAYSCALE)
|
||||
cconvert->pub.color_convert = grayscale_convert;
|
||||
else if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBA ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRA ||
|
||||
cinfo->in_color_space == JCS_EXT_ABGR ||
|
||||
cinfo->in_color_space == JCS_EXT_ARGB) {
|
||||
if (jsimd_can_rgb_gray())
|
||||
cconvert->pub.color_convert = jsimd_rgb_gray_convert;
|
||||
else {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = rgb_gray_convert;
|
||||
}
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr)
|
||||
cconvert->pub.color_convert = grayscale_convert;
|
||||
else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
if (cinfo->num_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (rgb_red[cinfo->in_color_space] == 0 &&
|
||||
rgb_green[cinfo->in_color_space] == 1 &&
|
||||
rgb_blue[cinfo->in_color_space] == 2 &&
|
||||
rgb_pixelsize[cinfo->in_color_space] == 3) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBA ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRA ||
|
||||
cinfo->in_color_space == JCS_EXT_ABGR ||
|
||||
cinfo->in_color_space == JCS_EXT_ARGB)
|
||||
cconvert->pub.color_convert = rgb_rgb_convert;
|
||||
else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_YCbCr:
|
||||
if (cinfo->num_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBX ||
|
||||
cinfo->in_color_space == JCS_EXT_BGR ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRX ||
|
||||
cinfo->in_color_space == JCS_EXT_XBGR ||
|
||||
cinfo->in_color_space == JCS_EXT_XRGB ||
|
||||
cinfo->in_color_space == JCS_EXT_RGBA ||
|
||||
cinfo->in_color_space == JCS_EXT_BGRA ||
|
||||
cinfo->in_color_space == JCS_EXT_ABGR ||
|
||||
cinfo->in_color_space == JCS_EXT_ARGB) {
|
||||
if (jsimd_can_rgb_ycc())
|
||||
cconvert->pub.color_convert = jsimd_rgb_ycc_convert;
|
||||
else {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = rgb_ycc_convert;
|
||||
}
|
||||
} else if (cinfo->in_color_space == JCS_YCbCr) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
if (cinfo->num_components != 4)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_CMYK) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_YCCK:
|
||||
if (cinfo->num_components != 4)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
if (cinfo->in_color_space == JCS_CMYK) {
|
||||
cconvert->pub.start_pass = rgb_ycc_start;
|
||||
cconvert->pub.color_convert = cmyk_ycck_convert;
|
||||
} else if (cinfo->in_color_space == JCS_YCCK) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
default: /* allow null conversion of JCS_UNKNOWN */
|
||||
if (cinfo->jpeg_color_space != cinfo->in_color_space ||
|
||||
cinfo->num_components != cinfo->input_components)
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
#if defined(__mips__)
|
||||
if (jsimd_c_can_null_convert())
|
||||
cconvert->pub.color_convert = jsimd_c_null_convert;
|
||||
else
|
||||
#endif
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
break;
|
||||
}
|
||||
}
|
||||
+721
@@ -0,0 +1,721 @@
|
||||
/*
|
||||
* jcdctmgr.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011, 2014-2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the forward-DCT management logic.
|
||||
* This code selects a particular DCT implementation to be used,
|
||||
* and it performs related housekeeping chores including coefficient
|
||||
* quantization.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdct.h" /* Private declarations for DCT subsystem */
|
||||
#include "jsimddct.h"
|
||||
|
||||
|
||||
/* Private subobject for this module */
|
||||
|
||||
typedef void (*forward_DCT_method_ptr) (DCTELEM *data);
|
||||
typedef void (*float_DCT_method_ptr) (FAST_FLOAT *data);
|
||||
|
||||
typedef void (*convsamp_method_ptr) (JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
DCTELEM *workspace);
|
||||
typedef void (*float_convsamp_method_ptr) (JSAMPARRAY sample_data,
|
||||
JDIMENSION start_col,
|
||||
FAST_FLOAT *workspace);
|
||||
|
||||
typedef void (*quantize_method_ptr) (JCOEFPTR coef_block, DCTELEM *divisors,
|
||||
DCTELEM *workspace);
|
||||
typedef void (*float_quantize_method_ptr) (JCOEFPTR coef_block,
|
||||
FAST_FLOAT *divisors,
|
||||
FAST_FLOAT *workspace);
|
||||
|
||||
METHODDEF(void) quantize(JCOEFPTR, DCTELEM *, DCTELEM *);
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_forward_dct pub; /* public fields */
|
||||
|
||||
/* Pointer to the DCT routine actually in use */
|
||||
forward_DCT_method_ptr dct;
|
||||
convsamp_method_ptr convsamp;
|
||||
quantize_method_ptr quantize;
|
||||
|
||||
/* The actual post-DCT divisors --- not identical to the quant table
|
||||
* entries, because of scaling (especially for an unnormalized DCT).
|
||||
* Each table is given in normal array order.
|
||||
*/
|
||||
DCTELEM *divisors[NUM_QUANT_TBLS];
|
||||
|
||||
/* work area for FDCT subroutine */
|
||||
DCTELEM *workspace;
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
/* Same as above for the floating-point case. */
|
||||
float_DCT_method_ptr float_dct;
|
||||
float_convsamp_method_ptr float_convsamp;
|
||||
float_quantize_method_ptr float_quantize;
|
||||
FAST_FLOAT *float_divisors[NUM_QUANT_TBLS];
|
||||
FAST_FLOAT *float_workspace;
|
||||
#endif
|
||||
} my_fdct_controller;
|
||||
|
||||
typedef my_fdct_controller *my_fdct_ptr;
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/*
|
||||
* Find the highest bit in an integer through binary search.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
flss(UINT16 val)
|
||||
{
|
||||
int bit;
|
||||
|
||||
bit = 16;
|
||||
|
||||
if (!val)
|
||||
return 0;
|
||||
|
||||
if (!(val & 0xff00)) {
|
||||
bit -= 8;
|
||||
val <<= 8;
|
||||
}
|
||||
if (!(val & 0xf000)) {
|
||||
bit -= 4;
|
||||
val <<= 4;
|
||||
}
|
||||
if (!(val & 0xc000)) {
|
||||
bit -= 2;
|
||||
val <<= 2;
|
||||
}
|
||||
if (!(val & 0x8000)) {
|
||||
bit -= 1;
|
||||
val <<= 1;
|
||||
}
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Compute values to do a division using reciprocal.
|
||||
*
|
||||
* This implementation is based on an algorithm described in
|
||||
* "How to optimize for the Pentium family of microprocessors"
|
||||
* (http://www.agner.org/assem/).
|
||||
* More information about the basic algorithm can be found in
|
||||
* the paper "Integer Division Using Reciprocals" by Robert Alverson.
|
||||
*
|
||||
* The basic idea is to replace x/d by x * d^-1. In order to store
|
||||
* d^-1 with enough precision we shift it left a few places. It turns
|
||||
* out that this algoright gives just enough precision, and also fits
|
||||
* into DCTELEM:
|
||||
*
|
||||
* b = (the number of significant bits in divisor) - 1
|
||||
* r = (word size) + b
|
||||
* f = 2^r / divisor
|
||||
*
|
||||
* f will not be an integer for most cases, so we need to compensate
|
||||
* for the rounding error introduced:
|
||||
*
|
||||
* no fractional part:
|
||||
*
|
||||
* result = input >> r
|
||||
*
|
||||
* fractional part of f < 0.5:
|
||||
*
|
||||
* round f down to nearest integer
|
||||
* result = ((input + 1) * f) >> r
|
||||
*
|
||||
* fractional part of f > 0.5:
|
||||
*
|
||||
* round f up to nearest integer
|
||||
* result = (input * f) >> r
|
||||
*
|
||||
* This is the original algorithm that gives truncated results. But we
|
||||
* want properly rounded results, so we replace "input" with
|
||||
* "input + divisor/2".
|
||||
*
|
||||
* In order to allow SIMD implementations we also tweak the values to
|
||||
* allow the same calculation to be made at all times:
|
||||
*
|
||||
* dctbl[0] = f rounded to nearest integer
|
||||
* dctbl[1] = divisor / 2 (+ 1 if fractional part of f < 0.5)
|
||||
* dctbl[2] = 1 << ((word size) * 2 - r)
|
||||
* dctbl[3] = r - (word size)
|
||||
*
|
||||
* dctbl[2] is for stupid instruction sets where the shift operation
|
||||
* isn't member wise (e.g. MMX).
|
||||
*
|
||||
* The reason dctbl[2] and dctbl[3] reduce the shift with (word size)
|
||||
* is that most SIMD implementations have a "multiply and store top
|
||||
* half" operation.
|
||||
*
|
||||
* Lastly, we store each of the values in their own table instead
|
||||
* of in a consecutive manner, yet again in order to allow SIMD
|
||||
* routines.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
compute_reciprocal(UINT16 divisor, DCTELEM *dtbl)
|
||||
{
|
||||
UDCTELEM2 fq, fr;
|
||||
UDCTELEM c;
|
||||
int b, r;
|
||||
|
||||
if (divisor == 1) {
|
||||
/* divisor == 1 means unquantized, so these reciprocal/correction/shift
|
||||
* values will cause the C quantization algorithm to act like the
|
||||
* identity function. Since only the C quantization algorithm is used in
|
||||
* these cases, the scale value is irrelevant.
|
||||
*/
|
||||
dtbl[DCTSIZE2 * 0] = (DCTELEM)1; /* reciprocal */
|
||||
dtbl[DCTSIZE2 * 1] = (DCTELEM)0; /* correction */
|
||||
dtbl[DCTSIZE2 * 2] = (DCTELEM)1; /* scale */
|
||||
dtbl[DCTSIZE2 * 3] = -(DCTELEM)(sizeof(DCTELEM) * 8); /* shift */
|
||||
return 0;
|
||||
}
|
||||
|
||||
b = flss(divisor) - 1;
|
||||
r = sizeof(DCTELEM) * 8 + b;
|
||||
|
||||
fq = ((UDCTELEM2)1 << r) / divisor;
|
||||
fr = ((UDCTELEM2)1 << r) % divisor;
|
||||
|
||||
c = divisor / 2; /* for rounding */
|
||||
|
||||
if (fr == 0) { /* divisor is power of two */
|
||||
/* fq will be one bit too large to fit in DCTELEM, so adjust */
|
||||
fq >>= 1;
|
||||
r--;
|
||||
} else if (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */
|
||||
c++;
|
||||
} else { /* fractional part is > 0.5 */
|
||||
fq++;
|
||||
}
|
||||
|
||||
dtbl[DCTSIZE2 * 0] = (DCTELEM)fq; /* reciprocal */
|
||||
dtbl[DCTSIZE2 * 1] = (DCTELEM)c; /* correction + roundfactor */
|
||||
#ifdef WITH_SIMD
|
||||
dtbl[DCTSIZE2 * 2] = (DCTELEM)(1 << (sizeof(DCTELEM) * 8 * 2 - r)); /* scale */
|
||||
#else
|
||||
dtbl[DCTSIZE2 * 2] = 1;
|
||||
#endif
|
||||
dtbl[DCTSIZE2 * 3] = (DCTELEM)r - sizeof(DCTELEM) * 8; /* shift */
|
||||
|
||||
if (r <= 16) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
* Verify that all referenced Q-tables are present, and set up
|
||||
* the divisor table for each one.
|
||||
* In the current implementation, DCT of all components is done during
|
||||
* the first pass, even if only some components will be output in the
|
||||
* first scan. Hence all components should be examined here.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_fdctmgr(j_compress_ptr cinfo)
|
||||
{
|
||||
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
|
||||
int ci, qtblno, i;
|
||||
jpeg_component_info *compptr;
|
||||
JQUANT_TBL *qtbl;
|
||||
DCTELEM *dtbl;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
qtblno = compptr->quant_tbl_no;
|
||||
/* Make sure specified quantization table is present */
|
||||
if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
|
||||
cinfo->quant_tbl_ptrs[qtblno] == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
|
||||
qtbl = cinfo->quant_tbl_ptrs[qtblno];
|
||||
/* Compute divisors for this quant table */
|
||||
/* We may do this more than once for same table, but it's not a big deal */
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
/* For LL&M IDCT method, divisors are equal to raw quantization
|
||||
* coefficients multiplied by 8 (to counteract scaling).
|
||||
*/
|
||||
if (fdct->divisors[qtblno] == NULL) {
|
||||
fdct->divisors[qtblno] = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(DCTSIZE2 * 4) * sizeof(DCTELEM));
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if (!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]) &&
|
||||
fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = ((DCTELEM)qtbl->quantval[i]) << 3;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
{
|
||||
/* For AA&N IDCT method, divisors are equal to quantization
|
||||
* coefficients scaled by scalefactor[row]*scalefactor[col], where
|
||||
* scalefactor[0] = 1
|
||||
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
|
||||
* We apply a further scale factor of 8.
|
||||
*/
|
||||
#define CONST_BITS 14
|
||||
static const INT16 aanscales[DCTSIZE2] = {
|
||||
/* precomputed values scaled up by 14 bits */
|
||||
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
|
||||
22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270,
|
||||
21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906,
|
||||
19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315,
|
||||
16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520,
|
||||
12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552,
|
||||
8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446,
|
||||
4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247
|
||||
};
|
||||
SHIFT_TEMPS
|
||||
|
||||
if (fdct->divisors[qtblno] == NULL) {
|
||||
fdct->divisors[qtblno] = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(DCTSIZE2 * 4) * sizeof(DCTELEM));
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if (!compute_reciprocal(
|
||||
DESCALE(MULTIPLY16V16((JLONG)qtbl->quantval[i],
|
||||
(JLONG)aanscales[i]),
|
||||
CONST_BITS - 3), &dtbl[i]) &&
|
||||
fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = (DCTELEM)
|
||||
DESCALE(MULTIPLY16V16((JLONG)qtbl->quantval[i],
|
||||
(JLONG)aanscales[i]),
|
||||
CONST_BITS - 3);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
{
|
||||
/* For float AA&N IDCT method, divisors are equal to quantization
|
||||
* coefficients scaled by scalefactor[row]*scalefactor[col], where
|
||||
* scalefactor[0] = 1
|
||||
* scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7
|
||||
* We apply a further scale factor of 8.
|
||||
* What's actually stored is 1/divisor so that the inner loop can
|
||||
* use a multiplication rather than a division.
|
||||
*/
|
||||
FAST_FLOAT *fdtbl;
|
||||
int row, col;
|
||||
static const double aanscalefactor[DCTSIZE] = {
|
||||
1.0, 1.387039845, 1.306562965, 1.175875602,
|
||||
1.0, 0.785694958, 0.541196100, 0.275899379
|
||||
};
|
||||
|
||||
if (fdct->float_divisors[qtblno] == NULL) {
|
||||
fdct->float_divisors[qtblno] = (FAST_FLOAT *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
DCTSIZE2 * sizeof(FAST_FLOAT));
|
||||
}
|
||||
fdtbl = fdct->float_divisors[qtblno];
|
||||
i = 0;
|
||||
for (row = 0; row < DCTSIZE; row++) {
|
||||
for (col = 0; col < DCTSIZE; col++) {
|
||||
fdtbl[i] = (FAST_FLOAT)
|
||||
(1.0 / (((double)qtbl->quantval[i] *
|
||||
aanscalefactor[row] * aanscalefactor[col] * 8.0)));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load data into workspace, applying unsigned->signed conversion.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp(JSAMPARRAY sample_data, JDIMENSION start_col, DCTELEM *workspace)
|
||||
{
|
||||
register DCTELEM *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
register int elemr;
|
||||
|
||||
workspaceptr = workspace;
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
#else
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Quantize/descale the coefficients, and store into coef_blocks[].
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
|
||||
{
|
||||
int i;
|
||||
DCTELEM temp;
|
||||
JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
UDCTELEM recip, corr;
|
||||
int shift;
|
||||
UDCTELEM2 product;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
temp = workspace[i];
|
||||
recip = divisors[i + DCTSIZE2 * 0];
|
||||
corr = divisors[i + DCTSIZE2 * 1];
|
||||
shift = divisors[i + DCTSIZE2 * 3];
|
||||
|
||||
if (temp < 0) {
|
||||
temp = -temp;
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM) * 8;
|
||||
temp = (DCTELEM)product;
|
||||
temp = -temp;
|
||||
} else {
|
||||
product = (UDCTELEM2)(temp + corr) * recip;
|
||||
product >>= shift + sizeof(DCTELEM) * 8;
|
||||
temp = (DCTELEM)product;
|
||||
}
|
||||
output_ptr[i] = (JCOEF)temp;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
register DCTELEM qval;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
qval = divisors[i];
|
||||
temp = workspace[i];
|
||||
/* Divide the coefficient value by qval, ensuring proper rounding.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
*
|
||||
* In most files, at least half of the output values will be zero
|
||||
* (at default quantization settings, more like three-quarters...)
|
||||
* so we should ensure that this case is fast. On many machines,
|
||||
* a comparison is enough cheaper than a divide to make a special test
|
||||
* a win. Since both inputs will be nonnegative, we need only test
|
||||
* for a < b to discover whether a/b is 0.
|
||||
* If your machine's division is fast enough, define FAST_DIVIDE.
|
||||
*/
|
||||
#ifdef FAST_DIVIDE
|
||||
#define DIVIDE_BY(a, b) a /= b
|
||||
#else
|
||||
#define DIVIDE_BY(a, b) if (a >= b) a /= b; else a = 0
|
||||
#endif
|
||||
if (temp < 0) {
|
||||
temp = -temp;
|
||||
temp += qval >> 1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
temp = -temp;
|
||||
} else {
|
||||
temp += qval >> 1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
}
|
||||
output_ptr[i] = (JCOEF)temp;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Perform forward DCT on one or more blocks of a component.
|
||||
*
|
||||
* The input samples are taken from the sample_data[] array starting at
|
||||
* position start_row/start_col, and moving to the right for any additional
|
||||
* blocks. The quantized coefficients are returned in coef_blocks[].
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||
JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks)
|
||||
/* This version is used for integer DCT implementations. */
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
|
||||
DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no];
|
||||
DCTELEM *workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
/* Make sure the compiler doesn't look up these every pass */
|
||||
forward_DCT_method_ptr do_dct = fdct->dct;
|
||||
convsamp_method_ptr do_convsamp = fdct->convsamp;
|
||||
quantize_method_ptr do_quantize = fdct->quantize;
|
||||
workspace = fdct->workspace;
|
||||
|
||||
sample_data += start_row; /* fold in the vertical offset once */
|
||||
|
||||
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
|
||||
/* Load data into workspace, applying unsigned->signed conversion */
|
||||
(*do_convsamp) (sample_data, start_col, workspace);
|
||||
|
||||
/* Perform the DCT */
|
||||
(*do_dct) (workspace);
|
||||
|
||||
/* Quantize/descale the coefficients, and store into coef_blocks[] */
|
||||
(*do_quantize) (coef_blocks[bi], divisors, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
|
||||
METHODDEF(void)
|
||||
convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
FAST_FLOAT *workspace)
|
||||
{
|
||||
register FAST_FLOAT *workspaceptr;
|
||||
register JSAMPROW elemptr;
|
||||
register int elemr;
|
||||
|
||||
workspaceptr = workspace;
|
||||
for (elemr = 0; elemr < DCTSIZE; elemr++) {
|
||||
elemptr = sample_data[elemr] + start_col;
|
||||
#if DCTSIZE == 8 /* unroll the inner loop */
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
*workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
#else
|
||||
{
|
||||
register int elemc;
|
||||
for (elemc = DCTSIZE; elemc > 0; elemc--)
|
||||
*workspaceptr++ = (FAST_FLOAT)
|
||||
(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
|
||||
FAST_FLOAT *workspace)
|
||||
{
|
||||
register FAST_FLOAT temp;
|
||||
register int i;
|
||||
register JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
/* Apply the quantization and scaling factor */
|
||||
temp = workspace[i] * divisors[i];
|
||||
|
||||
/* Round to nearest integer.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
* The maximum coefficient size is +-16K (for 12-bit data), so this
|
||||
* code should work for either 16-bit or 32-bit ints.
|
||||
*/
|
||||
output_ptr[i] = (JCOEF)((int)(temp + (FAST_FLOAT)16384.5) - 16384);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
forward_DCT_float(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
|
||||
JDIMENSION start_row, JDIMENSION start_col,
|
||||
JDIMENSION num_blocks)
|
||||
/* This version is used for floating-point DCT implementations. */
|
||||
{
|
||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
|
||||
FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no];
|
||||
FAST_FLOAT *workspace;
|
||||
JDIMENSION bi;
|
||||
|
||||
|
||||
/* Make sure the compiler doesn't look up these every pass */
|
||||
float_DCT_method_ptr do_dct = fdct->float_dct;
|
||||
float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;
|
||||
float_quantize_method_ptr do_quantize = fdct->float_quantize;
|
||||
workspace = fdct->float_workspace;
|
||||
|
||||
sample_data += start_row; /* fold in the vertical offset once */
|
||||
|
||||
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) {
|
||||
/* Load data into workspace, applying unsigned->signed conversion */
|
||||
(*do_convsamp) (sample_data, start_col, workspace);
|
||||
|
||||
/* Perform the DCT */
|
||||
(*do_dct) (workspace);
|
||||
|
||||
/* Quantize/descale the coefficients, and store into coef_blocks[] */
|
||||
(*do_quantize) (coef_blocks[bi], divisors, workspace);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* DCT_FLOAT_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize FDCT manager.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_forward_dct(j_compress_ptr cinfo)
|
||||
{
|
||||
my_fdct_ptr fdct;
|
||||
int i;
|
||||
|
||||
fdct = (my_fdct_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_fdct_controller));
|
||||
cinfo->fdct = (struct jpeg_forward_dct *)fdct;
|
||||
fdct->pub.start_pass = start_pass_fdctmgr;
|
||||
|
||||
/* First determine the DCT... */
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
fdct->pub.forward_DCT = forward_DCT;
|
||||
if (jsimd_can_fdct_islow())
|
||||
fdct->dct = jsimd_fdct_islow;
|
||||
else
|
||||
fdct->dct = jpeg_fdct_islow;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
fdct->pub.forward_DCT = forward_DCT;
|
||||
if (jsimd_can_fdct_ifast())
|
||||
fdct->dct = jsimd_fdct_ifast;
|
||||
else
|
||||
fdct->dct = jpeg_fdct_ifast;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
fdct->pub.forward_DCT = forward_DCT_float;
|
||||
if (jsimd_can_fdct_float())
|
||||
fdct->float_dct = jsimd_fdct_float;
|
||||
else
|
||||
fdct->float_dct = jpeg_fdct_float;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
break;
|
||||
}
|
||||
|
||||
/* ...then the supporting stages. */
|
||||
switch (cinfo->dct_method) {
|
||||
#ifdef DCT_ISLOW_SUPPORTED
|
||||
case JDCT_ISLOW:
|
||||
#endif
|
||||
#ifdef DCT_IFAST_SUPPORTED
|
||||
case JDCT_IFAST:
|
||||
#endif
|
||||
#if defined(DCT_ISLOW_SUPPORTED) || defined(DCT_IFAST_SUPPORTED)
|
||||
if (jsimd_can_convsamp())
|
||||
fdct->convsamp = jsimd_convsamp;
|
||||
else
|
||||
fdct->convsamp = convsamp;
|
||||
if (jsimd_can_quantize())
|
||||
fdct->quantize = jsimd_quantize;
|
||||
else
|
||||
fdct->quantize = quantize;
|
||||
break;
|
||||
#endif
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
case JDCT_FLOAT:
|
||||
if (jsimd_can_convsamp_float())
|
||||
fdct->float_convsamp = jsimd_convsamp_float;
|
||||
else
|
||||
fdct->float_convsamp = convsamp_float;
|
||||
if (jsimd_can_quantize_float())
|
||||
fdct->float_quantize = jsimd_quantize_float;
|
||||
else
|
||||
fdct->float_quantize = quantize_float;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Allocate workspace memory */
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
if (cinfo->dct_method == JDCT_FLOAT)
|
||||
fdct->float_workspace = (FAST_FLOAT *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(FAST_FLOAT) * DCTSIZE2);
|
||||
else
|
||||
#endif
|
||||
fdct->workspace = (DCTELEM *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(DCTELEM) * DCTSIZE2);
|
||||
|
||||
/* Mark divisor tables unallocated */
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
fdct->divisors[i] = NULL;
|
||||
#ifdef DCT_FLOAT_SUPPORTED
|
||||
fdct->float_divisors[i] = NULL;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Vendored
+1092
File diff suppressed because it is too large
Load Diff
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* jchuff.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains declarations for Huffman entropy encoding routines
|
||||
* that are shared between the sequential encoder (jchuff.c) and the
|
||||
* progressive encoder (jcphuff.c). No other modules need to see these.
|
||||
*/
|
||||
|
||||
/* The legal range of a DCT coefficient is
|
||||
* -1024 .. +1023 for 8-bit data;
|
||||
* -16384 .. +16383 for 12-bit data.
|
||||
* Hence the magnitude should always fit in 10 or 14 bits respectively.
|
||||
*/
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
#define MAX_COEF_BITS 10
|
||||
#else
|
||||
#define MAX_COEF_BITS 14
|
||||
#endif
|
||||
|
||||
/* Derived data constructed for each Huffman table */
|
||||
|
||||
typedef struct {
|
||||
unsigned int ehufco[256]; /* code for each symbol */
|
||||
char ehufsi[256]; /* length of code for each symbol */
|
||||
/* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */
|
||||
} c_derived_tbl;
|
||||
|
||||
/* Expand a Huffman table definition into the derived format */
|
||||
EXTERN(void) jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC,
|
||||
int tblno, c_derived_tbl **pdtbl);
|
||||
|
||||
/* Generate an optimal table definition given the specified counts */
|
||||
EXTERN(void) jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL *htbl,
|
||||
long freq[]);
|
||||
Vendored
+77
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* jcinit.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains initialization logic for the JPEG compressor.
|
||||
* This routine is in charge of selecting the modules to be executed and
|
||||
* making an initialization call to each one.
|
||||
*
|
||||
* Logically, this code belongs in jcmaster.c. It's split out because
|
||||
* linking this routine implies linking the entire compression library.
|
||||
* For a transcoding-only application, we want to be able to use jcmaster.c
|
||||
* without linking in the whole library.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Master selection of compression modules.
|
||||
* This is done once at the start of processing an image. We determine
|
||||
* which modules will be used and give them appropriate initialization calls.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_compress_master(j_compress_ptr cinfo)
|
||||
{
|
||||
/* Initialize master control (includes parameter checking/processing) */
|
||||
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
||||
|
||||
/* Preprocessing */
|
||||
if (!cinfo->raw_data_in) {
|
||||
jinit_color_converter(cinfo);
|
||||
jinit_downsampler(cinfo);
|
||||
jinit_c_prep_controller(cinfo, FALSE /* never need full buffer here */);
|
||||
}
|
||||
/* Forward DCT */
|
||||
jinit_forward_dct(cinfo);
|
||||
/* Entropy encoding: either Huffman or arithmetic coding. */
|
||||
if (cinfo->arith_code) {
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
jinit_arith_encoder(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
|
||||
#endif
|
||||
} else {
|
||||
if (cinfo->progressive_mode) {
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
jinit_phuff_encoder(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else
|
||||
jinit_huff_encoder(cinfo);
|
||||
}
|
||||
|
||||
/* Need a full-image coefficient buffer in any multi-pass mode. */
|
||||
jinit_c_coef_controller(cinfo, (boolean)(cinfo->num_scans > 1 ||
|
||||
cinfo->optimize_coding));
|
||||
jinit_c_main_controller(cinfo, FALSE /* never need full buffer here */);
|
||||
|
||||
jinit_marker_writer(cinfo);
|
||||
|
||||
/* We can now tell the memory manager to allocate virtual arrays. */
|
||||
(*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
|
||||
|
||||
/* Write the datastream header (SOI) immediately.
|
||||
* Frame and scan headers are postponed till later.
|
||||
* This lets application insert special markers after the SOI.
|
||||
*/
|
||||
(*cinfo->marker->write_file_header) (cinfo);
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* jcmainct.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the main buffer controller for compression.
|
||||
* The main buffer lies between the pre-processor and the JPEG
|
||||
* compressor proper; it holds downsampled data in the JPEG colorspace.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_c_main_controller pub; /* public fields */
|
||||
|
||||
JDIMENSION cur_iMCU_row; /* number of current iMCU row */
|
||||
JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */
|
||||
boolean suspended; /* remember if we suspended output */
|
||||
J_BUF_MODE pass_mode; /* current operating mode */
|
||||
|
||||
/* If using just a strip buffer, this points to the entire set of buffers
|
||||
* (we allocate one for each component). In the full-image case, this
|
||||
* points to the currently accessible strips of the virtual arrays.
|
||||
*/
|
||||
JSAMPARRAY buffer[MAX_COMPONENTS];
|
||||
} my_main_controller;
|
||||
|
||||
typedef my_main_controller *my_main_ptr;
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(void) process_data_simple_main(j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr,
|
||||
JDIMENSION in_rows_avail);
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_main(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
|
||||
/* Do nothing in raw-data mode. */
|
||||
if (cinfo->raw_data_in)
|
||||
return;
|
||||
|
||||
if (pass_mode != JBUF_PASS_THRU)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
main_ptr->cur_iMCU_row = 0; /* initialize counters */
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->suspended = FALSE;
|
||||
main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */
|
||||
main_ptr->pub.process_data = process_data_simple_main;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process some data.
|
||||
* This routine handles the simple pass-through mode,
|
||||
* where we have only a strip buffer.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
process_data_simple_main(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
|
||||
while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) {
|
||||
/* Read input data if we haven't filled the main buffer yet */
|
||||
if (main_ptr->rowgroup_ctr < DCTSIZE)
|
||||
(*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr,
|
||||
in_rows_avail, main_ptr->buffer,
|
||||
&main_ptr->rowgroup_ctr,
|
||||
(JDIMENSION)DCTSIZE);
|
||||
|
||||
/* If we don't have a full iMCU row buffered, return to application for
|
||||
* more data. Note that preprocessor will always pad to fill the iMCU row
|
||||
* at the bottom of the image.
|
||||
*/
|
||||
if (main_ptr->rowgroup_ctr != DCTSIZE)
|
||||
return;
|
||||
|
||||
/* Send the completed row to the compressor */
|
||||
if (!(*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) {
|
||||
/* If compressor did not consume the whole row, then we must need to
|
||||
* suspend processing and return to the application. In this situation
|
||||
* we pretend we didn't yet consume the last input row; otherwise, if
|
||||
* it happened to be the last row of the image, the application would
|
||||
* think we were done.
|
||||
*/
|
||||
if (!main_ptr->suspended) {
|
||||
(*in_row_ctr)--;
|
||||
main_ptr->suspended = TRUE;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/* We did finish the row. Undo our little suspension hack if a previous
|
||||
* call suspended; then mark the main buffer empty.
|
||||
*/
|
||||
if (main_ptr->suspended) {
|
||||
(*in_row_ctr)++;
|
||||
main_ptr->suspended = FALSE;
|
||||
}
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->cur_iMCU_row++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize main buffer controller.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_c_main_controller(j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_main_ptr main_ptr;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
main_ptr = (my_main_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_main_controller));
|
||||
cinfo->main = (struct jpeg_c_main_controller *)main_ptr;
|
||||
main_ptr->pub.start_pass = start_pass_main;
|
||||
|
||||
/* We don't need to create a buffer in raw-data mode. */
|
||||
if (cinfo->raw_data_in)
|
||||
return;
|
||||
|
||||
/* Create the buffer. It holds downsampled data, so each component
|
||||
* may be of a different size.
|
||||
*/
|
||||
if (need_full_buffer) {
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
} else {
|
||||
/* Allocate a strip buffer for each component */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
compptr->width_in_blocks * DCTSIZE,
|
||||
(JDIMENSION)(compptr->v_samp_factor * DCTSIZE));
|
||||
}
|
||||
}
|
||||
}
|
||||
+664
@@ -0,0 +1,664 @@
|
||||
/*
|
||||
* jcmarker.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains routines to write JPEG datastream markers.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
typedef enum { /* JPEG marker codes */
|
||||
M_SOF0 = 0xc0,
|
||||
M_SOF1 = 0xc1,
|
||||
M_SOF2 = 0xc2,
|
||||
M_SOF3 = 0xc3,
|
||||
|
||||
M_SOF5 = 0xc5,
|
||||
M_SOF6 = 0xc6,
|
||||
M_SOF7 = 0xc7,
|
||||
|
||||
M_JPG = 0xc8,
|
||||
M_SOF9 = 0xc9,
|
||||
M_SOF10 = 0xca,
|
||||
M_SOF11 = 0xcb,
|
||||
|
||||
M_SOF13 = 0xcd,
|
||||
M_SOF14 = 0xce,
|
||||
M_SOF15 = 0xcf,
|
||||
|
||||
M_DHT = 0xc4,
|
||||
|
||||
M_DAC = 0xcc,
|
||||
|
||||
M_RST0 = 0xd0,
|
||||
M_RST1 = 0xd1,
|
||||
M_RST2 = 0xd2,
|
||||
M_RST3 = 0xd3,
|
||||
M_RST4 = 0xd4,
|
||||
M_RST5 = 0xd5,
|
||||
M_RST6 = 0xd6,
|
||||
M_RST7 = 0xd7,
|
||||
|
||||
M_SOI = 0xd8,
|
||||
M_EOI = 0xd9,
|
||||
M_SOS = 0xda,
|
||||
M_DQT = 0xdb,
|
||||
M_DNL = 0xdc,
|
||||
M_DRI = 0xdd,
|
||||
M_DHP = 0xde,
|
||||
M_EXP = 0xdf,
|
||||
|
||||
M_APP0 = 0xe0,
|
||||
M_APP1 = 0xe1,
|
||||
M_APP2 = 0xe2,
|
||||
M_APP3 = 0xe3,
|
||||
M_APP4 = 0xe4,
|
||||
M_APP5 = 0xe5,
|
||||
M_APP6 = 0xe6,
|
||||
M_APP7 = 0xe7,
|
||||
M_APP8 = 0xe8,
|
||||
M_APP9 = 0xe9,
|
||||
M_APP10 = 0xea,
|
||||
M_APP11 = 0xeb,
|
||||
M_APP12 = 0xec,
|
||||
M_APP13 = 0xed,
|
||||
M_APP14 = 0xee,
|
||||
M_APP15 = 0xef,
|
||||
|
||||
M_JPG0 = 0xf0,
|
||||
M_JPG13 = 0xfd,
|
||||
M_COM = 0xfe,
|
||||
|
||||
M_TEM = 0x01,
|
||||
|
||||
M_ERROR = 0x100
|
||||
} JPEG_MARKER;
|
||||
|
||||
|
||||
/* Private state */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_marker_writer pub; /* public fields */
|
||||
|
||||
unsigned int last_restart_interval; /* last DRI value emitted; 0 after SOI */
|
||||
} my_marker_writer;
|
||||
|
||||
typedef my_marker_writer *my_marker_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Basic output routines.
|
||||
*
|
||||
* Note that we do not support suspension while writing a marker.
|
||||
* Therefore, an application using suspension must ensure that there is
|
||||
* enough buffer space for the initial markers (typ. 600-700 bytes) before
|
||||
* calling jpeg_start_compress, and enough space to write the trailing EOI
|
||||
* (a few bytes) before calling jpeg_finish_compress. Multipass compression
|
||||
* modes are not supported at all with suspension, so those two are the only
|
||||
* points where markers will be written.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
emit_byte(j_compress_ptr cinfo, int val)
|
||||
/* Emit a byte */
|
||||
{
|
||||
struct jpeg_destination_mgr *dest = cinfo->dest;
|
||||
|
||||
*(dest->next_output_byte)++ = (JOCTET)val;
|
||||
if (--dest->free_in_buffer == 0) {
|
||||
if (!(*dest->empty_output_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_marker(j_compress_ptr cinfo, JPEG_MARKER mark)
|
||||
/* Emit a marker code */
|
||||
{
|
||||
emit_byte(cinfo, 0xFF);
|
||||
emit_byte(cinfo, (int)mark);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_2bytes(j_compress_ptr cinfo, int value)
|
||||
/* Emit a 2-byte integer; these are always MSB first in JPEG files */
|
||||
{
|
||||
emit_byte(cinfo, (value >> 8) & 0xFF);
|
||||
emit_byte(cinfo, value & 0xFF);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Routines to write specific marker types.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
emit_dqt(j_compress_ptr cinfo, int index)
|
||||
/* Emit a DQT marker */
|
||||
/* Returns the precision used (0 = 8bits, 1 = 16bits) for baseline checking */
|
||||
{
|
||||
JQUANT_TBL *qtbl = cinfo->quant_tbl_ptrs[index];
|
||||
int prec;
|
||||
int i;
|
||||
|
||||
if (qtbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, index);
|
||||
|
||||
prec = 0;
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
if (qtbl->quantval[i] > 255)
|
||||
prec = 1;
|
||||
}
|
||||
|
||||
if (!qtbl->sent_table) {
|
||||
emit_marker(cinfo, M_DQT);
|
||||
|
||||
emit_2bytes(cinfo, prec ? DCTSIZE2 * 2 + 1 + 2 : DCTSIZE2 + 1 + 2);
|
||||
|
||||
emit_byte(cinfo, index + (prec << 4));
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
/* The table entries must be emitted in zigzag order. */
|
||||
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
|
||||
if (prec)
|
||||
emit_byte(cinfo, (int)(qval >> 8));
|
||||
emit_byte(cinfo, (int)(qval & 0xFF));
|
||||
}
|
||||
|
||||
qtbl->sent_table = TRUE;
|
||||
}
|
||||
|
||||
return prec;
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_dht(j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
/* Emit a DHT marker */
|
||||
{
|
||||
JHUFF_TBL *htbl;
|
||||
int length, i;
|
||||
|
||||
if (is_ac) {
|
||||
htbl = cinfo->ac_huff_tbl_ptrs[index];
|
||||
index += 0x10; /* output index has AC bit set */
|
||||
} else {
|
||||
htbl = cinfo->dc_huff_tbl_ptrs[index];
|
||||
}
|
||||
|
||||
if (htbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, index);
|
||||
|
||||
if (!htbl->sent_table) {
|
||||
emit_marker(cinfo, M_DHT);
|
||||
|
||||
length = 0;
|
||||
for (i = 1; i <= 16; i++)
|
||||
length += htbl->bits[i];
|
||||
|
||||
emit_2bytes(cinfo, length + 2 + 1 + 16);
|
||||
emit_byte(cinfo, index);
|
||||
|
||||
for (i = 1; i <= 16; i++)
|
||||
emit_byte(cinfo, htbl->bits[i]);
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
emit_byte(cinfo, htbl->huffval[i]);
|
||||
|
||||
htbl->sent_table = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_dac(j_compress_ptr cinfo)
|
||||
/* Emit a DAC marker */
|
||||
/* Since the useful info is so small, we want to emit all the tables in */
|
||||
/* one DAC marker. Therefore this routine does its own scan of the table. */
|
||||
{
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
char dc_in_use[NUM_ARITH_TBLS];
|
||||
char ac_in_use[NUM_ARITH_TBLS];
|
||||
int length, i;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++)
|
||||
dc_in_use[i] = ac_in_use[i] = 0;
|
||||
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0)
|
||||
dc_in_use[compptr->dc_tbl_no] = 1;
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->Se)
|
||||
ac_in_use[compptr->ac_tbl_no] = 1;
|
||||
}
|
||||
|
||||
length = 0;
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++)
|
||||
length += dc_in_use[i] + ac_in_use[i];
|
||||
|
||||
if (length) {
|
||||
emit_marker(cinfo, M_DAC);
|
||||
|
||||
emit_2bytes(cinfo, length * 2 + 2);
|
||||
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
if (dc_in_use[i]) {
|
||||
emit_byte(cinfo, i);
|
||||
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i] << 4));
|
||||
}
|
||||
if (ac_in_use[i]) {
|
||||
emit_byte(cinfo, i + 0x10);
|
||||
emit_byte(cinfo, cinfo->arith_ac_K[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* C_ARITH_CODING_SUPPORTED */
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_dri(j_compress_ptr cinfo)
|
||||
/* Emit a DRI marker */
|
||||
{
|
||||
emit_marker(cinfo, M_DRI);
|
||||
|
||||
emit_2bytes(cinfo, 4); /* fixed length */
|
||||
|
||||
emit_2bytes(cinfo, (int)cinfo->restart_interval);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_sof(j_compress_ptr cinfo, JPEG_MARKER code)
|
||||
/* Emit a SOF marker */
|
||||
{
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
emit_marker(cinfo, code);
|
||||
|
||||
emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */
|
||||
|
||||
/* Make sure image isn't bigger than SOF field can handle */
|
||||
if ((long)cinfo->_jpeg_height > 65535L || (long)cinfo->_jpeg_width > 65535L)
|
||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)65535);
|
||||
|
||||
emit_byte(cinfo, cinfo->data_precision);
|
||||
emit_2bytes(cinfo, (int)cinfo->_jpeg_height);
|
||||
emit_2bytes(cinfo, (int)cinfo->_jpeg_width);
|
||||
|
||||
emit_byte(cinfo, cinfo->num_components);
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
emit_byte(cinfo, compptr->component_id);
|
||||
emit_byte(cinfo, (compptr->h_samp_factor << 4) + compptr->v_samp_factor);
|
||||
emit_byte(cinfo, compptr->quant_tbl_no);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_sos(j_compress_ptr cinfo)
|
||||
/* Emit a SOS marker */
|
||||
{
|
||||
int i, td, ta;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
emit_marker(cinfo, M_SOS);
|
||||
|
||||
emit_2bytes(cinfo, 2 * cinfo->comps_in_scan + 2 + 1 + 3); /* length */
|
||||
|
||||
emit_byte(cinfo, cinfo->comps_in_scan);
|
||||
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
emit_byte(cinfo, compptr->component_id);
|
||||
|
||||
/* We emit 0 for unused field(s); this is recommended by the P&M text
|
||||
* but does not seem to be specified in the standard.
|
||||
*/
|
||||
|
||||
/* DC needs no table for refinement scan */
|
||||
td = cinfo->Ss == 0 && cinfo->Ah == 0 ? compptr->dc_tbl_no : 0;
|
||||
/* AC needs no table when not present */
|
||||
ta = cinfo->Se ? compptr->ac_tbl_no : 0;
|
||||
|
||||
emit_byte(cinfo, (td << 4) + ta);
|
||||
}
|
||||
|
||||
emit_byte(cinfo, cinfo->Ss);
|
||||
emit_byte(cinfo, cinfo->Se);
|
||||
emit_byte(cinfo, (cinfo->Ah << 4) + cinfo->Al);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_jfif_app0(j_compress_ptr cinfo)
|
||||
/* Emit a JFIF-compliant APP0 marker */
|
||||
{
|
||||
/*
|
||||
* Length of APP0 block (2 bytes)
|
||||
* Block ID (4 bytes - ASCII "JFIF")
|
||||
* Zero byte (1 byte to terminate the ID string)
|
||||
* Version Major, Minor (2 bytes - major first)
|
||||
* Units (1 byte - 0x00 = none, 0x01 = inch, 0x02 = cm)
|
||||
* Xdpu (2 bytes - dots per unit horizontal)
|
||||
* Ydpu (2 bytes - dots per unit vertical)
|
||||
* Thumbnail X size (1 byte)
|
||||
* Thumbnail Y size (1 byte)
|
||||
*/
|
||||
|
||||
emit_marker(cinfo, M_APP0);
|
||||
|
||||
emit_2bytes(cinfo, 2 + 4 + 1 + 2 + 1 + 2 + 2 + 1 + 1); /* length */
|
||||
|
||||
emit_byte(cinfo, 0x4A); /* Identifier: ASCII "JFIF" */
|
||||
emit_byte(cinfo, 0x46);
|
||||
emit_byte(cinfo, 0x49);
|
||||
emit_byte(cinfo, 0x46);
|
||||
emit_byte(cinfo, 0);
|
||||
emit_byte(cinfo, cinfo->JFIF_major_version); /* Version fields */
|
||||
emit_byte(cinfo, cinfo->JFIF_minor_version);
|
||||
emit_byte(cinfo, cinfo->density_unit); /* Pixel size information */
|
||||
emit_2bytes(cinfo, (int)cinfo->X_density);
|
||||
emit_2bytes(cinfo, (int)cinfo->Y_density);
|
||||
emit_byte(cinfo, 0); /* No thumbnail image */
|
||||
emit_byte(cinfo, 0);
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
emit_adobe_app14(j_compress_ptr cinfo)
|
||||
/* Emit an Adobe APP14 marker */
|
||||
{
|
||||
/*
|
||||
* Length of APP14 block (2 bytes)
|
||||
* Block ID (5 bytes - ASCII "Adobe")
|
||||
* Version Number (2 bytes - currently 100)
|
||||
* Flags0 (2 bytes - currently 0)
|
||||
* Flags1 (2 bytes - currently 0)
|
||||
* Color transform (1 byte)
|
||||
*
|
||||
* Although Adobe TN 5116 mentions Version = 101, all the Adobe files
|
||||
* now in circulation seem to use Version = 100, so that's what we write.
|
||||
*
|
||||
* We write the color transform byte as 1 if the JPEG color space is
|
||||
* YCbCr, 2 if it's YCCK, 0 otherwise. Adobe's definition has to do with
|
||||
* whether the encoder performed a transformation, which is pretty useless.
|
||||
*/
|
||||
|
||||
emit_marker(cinfo, M_APP14);
|
||||
|
||||
emit_2bytes(cinfo, 2 + 5 + 2 + 2 + 2 + 1); /* length */
|
||||
|
||||
emit_byte(cinfo, 0x41); /* Identifier: ASCII "Adobe" */
|
||||
emit_byte(cinfo, 0x64);
|
||||
emit_byte(cinfo, 0x6F);
|
||||
emit_byte(cinfo, 0x62);
|
||||
emit_byte(cinfo, 0x65);
|
||||
emit_2bytes(cinfo, 100); /* Version */
|
||||
emit_2bytes(cinfo, 0); /* Flags0 */
|
||||
emit_2bytes(cinfo, 0); /* Flags1 */
|
||||
switch (cinfo->jpeg_color_space) {
|
||||
case JCS_YCbCr:
|
||||
emit_byte(cinfo, 1); /* Color transform = 1 */
|
||||
break;
|
||||
case JCS_YCCK:
|
||||
emit_byte(cinfo, 2); /* Color transform = 2 */
|
||||
break;
|
||||
default:
|
||||
emit_byte(cinfo, 0); /* Color transform = 0 */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* These routines allow writing an arbitrary marker with parameters.
|
||||
* The only intended use is to emit COM or APPn markers after calling
|
||||
* write_file_header and before calling write_frame_header.
|
||||
* Other uses are not guaranteed to produce desirable results.
|
||||
* Counting the parameter bytes properly is the caller's responsibility.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_marker_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
|
||||
/* Emit an arbitrary marker header */
|
||||
{
|
||||
if (datalen > (unsigned int)65533) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_LENGTH);
|
||||
|
||||
emit_marker(cinfo, (JPEG_MARKER)marker);
|
||||
|
||||
emit_2bytes(cinfo, (int)(datalen + 2)); /* total length */
|
||||
}
|
||||
|
||||
METHODDEF(void)
|
||||
write_marker_byte(j_compress_ptr cinfo, int val)
|
||||
/* Emit one byte of marker parameters following write_marker_header */
|
||||
{
|
||||
emit_byte(cinfo, val);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write datastream header.
|
||||
* This consists of an SOI and optional APPn markers.
|
||||
* We recommend use of the JFIF marker, but not the Adobe marker,
|
||||
* when using YCbCr or grayscale data. The JFIF marker should NOT
|
||||
* be used for any other JPEG colorspace. The Adobe marker is helpful
|
||||
* to distinguish RGB, CMYK, and YCCK colorspaces.
|
||||
* Note that an application can write additional header markers after
|
||||
* jpeg_start_compress returns.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_file_header(j_compress_ptr cinfo)
|
||||
{
|
||||
my_marker_ptr marker = (my_marker_ptr)cinfo->marker;
|
||||
|
||||
emit_marker(cinfo, M_SOI); /* first the SOI */
|
||||
|
||||
/* SOI is defined to reset restart interval to 0 */
|
||||
marker->last_restart_interval = 0;
|
||||
|
||||
if (cinfo->write_JFIF_header) /* next an optional JFIF APP0 */
|
||||
emit_jfif_app0(cinfo);
|
||||
if (cinfo->write_Adobe_marker) /* next an optional Adobe APP14 */
|
||||
emit_adobe_app14(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write frame header.
|
||||
* This consists of DQT and SOFn markers.
|
||||
* Note that we do not emit the SOF until we have emitted the DQT(s).
|
||||
* This avoids compatibility problems with incorrect implementations that
|
||||
* try to error-check the quant table numbers as soon as they see the SOF.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_frame_header(j_compress_ptr cinfo)
|
||||
{
|
||||
int ci, prec;
|
||||
boolean is_baseline;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Emit DQT for each quantization table.
|
||||
* Note that emit_dqt() suppresses any duplicate tables.
|
||||
*/
|
||||
prec = 0;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
prec += emit_dqt(cinfo, compptr->quant_tbl_no);
|
||||
}
|
||||
/* now prec is nonzero iff there are any 16-bit quant tables. */
|
||||
|
||||
/* Check for a non-baseline specification.
|
||||
* Note we assume that Huffman table numbers won't be changed later.
|
||||
*/
|
||||
if (cinfo->arith_code || cinfo->progressive_mode ||
|
||||
cinfo->data_precision != 8) {
|
||||
is_baseline = FALSE;
|
||||
} else {
|
||||
is_baseline = TRUE;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
if (compptr->dc_tbl_no > 1 || compptr->ac_tbl_no > 1)
|
||||
is_baseline = FALSE;
|
||||
}
|
||||
if (prec && is_baseline) {
|
||||
is_baseline = FALSE;
|
||||
/* If it's baseline except for quantizer size, warn the user */
|
||||
TRACEMS(cinfo, 0, JTRC_16BIT_TABLES);
|
||||
}
|
||||
}
|
||||
|
||||
/* Emit the proper SOF marker */
|
||||
if (cinfo->arith_code) {
|
||||
if (cinfo->progressive_mode)
|
||||
emit_sof(cinfo, M_SOF10); /* SOF code for progressive arithmetic */
|
||||
else
|
||||
emit_sof(cinfo, M_SOF9); /* SOF code for sequential arithmetic */
|
||||
} else {
|
||||
if (cinfo->progressive_mode)
|
||||
emit_sof(cinfo, M_SOF2); /* SOF code for progressive Huffman */
|
||||
else if (is_baseline)
|
||||
emit_sof(cinfo, M_SOF0); /* SOF code for baseline implementation */
|
||||
else
|
||||
emit_sof(cinfo, M_SOF1); /* SOF code for non-baseline Huffman file */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write scan header.
|
||||
* This consists of DHT or DAC markers, optional DRI, and SOS.
|
||||
* Compressed data will be written following the SOS.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_scan_header(j_compress_ptr cinfo)
|
||||
{
|
||||
my_marker_ptr marker = (my_marker_ptr)cinfo->marker;
|
||||
int i;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (cinfo->arith_code) {
|
||||
/* Emit arith conditioning info. We may have some duplication
|
||||
* if the file has multiple scans, but it's so small it's hardly
|
||||
* worth worrying about.
|
||||
*/
|
||||
emit_dac(cinfo);
|
||||
} else {
|
||||
/* Emit Huffman tables.
|
||||
* Note that emit_dht() suppresses any duplicate tables.
|
||||
*/
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
/* DC needs no table for refinement scan */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0)
|
||||
emit_dht(cinfo, compptr->dc_tbl_no, FALSE);
|
||||
/* AC needs no table when not present */
|
||||
if (cinfo->Se)
|
||||
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/* Emit DRI if required --- note that DRI value could change for each scan.
|
||||
* We avoid wasting space with unnecessary DRIs, however.
|
||||
*/
|
||||
if (cinfo->restart_interval != marker->last_restart_interval) {
|
||||
emit_dri(cinfo);
|
||||
marker->last_restart_interval = cinfo->restart_interval;
|
||||
}
|
||||
|
||||
emit_sos(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write datastream trailer.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_file_trailer(j_compress_ptr cinfo)
|
||||
{
|
||||
emit_marker(cinfo, M_EOI);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write an abbreviated table-specification datastream.
|
||||
* This consists of SOI, DQT and DHT tables, and EOI.
|
||||
* Any table that is defined and not marked sent_table = TRUE will be
|
||||
* emitted. Note that all tables will be marked sent_table = TRUE at exit.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
write_tables_only(j_compress_ptr cinfo)
|
||||
{
|
||||
int i;
|
||||
|
||||
emit_marker(cinfo, M_SOI);
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
||||
if (cinfo->quant_tbl_ptrs[i] != NULL)
|
||||
(void)emit_dqt(cinfo, i);
|
||||
}
|
||||
|
||||
if (!cinfo->arith_code) {
|
||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||
if (cinfo->dc_huff_tbl_ptrs[i] != NULL)
|
||||
emit_dht(cinfo, i, FALSE);
|
||||
if (cinfo->ac_huff_tbl_ptrs[i] != NULL)
|
||||
emit_dht(cinfo, i, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
emit_marker(cinfo, M_EOI);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the marker writer module.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_marker_writer(j_compress_ptr cinfo)
|
||||
{
|
||||
my_marker_ptr marker;
|
||||
|
||||
/* Create the subobject */
|
||||
marker = (my_marker_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_marker_writer));
|
||||
cinfo->marker = (struct jpeg_marker_writer *)marker;
|
||||
/* Initialize method pointers */
|
||||
marker->pub.write_file_header = write_file_header;
|
||||
marker->pub.write_frame_header = write_frame_header;
|
||||
marker->pub.write_scan_header = write_scan_header;
|
||||
marker->pub.write_file_trailer = write_file_trailer;
|
||||
marker->pub.write_tables_only = write_tables_only;
|
||||
marker->pub.write_marker_header = write_marker_header;
|
||||
marker->pub.write_marker_byte = write_marker_byte;
|
||||
/* Initialize private state */
|
||||
marker->last_restart_interval = 0;
|
||||
}
|
||||
+640
@@ -0,0 +1,640 @@
|
||||
/*
|
||||
* jcmaster.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2010 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2016, 2018, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains master control logic for the JPEG compressor.
|
||||
* These routines are concerned with parameter validation, initial setup,
|
||||
* and inter-pass control (determining the number of passes and the work
|
||||
* to be done in each pass).
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/* Private state */
|
||||
|
||||
typedef enum {
|
||||
main_pass, /* input data, also do first output step */
|
||||
huff_opt_pass, /* Huffman code optimization pass */
|
||||
output_pass /* data output pass */
|
||||
} c_pass_type;
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_comp_master pub; /* public fields */
|
||||
|
||||
c_pass_type pass_type; /* the type of the current pass */
|
||||
|
||||
int pass_number; /* # of passes completed */
|
||||
int total_passes; /* total # of passes needed */
|
||||
|
||||
int scan_number; /* current index in scan_info[] */
|
||||
|
||||
/*
|
||||
* This is here so we can add libjpeg-turbo version/build information to the
|
||||
* global string table without introducing a new global symbol. Adding this
|
||||
* information to the global string table allows one to examine a binary
|
||||
* object and determine which version of libjpeg-turbo it was built from or
|
||||
* linked against.
|
||||
*/
|
||||
const char *jpeg_version;
|
||||
|
||||
} my_comp_master;
|
||||
|
||||
typedef my_comp_master *my_master_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Support routines that do various essential calculations.
|
||||
*/
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
/*
|
||||
* Compute JPEG image dimensions and related values.
|
||||
* NOTE: this is exported for possible use by application.
|
||||
* Hence it mustn't do anything that can't be done twice.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_calc_jpeg_dimensions(j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
/* Hardwire it to "no scaling" */
|
||||
cinfo->jpeg_width = cinfo->image_width;
|
||||
cinfo->jpeg_height = cinfo->image_height;
|
||||
cinfo->min_DCT_h_scaled_size = DCTSIZE;
|
||||
cinfo->min_DCT_v_scaled_size = DCTSIZE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
initial_setup(j_compress_ptr cinfo, boolean transcode_only)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
long samplesperrow;
|
||||
JDIMENSION jd_samplesperrow;
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
#if JPEG_LIB_VERSION >= 80
|
||||
if (!transcode_only)
|
||||
#endif
|
||||
jpeg_calc_jpeg_dimensions(cinfo);
|
||||
#endif
|
||||
|
||||
/* Sanity check on image dimensions */
|
||||
if (cinfo->_jpeg_height <= 0 || cinfo->_jpeg_width <= 0 ||
|
||||
cinfo->num_components <= 0 || cinfo->input_components <= 0)
|
||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||
|
||||
/* Make sure image isn't bigger than I can handle */
|
||||
if ((long)cinfo->_jpeg_height > (long)JPEG_MAX_DIMENSION ||
|
||||
(long)cinfo->_jpeg_width > (long)JPEG_MAX_DIMENSION)
|
||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)JPEG_MAX_DIMENSION);
|
||||
|
||||
/* Width of an input scanline must be representable as JDIMENSION. */
|
||||
samplesperrow = (long)cinfo->image_width * (long)cinfo->input_components;
|
||||
jd_samplesperrow = (JDIMENSION)samplesperrow;
|
||||
if ((long)jd_samplesperrow != samplesperrow)
|
||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||
|
||||
/* For now, precision must match compiled-in value... */
|
||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
|
||||
/* Check that number of components won't exceed internal array sizes */
|
||||
if (cinfo->num_components > MAX_COMPONENTS)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPONENTS);
|
||||
|
||||
/* Compute maximum sampling factors; check factor validity */
|
||||
cinfo->max_h_samp_factor = 1;
|
||||
cinfo->max_v_samp_factor = 1;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
if (compptr->h_samp_factor <= 0 ||
|
||||
compptr->h_samp_factor > MAX_SAMP_FACTOR ||
|
||||
compptr->v_samp_factor <= 0 ||
|
||||
compptr->v_samp_factor > MAX_SAMP_FACTOR)
|
||||
ERREXIT(cinfo, JERR_BAD_SAMPLING);
|
||||
cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
|
||||
compptr->h_samp_factor);
|
||||
cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
|
||||
compptr->v_samp_factor);
|
||||
}
|
||||
|
||||
/* Compute dimensions of components */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* Fill in the correct component_index value; don't rely on application */
|
||||
compptr->component_index = ci;
|
||||
/* For compression, we never do DCT scaling. */
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;
|
||||
#else
|
||||
compptr->DCT_scaled_size = DCTSIZE;
|
||||
#endif
|
||||
/* Size in DCT blocks */
|
||||
compptr->width_in_blocks = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_width * (long)compptr->h_samp_factor,
|
||||
(long)(cinfo->max_h_samp_factor * DCTSIZE));
|
||||
compptr->height_in_blocks = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_height * (long)compptr->v_samp_factor,
|
||||
(long)(cinfo->max_v_samp_factor * DCTSIZE));
|
||||
/* Size in samples */
|
||||
compptr->downsampled_width = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_width * (long)compptr->h_samp_factor,
|
||||
(long)cinfo->max_h_samp_factor);
|
||||
compptr->downsampled_height = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_height * (long)compptr->v_samp_factor,
|
||||
(long)cinfo->max_v_samp_factor);
|
||||
/* Mark component needed (this flag isn't actually used for compression) */
|
||||
compptr->component_needed = TRUE;
|
||||
}
|
||||
|
||||
/* Compute number of fully interleaved MCU rows (number of times that
|
||||
* main controller will call coefficient controller).
|
||||
*/
|
||||
cinfo->total_iMCU_rows = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_height,
|
||||
(long)(cinfo->max_v_samp_factor * DCTSIZE));
|
||||
}
|
||||
|
||||
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
|
||||
LOCAL(void)
|
||||
validate_script(j_compress_ptr cinfo)
|
||||
/* Verify that the scan script in cinfo->scan_info[] is valid; also
|
||||
* determine whether it uses progressive JPEG, and set cinfo->progressive_mode.
|
||||
*/
|
||||
{
|
||||
const jpeg_scan_info *scanptr;
|
||||
int scanno, ncomps, ci, coefi, thisi;
|
||||
int Ss, Se, Ah, Al;
|
||||
boolean component_sent[MAX_COMPONENTS];
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
int *last_bitpos_ptr;
|
||||
int last_bitpos[MAX_COMPONENTS][DCTSIZE2];
|
||||
/* -1 until that coefficient has been seen; then last Al for it */
|
||||
#endif
|
||||
|
||||
if (cinfo->num_scans <= 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, 0);
|
||||
|
||||
/* For sequential JPEG, all scans must have Ss=0, Se=DCTSIZE2-1;
|
||||
* for progressive JPEG, no scan can have this.
|
||||
*/
|
||||
scanptr = cinfo->scan_info;
|
||||
if (scanptr->Ss != 0 || scanptr->Se != DCTSIZE2 - 1) {
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
cinfo->progressive_mode = TRUE;
|
||||
last_bitpos_ptr = &last_bitpos[0][0];
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
for (coefi = 0; coefi < DCTSIZE2; coefi++)
|
||||
*last_bitpos_ptr++ = -1;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else {
|
||||
cinfo->progressive_mode = FALSE;
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
component_sent[ci] = FALSE;
|
||||
}
|
||||
|
||||
for (scanno = 1; scanno <= cinfo->num_scans; scanptr++, scanno++) {
|
||||
/* Validate component indexes */
|
||||
ncomps = scanptr->comps_in_scan;
|
||||
if (ncomps <= 0 || ncomps > MAX_COMPS_IN_SCAN)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, ncomps, MAX_COMPS_IN_SCAN);
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
thisi = scanptr->component_index[ci];
|
||||
if (thisi < 0 || thisi >= cinfo->num_components)
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
/* Components must appear in SOF order within each scan */
|
||||
if (ci > 0 && thisi <= scanptr->component_index[ci - 1])
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
}
|
||||
/* Validate progression parameters */
|
||||
Ss = scanptr->Ss;
|
||||
Se = scanptr->Se;
|
||||
Ah = scanptr->Ah;
|
||||
Al = scanptr->Al;
|
||||
if (cinfo->progressive_mode) {
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
/* Rec. ITU-T T.81 | ISO/IEC 10918-1 simply gives the ranges 0..13 for Ah
|
||||
* and Al, but that seems wrong: the upper bound ought to depend on data
|
||||
* precision. Perhaps they really meant 0..N+1 for N-bit precision.
|
||||
* Here we allow 0..10 for 8-bit data; Al larger than 10 results in
|
||||
* out-of-range reconstructed DC values during the first DC scan,
|
||||
* which might cause problems for some decoders.
|
||||
*/
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
#define MAX_AH_AL 10
|
||||
#else
|
||||
#define MAX_AH_AL 13
|
||||
#endif
|
||||
if (Ss < 0 || Ss >= DCTSIZE2 || Se < Ss || Se >= DCTSIZE2 ||
|
||||
Ah < 0 || Ah > MAX_AH_AL || Al < 0 || Al > MAX_AH_AL)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
if (Ss == 0) {
|
||||
if (Se != 0) /* DC and AC together not OK */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
} else {
|
||||
if (ncomps != 1) /* AC scans must be for only one component */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
}
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
last_bitpos_ptr = &last_bitpos[scanptr->component_index[ci]][0];
|
||||
if (Ss != 0 && last_bitpos_ptr[0] < 0) /* AC without prior DC scan */
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
for (coefi = Ss; coefi <= Se; coefi++) {
|
||||
if (last_bitpos_ptr[coefi] < 0) {
|
||||
/* first scan of this coefficient */
|
||||
if (Ah != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
} else {
|
||||
/* not first scan */
|
||||
if (Ah != last_bitpos_ptr[coefi] || Al != Ah - 1)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
}
|
||||
last_bitpos_ptr[coefi] = Al;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
/* For sequential JPEG, all progression parameters must be these: */
|
||||
if (Ss != 0 || Se != DCTSIZE2 - 1 || Ah != 0 || Al != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
/* Make sure components are not sent twice */
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
thisi = scanptr->component_index[ci];
|
||||
if (component_sent[thisi])
|
||||
ERREXIT1(cinfo, JERR_BAD_SCAN_SCRIPT, scanno);
|
||||
component_sent[thisi] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Now verify that everything got sent. */
|
||||
if (cinfo->progressive_mode) {
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
/* For progressive mode, we only check that at least some DC data
|
||||
* got sent for each component; the spec does not require that all bits
|
||||
* of all coefficients be transmitted. Would it be wiser to enforce
|
||||
* transmission of all coefficient bits??
|
||||
*/
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
if (last_bitpos[ci][0] < 0)
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
if (!component_sent[ci])
|
||||
ERREXIT(cinfo, JERR_MISSING_DATA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* C_MULTISCAN_FILES_SUPPORTED */
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
select_scan_parameters(j_compress_ptr cinfo)
|
||||
/* Set up the scan parameters for the current scan */
|
||||
{
|
||||
int ci;
|
||||
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
if (cinfo->scan_info != NULL) {
|
||||
/* Prepare for current scan --- the script is already validated */
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
const jpeg_scan_info *scanptr = cinfo->scan_info + master->scan_number;
|
||||
|
||||
cinfo->comps_in_scan = scanptr->comps_in_scan;
|
||||
for (ci = 0; ci < scanptr->comps_in_scan; ci++) {
|
||||
cinfo->cur_comp_info[ci] =
|
||||
&cinfo->comp_info[scanptr->component_index[ci]];
|
||||
}
|
||||
cinfo->Ss = scanptr->Ss;
|
||||
cinfo->Se = scanptr->Se;
|
||||
cinfo->Ah = scanptr->Ah;
|
||||
cinfo->Al = scanptr->Al;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Prepare for single sequential-JPEG scan containing all components */
|
||||
if (cinfo->num_components > MAX_COMPS_IN_SCAN)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPS_IN_SCAN);
|
||||
cinfo->comps_in_scan = cinfo->num_components;
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
cinfo->cur_comp_info[ci] = &cinfo->comp_info[ci];
|
||||
}
|
||||
cinfo->Ss = 0;
|
||||
cinfo->Se = DCTSIZE2 - 1;
|
||||
cinfo->Ah = 0;
|
||||
cinfo->Al = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
per_scan_setup(j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before processing a JPEG scan */
|
||||
/* cinfo->comps_in_scan and cinfo->cur_comp_info[] are already set */
|
||||
{
|
||||
int ci, mcublks, tmp;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (cinfo->comps_in_scan == 1) {
|
||||
|
||||
/* Noninterleaved (single-component) scan */
|
||||
compptr = cinfo->cur_comp_info[0];
|
||||
|
||||
/* Overall image size in MCUs */
|
||||
cinfo->MCUs_per_row = compptr->width_in_blocks;
|
||||
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
|
||||
|
||||
/* For noninterleaved scan, always one block per MCU */
|
||||
compptr->MCU_width = 1;
|
||||
compptr->MCU_height = 1;
|
||||
compptr->MCU_blocks = 1;
|
||||
compptr->MCU_sample_width = DCTSIZE;
|
||||
compptr->last_col_width = 1;
|
||||
/* For noninterleaved scans, it is convenient to define last_row_height
|
||||
* as the number of block rows present in the last iMCU row.
|
||||
*/
|
||||
tmp = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
|
||||
if (tmp == 0) tmp = compptr->v_samp_factor;
|
||||
compptr->last_row_height = tmp;
|
||||
|
||||
/* Prepare array describing MCU composition */
|
||||
cinfo->blocks_in_MCU = 1;
|
||||
cinfo->MCU_membership[0] = 0;
|
||||
|
||||
} else {
|
||||
|
||||
/* Interleaved (multi-component) scan */
|
||||
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
|
||||
MAX_COMPS_IN_SCAN);
|
||||
|
||||
/* Overall image size in MCUs */
|
||||
cinfo->MCUs_per_row = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_width,
|
||||
(long)(cinfo->max_h_samp_factor * DCTSIZE));
|
||||
cinfo->MCU_rows_in_scan = (JDIMENSION)
|
||||
jdiv_round_up((long)cinfo->_jpeg_height,
|
||||
(long)(cinfo->max_v_samp_factor * DCTSIZE));
|
||||
|
||||
cinfo->blocks_in_MCU = 0;
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
/* Sampling factors give # of blocks of component in each MCU */
|
||||
compptr->MCU_width = compptr->h_samp_factor;
|
||||
compptr->MCU_height = compptr->v_samp_factor;
|
||||
compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
|
||||
compptr->MCU_sample_width = compptr->MCU_width * DCTSIZE;
|
||||
/* Figure number of non-dummy blocks in last MCU column & row */
|
||||
tmp = (int)(compptr->width_in_blocks % compptr->MCU_width);
|
||||
if (tmp == 0) tmp = compptr->MCU_width;
|
||||
compptr->last_col_width = tmp;
|
||||
tmp = (int)(compptr->height_in_blocks % compptr->MCU_height);
|
||||
if (tmp == 0) tmp = compptr->MCU_height;
|
||||
compptr->last_row_height = tmp;
|
||||
/* Prepare array describing MCU composition */
|
||||
mcublks = compptr->MCU_blocks;
|
||||
if (cinfo->blocks_in_MCU + mcublks > C_MAX_BLOCKS_IN_MCU)
|
||||
ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
|
||||
while (mcublks-- > 0) {
|
||||
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Convert restart specified in rows to actual MCU count. */
|
||||
/* Note that count must fit in 16 bits, so we provide limiting. */
|
||||
if (cinfo->restart_in_rows > 0) {
|
||||
long nominal = (long)cinfo->restart_in_rows * (long)cinfo->MCUs_per_row;
|
||||
cinfo->restart_interval = (unsigned int)MIN(nominal, 65535L);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Per-pass setup.
|
||||
* This is called at the beginning of each pass. We determine which modules
|
||||
* will be active during this pass and give them appropriate start_pass calls.
|
||||
* We also set is_last_pass to indicate whether any more passes will be
|
||||
* required.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
prepare_for_pass(j_compress_ptr cinfo)
|
||||
{
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
|
||||
switch (master->pass_type) {
|
||||
case main_pass:
|
||||
/* Initial pass: will collect input data, and do either Huffman
|
||||
* optimization or data output for the first scan.
|
||||
*/
|
||||
select_scan_parameters(cinfo);
|
||||
per_scan_setup(cinfo);
|
||||
if (!cinfo->raw_data_in) {
|
||||
(*cinfo->cconvert->start_pass) (cinfo);
|
||||
(*cinfo->downsample->start_pass) (cinfo);
|
||||
(*cinfo->prep->start_pass) (cinfo, JBUF_PASS_THRU);
|
||||
}
|
||||
(*cinfo->fdct->start_pass) (cinfo);
|
||||
(*cinfo->entropy->start_pass) (cinfo, cinfo->optimize_coding);
|
||||
(*cinfo->coef->start_pass) (cinfo,
|
||||
(master->total_passes > 1 ?
|
||||
JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
|
||||
(*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
|
||||
if (cinfo->optimize_coding) {
|
||||
/* No immediate data output; postpone writing frame/scan headers */
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
} else {
|
||||
/* Will write frame/scan headers at first jpeg_write_scanlines call */
|
||||
master->pub.call_pass_startup = TRUE;
|
||||
}
|
||||
break;
|
||||
#ifdef ENTROPY_OPT_SUPPORTED
|
||||
case huff_opt_pass:
|
||||
/* Do Huffman optimization for a scan after the first one. */
|
||||
select_scan_parameters(cinfo);
|
||||
per_scan_setup(cinfo);
|
||||
if (cinfo->Ss != 0 || cinfo->Ah == 0 || cinfo->arith_code) {
|
||||
(*cinfo->entropy->start_pass) (cinfo, TRUE);
|
||||
(*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
break;
|
||||
}
|
||||
/* Special case: Huffman DC refinement scans need no Huffman table
|
||||
* and therefore we can skip the optimization pass for them.
|
||||
*/
|
||||
master->pass_type = output_pass;
|
||||
master->pass_number++;
|
||||
/*FALLTHROUGH*/
|
||||
#endif
|
||||
case output_pass:
|
||||
/* Do a data-output pass. */
|
||||
/* We need not repeat per-scan setup if prior optimization pass did it. */
|
||||
if (!cinfo->optimize_coding) {
|
||||
select_scan_parameters(cinfo);
|
||||
per_scan_setup(cinfo);
|
||||
}
|
||||
(*cinfo->entropy->start_pass) (cinfo, FALSE);
|
||||
(*cinfo->coef->start_pass) (cinfo, JBUF_CRANK_DEST);
|
||||
/* We emit frame/scan headers now */
|
||||
if (master->scan_number == 0)
|
||||
(*cinfo->marker->write_frame_header) (cinfo);
|
||||
(*cinfo->marker->write_scan_header) (cinfo);
|
||||
master->pub.call_pass_startup = FALSE;
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
}
|
||||
|
||||
master->pub.is_last_pass = (master->pass_number == master->total_passes - 1);
|
||||
|
||||
/* Set up progress monitor's pass info if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->completed_passes = master->pass_number;
|
||||
cinfo->progress->total_passes = master->total_passes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Special start-of-pass hook.
|
||||
* This is called by jpeg_write_scanlines if call_pass_startup is TRUE.
|
||||
* In single-pass processing, we need this hook because we don't want to
|
||||
* write frame/scan headers during jpeg_start_compress; we want to let the
|
||||
* application write COM markers etc. between jpeg_start_compress and the
|
||||
* jpeg_write_scanlines loop.
|
||||
* In multi-pass processing, this routine is not used.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
pass_startup(j_compress_ptr cinfo)
|
||||
{
|
||||
cinfo->master->call_pass_startup = FALSE; /* reset flag so call only once */
|
||||
|
||||
(*cinfo->marker->write_frame_header) (cinfo);
|
||||
(*cinfo->marker->write_scan_header) (cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finish up at end of pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
finish_pass_master(j_compress_ptr cinfo)
|
||||
{
|
||||
my_master_ptr master = (my_master_ptr)cinfo->master;
|
||||
|
||||
/* The entropy coder always needs an end-of-pass call,
|
||||
* either to analyze statistics or to flush its output buffer.
|
||||
*/
|
||||
(*cinfo->entropy->finish_pass) (cinfo);
|
||||
|
||||
/* Update state for next pass */
|
||||
switch (master->pass_type) {
|
||||
case main_pass:
|
||||
/* next pass is either output of scan 0 (after optimization)
|
||||
* or output of scan 1 (if no optimization).
|
||||
*/
|
||||
master->pass_type = output_pass;
|
||||
if (!cinfo->optimize_coding)
|
||||
master->scan_number++;
|
||||
break;
|
||||
case huff_opt_pass:
|
||||
/* next pass is always output of current scan */
|
||||
master->pass_type = output_pass;
|
||||
break;
|
||||
case output_pass:
|
||||
/* next pass is either optimization or output of next scan */
|
||||
if (cinfo->optimize_coding)
|
||||
master->pass_type = huff_opt_pass;
|
||||
master->scan_number++;
|
||||
break;
|
||||
}
|
||||
|
||||
master->pass_number++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize master compression control.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_c_master_control(j_compress_ptr cinfo, boolean transcode_only)
|
||||
{
|
||||
my_master_ptr master;
|
||||
|
||||
master = (my_master_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_comp_master));
|
||||
cinfo->master = (struct jpeg_comp_master *)master;
|
||||
master->pub.prepare_for_pass = prepare_for_pass;
|
||||
master->pub.pass_startup = pass_startup;
|
||||
master->pub.finish_pass = finish_pass_master;
|
||||
master->pub.is_last_pass = FALSE;
|
||||
|
||||
/* Validate parameters, determine derived values */
|
||||
initial_setup(cinfo, transcode_only);
|
||||
|
||||
if (cinfo->scan_info != NULL) {
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
validate_script(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else {
|
||||
cinfo->progressive_mode = FALSE;
|
||||
cinfo->num_scans = 1;
|
||||
}
|
||||
|
||||
if (cinfo->progressive_mode && !cinfo->arith_code) /* TEMPORARY HACK ??? */
|
||||
cinfo->optimize_coding = TRUE; /* assume default tables no good for progressive mode */
|
||||
|
||||
/* Initialize my private state */
|
||||
if (transcode_only) {
|
||||
/* no main pass in transcoding */
|
||||
if (cinfo->optimize_coding)
|
||||
master->pass_type = huff_opt_pass;
|
||||
else
|
||||
master->pass_type = output_pass;
|
||||
} else {
|
||||
/* for normal compression, first pass is always this type: */
|
||||
master->pass_type = main_pass;
|
||||
}
|
||||
master->scan_number = 0;
|
||||
master->pass_number = 0;
|
||||
if (cinfo->optimize_coding)
|
||||
master->total_passes = cinfo->num_scans * 2;
|
||||
else
|
||||
master->total_passes = cinfo->num_scans;
|
||||
|
||||
master->jpeg_version = PACKAGE_NAME " version " VERSION " (build " BUILD ")";
|
||||
}
|
||||
Vendored
+109
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* jcomapi.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface routines that are used for both
|
||||
* compression and decompression.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Abort processing of a JPEG compression or decompression operation,
|
||||
* but don't destroy the object itself.
|
||||
*
|
||||
* For this, we merely clean up all the nonpermanent memory pools.
|
||||
* Note that temp files (virtual arrays) are not allowed to belong to
|
||||
* the permanent pool, so we will be able to close all temp files here.
|
||||
* Closing a data source or destination, if necessary, is the application's
|
||||
* responsibility.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_abort(j_common_ptr cinfo)
|
||||
{
|
||||
int pool;
|
||||
|
||||
/* Do nothing if called on a not-initialized or destroyed JPEG object. */
|
||||
if (cinfo->mem == NULL)
|
||||
return;
|
||||
|
||||
/* Releasing pools in reverse order might help avoid fragmentation
|
||||
* with some (brain-damaged) malloc libraries.
|
||||
*/
|
||||
for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) {
|
||||
(*cinfo->mem->free_pool) (cinfo, pool);
|
||||
}
|
||||
|
||||
/* Reset overall state for possible reuse of object */
|
||||
if (cinfo->is_decompressor) {
|
||||
cinfo->global_state = DSTATE_START;
|
||||
/* Try to keep application from accessing now-deleted marker list.
|
||||
* A bit kludgy to do it here, but this is the most central place.
|
||||
*/
|
||||
((j_decompress_ptr)cinfo)->marker_list = NULL;
|
||||
} else {
|
||||
cinfo->global_state = CSTATE_START;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destruction of a JPEG object.
|
||||
*
|
||||
* Everything gets deallocated except the master jpeg_compress_struct itself
|
||||
* and the error manager struct. Both of these are supplied by the application
|
||||
* and must be freed, if necessary, by the application. (Often they are on
|
||||
* the stack and so don't need to be freed anyway.)
|
||||
* Closing a data source or destination, if necessary, is the application's
|
||||
* responsibility.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_destroy(j_common_ptr cinfo)
|
||||
{
|
||||
/* We need only tell the memory manager to release everything. */
|
||||
/* NB: mem pointer is NULL if memory mgr failed to initialize. */
|
||||
if (cinfo->mem != NULL)
|
||||
(*cinfo->mem->self_destruct) (cinfo);
|
||||
cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */
|
||||
cinfo->global_state = 0; /* mark it destroyed */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convenience routines for allocating quantization and Huffman tables.
|
||||
* (Would jutils.c be a more reasonable place to put these?)
|
||||
*/
|
||||
|
||||
GLOBAL(JQUANT_TBL *)
|
||||
jpeg_alloc_quant_table(j_common_ptr cinfo)
|
||||
{
|
||||
JQUANT_TBL *tbl;
|
||||
|
||||
tbl = (JQUANT_TBL *)
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
return tbl;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(JHUFF_TBL *)
|
||||
jpeg_alloc_huff_table(j_common_ptr cinfo)
|
||||
{
|
||||
JHUFF_TBL *tbl;
|
||||
|
||||
tbl = (JHUFF_TBL *)
|
||||
(*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL));
|
||||
tbl->sent_table = FALSE; /* make sure this is false in any new table */
|
||||
return tbl;
|
||||
}
|
||||
Vendored
+541
@@ -0,0 +1,541 @@
|
||||
/*
|
||||
* jcparam.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2003-2008 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2018, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains optional default-setting code for the JPEG compressor.
|
||||
* Applications do not have to use this file, but those that don't use it
|
||||
* must know a lot more about the innards of the JPEG code.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jstdhuff.c"
|
||||
|
||||
|
||||
/*
|
||||
* Quantization table setup routines
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_add_quant_table(j_compress_ptr cinfo, int which_tbl,
|
||||
const unsigned int *basic_table, int scale_factor,
|
||||
boolean force_baseline)
|
||||
/* Define a quantization table equal to the basic_table times
|
||||
* a scale factor (given as a percentage).
|
||||
* If force_baseline is TRUE, the computed quantization table entries
|
||||
* are limited to 1..255 for JPEG baseline compatibility.
|
||||
*/
|
||||
{
|
||||
JQUANT_TBL **qtblptr;
|
||||
int i;
|
||||
long temp;
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
if (which_tbl < 0 || which_tbl >= NUM_QUANT_TBLS)
|
||||
ERREXIT1(cinfo, JERR_DQT_INDEX, which_tbl);
|
||||
|
||||
qtblptr = &cinfo->quant_tbl_ptrs[which_tbl];
|
||||
|
||||
if (*qtblptr == NULL)
|
||||
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)cinfo);
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
temp = ((long)basic_table[i] * scale_factor + 50L) / 100L;
|
||||
/* limit the values to the valid range */
|
||||
if (temp <= 0L) temp = 1L;
|
||||
if (temp > 32767L) temp = 32767L; /* max quantizer needed for 12 bits */
|
||||
if (force_baseline && temp > 255L)
|
||||
temp = 255L; /* limit to baseline range if requested */
|
||||
(*qtblptr)->quantval[i] = (UINT16)temp;
|
||||
}
|
||||
|
||||
/* Initialize sent_table FALSE so table will be written to JPEG file. */
|
||||
(*qtblptr)->sent_table = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* These are the sample quantization tables given in Annex K (Clause K.1) of
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||
* The spec says that the values given produce "good" quality, and
|
||||
* when divided by 2, "very good" quality.
|
||||
*/
|
||||
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
|
||||
16, 11, 10, 16, 24, 40, 51, 61,
|
||||
12, 12, 14, 19, 26, 58, 60, 55,
|
||||
14, 13, 16, 24, 40, 57, 69, 56,
|
||||
14, 17, 22, 29, 51, 87, 80, 62,
|
||||
18, 22, 37, 56, 68, 109, 103, 77,
|
||||
24, 35, 55, 64, 81, 104, 113, 92,
|
||||
49, 64, 78, 87, 103, 121, 120, 101,
|
||||
72, 92, 95, 98, 112, 100, 103, 99
|
||||
};
|
||||
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
|
||||
17, 18, 24, 47, 99, 99, 99, 99,
|
||||
18, 21, 26, 66, 99, 99, 99, 99,
|
||||
24, 26, 56, 99, 99, 99, 99, 99,
|
||||
47, 66, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99,
|
||||
99, 99, 99, 99, 99, 99, 99, 99
|
||||
};
|
||||
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
GLOBAL(void)
|
||||
jpeg_default_qtables(j_compress_ptr cinfo, boolean force_baseline)
|
||||
/* Set or change the 'quality' (quantization) setting, using default tables
|
||||
* and straight percentage-scaling quality scales.
|
||||
* This entry point allows different scalings for luminance and chrominance.
|
||||
*/
|
||||
{
|
||||
/* Set up two quantization tables using the specified scaling */
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
|
||||
cinfo->q_scale_factor[0], force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
cinfo->q_scale_factor[1], force_baseline);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_set_linear_quality(j_compress_ptr cinfo, int scale_factor,
|
||||
boolean force_baseline)
|
||||
/* Set or change the 'quality' (quantization) setting, using default tables
|
||||
* and a straight percentage-scaling quality scale. In most cases it's better
|
||||
* to use jpeg_set_quality (below); this entry point is provided for
|
||||
* applications that insist on a linear percentage scaling.
|
||||
*/
|
||||
{
|
||||
/* Set up two quantization tables using the specified scaling */
|
||||
jpeg_add_quant_table(cinfo, 0, std_luminance_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
jpeg_add_quant_table(cinfo, 1, std_chrominance_quant_tbl,
|
||||
scale_factor, force_baseline);
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_quality_scaling(int quality)
|
||||
/* Convert a user-specified quality rating to a percentage scaling factor
|
||||
* for an underlying quantization table, using our recommended scaling curve.
|
||||
* The input 'quality' factor should be 0 (terrible) to 100 (very good).
|
||||
*/
|
||||
{
|
||||
/* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
|
||||
if (quality <= 0) quality = 1;
|
||||
if (quality > 100) quality = 100;
|
||||
|
||||
/* The basic table is used as-is (scaling 100) for a quality of 50.
|
||||
* Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
|
||||
* note that at Q=100 the scaling is 0, which will cause jpeg_add_quant_table
|
||||
* to make all the table entries 1 (hence, minimum quantization loss).
|
||||
* Qualities 1..50 are converted to scaling percentage 5000/Q.
|
||||
*/
|
||||
if (quality < 50)
|
||||
quality = 5000 / quality;
|
||||
else
|
||||
quality = 200 - quality * 2;
|
||||
|
||||
return quality;
|
||||
}
|
||||
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_set_quality(j_compress_ptr cinfo, int quality, boolean force_baseline)
|
||||
/* Set or change the 'quality' (quantization) setting, using default tables.
|
||||
* This is the standard quality-adjusting entry point for typical user
|
||||
* interfaces; only those who want detailed control over quantization tables
|
||||
* would use the preceding three routines directly.
|
||||
*/
|
||||
{
|
||||
/* Convert user 0-100 rating to percentage scaling */
|
||||
quality = jpeg_quality_scaling(quality);
|
||||
|
||||
/* Set up standard quality tables */
|
||||
jpeg_set_linear_quality(cinfo, quality, force_baseline);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Default parameter setup for compression.
|
||||
*
|
||||
* Applications that don't choose to use this routine must do their
|
||||
* own setup of all these parameters. Alternately, you can call this
|
||||
* to establish defaults and then alter parameters selectively. This
|
||||
* is the recommended approach since, if we add any new parameters,
|
||||
* your code will still work (they'll be set to reasonable defaults).
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_set_defaults(j_compress_ptr cinfo)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Allocate comp_info array large enough for maximum component count.
|
||||
* Array is made permanent in case application wants to compress
|
||||
* multiple images at same param settings.
|
||||
*/
|
||||
if (cinfo->comp_info == NULL)
|
||||
cinfo->comp_info = (jpeg_component_info *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
MAX_COMPONENTS * sizeof(jpeg_component_info));
|
||||
|
||||
/* Initialize everything not dependent on the color space */
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
cinfo->scale_num = 1; /* 1:1 scaling */
|
||||
cinfo->scale_denom = 1;
|
||||
#endif
|
||||
cinfo->data_precision = BITS_IN_JSAMPLE;
|
||||
/* Set up two quantization tables using default quality of 75 */
|
||||
jpeg_set_quality(cinfo, 75, TRUE);
|
||||
/* Set up two Huffman tables */
|
||||
std_huff_tables((j_common_ptr)cinfo);
|
||||
|
||||
/* Initialize default arithmetic coding conditioning */
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
cinfo->arith_dc_L[i] = 0;
|
||||
cinfo->arith_dc_U[i] = 1;
|
||||
cinfo->arith_ac_K[i] = 5;
|
||||
}
|
||||
|
||||
/* Default is no multiple-scan output */
|
||||
cinfo->scan_info = NULL;
|
||||
cinfo->num_scans = 0;
|
||||
|
||||
/* Expect normal source image, not raw downsampled data */
|
||||
cinfo->raw_data_in = FALSE;
|
||||
|
||||
/* Use Huffman coding, not arithmetic coding, by default */
|
||||
cinfo->arith_code = FALSE;
|
||||
|
||||
/* By default, don't do extra passes to optimize entropy coding */
|
||||
cinfo->optimize_coding = FALSE;
|
||||
/* The standard Huffman tables are only valid for 8-bit data precision.
|
||||
* If the precision is higher, force optimization on so that usable
|
||||
* tables will be computed. This test can be removed if default tables
|
||||
* are supplied that are valid for the desired precision.
|
||||
*/
|
||||
if (cinfo->data_precision > 8)
|
||||
cinfo->optimize_coding = TRUE;
|
||||
|
||||
/* By default, use the simpler non-cosited sampling alignment */
|
||||
cinfo->CCIR601_sampling = FALSE;
|
||||
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
/* By default, apply fancy downsampling */
|
||||
cinfo->do_fancy_downsampling = TRUE;
|
||||
#endif
|
||||
|
||||
/* No input smoothing */
|
||||
cinfo->smoothing_factor = 0;
|
||||
|
||||
/* DCT algorithm preference */
|
||||
cinfo->dct_method = JDCT_DEFAULT;
|
||||
|
||||
/* No restart markers */
|
||||
cinfo->restart_interval = 0;
|
||||
cinfo->restart_in_rows = 0;
|
||||
|
||||
/* Fill in default JFIF marker parameters. Note that whether the marker
|
||||
* will actually be written is determined by jpeg_set_colorspace.
|
||||
*
|
||||
* By default, the library emits JFIF version code 1.01.
|
||||
* An application that wants to emit JFIF 1.02 extension markers should set
|
||||
* JFIF_minor_version to 2. We could probably get away with just defaulting
|
||||
* to 1.02, but there may still be some decoders in use that will complain
|
||||
* about that; saying 1.01 should minimize compatibility problems.
|
||||
*/
|
||||
cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
|
||||
cinfo->JFIF_minor_version = 1;
|
||||
cinfo->density_unit = 0; /* Pixel size is unknown by default */
|
||||
cinfo->X_density = 1; /* Pixel aspect ratio is square by default */
|
||||
cinfo->Y_density = 1;
|
||||
|
||||
/* Choose JPEG colorspace based on input space, set defaults accordingly */
|
||||
|
||||
jpeg_default_colorspace(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Select an appropriate JPEG colorspace for in_color_space.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_default_colorspace(j_compress_ptr cinfo)
|
||||
{
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_RGBA:
|
||||
case JCS_EXT_BGRA:
|
||||
case JCS_EXT_ABGR:
|
||||
case JCS_EXT_ARGB:
|
||||
jpeg_set_colorspace(cinfo, JCS_YCbCr);
|
||||
break;
|
||||
case JCS_YCbCr:
|
||||
jpeg_set_colorspace(cinfo, JCS_YCbCr);
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
jpeg_set_colorspace(cinfo, JCS_CMYK); /* By default, no translation */
|
||||
break;
|
||||
case JCS_YCCK:
|
||||
jpeg_set_colorspace(cinfo, JCS_YCCK);
|
||||
break;
|
||||
case JCS_UNKNOWN:
|
||||
jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the JPEG colorspace, and choose colorspace-dependent default values.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
||||
{
|
||||
jpeg_component_info *compptr;
|
||||
int ci;
|
||||
|
||||
#define SET_COMP(index, id, hsamp, vsamp, quant, dctbl, actbl) \
|
||||
(compptr = &cinfo->comp_info[index], \
|
||||
compptr->component_id = (id), \
|
||||
compptr->h_samp_factor = (hsamp), \
|
||||
compptr->v_samp_factor = (vsamp), \
|
||||
compptr->quant_tbl_no = (quant), \
|
||||
compptr->dc_tbl_no = (dctbl), \
|
||||
compptr->ac_tbl_no = (actbl) )
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* For all colorspaces, we use Q and Huff tables 0 for luminance components,
|
||||
* tables 1 for chrominance components.
|
||||
*/
|
||||
|
||||
cinfo->jpeg_color_space = colorspace;
|
||||
|
||||
cinfo->write_JFIF_header = FALSE; /* No marker for non-JFIF colorspaces */
|
||||
cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
|
||||
|
||||
switch (colorspace) {
|
||||
case JCS_GRAYSCALE:
|
||||
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||
cinfo->num_components = 1;
|
||||
/* JFIF specifies component ID 1 */
|
||||
SET_COMP(0, 1, 1, 1, 0, 0, 0);
|
||||
break;
|
||||
case JCS_RGB:
|
||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
|
||||
cinfo->num_components = 3;
|
||||
SET_COMP(0, 0x52 /* 'R' */, 1, 1, 0, 0, 0);
|
||||
SET_COMP(1, 0x47 /* 'G' */, 1, 1, 0, 0, 0);
|
||||
SET_COMP(2, 0x42 /* 'B' */, 1, 1, 0, 0, 0);
|
||||
break;
|
||||
case JCS_YCbCr:
|
||||
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||
cinfo->num_components = 3;
|
||||
/* JFIF specifies component IDs 1,2,3 */
|
||||
/* We default to 2x2 subsamples of chrominance */
|
||||
SET_COMP(0, 1, 2, 2, 0, 0, 0);
|
||||
SET_COMP(1, 2, 1, 1, 1, 1, 1);
|
||||
SET_COMP(2, 3, 1, 1, 1, 1, 1);
|
||||
break;
|
||||
case JCS_CMYK:
|
||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
|
||||
cinfo->num_components = 4;
|
||||
SET_COMP(0, 0x43 /* 'C' */, 1, 1, 0, 0, 0);
|
||||
SET_COMP(1, 0x4D /* 'M' */, 1, 1, 0, 0, 0);
|
||||
SET_COMP(2, 0x59 /* 'Y' */, 1, 1, 0, 0, 0);
|
||||
SET_COMP(3, 0x4B /* 'K' */, 1, 1, 0, 0, 0);
|
||||
break;
|
||||
case JCS_YCCK:
|
||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
|
||||
cinfo->num_components = 4;
|
||||
SET_COMP(0, 1, 2, 2, 0, 0, 0);
|
||||
SET_COMP(1, 2, 1, 1, 1, 1, 1);
|
||||
SET_COMP(2, 3, 1, 1, 1, 1, 1);
|
||||
SET_COMP(3, 4, 2, 2, 0, 0, 0);
|
||||
break;
|
||||
case JCS_UNKNOWN:
|
||||
cinfo->num_components = cinfo->input_components;
|
||||
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
|
||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||
MAX_COMPONENTS);
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
SET_COMP(ci, ci, 1, 1, 0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_a_scan(jpeg_scan_info *scanptr, int ci, int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for specified component */
|
||||
{
|
||||
scanptr->comps_in_scan = 1;
|
||||
scanptr->component_index[0] = ci;
|
||||
scanptr->Ss = Ss;
|
||||
scanptr->Se = Se;
|
||||
scanptr->Ah = Ah;
|
||||
scanptr->Al = Al;
|
||||
scanptr++;
|
||||
return scanptr;
|
||||
}
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_scans(jpeg_scan_info *scanptr, int ncomps, int Ss, int Se, int Ah, int Al)
|
||||
/* Support routine: generate one scan for each component */
|
||||
{
|
||||
int ci;
|
||||
|
||||
for (ci = 0; ci < ncomps; ci++) {
|
||||
scanptr->comps_in_scan = 1;
|
||||
scanptr->component_index[0] = ci;
|
||||
scanptr->Ss = Ss;
|
||||
scanptr->Se = Se;
|
||||
scanptr->Ah = Ah;
|
||||
scanptr->Al = Al;
|
||||
scanptr++;
|
||||
}
|
||||
return scanptr;
|
||||
}
|
||||
|
||||
LOCAL(jpeg_scan_info *)
|
||||
fill_dc_scans(jpeg_scan_info *scanptr, int ncomps, int Ah, int Al)
|
||||
/* Support routine: generate interleaved DC scan if possible, else N scans */
|
||||
{
|
||||
int ci;
|
||||
|
||||
if (ncomps <= MAX_COMPS_IN_SCAN) {
|
||||
/* Single interleaved DC scan */
|
||||
scanptr->comps_in_scan = ncomps;
|
||||
for (ci = 0; ci < ncomps; ci++)
|
||||
scanptr->component_index[ci] = ci;
|
||||
scanptr->Ss = scanptr->Se = 0;
|
||||
scanptr->Ah = Ah;
|
||||
scanptr->Al = Al;
|
||||
scanptr++;
|
||||
} else {
|
||||
/* Noninterleaved DC scan for each component */
|
||||
scanptr = fill_scans(scanptr, ncomps, 0, 0, Ah, Al);
|
||||
}
|
||||
return scanptr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create a recommended progressive-JPEG script.
|
||||
* cinfo->num_components and cinfo->jpeg_color_space must be correct.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_simple_progression(j_compress_ptr cinfo)
|
||||
{
|
||||
int ncomps = cinfo->num_components;
|
||||
int nscans;
|
||||
jpeg_scan_info *scanptr;
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Figure space needed for script. Calculation must match code below! */
|
||||
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
/* Custom script for YCbCr color images. */
|
||||
nscans = 10;
|
||||
} else {
|
||||
/* All-purpose script for other color spaces. */
|
||||
if (ncomps > MAX_COMPS_IN_SCAN)
|
||||
nscans = 6 * ncomps; /* 2 DC + 4 AC scans per component */
|
||||
else
|
||||
nscans = 2 + 4 * ncomps; /* 2 DC scans; 4 AC scans per component */
|
||||
}
|
||||
|
||||
/* Allocate space for script.
|
||||
* We need to put it in the permanent pool in case the application performs
|
||||
* multiple compressions without changing the settings. To avoid a memory
|
||||
* leak if jpeg_simple_progression is called repeatedly for the same JPEG
|
||||
* object, we try to re-use previously allocated space, and we allocate
|
||||
* enough space to handle YCbCr even if initially asked for grayscale.
|
||||
*/
|
||||
if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
|
||||
cinfo->script_space_size = MAX(nscans, 10);
|
||||
cinfo->script_space = (jpeg_scan_info *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
cinfo->script_space_size * sizeof(jpeg_scan_info));
|
||||
}
|
||||
scanptr = cinfo->script_space;
|
||||
cinfo->scan_info = scanptr;
|
||||
cinfo->num_scans = nscans;
|
||||
|
||||
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
/* Custom script for YCbCr color images. */
|
||||
/* Initial DC scan */
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
|
||||
/* Initial AC scan: get some luma data out in a hurry */
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 5, 0, 2);
|
||||
/* Chroma data is too small to be worth expending many scans on */
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, 63, 0, 1);
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, 63, 0, 1);
|
||||
/* Complete spectral selection for luma AC */
|
||||
scanptr = fill_a_scan(scanptr, 0, 6, 63, 0, 2);
|
||||
/* Refine next bit of luma AC */
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 63, 2, 1);
|
||||
/* Finish DC successive approximation */
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
|
||||
/* Finish AC successive approximation */
|
||||
scanptr = fill_a_scan(scanptr, 2, 1, 63, 1, 0);
|
||||
scanptr = fill_a_scan(scanptr, 1, 1, 63, 1, 0);
|
||||
/* Luma bottom bit comes last since it's usually largest scan */
|
||||
scanptr = fill_a_scan(scanptr, 0, 1, 63, 1, 0);
|
||||
} else {
|
||||
/* All-purpose script for other color spaces. */
|
||||
/* Successive approximation first pass */
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
|
||||
scanptr = fill_scans(scanptr, ncomps, 1, 5, 0, 2);
|
||||
scanptr = fill_scans(scanptr, ncomps, 6, 63, 0, 2);
|
||||
/* Successive approximation second pass */
|
||||
scanptr = fill_scans(scanptr, ncomps, 1, 63, 2, 1);
|
||||
/* Successive approximation final pass */
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 1, 0);
|
||||
scanptr = fill_scans(scanptr, ncomps, 1, 63, 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* C_PROGRESSIVE_SUPPORTED */
|
||||
Vendored
+1105
File diff suppressed because it is too large
Load Diff
+351
@@ -0,0 +1,351 @@
|
||||
/*
|
||||
* jcprepct.c
|
||||
*
|
||||
* This file is part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the compression preprocessing controller.
|
||||
* This controller manages the color conversion, downsampling,
|
||||
* and edge expansion steps.
|
||||
*
|
||||
* Most of the complexity here is associated with buffering input rows
|
||||
* as required by the downsampler. See the comments at the head of
|
||||
* jcsample.c for the downsampler's needs.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* At present, jcsample.c can request context rows only for smoothing.
|
||||
* In the future, we might also need context rows for CCIR601 sampling
|
||||
* or other more-complex downsampling procedures. The code to support
|
||||
* context rows should be compiled only if needed.
|
||||
*/
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
#define CONTEXT_ROWS_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* For the simple (no-context-row) case, we just need to buffer one
|
||||
* row group's worth of pixels for the downsampling step. At the bottom of
|
||||
* the image, we pad to a full row group by replicating the last pixel row.
|
||||
* The downsampler's last output row is then replicated if needed to pad
|
||||
* out to a full iMCU row.
|
||||
*
|
||||
* When providing context rows, we must buffer three row groups' worth of
|
||||
* pixels. Three row groups are physically allocated, but the row pointer
|
||||
* arrays are made five row groups high, with the extra pointers above and
|
||||
* below "wrapping around" to point to the last and first real row groups.
|
||||
* This allows the downsampler to access the proper context rows.
|
||||
* At the top and bottom of the image, we create dummy context rows by
|
||||
* copying the first or last real pixel row. This copying could be avoided
|
||||
* by pointer hacking as is done in jdmainct.c, but it doesn't seem worth the
|
||||
* trouble on the compression side.
|
||||
*/
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_c_prep_controller pub; /* public fields */
|
||||
|
||||
/* Downsampling input buffer. This buffer holds color-converted data
|
||||
* until we have enough to do a downsample step.
|
||||
*/
|
||||
JSAMPARRAY color_buf[MAX_COMPONENTS];
|
||||
|
||||
JDIMENSION rows_to_go; /* counts rows remaining in source image */
|
||||
int next_buf_row; /* index of next row to store in color_buf */
|
||||
|
||||
#ifdef CONTEXT_ROWS_SUPPORTED /* only needed for context case */
|
||||
int this_row_group; /* starting row index of group to process */
|
||||
int next_buf_stop; /* downsample when we reach this index */
|
||||
#endif
|
||||
} my_prep_controller;
|
||||
|
||||
typedef my_prep_controller *my_prep_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_prep(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
{
|
||||
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
|
||||
|
||||
if (pass_mode != JBUF_PASS_THRU)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
/* Initialize total-height counter for detecting bottom of image */
|
||||
prep->rows_to_go = cinfo->image_height;
|
||||
/* Mark the conversion buffer empty */
|
||||
prep->next_buf_row = 0;
|
||||
#ifdef CONTEXT_ROWS_SUPPORTED
|
||||
/* Preset additional state variables for context mode.
|
||||
* These aren't used in non-context mode, so we needn't test which mode.
|
||||
*/
|
||||
prep->this_row_group = 0;
|
||||
/* Set next_buf_stop to stop after two row groups have been read in. */
|
||||
prep->next_buf_stop = 2 * cinfo->max_v_samp_factor;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Expand an image vertically from height input_rows to height output_rows,
|
||||
* by duplicating the bottom row.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
expand_bottom_edge(JSAMPARRAY image_data, JDIMENSION num_cols, int input_rows,
|
||||
int output_rows)
|
||||
{
|
||||
register int row;
|
||||
|
||||
for (row = input_rows; row < output_rows; row++) {
|
||||
jcopy_sample_rows(image_data, input_rows - 1, image_data, row, 1,
|
||||
num_cols);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process some data in the simple no-context case.
|
||||
*
|
||||
* Preprocessor output data is counted in "row groups". A row group
|
||||
* is defined to be v_samp_factor sample rows of each component.
|
||||
* Downsampling will produce this much data from each max_v_samp_factor
|
||||
* input rows.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
pre_process_data(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
|
||||
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
||||
JDIMENSION out_row_groups_avail)
|
||||
{
|
||||
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
|
||||
int numrows, ci;
|
||||
JDIMENSION inrows;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
while (*in_row_ctr < in_rows_avail &&
|
||||
*out_row_group_ctr < out_row_groups_avail) {
|
||||
/* Do color conversion to fill the conversion buffer. */
|
||||
inrows = in_rows_avail - *in_row_ctr;
|
||||
numrows = cinfo->max_v_samp_factor - prep->next_buf_row;
|
||||
numrows = (int)MIN((JDIMENSION)numrows, inrows);
|
||||
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
|
||||
prep->color_buf,
|
||||
(JDIMENSION)prep->next_buf_row,
|
||||
numrows);
|
||||
*in_row_ctr += numrows;
|
||||
prep->next_buf_row += numrows;
|
||||
prep->rows_to_go -= numrows;
|
||||
/* If at bottom of image, pad to fill the conversion buffer. */
|
||||
if (prep->rows_to_go == 0 &&
|
||||
prep->next_buf_row < cinfo->max_v_samp_factor) {
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
|
||||
prep->next_buf_row, cinfo->max_v_samp_factor);
|
||||
}
|
||||
prep->next_buf_row = cinfo->max_v_samp_factor;
|
||||
}
|
||||
/* If we've filled the conversion buffer, empty it. */
|
||||
if (prep->next_buf_row == cinfo->max_v_samp_factor) {
|
||||
(*cinfo->downsample->downsample) (cinfo,
|
||||
prep->color_buf, (JDIMENSION)0,
|
||||
output_buf, *out_row_group_ctr);
|
||||
prep->next_buf_row = 0;
|
||||
(*out_row_group_ctr)++;
|
||||
}
|
||||
/* If at bottom of image, pad the output to a full iMCU height.
|
||||
* Note we assume the caller is providing a one-iMCU-height output buffer!
|
||||
*/
|
||||
if (prep->rows_to_go == 0 && *out_row_group_ctr < out_row_groups_avail) {
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
expand_bottom_edge(output_buf[ci], compptr->width_in_blocks * DCTSIZE,
|
||||
(int)(*out_row_group_ctr * compptr->v_samp_factor),
|
||||
(int)(out_row_groups_avail * compptr->v_samp_factor));
|
||||
}
|
||||
*out_row_group_ctr = out_row_groups_avail;
|
||||
break; /* can exit outer loop without test */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONTEXT_ROWS_SUPPORTED
|
||||
|
||||
/*
|
||||
* Process some data in the context case.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
pre_process_context(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail,
|
||||
JSAMPIMAGE output_buf, JDIMENSION *out_row_group_ctr,
|
||||
JDIMENSION out_row_groups_avail)
|
||||
{
|
||||
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
|
||||
int numrows, ci;
|
||||
int buf_height = cinfo->max_v_samp_factor * 3;
|
||||
JDIMENSION inrows;
|
||||
|
||||
while (*out_row_group_ctr < out_row_groups_avail) {
|
||||
if (*in_row_ctr < in_rows_avail) {
|
||||
/* Do color conversion to fill the conversion buffer. */
|
||||
inrows = in_rows_avail - *in_row_ctr;
|
||||
numrows = prep->next_buf_stop - prep->next_buf_row;
|
||||
numrows = (int)MIN((JDIMENSION)numrows, inrows);
|
||||
(*cinfo->cconvert->color_convert) (cinfo, input_buf + *in_row_ctr,
|
||||
prep->color_buf,
|
||||
(JDIMENSION)prep->next_buf_row,
|
||||
numrows);
|
||||
/* Pad at top of image, if first time through */
|
||||
if (prep->rows_to_go == cinfo->image_height) {
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int row;
|
||||
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
|
||||
jcopy_sample_rows(prep->color_buf[ci], 0, prep->color_buf[ci],
|
||||
-row, 1, cinfo->image_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
*in_row_ctr += numrows;
|
||||
prep->next_buf_row += numrows;
|
||||
prep->rows_to_go -= numrows;
|
||||
} else {
|
||||
/* Return for more data, unless we are at the bottom of the image. */
|
||||
if (prep->rows_to_go != 0)
|
||||
break;
|
||||
/* When at bottom of image, pad to fill the conversion buffer. */
|
||||
if (prep->next_buf_row < prep->next_buf_stop) {
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
expand_bottom_edge(prep->color_buf[ci], cinfo->image_width,
|
||||
prep->next_buf_row, prep->next_buf_stop);
|
||||
}
|
||||
prep->next_buf_row = prep->next_buf_stop;
|
||||
}
|
||||
}
|
||||
/* If we've gotten enough data, downsample a row group. */
|
||||
if (prep->next_buf_row == prep->next_buf_stop) {
|
||||
(*cinfo->downsample->downsample) (cinfo, prep->color_buf,
|
||||
(JDIMENSION)prep->this_row_group,
|
||||
output_buf, *out_row_group_ctr);
|
||||
(*out_row_group_ctr)++;
|
||||
/* Advance pointers with wraparound as necessary. */
|
||||
prep->this_row_group += cinfo->max_v_samp_factor;
|
||||
if (prep->this_row_group >= buf_height)
|
||||
prep->this_row_group = 0;
|
||||
if (prep->next_buf_row >= buf_height)
|
||||
prep->next_buf_row = 0;
|
||||
prep->next_buf_stop = prep->next_buf_row + cinfo->max_v_samp_factor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create the wrapped-around downsampling input buffer needed for context mode.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
create_context_buffer(j_compress_ptr cinfo)
|
||||
{
|
||||
my_prep_ptr prep = (my_prep_ptr)cinfo->prep;
|
||||
int rgroup_height = cinfo->max_v_samp_factor;
|
||||
int ci, i;
|
||||
jpeg_component_info *compptr;
|
||||
JSAMPARRAY true_buffer, fake_buffer;
|
||||
|
||||
/* Grab enough space for fake row pointers for all the components;
|
||||
* we need five row groups' worth of pointers for each component.
|
||||
*/
|
||||
fake_buffer = (JSAMPARRAY)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(cinfo->num_components * 5 * rgroup_height) *
|
||||
sizeof(JSAMPROW));
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* Allocate the actual buffer space (3 row groups) for this component.
|
||||
* We make the buffer wide enough to allow the downsampler to edge-expand
|
||||
* horizontally within the buffer, if it so chooses.
|
||||
*/
|
||||
true_buffer = (*cinfo->mem->alloc_sarray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(JDIMENSION)(((long)compptr->width_in_blocks * DCTSIZE *
|
||||
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
|
||||
(JDIMENSION)(3 * rgroup_height));
|
||||
/* Copy true buffer row pointers into the middle of the fake row array */
|
||||
MEMCOPY(fake_buffer + rgroup_height, true_buffer,
|
||||
3 * rgroup_height * sizeof(JSAMPROW));
|
||||
/* Fill in the above and below wraparound pointers */
|
||||
for (i = 0; i < rgroup_height; i++) {
|
||||
fake_buffer[i] = true_buffer[2 * rgroup_height + i];
|
||||
fake_buffer[4 * rgroup_height + i] = true_buffer[i];
|
||||
}
|
||||
prep->color_buf[ci] = fake_buffer + rgroup_height;
|
||||
fake_buffer += 5 * rgroup_height; /* point to space for next component */
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONTEXT_ROWS_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize preprocessing controller.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_c_prep_controller(j_compress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_prep_ptr prep;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (need_full_buffer) /* safety check */
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
prep = (my_prep_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_prep_controller));
|
||||
cinfo->prep = (struct jpeg_c_prep_controller *)prep;
|
||||
prep->pub.start_pass = start_pass_prep;
|
||||
|
||||
/* Allocate the color conversion buffer.
|
||||
* We make the buffer wide enough to allow the downsampler to edge-expand
|
||||
* horizontally within the buffer, if it so chooses.
|
||||
*/
|
||||
if (cinfo->downsample->need_context_rows) {
|
||||
/* Set up to provide context rows */
|
||||
#ifdef CONTEXT_ROWS_SUPPORTED
|
||||
prep->pub.pre_process_data = pre_process_context;
|
||||
create_context_buffer(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else {
|
||||
/* No context, just make it tall enough for one row group */
|
||||
prep->pub.pre_process_data = pre_process_data;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
prep->color_buf[ci] = (*cinfo->mem->alloc_sarray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(JDIMENSION)(((long)compptr->width_in_blocks * DCTSIZE *
|
||||
cinfo->max_h_samp_factor) / compptr->h_samp_factor),
|
||||
(JDIMENSION)cinfo->max_v_samp_factor);
|
||||
}
|
||||
}
|
||||
}
|
||||
+539
@@ -0,0 +1,539 @@
|
||||
/*
|
||||
* jcsample.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains downsampling routines.
|
||||
*
|
||||
* Downsampling input data is counted in "row groups". A row group
|
||||
* is defined to be max_v_samp_factor pixel rows of each component,
|
||||
* from which the downsampler produces v_samp_factor sample rows.
|
||||
* A single row group is processed in each call to the downsampler module.
|
||||
*
|
||||
* The downsampler is responsible for edge-expansion of its output data
|
||||
* to fill an integral number of DCT blocks horizontally. The source buffer
|
||||
* may be modified if it is helpful for this purpose (the source buffer is
|
||||
* allocated wide enough to correspond to the desired output width).
|
||||
* The caller (the prep controller) is responsible for vertical padding.
|
||||
*
|
||||
* The downsampler may request "context rows" by setting need_context_rows
|
||||
* during startup. In this case, the input arrays will contain at least
|
||||
* one row group's worth of pixels above and below the passed-in data;
|
||||
* the caller will create dummy rows at image top and bottom by replicating
|
||||
* the first or last real pixel row.
|
||||
*
|
||||
* An excellent reference for image resampling is
|
||||
* Digital Image Warping, George Wolberg, 1990.
|
||||
* Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
|
||||
*
|
||||
* The downsampling algorithm used here is a simple average of the source
|
||||
* pixels covered by the output pixel. The hi-falutin sampling literature
|
||||
* refers to this as a "box filter". In general the characteristics of a box
|
||||
* filter are not very good, but for the specific cases we normally use (1:1
|
||||
* and 2:1 ratios) the box is equivalent to a "triangle filter" which is not
|
||||
* nearly so bad. If you intend to use other sampling ratios, you'd be well
|
||||
* advised to improve this code.
|
||||
*
|
||||
* A simple input-smoothing capability is provided. This is mainly intended
|
||||
* for cleaning up color-dithered GIF input files (if you find it inadequate,
|
||||
* we suggest using an external filtering program such as pnmconvol). When
|
||||
* enabled, each input pixel P is replaced by a weighted sum of itself and its
|
||||
* eight neighbors. P's weight is 1-8*SF and each neighbor's weight is SF,
|
||||
* where SF = (smoothing_factor / 1024).
|
||||
* Currently, smoothing is only supported for 2h2v sampling factors.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
|
||||
/* Pointer to routine to downsample a single component */
|
||||
typedef void (*downsample1_ptr) (j_compress_ptr cinfo,
|
||||
jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY output_data);
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_downsampler pub; /* public fields */
|
||||
|
||||
/* Downsampling method pointers, one per component */
|
||||
downsample1_ptr methods[MAX_COMPONENTS];
|
||||
} my_downsampler;
|
||||
|
||||
typedef my_downsampler *my_downsample_ptr;
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a downsampling pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_downsample(j_compress_ptr cinfo)
|
||||
{
|
||||
/* no work for now */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Expand a component horizontally from width input_cols to width output_cols,
|
||||
* by duplicating the rightmost samples.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols,
|
||||
JDIMENSION output_cols)
|
||||
{
|
||||
register JSAMPROW ptr;
|
||||
register JSAMPLE pixval;
|
||||
register int count;
|
||||
int row;
|
||||
int numcols = (int)(output_cols - input_cols);
|
||||
|
||||
if (numcols > 0) {
|
||||
for (row = 0; row < num_rows; row++) {
|
||||
ptr = image_data[row] + input_cols;
|
||||
pixval = ptr[-1]; /* don't need GETJSAMPLE() here */
|
||||
for (count = numcols; count > 0; count--)
|
||||
*ptr++ = pixval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Do downsampling for a whole row group (all components).
|
||||
*
|
||||
* In this version we simply downsample each component independently.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
sep_downsample(j_compress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_index, JSAMPIMAGE output_buf,
|
||||
JDIMENSION out_row_group_index)
|
||||
{
|
||||
my_downsample_ptr downsample = (my_downsample_ptr)cinfo->downsample;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
JSAMPARRAY in_ptr, out_ptr;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
in_ptr = input_buf[ci] + in_row_index;
|
||||
out_ptr = output_buf[ci] + (out_row_group_index * compptr->v_samp_factor);
|
||||
(*downsample->methods[ci]) (cinfo, compptr, in_ptr, out_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* One row group is processed per call.
|
||||
* This version handles arbitrary integral sampling ratios, without smoothing.
|
||||
* Note that this version is not actually used for customary sampling ratios.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
int_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow, h_expand, v_expand, numpix, numpix2, h, v;
|
||||
JDIMENSION outcol, outcol_h; /* outcol_h == outcol*h_expand */
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
JSAMPROW inptr, outptr;
|
||||
JLONG outvalue;
|
||||
|
||||
h_expand = cinfo->max_h_samp_factor / compptr->h_samp_factor;
|
||||
v_expand = cinfo->max_v_samp_factor / compptr->v_samp_factor;
|
||||
numpix = h_expand * v_expand;
|
||||
numpix2 = numpix / 2;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
* efficient.
|
||||
*/
|
||||
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||
output_cols * h_expand);
|
||||
|
||||
inrow = 0;
|
||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
for (outcol = 0, outcol_h = 0; outcol < output_cols;
|
||||
outcol++, outcol_h += h_expand) {
|
||||
outvalue = 0;
|
||||
for (v = 0; v < v_expand; v++) {
|
||||
inptr = input_data[inrow + v] + outcol_h;
|
||||
for (h = 0; h < h_expand; h++) {
|
||||
outvalue += (JLONG)GETJSAMPLE(*inptr++);
|
||||
}
|
||||
}
|
||||
*outptr++ = (JSAMPLE)((outvalue + numpix2) / numpix);
|
||||
}
|
||||
inrow += v_expand;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* This version handles the special case of a full-size component,
|
||||
* without smoothing.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
fullsize_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
/* Copy the data */
|
||||
jcopy_sample_rows(input_data, 0, output_data, 0, cinfo->max_v_samp_factor,
|
||||
cinfo->image_width);
|
||||
/* Edge-expand */
|
||||
expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||
compptr->width_in_blocks * DCTSIZE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* This version handles the common case of 2:1 horizontal and 1:1 vertical,
|
||||
* without smoothing.
|
||||
*
|
||||
* A note about the "bias" calculations: when rounding fractional values to
|
||||
* integer, we do not want to always round 0.5 up to the next integer.
|
||||
* If we did that, we'd introduce a noticeable bias towards larger values.
|
||||
* Instead, this code is arranged so that 0.5 will be rounded up or down at
|
||||
* alternate pixel locations (a simple ordered dither pattern).
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int outrow;
|
||||
JDIMENSION outcol;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr, outptr;
|
||||
register int bias;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
* efficient.
|
||||
*/
|
||||
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||
output_cols * 2);
|
||||
|
||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr = input_data[outrow];
|
||||
bias = 0; /* bias = 0,1,0,1,... for successive samples */
|
||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||
*outptr++ =
|
||||
(JSAMPLE)((GETJSAMPLE(*inptr) + GETJSAMPLE(inptr[1]) + bias) >> 1);
|
||||
bias ^= 1; /* 0=>1, 1=>0 */
|
||||
inptr += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* This version handles the standard case of 2:1 horizontal and 2:1 vertical,
|
||||
* without smoothing.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow;
|
||||
JDIMENSION outcol;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr0, inptr1, outptr;
|
||||
register int bias;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
* efficient.
|
||||
*/
|
||||
expand_right_edge(input_data, cinfo->max_v_samp_factor, cinfo->image_width,
|
||||
output_cols * 2);
|
||||
|
||||
inrow = 0;
|
||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr0 = input_data[inrow];
|
||||
inptr1 = input_data[inrow + 1];
|
||||
bias = 1; /* bias = 1,2,1,2,... for successive samples */
|
||||
for (outcol = 0; outcol < output_cols; outcol++) {
|
||||
*outptr++ =
|
||||
(JSAMPLE)((GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]) + bias) >> 2);
|
||||
bias ^= 3; /* 1=>2, 2=>1 */
|
||||
inptr0 += 2; inptr1 += 2;
|
||||
}
|
||||
inrow += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* This version handles the standard case of 2:1 horizontal and 2:1 vertical,
|
||||
* with smoothing. One row of context is required.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
h2v2_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int inrow, outrow;
|
||||
JDIMENSION colctr;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr0, inptr1, above_ptr, below_ptr, outptr;
|
||||
JLONG membersum, neighsum, memberscale, neighscale;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
* efficient.
|
||||
*/
|
||||
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
|
||||
cinfo->image_width, output_cols * 2);
|
||||
|
||||
/* We don't bother to form the individual "smoothed" input pixel values;
|
||||
* we can directly compute the output which is the average of the four
|
||||
* smoothed values. Each of the four member pixels contributes a fraction
|
||||
* (1-8*SF) to its own smoothed image and a fraction SF to each of the three
|
||||
* other smoothed pixels, therefore a total fraction (1-5*SF)/4 to the final
|
||||
* output. The four corner-adjacent neighbor pixels contribute a fraction
|
||||
* SF to just one smoothed pixel, or SF/4 to the final output; while the
|
||||
* eight edge-adjacent neighbors contribute SF to each of two smoothed
|
||||
* pixels, or SF/2 overall. In order to use integer arithmetic, these
|
||||
* factors are scaled by 2^16 = 65536.
|
||||
* Also recall that SF = smoothing_factor / 1024.
|
||||
*/
|
||||
|
||||
memberscale = 16384 - cinfo->smoothing_factor * 80; /* scaled (1-5*SF)/4 */
|
||||
neighscale = cinfo->smoothing_factor * 16; /* scaled SF/4 */
|
||||
|
||||
inrow = 0;
|
||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr0 = input_data[inrow];
|
||||
inptr1 = input_data[inrow + 1];
|
||||
above_ptr = input_data[inrow - 1];
|
||||
below_ptr = input_data[inrow + 2];
|
||||
|
||||
/* Special case for first column: pretend column -1 is same as column 0 */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[2]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[2]);
|
||||
neighsum += neighsum;
|
||||
neighsum += GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[2]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[2]);
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
|
||||
|
||||
for (colctr = output_cols - 2; colctr > 0; colctr--) {
|
||||
/* sum of pixels directly mapped to this output element */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
/* sum of edge-neighbor pixels */
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[2]) +
|
||||
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[2]);
|
||||
/* The edge-neighbors count twice as much as corner-neighbors */
|
||||
neighsum += neighsum;
|
||||
/* Add in the corner-neighbors */
|
||||
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[2]) +
|
||||
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[2]);
|
||||
/* form final output scaled up by 2^16 */
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
/* round, descale and output it */
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
inptr0 += 2; inptr1 += 2; above_ptr += 2; below_ptr += 2;
|
||||
}
|
||||
|
||||
/* Special case for last column */
|
||||
membersum = GETJSAMPLE(*inptr0) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(*inptr1) + GETJSAMPLE(inptr1[1]);
|
||||
neighsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(*below_ptr) + GETJSAMPLE(below_ptr[1]) +
|
||||
GETJSAMPLE(inptr0[-1]) + GETJSAMPLE(inptr0[1]) +
|
||||
GETJSAMPLE(inptr1[-1]) + GETJSAMPLE(inptr1[1]);
|
||||
neighsum += neighsum;
|
||||
neighsum += GETJSAMPLE(above_ptr[-1]) + GETJSAMPLE(above_ptr[1]) +
|
||||
GETJSAMPLE(below_ptr[-1]) + GETJSAMPLE(below_ptr[1]);
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
|
||||
inrow += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Downsample pixel values of a single component.
|
||||
* This version handles the special case of a full-size component,
|
||||
* with smoothing. One row of context is required.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
fullsize_smooth_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
int outrow;
|
||||
JDIMENSION colctr;
|
||||
JDIMENSION output_cols = compptr->width_in_blocks * DCTSIZE;
|
||||
register JSAMPROW inptr, above_ptr, below_ptr, outptr;
|
||||
JLONG membersum, neighsum, memberscale, neighscale;
|
||||
int colsum, lastcolsum, nextcolsum;
|
||||
|
||||
/* Expand input data enough to let all the output samples be generated
|
||||
* by the standard loop. Special-casing padded output would be more
|
||||
* efficient.
|
||||
*/
|
||||
expand_right_edge(input_data - 1, cinfo->max_v_samp_factor + 2,
|
||||
cinfo->image_width, output_cols);
|
||||
|
||||
/* Each of the eight neighbor pixels contributes a fraction SF to the
|
||||
* smoothed pixel, while the main pixel contributes (1-8*SF). In order
|
||||
* to use integer arithmetic, these factors are multiplied by 2^16 = 65536.
|
||||
* Also recall that SF = smoothing_factor / 1024.
|
||||
*/
|
||||
|
||||
memberscale = 65536L - cinfo->smoothing_factor * 512L; /* scaled 1-8*SF */
|
||||
neighscale = cinfo->smoothing_factor * 64; /* scaled SF */
|
||||
|
||||
for (outrow = 0; outrow < compptr->v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr = input_data[outrow];
|
||||
above_ptr = input_data[outrow - 1];
|
||||
below_ptr = input_data[outrow + 1];
|
||||
|
||||
/* Special case for first column */
|
||||
colsum = GETJSAMPLE(*above_ptr++) + GETJSAMPLE(*below_ptr++) +
|
||||
GETJSAMPLE(*inptr);
|
||||
membersum = GETJSAMPLE(*inptr++);
|
||||
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
|
||||
GETJSAMPLE(*inptr);
|
||||
neighsum = colsum + (colsum - membersum) + nextcolsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
lastcolsum = colsum; colsum = nextcolsum;
|
||||
|
||||
for (colctr = output_cols - 2; colctr > 0; colctr--) {
|
||||
membersum = GETJSAMPLE(*inptr++);
|
||||
above_ptr++; below_ptr++;
|
||||
nextcolsum = GETJSAMPLE(*above_ptr) + GETJSAMPLE(*below_ptr) +
|
||||
GETJSAMPLE(*inptr);
|
||||
neighsum = lastcolsum + (colsum - membersum) + nextcolsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr++ = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
lastcolsum = colsum; colsum = nextcolsum;
|
||||
}
|
||||
|
||||
/* Special case for last column */
|
||||
membersum = GETJSAMPLE(*inptr);
|
||||
neighsum = lastcolsum + (colsum - membersum) + colsum;
|
||||
membersum = membersum * memberscale + neighsum * neighscale;
|
||||
*outptr = (JSAMPLE)((membersum + 32768) >> 16);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* INPUT_SMOOTHING_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Module initialization routine for downsampling.
|
||||
* Note that we must select a routine for each component.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_downsampler(j_compress_ptr cinfo)
|
||||
{
|
||||
my_downsample_ptr downsample;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
boolean smoothok = TRUE;
|
||||
|
||||
downsample = (my_downsample_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_downsampler));
|
||||
cinfo->downsample = (struct jpeg_downsampler *)downsample;
|
||||
downsample->pub.start_pass = start_pass_downsample;
|
||||
downsample->pub.downsample = sep_downsample;
|
||||
downsample->pub.need_context_rows = FALSE;
|
||||
|
||||
if (cinfo->CCIR601_sampling)
|
||||
ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
|
||||
|
||||
/* Verify we can handle the sampling factors, and set up method pointers */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
if (compptr->h_samp_factor == cinfo->max_h_samp_factor &&
|
||||
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
if (cinfo->smoothing_factor) {
|
||||
downsample->methods[ci] = fullsize_smooth_downsample;
|
||||
downsample->pub.need_context_rows = TRUE;
|
||||
} else
|
||||
#endif
|
||||
downsample->methods[ci] = fullsize_downsample;
|
||||
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
|
||||
compptr->v_samp_factor == cinfo->max_v_samp_factor) {
|
||||
smoothok = FALSE;
|
||||
if (jsimd_can_h2v1_downsample())
|
||||
downsample->methods[ci] = jsimd_h2v1_downsample;
|
||||
else
|
||||
downsample->methods[ci] = h2v1_downsample;
|
||||
} else if (compptr->h_samp_factor * 2 == cinfo->max_h_samp_factor &&
|
||||
compptr->v_samp_factor * 2 == cinfo->max_v_samp_factor) {
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
if (cinfo->smoothing_factor) {
|
||||
#if defined(__mips__)
|
||||
if (jsimd_can_h2v2_smooth_downsample())
|
||||
downsample->methods[ci] = jsimd_h2v2_smooth_downsample;
|
||||
else
|
||||
#endif
|
||||
downsample->methods[ci] = h2v2_smooth_downsample;
|
||||
downsample->pub.need_context_rows = TRUE;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (jsimd_can_h2v2_downsample())
|
||||
downsample->methods[ci] = jsimd_h2v2_downsample;
|
||||
else
|
||||
downsample->methods[ci] = h2v2_downsample;
|
||||
}
|
||||
} else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 &&
|
||||
(cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) {
|
||||
smoothok = FALSE;
|
||||
downsample->methods[ci] = int_downsample;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
|
||||
}
|
||||
|
||||
#ifdef INPUT_SMOOTHING_SUPPORTED
|
||||
if (cinfo->smoothing_factor && !smoothok)
|
||||
TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
|
||||
#endif
|
||||
}
|
||||
Vendored
+400
@@ -0,0 +1,400 @@
|
||||
/*
|
||||
* jctrans.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||
* Modified 2000-2009 by Guido Vollbeding.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains library routines for transcoding compression,
|
||||
* that is, writing raw DCT coefficient arrays to an output JPEG file.
|
||||
* The routines in jcapimin.c will also be needed by a transcoder.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
LOCAL(void) transencode_master_selection(j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr *coef_arrays);
|
||||
LOCAL(void) transencode_coef_controller(j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr *coef_arrays);
|
||||
|
||||
|
||||
/*
|
||||
* Compression initialization for writing raw-coefficient data.
|
||||
* Before calling this, all parameters and a data destination must be set up.
|
||||
* Call jpeg_finish_compress() to actually write the data.
|
||||
*
|
||||
* The number of passed virtual arrays must match cinfo->num_components.
|
||||
* Note that the virtual arrays need not be filled or even realized at
|
||||
* the time write_coefficients is called; indeed, if the virtual arrays
|
||||
* were requested from this compression object's memory manager, they
|
||||
* typically will be realized during this routine and filled afterwards.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_coefficients(j_compress_ptr cinfo, jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
if (cinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
/* Mark all tables to be written */
|
||||
jpeg_suppress_tables(cinfo, FALSE);
|
||||
/* (Re)initialize error mgr and destination modules */
|
||||
(*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
|
||||
(*cinfo->dest->init_destination) (cinfo);
|
||||
/* Perform master selection of active modules */
|
||||
transencode_master_selection(cinfo, coef_arrays);
|
||||
/* Wait for jpeg_finish_compress() call */
|
||||
cinfo->next_scanline = 0; /* so jpeg_write_marker works */
|
||||
cinfo->global_state = CSTATE_WRCOEFS;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the compression object with default parameters,
|
||||
* then copy from the source object all parameters needed for lossless
|
||||
* transcoding. Parameters that can be varied without loss (such as
|
||||
* scan script and Huffman optimization) are left in their default states.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
|
||||
{
|
||||
JQUANT_TBL **qtblptr;
|
||||
jpeg_component_info *incomp, *outcomp;
|
||||
JQUANT_TBL *c_quant, *slot_quant;
|
||||
int tblno, ci, coefi;
|
||||
|
||||
/* Safety check to ensure start_compress not called yet. */
|
||||
if (dstinfo->global_state != CSTATE_START)
|
||||
ERREXIT1(dstinfo, JERR_BAD_STATE, dstinfo->global_state);
|
||||
/* Copy fundamental image dimensions */
|
||||
dstinfo->image_width = srcinfo->image_width;
|
||||
dstinfo->image_height = srcinfo->image_height;
|
||||
dstinfo->input_components = srcinfo->num_components;
|
||||
dstinfo->in_color_space = srcinfo->jpeg_color_space;
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
dstinfo->jpeg_width = srcinfo->output_width;
|
||||
dstinfo->jpeg_height = srcinfo->output_height;
|
||||
dstinfo->min_DCT_h_scaled_size = srcinfo->min_DCT_h_scaled_size;
|
||||
dstinfo->min_DCT_v_scaled_size = srcinfo->min_DCT_v_scaled_size;
|
||||
#endif
|
||||
/* Initialize all parameters to default values */
|
||||
jpeg_set_defaults(dstinfo);
|
||||
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
|
||||
* Fix it to get the right header markers for the image colorspace.
|
||||
*/
|
||||
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
|
||||
dstinfo->data_precision = srcinfo->data_precision;
|
||||
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
|
||||
/* Copy the source's quantization tables. */
|
||||
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
|
||||
if (srcinfo->quant_tbl_ptrs[tblno] != NULL) {
|
||||
qtblptr = &dstinfo->quant_tbl_ptrs[tblno];
|
||||
if (*qtblptr == NULL)
|
||||
*qtblptr = jpeg_alloc_quant_table((j_common_ptr)dstinfo);
|
||||
MEMCOPY((*qtblptr)->quantval, srcinfo->quant_tbl_ptrs[tblno]->quantval,
|
||||
sizeof((*qtblptr)->quantval));
|
||||
(*qtblptr)->sent_table = FALSE;
|
||||
}
|
||||
}
|
||||
/* Copy the source's per-component info.
|
||||
* Note we assume jpeg_set_defaults has allocated the dest comp_info array.
|
||||
*/
|
||||
dstinfo->num_components = srcinfo->num_components;
|
||||
if (dstinfo->num_components < 1 || dstinfo->num_components > MAX_COMPONENTS)
|
||||
ERREXIT2(dstinfo, JERR_COMPONENT_COUNT, dstinfo->num_components,
|
||||
MAX_COMPONENTS);
|
||||
for (ci = 0, incomp = srcinfo->comp_info, outcomp = dstinfo->comp_info;
|
||||
ci < dstinfo->num_components; ci++, incomp++, outcomp++) {
|
||||
outcomp->component_id = incomp->component_id;
|
||||
outcomp->h_samp_factor = incomp->h_samp_factor;
|
||||
outcomp->v_samp_factor = incomp->v_samp_factor;
|
||||
outcomp->quant_tbl_no = incomp->quant_tbl_no;
|
||||
/* Make sure saved quantization table for component matches the qtable
|
||||
* slot. If not, the input file re-used this qtable slot.
|
||||
* IJG encoder currently cannot duplicate this.
|
||||
*/
|
||||
tblno = outcomp->quant_tbl_no;
|
||||
if (tblno < 0 || tblno >= NUM_QUANT_TBLS ||
|
||||
srcinfo->quant_tbl_ptrs[tblno] == NULL)
|
||||
ERREXIT1(dstinfo, JERR_NO_QUANT_TABLE, tblno);
|
||||
slot_quant = srcinfo->quant_tbl_ptrs[tblno];
|
||||
c_quant = incomp->quant_table;
|
||||
if (c_quant != NULL) {
|
||||
for (coefi = 0; coefi < DCTSIZE2; coefi++) {
|
||||
if (c_quant->quantval[coefi] != slot_quant->quantval[coefi])
|
||||
ERREXIT1(dstinfo, JERR_MISMATCHED_QUANT_TABLE, tblno);
|
||||
}
|
||||
}
|
||||
/* Note: we do not copy the source's Huffman table assignments;
|
||||
* instead we rely on jpeg_set_colorspace to have made a suitable choice.
|
||||
*/
|
||||
}
|
||||
/* Also copy JFIF version and resolution information, if available.
|
||||
* Strictly speaking this isn't "critical" info, but it's nearly
|
||||
* always appropriate to copy it if available. In particular,
|
||||
* if the application chooses to copy JFIF 1.02 extension markers from
|
||||
* the source file, we need to copy the version to make sure we don't
|
||||
* emit a file that has 1.02 extensions but a claimed version of 1.01.
|
||||
* We will *not*, however, copy version info from mislabeled "2.01" files.
|
||||
*/
|
||||
if (srcinfo->saw_JFIF_marker) {
|
||||
if (srcinfo->JFIF_major_version == 1) {
|
||||
dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
|
||||
dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
|
||||
}
|
||||
dstinfo->density_unit = srcinfo->density_unit;
|
||||
dstinfo->X_density = srcinfo->X_density;
|
||||
dstinfo->Y_density = srcinfo->Y_density;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Master selection of compression modules for transcoding.
|
||||
* This substitutes for jcinit.c's initialization of the full compressor.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
transencode_master_selection(j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
/* Although we don't actually use input_components for transcoding,
|
||||
* jcmaster.c's initial_setup will complain if input_components is 0.
|
||||
*/
|
||||
cinfo->input_components = 1;
|
||||
/* Initialize master control (includes parameter checking/processing) */
|
||||
jinit_c_master_control(cinfo, TRUE /* transcode only */);
|
||||
|
||||
/* Entropy encoding: either Huffman or arithmetic coding. */
|
||||
if (cinfo->arith_code) {
|
||||
#ifdef C_ARITH_CODING_SUPPORTED
|
||||
jinit_arith_encoder(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
|
||||
#endif
|
||||
} else {
|
||||
if (cinfo->progressive_mode) {
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
jinit_phuff_encoder(cinfo);
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else
|
||||
jinit_huff_encoder(cinfo);
|
||||
}
|
||||
|
||||
/* We need a special coefficient buffer controller. */
|
||||
transencode_coef_controller(cinfo, coef_arrays);
|
||||
|
||||
jinit_marker_writer(cinfo);
|
||||
|
||||
/* We can now tell the memory manager to allocate virtual arrays. */
|
||||
(*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
|
||||
|
||||
/* Write the datastream header (SOI, JFIF) immediately.
|
||||
* Frame and scan headers are postponed till later.
|
||||
* This lets application insert special markers after the SOI.
|
||||
*/
|
||||
(*cinfo->marker->write_file_header) (cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The rest of this file is a special implementation of the coefficient
|
||||
* buffer controller. This is similar to jccoefct.c, but it handles only
|
||||
* output from presupplied virtual arrays. Furthermore, we generate any
|
||||
* dummy padding blocks on-the-fly rather than expecting them to be present
|
||||
* in the arrays.
|
||||
*/
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_c_coef_controller pub; /* public fields */
|
||||
|
||||
JDIMENSION iMCU_row_num; /* iMCU row # within image */
|
||||
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
|
||||
int MCU_vert_offset; /* counts MCU rows within iMCU row */
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
|
||||
/* Virtual block array for each component. */
|
||||
jvirt_barray_ptr *whole_image;
|
||||
|
||||
/* Workspace for constructing dummy blocks at right/bottom edges. */
|
||||
JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
|
||||
} my_coef_controller;
|
||||
|
||||
typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
start_iMCU_row(j_compress_ptr cinfo)
|
||||
/* Reset within-iMCU-row counters for a new row */
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
/* In an interleaved scan, an MCU row is the same as an iMCU row.
|
||||
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
|
||||
* But at the bottom of the image, process only what's left.
|
||||
*/
|
||||
if (cinfo->comps_in_scan > 1) {
|
||||
coef->MCU_rows_per_iMCU_row = 1;
|
||||
} else {
|
||||
if (coef->iMCU_row_num < (cinfo->total_iMCU_rows - 1))
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
|
||||
else
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
|
||||
}
|
||||
|
||||
coef->mcu_ctr = 0;
|
||||
coef->MCU_vert_offset = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_coef(j_compress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
if (pass_mode != JBUF_CRANK_DEST)
|
||||
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
|
||||
|
||||
coef->iMCU_row_num = 0;
|
||||
start_iMCU_row(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process some data.
|
||||
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
|
||||
* per call, ie, v_samp_factor block rows for each component in the scan.
|
||||
* The data is obtained from the virtual arrays and fed to the entropy coder.
|
||||
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
|
||||
*
|
||||
* NB: input_buf is ignored; it is likely to be a NULL pointer.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
compress_output(j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
int blkn, ci, xindex, yindex, yoffset, blockcnt;
|
||||
JDIMENSION start_col;
|
||||
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
|
||||
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
|
||||
JBLOCKROW buffer_ptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Align the virtual buffers for the components used in this scan. */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
buffer[ci] = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
|
||||
coef->iMCU_row_num * compptr->v_samp_factor,
|
||||
(JDIMENSION)compptr->v_samp_factor, FALSE);
|
||||
}
|
||||
|
||||
/* Loop to process one whole iMCU row */
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
|
||||
MCU_col_num++) {
|
||||
/* Construct list of pointers to DCT blocks belonging to this MCU */
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
start_col = MCU_col_num * compptr->MCU_width;
|
||||
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width :
|
||||
compptr->last_col_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
if (coef->iMCU_row_num < last_iMCU_row ||
|
||||
yindex + yoffset < compptr->last_row_height) {
|
||||
/* Fill in pointers to real blocks in this row */
|
||||
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
|
||||
for (xindex = 0; xindex < blockcnt; xindex++)
|
||||
MCU_buffer[blkn++] = buffer_ptr++;
|
||||
} else {
|
||||
/* At bottom of image, need a whole row of dummy blocks */
|
||||
xindex = 0;
|
||||
}
|
||||
/* Fill in any dummy blocks needed in this row.
|
||||
* Dummy blocks are filled in the same way as in jccoefct.c:
|
||||
* all zeroes in the AC entries, DC entries equal to previous
|
||||
* block's DC value. The init routine has already zeroed the
|
||||
* AC entries, so we need only set the DC entries correctly.
|
||||
*/
|
||||
for (; xindex < compptr->MCU_width; xindex++) {
|
||||
MCU_buffer[blkn] = coef->dummy_buffer[blkn];
|
||||
MCU_buffer[blkn][0][0] = MCU_buffer[blkn - 1][0][0];
|
||||
blkn++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Try to write the MCU. */
|
||||
if (!(*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->mcu_ctr = MCU_col_num;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
coef->mcu_ctr = 0;
|
||||
}
|
||||
/* Completed the iMCU row, advance counters for next one */
|
||||
coef->iMCU_row_num++;
|
||||
start_iMCU_row(cinfo);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize coefficient buffer controller.
|
||||
*
|
||||
* Each passed coefficient array must be the right size for that
|
||||
* coefficient: width_in_blocks wide and height_in_blocks high,
|
||||
* with unitheight at least v_samp_factor.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
transencode_coef_controller(j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr *coef_arrays)
|
||||
{
|
||||
my_coef_ptr coef;
|
||||
JBLOCKROW buffer;
|
||||
int i;
|
||||
|
||||
coef = (my_coef_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_coef_controller));
|
||||
cinfo->coef = (struct jpeg_c_coef_controller *)coef;
|
||||
coef->pub.start_pass = start_pass_coef;
|
||||
coef->pub.compress_data = compress_output;
|
||||
|
||||
/* Save pointer to virtual arrays */
|
||||
coef->whole_image = coef_arrays;
|
||||
|
||||
/* Allocate and pre-zero space for dummy DCT blocks. */
|
||||
buffer = (JBLOCKROW)
|
||||
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
|
||||
jzero_far((void *)buffer, C_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
|
||||
for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
|
||||
coef->dummy_buffer[i] = buffer + i;
|
||||
}
|
||||
}
|
||||
+407
@@ -0,0 +1,407 @@
|
||||
/*
|
||||
* jdapimin.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2016, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the decompression half
|
||||
* of the JPEG library. These are the "minimum" API routines that may be
|
||||
* needed in either the normal full-decompression case or the
|
||||
* transcoding-only case.
|
||||
*
|
||||
* Most of the routines intended to be called directly by an application
|
||||
* are in this file or in jdapistd.c. But also see jcomapi.c for routines
|
||||
* shared by compression and decompression, and jdtrans.c for the transcoding
|
||||
* case.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jdmaster.h"
|
||||
|
||||
|
||||
/*
|
||||
* Initialization of a JPEG decompression object.
|
||||
* The error manager must already be set up (in case memory manager fails).
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_CreateDecompress(j_decompress_ptr cinfo, int version, size_t structsize)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Guard against version mismatches between library and caller. */
|
||||
cinfo->mem = NULL; /* so jpeg_destroy knows mem mgr not called */
|
||||
if (version != JPEG_LIB_VERSION)
|
||||
ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
|
||||
if (structsize != sizeof(struct jpeg_decompress_struct))
|
||||
ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
|
||||
(int)sizeof(struct jpeg_decompress_struct), (int)structsize);
|
||||
|
||||
/* For debugging purposes, we zero the whole master structure.
|
||||
* But the application has already set the err pointer, and may have set
|
||||
* client_data, so we have to save and restore those fields.
|
||||
* Note: if application hasn't set client_data, tools like Purify may
|
||||
* complain here.
|
||||
*/
|
||||
{
|
||||
struct jpeg_error_mgr *err = cinfo->err;
|
||||
void *client_data = cinfo->client_data; /* ignore Purify complaint here */
|
||||
MEMZERO(cinfo, sizeof(struct jpeg_decompress_struct));
|
||||
cinfo->err = err;
|
||||
cinfo->client_data = client_data;
|
||||
}
|
||||
cinfo->is_decompressor = TRUE;
|
||||
|
||||
/* Initialize a memory manager instance for this object */
|
||||
jinit_memory_mgr((j_common_ptr)cinfo);
|
||||
|
||||
/* Zero out pointers to permanent structures. */
|
||||
cinfo->progress = NULL;
|
||||
cinfo->src = NULL;
|
||||
|
||||
for (i = 0; i < NUM_QUANT_TBLS; i++)
|
||||
cinfo->quant_tbl_ptrs[i] = NULL;
|
||||
|
||||
for (i = 0; i < NUM_HUFF_TBLS; i++) {
|
||||
cinfo->dc_huff_tbl_ptrs[i] = NULL;
|
||||
cinfo->ac_huff_tbl_ptrs[i] = NULL;
|
||||
}
|
||||
|
||||
/* Initialize marker processor so application can override methods
|
||||
* for COM, APPn markers before calling jpeg_read_header.
|
||||
*/
|
||||
cinfo->marker_list = NULL;
|
||||
jinit_marker_reader(cinfo);
|
||||
|
||||
/* And initialize the overall input controller. */
|
||||
jinit_input_controller(cinfo);
|
||||
|
||||
/* OK, I'm ready */
|
||||
cinfo->global_state = DSTATE_START;
|
||||
|
||||
/* The master struct is used to store extension parameters, so we allocate it
|
||||
* here.
|
||||
*/
|
||||
cinfo->master = (struct jpeg_decomp_master *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_decomp_master));
|
||||
MEMZERO(cinfo->master, sizeof(my_decomp_master));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Destruction of a JPEG decompression object
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_destroy_decompress(j_decompress_ptr cinfo)
|
||||
{
|
||||
jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Abort processing of a JPEG decompression operation,
|
||||
* but don't destroy the object itself.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_abort_decompress(j_decompress_ptr cinfo)
|
||||
{
|
||||
jpeg_abort((j_common_ptr)cinfo); /* use common routine */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set default decompression parameters.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
default_decompress_parms(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* Guess the input colorspace, and set output colorspace accordingly. */
|
||||
/* (Wish JPEG committee had provided a real way to specify this...) */
|
||||
/* Note application may override our guesses. */
|
||||
switch (cinfo->num_components) {
|
||||
case 1:
|
||||
cinfo->jpeg_color_space = JCS_GRAYSCALE;
|
||||
cinfo->out_color_space = JCS_GRAYSCALE;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (cinfo->saw_JFIF_marker) {
|
||||
cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
|
||||
} else if (cinfo->saw_Adobe_marker) {
|
||||
switch (cinfo->Adobe_transform) {
|
||||
case 0:
|
||||
cinfo->jpeg_color_space = JCS_RGB;
|
||||
break;
|
||||
case 1:
|
||||
cinfo->jpeg_color_space = JCS_YCbCr;
|
||||
break;
|
||||
default:
|
||||
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
|
||||
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* Saw no special markers, try to guess from the component IDs */
|
||||
int cid0 = cinfo->comp_info[0].component_id;
|
||||
int cid1 = cinfo->comp_info[1].component_id;
|
||||
int cid2 = cinfo->comp_info[2].component_id;
|
||||
|
||||
if (cid0 == 1 && cid1 == 2 && cid2 == 3)
|
||||
cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
|
||||
else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
|
||||
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
|
||||
else {
|
||||
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
|
||||
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
|
||||
}
|
||||
}
|
||||
/* Always guess RGB is proper output colorspace. */
|
||||
cinfo->out_color_space = JCS_RGB;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (cinfo->saw_Adobe_marker) {
|
||||
switch (cinfo->Adobe_transform) {
|
||||
case 0:
|
||||
cinfo->jpeg_color_space = JCS_CMYK;
|
||||
break;
|
||||
case 2:
|
||||
cinfo->jpeg_color_space = JCS_YCCK;
|
||||
break;
|
||||
default:
|
||||
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
|
||||
cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* No special markers, assume straight CMYK. */
|
||||
cinfo->jpeg_color_space = JCS_CMYK;
|
||||
}
|
||||
cinfo->out_color_space = JCS_CMYK;
|
||||
break;
|
||||
|
||||
default:
|
||||
cinfo->jpeg_color_space = JCS_UNKNOWN;
|
||||
cinfo->out_color_space = JCS_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set defaults for other decompression parameters. */
|
||||
cinfo->scale_num = 1; /* 1:1 scaling */
|
||||
cinfo->scale_denom = 1;
|
||||
cinfo->output_gamma = 1.0;
|
||||
cinfo->buffered_image = FALSE;
|
||||
cinfo->raw_data_out = FALSE;
|
||||
cinfo->dct_method = JDCT_DEFAULT;
|
||||
cinfo->do_fancy_upsampling = TRUE;
|
||||
cinfo->do_block_smoothing = TRUE;
|
||||
cinfo->quantize_colors = FALSE;
|
||||
/* We set these in case application only sets quantize_colors. */
|
||||
cinfo->dither_mode = JDITHER_FS;
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
cinfo->two_pass_quantize = TRUE;
|
||||
#else
|
||||
cinfo->two_pass_quantize = FALSE;
|
||||
#endif
|
||||
cinfo->desired_number_of_colors = 256;
|
||||
cinfo->colormap = NULL;
|
||||
/* Initialize for no mode change in buffered-image mode. */
|
||||
cinfo->enable_1pass_quant = FALSE;
|
||||
cinfo->enable_external_quant = FALSE;
|
||||
cinfo->enable_2pass_quant = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decompression startup: read start of JPEG datastream to see what's there.
|
||||
* Need only initialize JPEG object and supply a data source before calling.
|
||||
*
|
||||
* This routine will read as far as the first SOS marker (ie, actual start of
|
||||
* compressed data), and will save all tables and parameters in the JPEG
|
||||
* object. It will also initialize the decompression parameters to default
|
||||
* values, and finally return JPEG_HEADER_OK. On return, the application may
|
||||
* adjust the decompression parameters and then call jpeg_start_decompress.
|
||||
* (Or, if the application only wanted to determine the image parameters,
|
||||
* the data need not be decompressed. In that case, call jpeg_abort or
|
||||
* jpeg_destroy to release any temporary space.)
|
||||
* If an abbreviated (tables only) datastream is presented, the routine will
|
||||
* return JPEG_HEADER_TABLES_ONLY upon reaching EOI. The application may then
|
||||
* re-use the JPEG object to read the abbreviated image datastream(s).
|
||||
* It is unnecessary (but OK) to call jpeg_abort in this case.
|
||||
* The JPEG_SUSPENDED return code only occurs if the data source module
|
||||
* requests suspension of the decompressor. In this case the application
|
||||
* should load more source data and then re-call jpeg_read_header to resume
|
||||
* processing.
|
||||
* If a non-suspending data source is used and require_image is TRUE, then the
|
||||
* return code need not be inspected since only JPEG_HEADER_OK is possible.
|
||||
*
|
||||
* This routine is now just a front end to jpeg_consume_input, with some
|
||||
* extra error checking.
|
||||
*/
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
|
||||
{
|
||||
int retcode;
|
||||
|
||||
if (cinfo->global_state != DSTATE_START &&
|
||||
cinfo->global_state != DSTATE_INHEADER)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
retcode = jpeg_consume_input(cinfo);
|
||||
|
||||
switch (retcode) {
|
||||
case JPEG_REACHED_SOS:
|
||||
retcode = JPEG_HEADER_OK;
|
||||
break;
|
||||
case JPEG_REACHED_EOI:
|
||||
if (require_image) /* Complain if application wanted an image */
|
||||
ERREXIT(cinfo, JERR_NO_IMAGE);
|
||||
/* Reset to start state; it would be safer to require the application to
|
||||
* call jpeg_abort, but we can't change it now for compatibility reasons.
|
||||
* A side effect is to free any temporary memory (there shouldn't be any).
|
||||
*/
|
||||
jpeg_abort((j_common_ptr)cinfo); /* sets state = DSTATE_START */
|
||||
retcode = JPEG_HEADER_TABLES_ONLY;
|
||||
break;
|
||||
case JPEG_SUSPENDED:
|
||||
/* no work */
|
||||
break;
|
||||
}
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Consume data in advance of what the decompressor requires.
|
||||
* This can be called at any time once the decompressor object has
|
||||
* been created and a data source has been set up.
|
||||
*
|
||||
* This routine is essentially a state machine that handles a couple
|
||||
* of critical state-transition actions, namely initial setup and
|
||||
* transition from header scanning to ready-for-start_decompress.
|
||||
* All the actual input is done via the input controller's consume_input
|
||||
* method.
|
||||
*/
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_consume_input(j_decompress_ptr cinfo)
|
||||
{
|
||||
int retcode = JPEG_SUSPENDED;
|
||||
|
||||
/* NB: every possible DSTATE value should be listed in this switch */
|
||||
switch (cinfo->global_state) {
|
||||
case DSTATE_START:
|
||||
/* Start-of-datastream actions: reset appropriate modules */
|
||||
(*cinfo->inputctl->reset_input_controller) (cinfo);
|
||||
/* Initialize application's data source module */
|
||||
(*cinfo->src->init_source) (cinfo);
|
||||
cinfo->global_state = DSTATE_INHEADER;
|
||||
/*FALLTHROUGH*/
|
||||
case DSTATE_INHEADER:
|
||||
retcode = (*cinfo->inputctl->consume_input) (cinfo);
|
||||
if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
|
||||
/* Set up default parameters based on header data */
|
||||
default_decompress_parms(cinfo);
|
||||
/* Set global state: ready for start_decompress */
|
||||
cinfo->global_state = DSTATE_READY;
|
||||
}
|
||||
break;
|
||||
case DSTATE_READY:
|
||||
/* Can't advance past first SOS until start_decompress is called */
|
||||
retcode = JPEG_REACHED_SOS;
|
||||
break;
|
||||
case DSTATE_PRELOAD:
|
||||
case DSTATE_PRESCAN:
|
||||
case DSTATE_SCANNING:
|
||||
case DSTATE_RAW_OK:
|
||||
case DSTATE_BUFIMAGE:
|
||||
case DSTATE_BUFPOST:
|
||||
case DSTATE_STOPPING:
|
||||
retcode = (*cinfo->inputctl->consume_input) (cinfo);
|
||||
break;
|
||||
default:
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
}
|
||||
return retcode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Have we finished reading the input file?
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_input_complete(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* Check for valid jpeg object */
|
||||
if (cinfo->global_state < DSTATE_START ||
|
||||
cinfo->global_state > DSTATE_STOPPING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
return cinfo->inputctl->eoi_reached;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Is there more than one scan?
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_has_multiple_scans(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* Only valid after jpeg_read_header completes */
|
||||
if (cinfo->global_state < DSTATE_READY ||
|
||||
cinfo->global_state > DSTATE_STOPPING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
return cinfo->inputctl->has_multiple_scans;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finish JPEG decompression.
|
||||
*
|
||||
* This will normally just verify the file trailer and release temp storage.
|
||||
*
|
||||
* Returns FALSE if suspended. The return value need be inspected only if
|
||||
* a suspending data source is used.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_finish_decompress(j_decompress_ptr cinfo)
|
||||
{
|
||||
if ((cinfo->global_state == DSTATE_SCANNING ||
|
||||
cinfo->global_state == DSTATE_RAW_OK) && !cinfo->buffered_image) {
|
||||
/* Terminate final pass of non-buffered mode */
|
||||
if (cinfo->output_scanline < cinfo->output_height)
|
||||
ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
|
||||
(*cinfo->master->finish_output_pass) (cinfo);
|
||||
cinfo->global_state = DSTATE_STOPPING;
|
||||
} else if (cinfo->global_state == DSTATE_BUFIMAGE) {
|
||||
/* Finishing after a buffered-image operation */
|
||||
cinfo->global_state = DSTATE_STOPPING;
|
||||
} else if (cinfo->global_state != DSTATE_STOPPING) {
|
||||
/* STOPPING = repeat call after a suspension, anything else is error */
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
}
|
||||
/* Read until EOI */
|
||||
while (!cinfo->inputctl->eoi_reached) {
|
||||
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
|
||||
return FALSE; /* Suspend, come back later */
|
||||
}
|
||||
/* Do final cleanup */
|
||||
(*cinfo->src->term_source) (cinfo);
|
||||
/* We can use jpeg_abort to release memory and reset global_state */
|
||||
jpeg_abort((j_common_ptr)cinfo);
|
||||
return TRUE;
|
||||
}
|
||||
+639
@@ -0,0 +1,639 @@
|
||||
/*
|
||||
* jdapistd.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2015-2018, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains application interface code for the decompression half
|
||||
* of the JPEG library. These are the "standard" API routines that are
|
||||
* used in the normal full-decompression case. They are not used by a
|
||||
* transcoding-only application. Note that if an application links in
|
||||
* jpeg_start_decompress, it will end up linking in the entire decompressor.
|
||||
* We thus must separate this file from jdapimin.c to avoid linking the
|
||||
* whole decompression library into a transcoder.
|
||||
*/
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jdmainct.h"
|
||||
#include "jdcoefct.h"
|
||||
#include "jdsample.h"
|
||||
#include "jmemsys.h"
|
||||
|
||||
/* Forward declarations */
|
||||
LOCAL(boolean) output_pass_setup(j_decompress_ptr cinfo);
|
||||
|
||||
|
||||
/*
|
||||
* Decompression initialization.
|
||||
* jpeg_read_header must be completed before calling this.
|
||||
*
|
||||
* If a multipass operating mode was selected, this will do all but the
|
||||
* last pass, and thus may take a great deal of time.
|
||||
*
|
||||
* Returns FALSE if suspended. The return value need be inspected only if
|
||||
* a suspending data source is used.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_start_decompress(j_decompress_ptr cinfo)
|
||||
{
|
||||
if (cinfo->global_state == DSTATE_READY) {
|
||||
/* First call: initialize master control, select active modules */
|
||||
jinit_master_decompress(cinfo);
|
||||
if (cinfo->buffered_image) {
|
||||
/* No more work here; expecting jpeg_start_output next */
|
||||
cinfo->global_state = DSTATE_BUFIMAGE;
|
||||
return TRUE;
|
||||
}
|
||||
cinfo->global_state = DSTATE_PRELOAD;
|
||||
}
|
||||
if (cinfo->global_state == DSTATE_PRELOAD) {
|
||||
/* If file has multiple scans, absorb them all into the coef buffer */
|
||||
if (cinfo->inputctl->has_multiple_scans) {
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
for (;;) {
|
||||
int retcode;
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL)
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
/* Absorb some more input */
|
||||
retcode = (*cinfo->inputctl->consume_input) (cinfo);
|
||||
if (retcode == JPEG_SUSPENDED)
|
||||
return FALSE;
|
||||
if (retcode == JPEG_REACHED_EOI)
|
||||
break;
|
||||
/* Advance progress counter if appropriate */
|
||||
if (cinfo->progress != NULL &&
|
||||
(retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
|
||||
if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
|
||||
/* jdmaster underestimated number of scans; ratchet up one scan */
|
||||
cinfo->progress->pass_limit += (long)cinfo->total_iMCU_rows;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif /* D_MULTISCAN_FILES_SUPPORTED */
|
||||
}
|
||||
cinfo->output_scan_number = cinfo->input_scan_number;
|
||||
} else if (cinfo->global_state != DSTATE_PRESCAN)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
/* Perform any dummy output passes, and set up for the final pass */
|
||||
return output_pass_setup(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set up for an output pass, and perform any dummy pass(es) needed.
|
||||
* Common subroutine for jpeg_start_decompress and jpeg_start_output.
|
||||
* Entry: global_state = DSTATE_PRESCAN only if previously suspended.
|
||||
* Exit: If done, returns TRUE and sets global_state for proper output mode.
|
||||
* If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN.
|
||||
*/
|
||||
|
||||
LOCAL(boolean)
|
||||
output_pass_setup(j_decompress_ptr cinfo)
|
||||
{
|
||||
if (cinfo->global_state != DSTATE_PRESCAN) {
|
||||
/* First call: do pass setup */
|
||||
(*cinfo->master->prepare_for_output_pass) (cinfo);
|
||||
cinfo->output_scanline = 0;
|
||||
cinfo->global_state = DSTATE_PRESCAN;
|
||||
}
|
||||
/* Loop over any required dummy passes */
|
||||
while (cinfo->master->is_dummy_pass) {
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
/* Crank through the dummy pass */
|
||||
while (cinfo->output_scanline < cinfo->output_height) {
|
||||
JDIMENSION last_scanline;
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
|
||||
cinfo->progress->pass_limit = (long)cinfo->output_height;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
/* Process some data */
|
||||
last_scanline = cinfo->output_scanline;
|
||||
(*cinfo->main->process_data) (cinfo, (JSAMPARRAY)NULL,
|
||||
&cinfo->output_scanline, (JDIMENSION)0);
|
||||
if (cinfo->output_scanline == last_scanline)
|
||||
return FALSE; /* No progress made, must suspend */
|
||||
}
|
||||
/* Finish up dummy pass, and set up for another one */
|
||||
(*cinfo->master->finish_output_pass) (cinfo);
|
||||
(*cinfo->master->prepare_for_output_pass) (cinfo);
|
||||
cinfo->output_scanline = 0;
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif /* QUANT_2PASS_SUPPORTED */
|
||||
}
|
||||
/* Ready for application to drive output pass through
|
||||
* jpeg_read_scanlines or jpeg_read_raw_data.
|
||||
*/
|
||||
cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Enable partial scanline decompression
|
||||
*
|
||||
* Must be called after jpeg_start_decompress() and before any calls to
|
||||
* jpeg_read_scanlines() or jpeg_skip_scanlines().
|
||||
*
|
||||
* Refer to libjpeg.txt for more information.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_crop_scanline(j_decompress_ptr cinfo, JDIMENSION *xoffset,
|
||||
JDIMENSION *width)
|
||||
{
|
||||
int ci, align, orig_downsampled_width;
|
||||
JDIMENSION input_xoffset;
|
||||
boolean reinit_upsampler = FALSE;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (cinfo->global_state != DSTATE_SCANNING || cinfo->output_scanline != 0)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
if (!xoffset || !width)
|
||||
ERREXIT(cinfo, JERR_BAD_CROP_SPEC);
|
||||
|
||||
/* xoffset and width must fall within the output image dimensions. */
|
||||
if (*width == 0 || *xoffset + *width > cinfo->output_width)
|
||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||
|
||||
/* No need to do anything if the caller wants the entire width. */
|
||||
if (*width == cinfo->output_width)
|
||||
return;
|
||||
|
||||
/* Ensuring the proper alignment of xoffset is tricky. At minimum, it
|
||||
* must align with an MCU boundary, because:
|
||||
*
|
||||
* (1) The IDCT is performed in blocks, and it is not feasible to modify
|
||||
* the algorithm so that it can transform partial blocks.
|
||||
* (2) Because of the SIMD extensions, any input buffer passed to the
|
||||
* upsampling and color conversion routines must be aligned to the
|
||||
* SIMD word size (for instance, 128-bit in the case of SSE2.) The
|
||||
* easiest way to accomplish this without copying data is to ensure
|
||||
* that upsampling and color conversion begin at the start of the
|
||||
* first MCU column that will be inverse transformed.
|
||||
*
|
||||
* In practice, we actually impose a stricter alignment requirement. We
|
||||
* require that xoffset be a multiple of the maximum MCU column width of all
|
||||
* of the components (the "iMCU column width.") This is to simplify the
|
||||
* single-pass decompression case, allowing us to use the same MCU column
|
||||
* width for all of the components.
|
||||
*/
|
||||
if (cinfo->comps_in_scan == 1 && cinfo->num_components == 1)
|
||||
align = cinfo->_min_DCT_scaled_size;
|
||||
else
|
||||
align = cinfo->_min_DCT_scaled_size * cinfo->max_h_samp_factor;
|
||||
|
||||
/* Adjust xoffset to the nearest iMCU boundary <= the requested value */
|
||||
input_xoffset = *xoffset;
|
||||
*xoffset = (input_xoffset / align) * align;
|
||||
|
||||
/* Adjust the width so that the right edge of the output image is as
|
||||
* requested (only the left edge is altered.) It is important that calling
|
||||
* programs check this value after this function returns, so that they can
|
||||
* allocate an output buffer with the appropriate size.
|
||||
*/
|
||||
*width = *width + input_xoffset - *xoffset;
|
||||
cinfo->output_width = *width;
|
||||
|
||||
/* Set the first and last iMCU columns that we must decompress. These values
|
||||
* will be used in single-scan decompressions.
|
||||
*/
|
||||
cinfo->master->first_iMCU_col = (JDIMENSION)(long)(*xoffset) / (long)align;
|
||||
cinfo->master->last_iMCU_col =
|
||||
(JDIMENSION)jdiv_round_up((long)(*xoffset + cinfo->output_width),
|
||||
(long)align) - 1;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
int hsf = (cinfo->comps_in_scan == 1 && cinfo->num_components == 1) ?
|
||||
1 : compptr->h_samp_factor;
|
||||
|
||||
/* Set downsampled_width to the new output width. */
|
||||
orig_downsampled_width = compptr->downsampled_width;
|
||||
compptr->downsampled_width =
|
||||
(JDIMENSION)jdiv_round_up((long)(cinfo->output_width *
|
||||
compptr->h_samp_factor),
|
||||
(long)cinfo->max_h_samp_factor);
|
||||
if (compptr->downsampled_width < 2 && orig_downsampled_width >= 2)
|
||||
reinit_upsampler = TRUE;
|
||||
|
||||
/* Set the first and last iMCU columns that we must decompress. These
|
||||
* values will be used in multi-scan decompressions.
|
||||
*/
|
||||
cinfo->master->first_MCU_col[ci] =
|
||||
(JDIMENSION)(long)(*xoffset * hsf) / (long)align;
|
||||
cinfo->master->last_MCU_col[ci] =
|
||||
(JDIMENSION)jdiv_round_up((long)((*xoffset + cinfo->output_width) * hsf),
|
||||
(long)align) - 1;
|
||||
}
|
||||
|
||||
if (reinit_upsampler) {
|
||||
cinfo->master->jinit_upsampler_no_alloc = TRUE;
|
||||
jinit_upsampler(cinfo);
|
||||
cinfo->master->jinit_upsampler_no_alloc = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read some scanlines of data from the JPEG decompressor.
|
||||
*
|
||||
* The return value will be the number of lines actually read.
|
||||
* This may be less than the number requested in several cases,
|
||||
* including bottom of image, data source suspension, and operating
|
||||
* modes that emit multiple scanlines at a time.
|
||||
*
|
||||
* Note: we warn about excess calls to jpeg_read_scanlines() since
|
||||
* this likely signals an application programmer error. However,
|
||||
* an oversize buffer (max_lines > scanlines remaining) is not an error.
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_read_scanlines(j_decompress_ptr cinfo, JSAMPARRAY scanlines,
|
||||
JDIMENSION max_lines)
|
||||
{
|
||||
JDIMENSION row_ctr;
|
||||
|
||||
if (cinfo->global_state != DSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->output_scanline >= cinfo->output_height) {
|
||||
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
|
||||
cinfo->progress->pass_limit = (long)cinfo->output_height;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
|
||||
/* Process some data */
|
||||
row_ctr = 0;
|
||||
(*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
|
||||
cinfo->output_scanline += row_ctr;
|
||||
return row_ctr;
|
||||
}
|
||||
|
||||
|
||||
/* Dummy color convert function used by jpeg_skip_scanlines() */
|
||||
LOCAL(void)
|
||||
noop_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* Dummy quantize function used by jpeg_skip_scanlines() */
|
||||
LOCAL(void)
|
||||
noop_quantize(j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* In some cases, it is best to call jpeg_read_scanlines() and discard the
|
||||
* output, rather than skipping the scanlines, because this allows us to
|
||||
* maintain the internal state of the context-based upsampler. In these cases,
|
||||
* we set up and tear down a dummy color converter in order to avoid valgrind
|
||||
* errors and to achieve the best possible performance.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
read_and_discard_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
JDIMENSION n;
|
||||
void (*color_convert) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows) = NULL;
|
||||
void (*color_quantize) (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPARRAY output_buf, int num_rows) = NULL;
|
||||
|
||||
if (cinfo->cconvert && cinfo->cconvert->color_convert) {
|
||||
color_convert = cinfo->cconvert->color_convert;
|
||||
cinfo->cconvert->color_convert = noop_convert;
|
||||
}
|
||||
|
||||
if (cinfo->cquantize && cinfo->cquantize->color_quantize) {
|
||||
color_quantize = cinfo->cquantize->color_quantize;
|
||||
cinfo->cquantize->color_quantize = noop_quantize;
|
||||
}
|
||||
|
||||
for (n = 0; n < num_lines; n++)
|
||||
jpeg_read_scanlines(cinfo, NULL, 1);
|
||||
|
||||
if (color_convert)
|
||||
cinfo->cconvert->color_convert = color_convert;
|
||||
|
||||
if (color_quantize)
|
||||
cinfo->cquantize->color_quantize = color_quantize;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Called by jpeg_skip_scanlines(). This partially skips a decompress block by
|
||||
* incrementing the rowgroup counter.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
increment_simple_rowgroup_ctr(j_decompress_ptr cinfo, JDIMENSION rows)
|
||||
{
|
||||
JDIMENSION rows_left;
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
|
||||
/* Increment the counter to the next row group after the skipped rows. */
|
||||
main_ptr->rowgroup_ctr += rows / cinfo->max_v_samp_factor;
|
||||
|
||||
/* Partially skipping a row group would involve modifying the internal state
|
||||
* of the upsampler, so read the remaining rows into a dummy buffer instead.
|
||||
*/
|
||||
rows_left = rows % cinfo->max_v_samp_factor;
|
||||
cinfo->output_scanline += rows - rows_left;
|
||||
|
||||
read_and_discard_scanlines(cinfo, rows_left);
|
||||
}
|
||||
|
||||
/*
|
||||
* Skips some scanlines of data from the JPEG decompressor.
|
||||
*
|
||||
* The return value will be the number of lines actually skipped. If skipping
|
||||
* num_lines would move beyond the end of the image, then the actual number of
|
||||
* lines remaining in the image is returned. Otherwise, the return value will
|
||||
* be equal to num_lines.
|
||||
*
|
||||
* Refer to libjpeg.txt for more information.
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_skip_scanlines(j_decompress_ptr cinfo, JDIMENSION num_lines)
|
||||
{
|
||||
my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
|
||||
JDIMENSION i, x;
|
||||
int y;
|
||||
JDIMENSION lines_per_iMCU_row, lines_left_in_iMCU_row, lines_after_iMCU_row;
|
||||
JDIMENSION lines_to_skip, lines_to_read;
|
||||
|
||||
if (cinfo->global_state != DSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Do not skip past the bottom of the image. */
|
||||
if (cinfo->output_scanline + num_lines >= cinfo->output_height) {
|
||||
cinfo->output_scanline = cinfo->output_height;
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
cinfo->inputctl->eoi_reached = TRUE;
|
||||
return cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
|
||||
if (num_lines == 0)
|
||||
return 0;
|
||||
|
||||
lines_per_iMCU_row = cinfo->_min_DCT_scaled_size * cinfo->max_v_samp_factor;
|
||||
lines_left_in_iMCU_row =
|
||||
(lines_per_iMCU_row - (cinfo->output_scanline % lines_per_iMCU_row)) %
|
||||
lines_per_iMCU_row;
|
||||
lines_after_iMCU_row = num_lines - lines_left_in_iMCU_row;
|
||||
|
||||
/* Skip the lines remaining in the current iMCU row. When upsampling
|
||||
* requires context rows, we need the previous and next rows in order to read
|
||||
* the current row. This adds some complexity.
|
||||
*/
|
||||
if (cinfo->upsample->need_context_rows) {
|
||||
/* If the skipped lines would not move us past the current iMCU row, we
|
||||
* read the lines and ignore them. There might be a faster way of doing
|
||||
* this, but we are facing increasing complexity for diminishing returns.
|
||||
* The increasing complexity would be a by-product of meddling with the
|
||||
* state machine used to skip context rows. Near the end of an iMCU row,
|
||||
* the next iMCU row may have already been entropy-decoded. In this unique
|
||||
* case, we will read the next iMCU row if we cannot skip past it as well.
|
||||
*/
|
||||
if ((num_lines < lines_left_in_iMCU_row + 1) ||
|
||||
(lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full &&
|
||||
lines_after_iMCU_row < lines_per_iMCU_row + 1)) {
|
||||
read_and_discard_scanlines(cinfo, num_lines);
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
/* If the next iMCU row has already been entropy-decoded, make sure that
|
||||
* we do not skip too far.
|
||||
*/
|
||||
if (lines_left_in_iMCU_row <= 1 && main_ptr->buffer_full) {
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row + lines_per_iMCU_row;
|
||||
lines_after_iMCU_row -= lines_per_iMCU_row;
|
||||
} else {
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
}
|
||||
|
||||
/* If we have just completed the first block, adjust the buffer pointers */
|
||||
if (main_ptr->iMCU_row_ctr == 0 ||
|
||||
(main_ptr->iMCU_row_ctr == 1 && lines_left_in_iMCU_row > 2))
|
||||
set_wraparound_pointers(cinfo);
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
|
||||
/* Skipping is much simpler when context rows are not required. */
|
||||
else {
|
||||
if (num_lines < lines_left_in_iMCU_row) {
|
||||
increment_simple_rowgroup_ctr(cinfo, num_lines);
|
||||
return num_lines;
|
||||
} else {
|
||||
cinfo->output_scanline += lines_left_in_iMCU_row;
|
||||
main_ptr->buffer_full = FALSE;
|
||||
main_ptr->rowgroup_ctr = 0;
|
||||
upsample->next_row_out = cinfo->max_v_samp_factor;
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate how many full iMCU rows we can skip. */
|
||||
if (cinfo->upsample->need_context_rows)
|
||||
lines_to_skip = ((lines_after_iMCU_row - 1) / lines_per_iMCU_row) *
|
||||
lines_per_iMCU_row;
|
||||
else
|
||||
lines_to_skip = (lines_after_iMCU_row / lines_per_iMCU_row) *
|
||||
lines_per_iMCU_row;
|
||||
/* Calculate the number of lines that remain to be skipped after skipping all
|
||||
* of the full iMCU rows that we can. We will not read these lines unless we
|
||||
* have to.
|
||||
*/
|
||||
lines_to_read = lines_after_iMCU_row - lines_to_skip;
|
||||
|
||||
/* For images requiring multiple scans (progressive, non-interleaved, etc.),
|
||||
* all of the entropy decoding occurs in jpeg_start_decompress(), assuming
|
||||
* that the input data source is non-suspending. This makes skipping easy.
|
||||
*/
|
||||
if (cinfo->inputctl->has_multiple_scans) {
|
||||
if (cinfo->upsample->need_context_rows) {
|
||||
cinfo->output_scanline += lines_to_skip;
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;
|
||||
/* It is complex to properly move to the middle of a context block, so
|
||||
* read the remaining lines instead of skipping them.
|
||||
*/
|
||||
read_and_discard_scanlines(cinfo, lines_to_read);
|
||||
} else {
|
||||
cinfo->output_scanline += lines_to_skip;
|
||||
cinfo->output_iMCU_row += lines_to_skip / lines_per_iMCU_row;
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
/* Skip the iMCU rows that we can safely skip. */
|
||||
for (i = 0; i < lines_to_skip; i += lines_per_iMCU_row) {
|
||||
for (y = 0; y < coef->MCU_rows_per_iMCU_row; y++) {
|
||||
for (x = 0; x < cinfo->MCUs_per_row; x++) {
|
||||
/* Calling decode_mcu() with a NULL pointer causes it to discard the
|
||||
* decoded coefficients. This is ~5% faster for large subsets, but
|
||||
* it's tough to tell a difference for smaller images.
|
||||
*/
|
||||
(*cinfo->entropy->decode_mcu) (cinfo, NULL);
|
||||
}
|
||||
}
|
||||
cinfo->input_iMCU_row++;
|
||||
cinfo->output_iMCU_row++;
|
||||
if (cinfo->input_iMCU_row < cinfo->total_iMCU_rows)
|
||||
start_iMCU_row(cinfo);
|
||||
else
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
}
|
||||
cinfo->output_scanline += lines_to_skip;
|
||||
|
||||
if (cinfo->upsample->need_context_rows) {
|
||||
/* Context-based upsampling keeps track of iMCU rows. */
|
||||
main_ptr->iMCU_row_ctr += lines_to_skip / lines_per_iMCU_row;
|
||||
|
||||
/* It is complex to properly move to the middle of a context block, so
|
||||
* read the remaining lines instead of skipping them.
|
||||
*/
|
||||
read_and_discard_scanlines(cinfo, lines_to_read);
|
||||
} else {
|
||||
increment_simple_rowgroup_ctr(cinfo, lines_to_read);
|
||||
}
|
||||
|
||||
/* Since skipping lines involves skipping the upsampling step, the value of
|
||||
* "rows_to_go" will become invalid unless we set it here. NOTE: This is a
|
||||
* bit odd, since "rows_to_go" seems to be redundantly keeping track of
|
||||
* output_scanline.
|
||||
*/
|
||||
upsample->rows_to_go = cinfo->output_height - cinfo->output_scanline;
|
||||
|
||||
/* Always skip the requested number of lines. */
|
||||
return num_lines;
|
||||
}
|
||||
|
||||
/*
|
||||
* Alternate entry point to read raw data.
|
||||
* Processes exactly one iMCU row per call, unless suspended.
|
||||
*/
|
||||
|
||||
GLOBAL(JDIMENSION)
|
||||
jpeg_read_raw_data(j_decompress_ptr cinfo, JSAMPIMAGE data,
|
||||
JDIMENSION max_lines)
|
||||
{
|
||||
JDIMENSION lines_per_iMCU_row;
|
||||
|
||||
if (cinfo->global_state != DSTATE_RAW_OK)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
if (cinfo->output_scanline >= cinfo->output_height) {
|
||||
WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Call progress monitor hook if present */
|
||||
if (cinfo->progress != NULL) {
|
||||
cinfo->progress->pass_counter = (long)cinfo->output_scanline;
|
||||
cinfo->progress->pass_limit = (long)cinfo->output_height;
|
||||
(*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
|
||||
}
|
||||
|
||||
/* Verify that at least one iMCU row can be returned. */
|
||||
lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size;
|
||||
if (max_lines < lines_per_iMCU_row)
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
|
||||
/* Decompress directly into user's buffer. */
|
||||
if (!(*cinfo->coef->decompress_data) (cinfo, data))
|
||||
return 0; /* suspension forced, can do nothing more */
|
||||
|
||||
/* OK, we processed one iMCU row. */
|
||||
cinfo->output_scanline += lines_per_iMCU_row;
|
||||
return lines_per_iMCU_row;
|
||||
}
|
||||
|
||||
|
||||
/* Additional entry points for buffered-image mode. */
|
||||
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
|
||||
/*
|
||||
* Initialize for an output pass in buffered-image mode.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_start_output(j_decompress_ptr cinfo, int scan_number)
|
||||
{
|
||||
if (cinfo->global_state != DSTATE_BUFIMAGE &&
|
||||
cinfo->global_state != DSTATE_PRESCAN)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
/* Limit scan number to valid range */
|
||||
if (scan_number <= 0)
|
||||
scan_number = 1;
|
||||
if (cinfo->inputctl->eoi_reached && scan_number > cinfo->input_scan_number)
|
||||
scan_number = cinfo->input_scan_number;
|
||||
cinfo->output_scan_number = scan_number;
|
||||
/* Perform any dummy output passes, and set up for the real pass */
|
||||
return output_pass_setup(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finish up after an output pass in buffered-image mode.
|
||||
*
|
||||
* Returns FALSE if suspended. The return value need be inspected only if
|
||||
* a suspending data source is used.
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_finish_output(j_decompress_ptr cinfo)
|
||||
{
|
||||
if ((cinfo->global_state == DSTATE_SCANNING ||
|
||||
cinfo->global_state == DSTATE_RAW_OK) && cinfo->buffered_image) {
|
||||
/* Terminate this pass. */
|
||||
/* We do not require the whole pass to have been completed. */
|
||||
(*cinfo->master->finish_output_pass) (cinfo);
|
||||
cinfo->global_state = DSTATE_BUFPOST;
|
||||
} else if (cinfo->global_state != DSTATE_BUFPOST) {
|
||||
/* BUFPOST = repeat call after a suspension, anything else is error */
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
}
|
||||
/* Read markers looking for SOS or EOI */
|
||||
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
|
||||
!cinfo->inputctl->eoi_reached) {
|
||||
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
|
||||
return FALSE; /* Suspend, come back later */
|
||||
}
|
||||
cinfo->global_state = DSTATE_BUFIMAGE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif /* D_MULTISCAN_FILES_SUPPORTED */
|
||||
Vendored
+773
@@ -0,0 +1,773 @@
|
||||
/*
|
||||
* jdarith.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Developed 1997-2015 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015-2018, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains portable arithmetic entropy encoding routines for JPEG
|
||||
* (implementing Recommendation ITU-T T.81 | ISO/IEC 10918-1).
|
||||
*
|
||||
* Both sequential and progressive modes are supported in this single module.
|
||||
*
|
||||
* Suspension is not currently supported in this module.
|
||||
*
|
||||
* NOTE: All referenced figures are from
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
#define NEG_1 ((unsigned int)-1)
|
||||
|
||||
|
||||
/* Expanded entropy decoder object for arithmetic decoding. */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_entropy_decoder pub; /* public fields */
|
||||
|
||||
JLONG c; /* C register, base of coding interval + input bit buffer */
|
||||
JLONG a; /* A register, normalized size of coding interval */
|
||||
int ct; /* bit shift counter, # of bits left in bit buffer part of C */
|
||||
/* init: ct = -16 */
|
||||
/* run: ct = 0..7 */
|
||||
/* error: ct = -1 */
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
int dc_context[MAX_COMPS_IN_SCAN]; /* context index for DC conditioning */
|
||||
|
||||
unsigned int restarts_to_go; /* MCUs left in this restart interval */
|
||||
|
||||
/* Pointers to statistics areas (these workspaces have image lifespan) */
|
||||
unsigned char *dc_stats[NUM_ARITH_TBLS];
|
||||
unsigned char *ac_stats[NUM_ARITH_TBLS];
|
||||
|
||||
/* Statistics bin for coding with fixed probability 0.5 */
|
||||
unsigned char fixed_bin[4];
|
||||
} arith_entropy_decoder;
|
||||
|
||||
typedef arith_entropy_decoder *arith_entropy_ptr;
|
||||
|
||||
/* The following two definitions specify the allocation chunk size
|
||||
* for the statistics area.
|
||||
* According to sections F.1.4.4.1.3 and F.1.4.4.2, we need at least
|
||||
* 49 statistics bins for DC, and 245 statistics bins for AC coding.
|
||||
*
|
||||
* We use a compact representation with 1 byte per statistics bin,
|
||||
* thus the numbers directly represent byte sizes.
|
||||
* This 1 byte per statistics bin contains the meaning of the MPS
|
||||
* (more probable symbol) in the highest bit (mask 0x80), and the
|
||||
* index into the probability estimation state machine table
|
||||
* in the lower bits (mask 0x7F).
|
||||
*/
|
||||
|
||||
#define DC_STAT_BINS 64
|
||||
#define AC_STAT_BINS 256
|
||||
|
||||
|
||||
LOCAL(int)
|
||||
get_byte(j_decompress_ptr cinfo)
|
||||
/* Read next input byte; we do not support suspension in this module. */
|
||||
{
|
||||
struct jpeg_source_mgr *src = cinfo->src;
|
||||
|
||||
if (src->bytes_in_buffer == 0)
|
||||
if (!(*src->fill_input_buffer) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
src->bytes_in_buffer--;
|
||||
return GETJOCTET(*src->next_input_byte++);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The core arithmetic decoding routine (common in JPEG and JBIG).
|
||||
* This needs to go as fast as possible.
|
||||
* Machine-dependent optimization facilities
|
||||
* are not utilized in this portable implementation.
|
||||
* However, this code should be fairly efficient and
|
||||
* may be a good base for further optimizations anyway.
|
||||
*
|
||||
* Return value is 0 or 1 (binary decision).
|
||||
*
|
||||
* Note: I've changed the handling of the code base & bit
|
||||
* buffer register C compared to other implementations
|
||||
* based on the standards layout & procedures.
|
||||
* While it also contains both the actual base of the
|
||||
* coding interval (16 bits) and the next-bits buffer,
|
||||
* the cut-point between these two parts is floating
|
||||
* (instead of fixed) with the bit shift counter CT.
|
||||
* Thus, we also need only one (variable instead of
|
||||
* fixed size) shift for the LPS/MPS decision, and
|
||||
* we can do away with any renormalization update
|
||||
* of C (except for new data insertion, of course).
|
||||
*
|
||||
* I've also introduced a new scheme for accessing
|
||||
* the probability estimation state machine table,
|
||||
* derived from Markus Kuhn's JBIG implementation.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
arith_decode(j_decompress_ptr cinfo, unsigned char *st)
|
||||
{
|
||||
register arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
|
||||
register unsigned char nl, nm;
|
||||
register JLONG qe, temp;
|
||||
register int sv, data;
|
||||
|
||||
/* Renormalization & data input per section D.2.6 */
|
||||
while (e->a < 0x8000L) {
|
||||
if (--e->ct < 0) {
|
||||
/* Need to fetch next data byte */
|
||||
if (cinfo->unread_marker)
|
||||
data = 0; /* stuff zero data */
|
||||
else {
|
||||
data = get_byte(cinfo); /* read next input byte */
|
||||
if (data == 0xFF) { /* zero stuff or marker code */
|
||||
do data = get_byte(cinfo);
|
||||
while (data == 0xFF); /* swallow extra 0xFF bytes */
|
||||
if (data == 0)
|
||||
data = 0xFF; /* discard stuffed zero byte */
|
||||
else {
|
||||
/* Note: Different from the Huffman decoder, hitting
|
||||
* a marker while processing the compressed data
|
||||
* segment is legal in arithmetic coding.
|
||||
* The convention is to supply zero data
|
||||
* then until decoding is complete.
|
||||
*/
|
||||
cinfo->unread_marker = data;
|
||||
data = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
e->c = (e->c << 8) | data; /* insert data into C register */
|
||||
if ((e->ct += 8) < 0) /* update bit shift counter */
|
||||
/* Need more initial bytes */
|
||||
if (++e->ct == 0)
|
||||
/* Got 2 initial bytes -> re-init A and exit loop */
|
||||
e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */
|
||||
}
|
||||
e->a <<= 1;
|
||||
}
|
||||
|
||||
/* Fetch values from our compact representation of Table D.2:
|
||||
* Qe values and probability estimation state machine
|
||||
*/
|
||||
sv = *st;
|
||||
qe = jpeg_aritab[sv & 0x7F]; /* => Qe_Value */
|
||||
nl = qe & 0xFF; qe >>= 8; /* Next_Index_LPS + Switch_MPS */
|
||||
nm = qe & 0xFF; qe >>= 8; /* Next_Index_MPS */
|
||||
|
||||
/* Decode & estimation procedures per sections D.2.4 & D.2.5 */
|
||||
temp = e->a - qe;
|
||||
e->a = temp;
|
||||
temp <<= e->ct;
|
||||
if (e->c >= temp) {
|
||||
e->c -= temp;
|
||||
/* Conditional LPS (less probable symbol) exchange */
|
||||
if (e->a < qe) {
|
||||
e->a = qe;
|
||||
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
|
||||
} else {
|
||||
e->a = qe;
|
||||
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
|
||||
sv ^= 0x80; /* Exchange LPS/MPS */
|
||||
}
|
||||
} else if (e->a < 0x8000L) {
|
||||
/* Conditional MPS (more probable symbol) exchange */
|
||||
if (e->a < qe) {
|
||||
*st = (sv & 0x80) ^ nl; /* Estimate_after_LPS */
|
||||
sv ^= 0x80; /* Exchange LPS/MPS */
|
||||
} else {
|
||||
*st = (sv & 0x80) ^ nm; /* Estimate_after_MPS */
|
||||
}
|
||||
}
|
||||
|
||||
return sv >> 7;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check for a restart marker & resynchronize decoder.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
process_restart(j_decompress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
int ci;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Advance past the RSTn marker */
|
||||
if (!(*cinfo->marker->read_restart_marker) (cinfo))
|
||||
ERREXIT(cinfo, JERR_CANT_SUSPEND);
|
||||
|
||||
/* Re-initialize statistics areas */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
|
||||
/* Reset DC predictions to 0 */
|
||||
entropy->last_dc_val[ci] = 0;
|
||||
entropy->dc_context[ci] = 0;
|
||||
}
|
||||
if (!cinfo->progressive_mode || cinfo->Ss) {
|
||||
MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Reset arithmetic decoding variables */
|
||||
entropy->c = 0;
|
||||
entropy->a = 0;
|
||||
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
|
||||
|
||||
/* Reset restart counter */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Arithmetic MCU decoding.
|
||||
* Each of these routines decodes and returns one MCU's worth of
|
||||
* arithmetic-compressed coefficients.
|
||||
* The coefficients are reordered from zigzag order into natural array order,
|
||||
* but are not dequantized.
|
||||
*
|
||||
* The i'th block of the MCU is stored into the block pointed to by
|
||||
* MCU_data[i]. WE ASSUME THIS AREA IS INITIALLY ZEROED BY THE CALLER.
|
||||
*/
|
||||
|
||||
/*
|
||||
* MCU decoding for DC initial scan (either spectral selection,
|
||||
* or first pass of successive approximation).
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu_DC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int blkn, ci, tbl, sign;
|
||||
int v, m;
|
||||
|
||||
/* Process restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
process_restart(cinfo);
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
if (entropy->ct == -1) return TRUE; /* if error do nothing */
|
||||
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
block = MCU_data[blkn];
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
|
||||
|
||||
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
|
||||
|
||||
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
|
||||
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
|
||||
|
||||
/* Figure F.19: Decode_DC_DIFF */
|
||||
if (arith_decode(cinfo, st) == 0)
|
||||
entropy->dc_context[ci] = 0;
|
||||
else {
|
||||
/* Figure F.21: Decoding nonzero value v */
|
||||
/* Figure F.22: Decoding the sign of v */
|
||||
sign = arith_decode(cinfo, st + 1);
|
||||
st += 2; st += sign;
|
||||
/* Figure F.23: Decoding the magnitude category of v */
|
||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (arith_decode(cinfo, st)) {
|
||||
if ((m <<= 1) == 0x8000) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* magnitude overflow */
|
||||
return TRUE;
|
||||
}
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
|
||||
else
|
||||
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
|
||||
v = m;
|
||||
/* Figure F.24: Decoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
if (arith_decode(cinfo, st)) v |= m;
|
||||
v += 1; if (sign) v = -v;
|
||||
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
|
||||
}
|
||||
|
||||
/* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
|
||||
(*block)[0] = (JCOEF)LEFT_SHIFT(entropy->last_dc_val[ci], cinfo->Al);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU decoding for AC initial scan (either spectral selection,
|
||||
* or first pass of successive approximation).
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu_AC_first(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int tbl, sign, k;
|
||||
int v, m;
|
||||
|
||||
/* Process restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
process_restart(cinfo);
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
if (entropy->ct == -1) return TRUE; /* if error do nothing */
|
||||
|
||||
/* There is always only one block per MCU */
|
||||
block = MCU_data[0];
|
||||
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
||||
|
||||
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
|
||||
|
||||
/* Figure F.20: Decode_AC_coefficients */
|
||||
for (k = cinfo->Ss; k <= cinfo->Se; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
if (arith_decode(cinfo, st)) break; /* EOB flag */
|
||||
while (arith_decode(cinfo, st + 1) == 0) {
|
||||
st += 3; k++;
|
||||
if (k > cinfo->Se) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* spectral overflow */
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
/* Figure F.21: Decoding nonzero value v */
|
||||
/* Figure F.22: Decoding the sign of v */
|
||||
sign = arith_decode(cinfo, entropy->fixed_bin);
|
||||
st += 2;
|
||||
/* Figure F.23: Decoding the magnitude category of v */
|
||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||
if (arith_decode(cinfo, st)) {
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (arith_decode(cinfo, st)) {
|
||||
if ((m <<= 1) == 0x8000) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* magnitude overflow */
|
||||
return TRUE;
|
||||
}
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
v = m;
|
||||
/* Figure F.24: Decoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
if (arith_decode(cinfo, st)) v |= m;
|
||||
v += 1; if (sign) v = -v;
|
||||
/* Scale and output coefficient in natural (dezigzagged) order */
|
||||
(*block)[jpeg_natural_order[k]] = (JCOEF)((unsigned)v << cinfo->Al);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU decoding for DC successive approximation refinement scan.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu_DC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
unsigned char *st;
|
||||
int p1, blkn;
|
||||
|
||||
/* Process restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
process_restart(cinfo);
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
st = entropy->fixed_bin; /* use fixed probability estimation */
|
||||
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
||||
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
/* Encoded data is simply the next bit of the two's-complement DC value */
|
||||
if (arith_decode(cinfo, st))
|
||||
MCU_data[blkn][0][0] |= p1;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MCU decoding for AC successive approximation refinement scan.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu_AC_refine(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
JBLOCKROW block;
|
||||
JCOEFPTR thiscoef;
|
||||
unsigned char *st;
|
||||
int tbl, k, kex;
|
||||
int p1, m1;
|
||||
|
||||
/* Process restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
process_restart(cinfo);
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
if (entropy->ct == -1) return TRUE; /* if error do nothing */
|
||||
|
||||
/* There is always only one block per MCU */
|
||||
block = MCU_data[0];
|
||||
tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
|
||||
|
||||
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
||||
m1 = (NEG_1) << cinfo->Al; /* -1 in the bit position being coded */
|
||||
|
||||
/* Establish EOBx (previous stage end-of-block) index */
|
||||
for (kex = cinfo->Se; kex > 0; kex--)
|
||||
if ((*block)[jpeg_natural_order[kex]]) break;
|
||||
|
||||
for (k = cinfo->Ss; k <= cinfo->Se; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
if (k > kex)
|
||||
if (arith_decode(cinfo, st)) break; /* EOB flag */
|
||||
for (;;) {
|
||||
thiscoef = *block + jpeg_natural_order[k];
|
||||
if (*thiscoef) { /* previously nonzero coef */
|
||||
if (arith_decode(cinfo, st + 2)) {
|
||||
if (*thiscoef < 0)
|
||||
*thiscoef += m1;
|
||||
else
|
||||
*thiscoef += p1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (arith_decode(cinfo, st + 1)) { /* newly nonzero coef */
|
||||
if (arith_decode(cinfo, entropy->fixed_bin))
|
||||
*thiscoef = m1;
|
||||
else
|
||||
*thiscoef = p1;
|
||||
break;
|
||||
}
|
||||
st += 3; k++;
|
||||
if (k > cinfo->Se) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* spectral overflow */
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decode one MCU's worth of arithmetic-compressed coefficients.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
decode_mcu(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
jpeg_component_info *compptr;
|
||||
JBLOCKROW block;
|
||||
unsigned char *st;
|
||||
int blkn, ci, tbl, sign, k;
|
||||
int v, m;
|
||||
|
||||
/* Process restart marker if needed */
|
||||
if (cinfo->restart_interval) {
|
||||
if (entropy->restarts_to_go == 0)
|
||||
process_restart(cinfo);
|
||||
entropy->restarts_to_go--;
|
||||
}
|
||||
|
||||
if (entropy->ct == -1) return TRUE; /* if error do nothing */
|
||||
|
||||
/* Outer loop handles each block in the MCU */
|
||||
|
||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||
block = MCU_data ? MCU_data[blkn] : NULL;
|
||||
ci = cinfo->MCU_membership[blkn];
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
|
||||
/* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
|
||||
|
||||
tbl = compptr->dc_tbl_no;
|
||||
|
||||
/* Table F.4: Point to statistics bin S0 for DC coefficient coding */
|
||||
st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
|
||||
|
||||
/* Figure F.19: Decode_DC_DIFF */
|
||||
if (arith_decode(cinfo, st) == 0)
|
||||
entropy->dc_context[ci] = 0;
|
||||
else {
|
||||
/* Figure F.21: Decoding nonzero value v */
|
||||
/* Figure F.22: Decoding the sign of v */
|
||||
sign = arith_decode(cinfo, st + 1);
|
||||
st += 2; st += sign;
|
||||
/* Figure F.23: Decoding the magnitude category of v */
|
||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||
st = entropy->dc_stats[tbl] + 20; /* Table F.4: X1 = 20 */
|
||||
while (arith_decode(cinfo, st)) {
|
||||
if ((m <<= 1) == 0x8000) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* magnitude overflow */
|
||||
return TRUE;
|
||||
}
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
/* Section F.1.4.4.1.2: Establish dc_context conditioning category */
|
||||
if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 0; /* zero diff category */
|
||||
else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
|
||||
entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
|
||||
else
|
||||
entropy->dc_context[ci] = 4 + (sign * 4); /* small diff category */
|
||||
v = m;
|
||||
/* Figure F.24: Decoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
if (arith_decode(cinfo, st)) v |= m;
|
||||
v += 1; if (sign) v = -v;
|
||||
entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
|
||||
}
|
||||
|
||||
if (block)
|
||||
(*block)[0] = (JCOEF)entropy->last_dc_val[ci];
|
||||
|
||||
/* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
|
||||
|
||||
tbl = compptr->ac_tbl_no;
|
||||
|
||||
/* Figure F.20: Decode_AC_coefficients */
|
||||
for (k = 1; k <= DCTSIZE2 - 1; k++) {
|
||||
st = entropy->ac_stats[tbl] + 3 * (k - 1);
|
||||
if (arith_decode(cinfo, st)) break; /* EOB flag */
|
||||
while (arith_decode(cinfo, st + 1) == 0) {
|
||||
st += 3; k++;
|
||||
if (k > DCTSIZE2 - 1) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* spectral overflow */
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
/* Figure F.21: Decoding nonzero value v */
|
||||
/* Figure F.22: Decoding the sign of v */
|
||||
sign = arith_decode(cinfo, entropy->fixed_bin);
|
||||
st += 2;
|
||||
/* Figure F.23: Decoding the magnitude category of v */
|
||||
if ((m = arith_decode(cinfo, st)) != 0) {
|
||||
if (arith_decode(cinfo, st)) {
|
||||
m <<= 1;
|
||||
st = entropy->ac_stats[tbl] +
|
||||
(k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
|
||||
while (arith_decode(cinfo, st)) {
|
||||
if ((m <<= 1) == 0x8000) {
|
||||
WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
|
||||
entropy->ct = -1; /* magnitude overflow */
|
||||
return TRUE;
|
||||
}
|
||||
st += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
v = m;
|
||||
/* Figure F.24: Decoding the magnitude bit pattern of v */
|
||||
st += 14;
|
||||
while (m >>= 1)
|
||||
if (arith_decode(cinfo, st)) v |= m;
|
||||
v += 1; if (sign) v = -v;
|
||||
if (block)
|
||||
(*block)[jpeg_natural_order[k]] = (JCOEF)v;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for an arithmetic-compressed scan.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass(j_decompress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
|
||||
int ci, tbl;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (cinfo->progressive_mode) {
|
||||
/* Validate progressive scan parameters */
|
||||
if (cinfo->Ss == 0) {
|
||||
if (cinfo->Se != 0)
|
||||
goto bad;
|
||||
} else {
|
||||
/* need not check Ss/Se < 0 since they came from unsigned bytes */
|
||||
if (cinfo->Se < cinfo->Ss || cinfo->Se > DCTSIZE2 - 1)
|
||||
goto bad;
|
||||
/* AC scans may have only one component */
|
||||
if (cinfo->comps_in_scan != 1)
|
||||
goto bad;
|
||||
}
|
||||
if (cinfo->Ah != 0) {
|
||||
/* Successive approximation refinement scan: must have Al = Ah-1. */
|
||||
if (cinfo->Ah - 1 != cinfo->Al)
|
||||
goto bad;
|
||||
}
|
||||
if (cinfo->Al > 13) { /* need not check for < 0 */
|
||||
bad:
|
||||
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
|
||||
cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
|
||||
}
|
||||
/* Update progression status, and verify that scan order is legal.
|
||||
* Note that inter-scan inconsistencies are treated as warnings
|
||||
* not fatal errors ... not clear if this is right way to behave.
|
||||
*/
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
|
||||
int *coef_bit_ptr = &cinfo->coef_bits[cindex][0];
|
||||
if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
|
||||
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
|
||||
for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
|
||||
int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
|
||||
if (cinfo->Ah != expected)
|
||||
WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
|
||||
coef_bit_ptr[coefi] = cinfo->Al;
|
||||
}
|
||||
}
|
||||
/* Select MCU decoding routine */
|
||||
if (cinfo->Ah == 0) {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.decode_mcu = decode_mcu_DC_first;
|
||||
else
|
||||
entropy->pub.decode_mcu = decode_mcu_AC_first;
|
||||
} else {
|
||||
if (cinfo->Ss == 0)
|
||||
entropy->pub.decode_mcu = decode_mcu_DC_refine;
|
||||
else
|
||||
entropy->pub.decode_mcu = decode_mcu_AC_refine;
|
||||
}
|
||||
} else {
|
||||
/* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
|
||||
* This ought to be an error condition, but we make it a warning.
|
||||
*/
|
||||
if (cinfo->Ss != 0 || cinfo->Ah != 0 || cinfo->Al != 0 ||
|
||||
(cinfo->Se < DCTSIZE2 && cinfo->Se != DCTSIZE2 - 1))
|
||||
WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
|
||||
/* Select MCU decoding routine */
|
||||
entropy->pub.decode_mcu = decode_mcu;
|
||||
}
|
||||
|
||||
/* Allocate & initialize requested statistics areas */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
|
||||
tbl = compptr->dc_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->dc_stats[tbl] == NULL)
|
||||
entropy->dc_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
|
||||
MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
|
||||
/* Initialize DC predictions to 0 */
|
||||
entropy->last_dc_val[ci] = 0;
|
||||
entropy->dc_context[ci] = 0;
|
||||
}
|
||||
if (!cinfo->progressive_mode || cinfo->Ss) {
|
||||
tbl = compptr->ac_tbl_no;
|
||||
if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
|
||||
ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
|
||||
if (entropy->ac_stats[tbl] == NULL)
|
||||
entropy->ac_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
|
||||
MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize arithmetic decoding variables */
|
||||
entropy->c = 0;
|
||||
entropy->a = 0;
|
||||
entropy->ct = -16; /* force reading 2 initial bytes to fill C */
|
||||
|
||||
/* Initialize restart counter */
|
||||
entropy->restarts_to_go = cinfo->restart_interval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Module initialization routine for arithmetic entropy decoding.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_arith_decoder(j_decompress_ptr cinfo)
|
||||
{
|
||||
arith_entropy_ptr entropy;
|
||||
int i;
|
||||
|
||||
entropy = (arith_entropy_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(arith_entropy_decoder));
|
||||
cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
|
||||
entropy->pub.start_pass = start_pass;
|
||||
|
||||
/* Mark tables unallocated */
|
||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||
entropy->dc_stats[i] = NULL;
|
||||
entropy->ac_stats[i] = NULL;
|
||||
}
|
||||
|
||||
/* Initialize index for fixed probability estimation */
|
||||
entropy->fixed_bin[0] = 113;
|
||||
|
||||
if (cinfo->progressive_mode) {
|
||||
/* Create progression status table */
|
||||
int *coef_bit_ptr, ci;
|
||||
cinfo->coef_bits = (int (*)[DCTSIZE2])
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
cinfo->num_components * DCTSIZE2 *
|
||||
sizeof(int));
|
||||
coef_bit_ptr = &cinfo->coef_bits[0][0];
|
||||
for (ci = 0; ci < cinfo->num_components; ci++)
|
||||
for (i = 0; i < DCTSIZE2; i++)
|
||||
*coef_bit_ptr++ = -1;
|
||||
}
|
||||
}
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
* jdatadst.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2009-2012 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, 2016, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains compression data destination routines for the case of
|
||||
* emitting JPEG data to memory or to a file (or any stdio stream).
|
||||
* While these routines are sufficient for most applications,
|
||||
* some will want to use a different destination manager.
|
||||
* IMPORTANT: we assume that fwrite() will correctly transcribe an array of
|
||||
* JOCTETs into 8-bit-wide elements on external storage. If char is wider
|
||||
* than 8 bits on your machine, you may need to do some tweaking.
|
||||
*/
|
||||
|
||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
|
||||
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc(),free() */
|
||||
extern void *malloc(size_t size);
|
||||
extern void free(void *ptr);
|
||||
#endif
|
||||
|
||||
|
||||
/* Expanded data destination object for stdio output */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_destination_mgr pub; /* public fields */
|
||||
|
||||
FILE *outfile; /* target stream */
|
||||
JOCTET *buffer; /* start of buffer */
|
||||
} my_destination_mgr;
|
||||
|
||||
typedef my_destination_mgr *my_dest_ptr;
|
||||
|
||||
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
|
||||
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
/* Expanded data destination object for memory output */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_destination_mgr pub; /* public fields */
|
||||
|
||||
unsigned char **outbuffer; /* target buffer */
|
||||
unsigned long *outsize;
|
||||
unsigned char *newbuffer; /* newly allocated buffer */
|
||||
JOCTET *buffer; /* start of buffer */
|
||||
size_t bufsize;
|
||||
} my_mem_destination_mgr;
|
||||
|
||||
typedef my_mem_destination_mgr *my_mem_dest_ptr;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize destination --- called by jpeg_start_compress
|
||||
* before any data is actually written.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
init_destination(j_compress_ptr cinfo)
|
||||
{
|
||||
my_dest_ptr dest = (my_dest_ptr)cinfo->dest;
|
||||
|
||||
/* Allocate the output buffer --- it will be released when done with image */
|
||||
dest->buffer = (JOCTET *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
OUTPUT_BUF_SIZE * sizeof(JOCTET));
|
||||
|
||||
dest->pub.next_output_byte = dest->buffer;
|
||||
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
METHODDEF(void)
|
||||
init_mem_destination(j_compress_ptr cinfo)
|
||||
{
|
||||
/* no work necessary here */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Empty the output buffer --- called whenever buffer fills up.
|
||||
*
|
||||
* In typical applications, this should write the entire output buffer
|
||||
* (ignoring the current state of next_output_byte & free_in_buffer),
|
||||
* reset the pointer & count to the start of the buffer, and return TRUE
|
||||
* indicating that the buffer has been dumped.
|
||||
*
|
||||
* In applications that need to be able to suspend compression due to output
|
||||
* overrun, a FALSE return indicates that the buffer cannot be emptied now.
|
||||
* In this situation, the compressor will return to its caller (possibly with
|
||||
* an indication that it has not accepted all the supplied scanlines). The
|
||||
* application should resume compression after it has made more room in the
|
||||
* output buffer. Note that there are substantial restrictions on the use of
|
||||
* suspension --- see the documentation.
|
||||
*
|
||||
* When suspending, the compressor will back up to a convenient restart point
|
||||
* (typically the start of the current MCU). next_output_byte & free_in_buffer
|
||||
* indicate where the restart point will be if the current call returns FALSE.
|
||||
* Data beyond this point will be regenerated after resumption, so do not
|
||||
* write it out when emptying the buffer externally.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
empty_output_buffer(j_compress_ptr cinfo)
|
||||
{
|
||||
my_dest_ptr dest = (my_dest_ptr)cinfo->dest;
|
||||
|
||||
if (JFWRITE(dest->outfile, dest->buffer, OUTPUT_BUF_SIZE) !=
|
||||
(size_t)OUTPUT_BUF_SIZE)
|
||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||
|
||||
dest->pub.next_output_byte = dest->buffer;
|
||||
dest->pub.free_in_buffer = OUTPUT_BUF_SIZE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
METHODDEF(boolean)
|
||||
empty_mem_output_buffer(j_compress_ptr cinfo)
|
||||
{
|
||||
size_t nextsize;
|
||||
JOCTET *nextbuffer;
|
||||
my_mem_dest_ptr dest = (my_mem_dest_ptr)cinfo->dest;
|
||||
|
||||
/* Try to allocate new buffer with double size */
|
||||
nextsize = dest->bufsize * 2;
|
||||
nextbuffer = (JOCTET *)malloc(nextsize);
|
||||
|
||||
if (nextbuffer == NULL)
|
||||
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
|
||||
|
||||
MEMCOPY(nextbuffer, dest->buffer, dest->bufsize);
|
||||
|
||||
if (dest->newbuffer != NULL)
|
||||
free(dest->newbuffer);
|
||||
|
||||
dest->newbuffer = nextbuffer;
|
||||
|
||||
dest->pub.next_output_byte = nextbuffer + dest->bufsize;
|
||||
dest->pub.free_in_buffer = dest->bufsize;
|
||||
|
||||
dest->buffer = nextbuffer;
|
||||
dest->bufsize = nextsize;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Terminate destination --- called by jpeg_finish_compress
|
||||
* after all data has been written. Usually needs to flush buffer.
|
||||
*
|
||||
* NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
|
||||
* application must deal with any cleanup that should happen even
|
||||
* for error exit.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
term_destination(j_compress_ptr cinfo)
|
||||
{
|
||||
my_dest_ptr dest = (my_dest_ptr)cinfo->dest;
|
||||
size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer;
|
||||
|
||||
/* Write any data remaining in the buffer */
|
||||
if (datacount > 0) {
|
||||
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
|
||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||
}
|
||||
fflush(dest->outfile);
|
||||
/* Make sure we wrote the output file OK */
|
||||
if (ferror(dest->outfile))
|
||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
METHODDEF(void)
|
||||
term_mem_destination(j_compress_ptr cinfo)
|
||||
{
|
||||
my_mem_dest_ptr dest = (my_mem_dest_ptr)cinfo->dest;
|
||||
|
||||
*dest->outbuffer = dest->buffer;
|
||||
*dest->outsize = (unsigned long)(dest->bufsize - dest->pub.free_in_buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Prepare for output to a stdio stream.
|
||||
* The caller must have already opened the stream, and is responsible
|
||||
* for closing it after finishing compression.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile)
|
||||
{
|
||||
my_dest_ptr dest;
|
||||
|
||||
/* The destination object is made permanent so that multiple JPEG images
|
||||
* can be written to the same file without re-executing jpeg_stdio_dest.
|
||||
*/
|
||||
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->dest = (struct jpeg_destination_mgr *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_destination_mgr));
|
||||
} else if (cinfo->dest->init_destination != init_destination) {
|
||||
/* It is unsafe to reuse the existing destination manager unless it was
|
||||
* created by this function. Otherwise, there is no guarantee that the
|
||||
* opaque structure is the right size. Note that we could just create a
|
||||
* new structure, but the old structure would not be freed until
|
||||
* jpeg_destroy_compress() was called.
|
||||
*/
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
dest = (my_dest_ptr)cinfo->dest;
|
||||
dest->pub.init_destination = init_destination;
|
||||
dest->pub.empty_output_buffer = empty_output_buffer;
|
||||
dest->pub.term_destination = term_destination;
|
||||
dest->outfile = outfile;
|
||||
}
|
||||
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
/*
|
||||
* Prepare for output to a memory buffer.
|
||||
* The caller may supply an own initial buffer with appropriate size.
|
||||
* Otherwise, or when the actual data output exceeds the given size,
|
||||
* the library adapts the buffer size as necessary.
|
||||
* The standard library functions malloc/free are used for allocating
|
||||
* larger memory, so the buffer is available to the application after
|
||||
* finishing compression, and then the application is responsible for
|
||||
* freeing the requested memory.
|
||||
* Note: An initial buffer supplied by the caller is expected to be
|
||||
* managed by the application. The library does not free such buffer
|
||||
* when allocating a larger buffer.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_dest(j_compress_ptr cinfo, unsigned char **outbuffer,
|
||||
unsigned long *outsize)
|
||||
{
|
||||
my_mem_dest_ptr dest;
|
||||
|
||||
if (outbuffer == NULL || outsize == NULL) /* sanity check */
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
|
||||
/* The destination object is made permanent so that multiple JPEG images
|
||||
* can be written to the same buffer without re-executing jpeg_mem_dest.
|
||||
*/
|
||||
if (cinfo->dest == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->dest = (struct jpeg_destination_mgr *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_mem_destination_mgr));
|
||||
} else if (cinfo->dest->init_destination != init_mem_destination) {
|
||||
/* It is unsafe to reuse the existing destination manager unless it was
|
||||
* created by this function.
|
||||
*/
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
dest = (my_mem_dest_ptr)cinfo->dest;
|
||||
dest->pub.init_destination = init_mem_destination;
|
||||
dest->pub.empty_output_buffer = empty_mem_output_buffer;
|
||||
dest->pub.term_destination = term_mem_destination;
|
||||
dest->outbuffer = outbuffer;
|
||||
dest->outsize = outsize;
|
||||
dest->newbuffer = NULL;
|
||||
|
||||
if (*outbuffer == NULL || *outsize == 0) {
|
||||
/* Allocate initial buffer */
|
||||
dest->newbuffer = *outbuffer = (unsigned char *)malloc(OUTPUT_BUF_SIZE);
|
||||
if (dest->newbuffer == NULL)
|
||||
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10);
|
||||
*outsize = OUTPUT_BUF_SIZE;
|
||||
}
|
||||
|
||||
dest->pub.next_output_byte = dest->buffer = *outbuffer;
|
||||
dest->pub.free_in_buffer = dest->bufsize = *outsize;
|
||||
}
|
||||
#endif
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
* jdatasrc.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2009-2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, 2016, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains decompression data source routines for the case of
|
||||
* reading JPEG data from memory or from a file (or any stdio stream).
|
||||
* While these routines are sufficient for most applications,
|
||||
* some will want to use a different source manager.
|
||||
* IMPORTANT: we assume that fread() will correctly transcribe an array of
|
||||
* JOCTETs from 8-bit-wide elements on external storage. If char is wider
|
||||
* than 8 bits on your machine, you may need to do some tweaking.
|
||||
*/
|
||||
|
||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
/* Expanded data source object for stdio input */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_source_mgr pub; /* public fields */
|
||||
|
||||
FILE *infile; /* source stream */
|
||||
JOCTET *buffer; /* start of buffer */
|
||||
boolean start_of_file; /* have we gotten any data yet? */
|
||||
} my_source_mgr;
|
||||
|
||||
typedef my_source_mgr *my_src_ptr;
|
||||
|
||||
#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize source --- called by jpeg_read_header
|
||||
* before any data is actually read.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
init_source(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_src_ptr src = (my_src_ptr)cinfo->src;
|
||||
|
||||
/* We reset the empty-input-file flag for each image,
|
||||
* but we don't clear the input buffer.
|
||||
* This is correct behavior for reading a series of images from one source.
|
||||
*/
|
||||
src->start_of_file = TRUE;
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
METHODDEF(void)
|
||||
init_mem_source(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* no work necessary here */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Fill the input buffer --- called whenever buffer is emptied.
|
||||
*
|
||||
* In typical applications, this should read fresh data into the buffer
|
||||
* (ignoring the current state of next_input_byte & bytes_in_buffer),
|
||||
* reset the pointer & count to the start of the buffer, and return TRUE
|
||||
* indicating that the buffer has been reloaded. It is not necessary to
|
||||
* fill the buffer entirely, only to obtain at least one more byte.
|
||||
*
|
||||
* There is no such thing as an EOF return. If the end of the file has been
|
||||
* reached, the routine has a choice of ERREXIT() or inserting fake data into
|
||||
* the buffer. In most cases, generating a warning message and inserting a
|
||||
* fake EOI marker is the best course of action --- this will allow the
|
||||
* decompressor to output however much of the image is there. However,
|
||||
* the resulting error message is misleading if the real problem is an empty
|
||||
* input file, so we handle that case specially.
|
||||
*
|
||||
* In applications that need to be able to suspend compression due to input
|
||||
* not being available yet, a FALSE return indicates that no more data can be
|
||||
* obtained right now, but more may be forthcoming later. In this situation,
|
||||
* the decompressor will return to its caller (with an indication of the
|
||||
* number of scanlines it has read, if any). The application should resume
|
||||
* decompression after it has loaded more data into the input buffer. Note
|
||||
* that there are substantial restrictions on the use of suspension --- see
|
||||
* the documentation.
|
||||
*
|
||||
* When suspending, the decompressor will back up to a convenient restart point
|
||||
* (typically the start of the current MCU). next_input_byte & bytes_in_buffer
|
||||
* indicate where the restart point will be if the current call returns FALSE.
|
||||
* Data beyond this point must be rescanned after resumption, so move it to
|
||||
* the front of the buffer rather than discarding it.
|
||||
*/
|
||||
|
||||
METHODDEF(boolean)
|
||||
fill_input_buffer(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_src_ptr src = (my_src_ptr)cinfo->src;
|
||||
size_t nbytes;
|
||||
|
||||
nbytes = JFREAD(src->infile, src->buffer, INPUT_BUF_SIZE);
|
||||
|
||||
if (nbytes <= 0) {
|
||||
if (src->start_of_file) /* Treat empty input file as fatal error */
|
||||
ERREXIT(cinfo, JERR_INPUT_EMPTY);
|
||||
WARNMS(cinfo, JWRN_JPEG_EOF);
|
||||
/* Insert a fake EOI marker */
|
||||
src->buffer[0] = (JOCTET)0xFF;
|
||||
src->buffer[1] = (JOCTET)JPEG_EOI;
|
||||
nbytes = 2;
|
||||
}
|
||||
|
||||
src->pub.next_input_byte = src->buffer;
|
||||
src->pub.bytes_in_buffer = nbytes;
|
||||
src->start_of_file = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
METHODDEF(boolean)
|
||||
fill_mem_input_buffer(j_decompress_ptr cinfo)
|
||||
{
|
||||
static const JOCTET mybuffer[4] = {
|
||||
(JOCTET)0xFF, (JOCTET)JPEG_EOI, 0, 0
|
||||
};
|
||||
|
||||
/* The whole JPEG data is expected to reside in the supplied memory
|
||||
* buffer, so any request for more data beyond the given buffer size
|
||||
* is treated as an error.
|
||||
*/
|
||||
WARNMS(cinfo, JWRN_JPEG_EOF);
|
||||
|
||||
/* Insert a fake EOI marker */
|
||||
|
||||
cinfo->src->next_input_byte = mybuffer;
|
||||
cinfo->src->bytes_in_buffer = 2;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Skip data --- used to skip over a potentially large amount of
|
||||
* uninteresting data (such as an APPn marker).
|
||||
*
|
||||
* Writers of suspendable-input applications must note that skip_input_data
|
||||
* is not granted the right to give a suspension return. If the skip extends
|
||||
* beyond the data currently in the buffer, the buffer can be marked empty so
|
||||
* that the next read will cause a fill_input_buffer call that can suspend.
|
||||
* Arranging for additional bytes to be discarded before reloading the input
|
||||
* buffer is the application writer's problem.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
skip_input_data(j_decompress_ptr cinfo, long num_bytes)
|
||||
{
|
||||
struct jpeg_source_mgr *src = cinfo->src;
|
||||
|
||||
/* Just a dumb implementation for now. Could use fseek() except
|
||||
* it doesn't work on pipes. Not clear that being smart is worth
|
||||
* any trouble anyway --- large skips are infrequent.
|
||||
*/
|
||||
if (num_bytes > 0) {
|
||||
while (num_bytes > (long)src->bytes_in_buffer) {
|
||||
num_bytes -= (long)src->bytes_in_buffer;
|
||||
(void)(*src->fill_input_buffer) (cinfo);
|
||||
/* note we assume that fill_input_buffer will never return FALSE,
|
||||
* so suspension need not be handled.
|
||||
*/
|
||||
}
|
||||
src->next_input_byte += (size_t)num_bytes;
|
||||
src->bytes_in_buffer -= (size_t)num_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* An additional method that can be provided by data source modules is the
|
||||
* resync_to_restart method for error recovery in the presence of RST markers.
|
||||
* For the moment, this source module just uses the default resync method
|
||||
* provided by the JPEG library. That method assumes that no backtracking
|
||||
* is possible.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Terminate source --- called by jpeg_finish_decompress
|
||||
* after all data has been read. Often a no-op.
|
||||
*
|
||||
* NB: *not* called by jpeg_abort or jpeg_destroy; surrounding
|
||||
* application must deal with any cleanup that should happen even
|
||||
* for error exit.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
term_source(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* no work necessary here */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Prepare for input from a stdio stream.
|
||||
* The caller must have already opened the stream, and is responsible
|
||||
* for closing it after finishing decompression.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile)
|
||||
{
|
||||
my_src_ptr src;
|
||||
|
||||
/* The source object and input buffer are made permanent so that a series
|
||||
* of JPEG images can be read from the same file by calling jpeg_stdio_src
|
||||
* only before the first one. (If we discarded the buffer at the end of
|
||||
* one image, we'd likely lose the start of the next one.)
|
||||
*/
|
||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->src = (struct jpeg_source_mgr *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(my_source_mgr));
|
||||
src = (my_src_ptr)cinfo->src;
|
||||
src->buffer = (JOCTET *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
INPUT_BUF_SIZE * sizeof(JOCTET));
|
||||
} else if (cinfo->src->init_source != init_source) {
|
||||
/* It is unsafe to reuse the existing source manager unless it was created
|
||||
* by this function. Otherwise, there is no guarantee that the opaque
|
||||
* structure is the right size. Note that we could just create a new
|
||||
* structure, but the old structure would not be freed until
|
||||
* jpeg_destroy_decompress() was called.
|
||||
*/
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
src = (my_src_ptr)cinfo->src;
|
||||
src->pub.init_source = init_source;
|
||||
src->pub.fill_input_buffer = fill_input_buffer;
|
||||
src->pub.skip_input_data = skip_input_data;
|
||||
src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
||||
src->pub.term_source = term_source;
|
||||
src->infile = infile;
|
||||
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
|
||||
src->pub.next_input_byte = NULL; /* until buffer loaded */
|
||||
}
|
||||
|
||||
|
||||
#if JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)
|
||||
/*
|
||||
* Prepare for input from a supplied memory buffer.
|
||||
* The buffer must contain the whole JPEG data.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *inbuffer,
|
||||
unsigned long insize)
|
||||
{
|
||||
struct jpeg_source_mgr *src;
|
||||
|
||||
if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */
|
||||
ERREXIT(cinfo, JERR_INPUT_EMPTY);
|
||||
|
||||
/* The source object is made permanent so that a series of JPEG images
|
||||
* can be read from the same buffer by calling jpeg_mem_src only before
|
||||
* the first one.
|
||||
*/
|
||||
if (cinfo->src == NULL) { /* first time for this JPEG object? */
|
||||
cinfo->src = (struct jpeg_source_mgr *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
|
||||
sizeof(struct jpeg_source_mgr));
|
||||
} else if (cinfo->src->init_source != init_mem_source) {
|
||||
/* It is unsafe to reuse the existing source manager unless it was created
|
||||
* by this function.
|
||||
*/
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
src = cinfo->src;
|
||||
src->init_source = init_mem_source;
|
||||
src->fill_input_buffer = fill_mem_input_buffer;
|
||||
src->skip_input_data = skip_input_data;
|
||||
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
||||
src->term_source = term_source;
|
||||
src->bytes_in_buffer = (size_t)insize;
|
||||
src->next_input_byte = (const JOCTET *)inbuffer;
|
||||
}
|
||||
#endif
|
||||
+692
@@ -0,0 +1,692 @@
|
||||
/*
|
||||
* jdcoefct.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains the coefficient buffer controller for decompression.
|
||||
* This controller is the top level of the JPEG decompressor proper.
|
||||
* The coefficient buffer lies between entropy decoding and inverse-DCT steps.
|
||||
*
|
||||
* In buffered-image mode, this controller is the interface between
|
||||
* input-oriented processing and output-oriented processing.
|
||||
* Also, the input side (only) is used when reading a file for transcoding.
|
||||
*/
|
||||
|
||||
#include "jinclude.h"
|
||||
#include "jdcoefct.h"
|
||||
#include "jpegcomp.h"
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
METHODDEF(int) decompress_onepass(j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE output_buf);
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
METHODDEF(int) decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf);
|
||||
#endif
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
LOCAL(boolean) smoothing_ok(j_decompress_ptr cinfo);
|
||||
METHODDEF(int) decompress_smooth_data(j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE output_buf);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for an input processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_input_pass(j_decompress_ptr cinfo)
|
||||
{
|
||||
cinfo->input_iMCU_row = 0;
|
||||
start_iMCU_row(cinfo);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for an output processing pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_output_pass(j_decompress_ptr cinfo)
|
||||
{
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
/* If multipass, check to see whether to use block smoothing on this pass */
|
||||
if (coef->pub.coef_arrays != NULL) {
|
||||
if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
|
||||
coef->pub.decompress_data = decompress_smooth_data;
|
||||
else
|
||||
coef->pub.decompress_data = decompress_data;
|
||||
}
|
||||
#endif
|
||||
cinfo->output_iMCU_row = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decompress and return some data in the single-pass case.
|
||||
* Always attempts to emit one fully interleaved MCU row ("iMCU" row).
|
||||
* Input and output must run in lockstep since we have only a one-MCU buffer.
|
||||
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
|
||||
*
|
||||
* NB: output_buf contains a plane for each component in image,
|
||||
* which we index according to the component's SOF position.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
decompress_onepass(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
int blkn, ci, xindex, yindex, yoffset, useful_width;
|
||||
JSAMPARRAY output_ptr;
|
||||
JDIMENSION start_col, output_col;
|
||||
jpeg_component_info *compptr;
|
||||
inverse_DCT_method_ptr inverse_DCT;
|
||||
|
||||
/* Loop to process as much as one whole iMCU row */
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
|
||||
MCU_col_num++) {
|
||||
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
|
||||
jzero_far((void *)coef->MCU_buffer[0],
|
||||
(size_t)(cinfo->blocks_in_MCU * sizeof(JBLOCK)));
|
||||
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->MCU_ctr = MCU_col_num;
|
||||
return JPEG_SUSPENDED;
|
||||
}
|
||||
|
||||
/* Only perform the IDCT on blocks that are contained within the desired
|
||||
* cropping region.
|
||||
*/
|
||||
if (MCU_col_num >= cinfo->master->first_iMCU_col &&
|
||||
MCU_col_num <= cinfo->master->last_iMCU_col) {
|
||||
/* Determine where data should go in output_buf and do the IDCT thing.
|
||||
* We skip dummy blocks at the right and bottom edges (but blkn gets
|
||||
* incremented past them!). Note the inner loop relies on having
|
||||
* allocated the MCU_buffer[] blocks sequentially.
|
||||
*/
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
/* Don't bother to IDCT an uninteresting component. */
|
||||
if (!compptr->component_needed) {
|
||||
blkn += compptr->MCU_blocks;
|
||||
continue;
|
||||
}
|
||||
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
|
||||
useful_width = (MCU_col_num < last_MCU_col) ?
|
||||
compptr->MCU_width : compptr->last_col_width;
|
||||
output_ptr = output_buf[compptr->component_index] +
|
||||
yoffset * compptr->_DCT_scaled_size;
|
||||
start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *
|
||||
compptr->MCU_sample_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
if (cinfo->input_iMCU_row < last_iMCU_row ||
|
||||
yoffset + yindex < compptr->last_row_height) {
|
||||
output_col = start_col;
|
||||
for (xindex = 0; xindex < useful_width; xindex++) {
|
||||
(*inverse_DCT) (cinfo, compptr,
|
||||
(JCOEFPTR)coef->MCU_buffer[blkn + xindex],
|
||||
output_ptr, output_col);
|
||||
output_col += compptr->_DCT_scaled_size;
|
||||
}
|
||||
}
|
||||
blkn += compptr->MCU_width;
|
||||
output_ptr += compptr->_DCT_scaled_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
coef->MCU_ctr = 0;
|
||||
}
|
||||
/* Completed the iMCU row, advance counters for next one */
|
||||
cinfo->output_iMCU_row++;
|
||||
if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
|
||||
start_iMCU_row(cinfo);
|
||||
return JPEG_ROW_COMPLETED;
|
||||
}
|
||||
/* Completed the scan */
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
return JPEG_SCAN_COMPLETED;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Dummy consume-input routine for single-pass operation.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
dummy_consume_data(j_decompress_ptr cinfo)
|
||||
{
|
||||
return JPEG_SUSPENDED; /* Always indicate nothing was done */
|
||||
}
|
||||
|
||||
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
|
||||
/*
|
||||
* Consume input data and store it in the full-image coefficient buffer.
|
||||
* We read as much as one fully interleaved MCU row ("iMCU" row) per call,
|
||||
* ie, v_samp_factor block rows for each component in the scan.
|
||||
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
consume_data(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION MCU_col_num; /* index of current MCU within row */
|
||||
int blkn, ci, xindex, yindex, yoffset;
|
||||
JDIMENSION start_col;
|
||||
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
|
||||
JBLOCKROW buffer_ptr;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
/* Align the virtual buffers for the components used in this scan. */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
buffer[ci] = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
|
||||
cinfo->input_iMCU_row * compptr->v_samp_factor,
|
||||
(JDIMENSION)compptr->v_samp_factor, TRUE);
|
||||
/* Note: entropy decoder expects buffer to be zeroed,
|
||||
* but this is handled automatically by the memory manager
|
||||
* because we requested a pre-zeroed array.
|
||||
*/
|
||||
}
|
||||
|
||||
/* Loop to process one whole iMCU row */
|
||||
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
|
||||
yoffset++) {
|
||||
for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
|
||||
MCU_col_num++) {
|
||||
/* Construct list of pointers to DCT blocks belonging to this MCU */
|
||||
blkn = 0; /* index of current DCT block within MCU */
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
start_col = MCU_col_num * compptr->MCU_width;
|
||||
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
|
||||
buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
|
||||
for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
|
||||
coef->MCU_buffer[blkn++] = buffer_ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Try to fetch the MCU. */
|
||||
if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
|
||||
/* Suspension forced; update state counters and exit */
|
||||
coef->MCU_vert_offset = yoffset;
|
||||
coef->MCU_ctr = MCU_col_num;
|
||||
return JPEG_SUSPENDED;
|
||||
}
|
||||
}
|
||||
/* Completed an MCU row, but perhaps not an iMCU row */
|
||||
coef->MCU_ctr = 0;
|
||||
}
|
||||
/* Completed the iMCU row, advance counters for next one */
|
||||
if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
|
||||
start_iMCU_row(cinfo);
|
||||
return JPEG_ROW_COMPLETED;
|
||||
}
|
||||
/* Completed the scan */
|
||||
(*cinfo->inputctl->finish_input_pass) (cinfo);
|
||||
return JPEG_SCAN_COMPLETED;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decompress and return some data in the multi-pass case.
|
||||
* Always attempts to emit one fully interleaved MCU row ("iMCU" row).
|
||||
* Return value is JPEG_ROW_COMPLETED, JPEG_SCAN_COMPLETED, or JPEG_SUSPENDED.
|
||||
*
|
||||
* NB: output_buf contains a plane for each component in image.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
decompress_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
JDIMENSION block_num;
|
||||
int ci, block_row, block_rows;
|
||||
JBLOCKARRAY buffer;
|
||||
JBLOCKROW buffer_ptr;
|
||||
JSAMPARRAY output_ptr;
|
||||
JDIMENSION output_col;
|
||||
jpeg_component_info *compptr;
|
||||
inverse_DCT_method_ptr inverse_DCT;
|
||||
|
||||
/* Force some input to be done if we are getting ahead of the input. */
|
||||
while (cinfo->input_scan_number < cinfo->output_scan_number ||
|
||||
(cinfo->input_scan_number == cinfo->output_scan_number &&
|
||||
cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
|
||||
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
|
||||
return JPEG_SUSPENDED;
|
||||
}
|
||||
|
||||
/* OK, output from the virtual arrays. */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* Don't bother to IDCT an uninteresting component. */
|
||||
if (!compptr->component_needed)
|
||||
continue;
|
||||
/* Align the virtual buffer for this component. */
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
cinfo->output_iMCU_row * compptr->v_samp_factor,
|
||||
(JDIMENSION)compptr->v_samp_factor, FALSE);
|
||||
/* Count non-dummy DCT block rows in this iMCU row. */
|
||||
if (cinfo->output_iMCU_row < last_iMCU_row)
|
||||
block_rows = compptr->v_samp_factor;
|
||||
else {
|
||||
/* NB: can't use last_row_height here; it is input-side-dependent! */
|
||||
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
|
||||
if (block_rows == 0) block_rows = compptr->v_samp_factor;
|
||||
}
|
||||
inverse_DCT = cinfo->idct->inverse_DCT[ci];
|
||||
output_ptr = output_buf[ci];
|
||||
/* Loop over all DCT blocks to be processed. */
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
|
||||
output_col = 0;
|
||||
for (block_num = cinfo->master->first_MCU_col[ci];
|
||||
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
|
||||
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)buffer_ptr, output_ptr,
|
||||
output_col);
|
||||
buffer_ptr++;
|
||||
output_col += compptr->_DCT_scaled_size;
|
||||
}
|
||||
output_ptr += compptr->_DCT_scaled_size;
|
||||
}
|
||||
}
|
||||
|
||||
if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
|
||||
return JPEG_ROW_COMPLETED;
|
||||
return JPEG_SCAN_COMPLETED;
|
||||
}
|
||||
|
||||
#endif /* D_MULTISCAN_FILES_SUPPORTED */
|
||||
|
||||
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
|
||||
/*
|
||||
* This code applies interblock smoothing as described by section K.8
|
||||
* of the JPEG standard: the first 5 AC coefficients are estimated from
|
||||
* the DC values of a DCT block and its 8 neighboring blocks.
|
||||
* We apply smoothing only for progressive JPEG decoding, and only if
|
||||
* the coefficients it can estimate are not yet known to full precision.
|
||||
*/
|
||||
|
||||
/* Natural-order array positions of the first 5 zigzag-order coefficients */
|
||||
#define Q01_POS 1
|
||||
#define Q10_POS 8
|
||||
#define Q20_POS 16
|
||||
#define Q11_POS 9
|
||||
#define Q02_POS 2
|
||||
|
||||
/*
|
||||
* Determine whether block smoothing is applicable and safe.
|
||||
* We also latch the current states of the coef_bits[] entries for the
|
||||
* AC coefficients; otherwise, if the input side of the decompressor
|
||||
* advances into a new scan, we might think the coefficients are known
|
||||
* more accurately than they really are.
|
||||
*/
|
||||
|
||||
LOCAL(boolean)
|
||||
smoothing_ok(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
boolean smoothing_useful = FALSE;
|
||||
int ci, coefi;
|
||||
jpeg_component_info *compptr;
|
||||
JQUANT_TBL *qtable;
|
||||
int *coef_bits;
|
||||
int *coef_bits_latch;
|
||||
|
||||
if (!cinfo->progressive_mode || cinfo->coef_bits == NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Allocate latch area if not already done */
|
||||
if (coef->coef_bits_latch == NULL)
|
||||
coef->coef_bits_latch = (int *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
cinfo->num_components *
|
||||
(SAVED_COEFS * sizeof(int)));
|
||||
coef_bits_latch = coef->coef_bits_latch;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* All components' quantization values must already be latched. */
|
||||
if ((qtable = compptr->quant_table) == NULL)
|
||||
return FALSE;
|
||||
/* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
|
||||
if (qtable->quantval[0] == 0 ||
|
||||
qtable->quantval[Q01_POS] == 0 ||
|
||||
qtable->quantval[Q10_POS] == 0 ||
|
||||
qtable->quantval[Q20_POS] == 0 ||
|
||||
qtable->quantval[Q11_POS] == 0 ||
|
||||
qtable->quantval[Q02_POS] == 0)
|
||||
return FALSE;
|
||||
/* DC values must be at least partly known for all components. */
|
||||
coef_bits = cinfo->coef_bits[ci];
|
||||
if (coef_bits[0] < 0)
|
||||
return FALSE;
|
||||
/* Block smoothing is helpful if some AC coefficients remain inaccurate. */
|
||||
for (coefi = 1; coefi <= 5; coefi++) {
|
||||
coef_bits_latch[coefi] = coef_bits[coefi];
|
||||
if (coef_bits[coefi] != 0)
|
||||
smoothing_useful = TRUE;
|
||||
}
|
||||
coef_bits_latch += SAVED_COEFS;
|
||||
}
|
||||
|
||||
return smoothing_useful;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Variant of decompress_data for use when doing block smoothing.
|
||||
*/
|
||||
|
||||
METHODDEF(int)
|
||||
decompress_smooth_data(j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
|
||||
JDIMENSION block_num, last_block_column;
|
||||
int ci, block_row, block_rows, access_rows;
|
||||
JBLOCKARRAY buffer;
|
||||
JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
|
||||
JSAMPARRAY output_ptr;
|
||||
JDIMENSION output_col;
|
||||
jpeg_component_info *compptr;
|
||||
inverse_DCT_method_ptr inverse_DCT;
|
||||
boolean first_row, last_row;
|
||||
JCOEF *workspace;
|
||||
int *coef_bits;
|
||||
JQUANT_TBL *quanttbl;
|
||||
JLONG Q00, Q01, Q02, Q10, Q11, Q20, num;
|
||||
int DC1, DC2, DC3, DC4, DC5, DC6, DC7, DC8, DC9;
|
||||
int Al, pred;
|
||||
|
||||
/* Keep a local variable to avoid looking it up more than once */
|
||||
workspace = coef->workspace;
|
||||
|
||||
/* Force some input to be done if we are getting ahead of the input. */
|
||||
while (cinfo->input_scan_number <= cinfo->output_scan_number &&
|
||||
!cinfo->inputctl->eoi_reached) {
|
||||
if (cinfo->input_scan_number == cinfo->output_scan_number) {
|
||||
/* If input is working on current scan, we ordinarily want it to
|
||||
* have completed the current row. But if input scan is DC,
|
||||
* we want it to keep one row ahead so that next block row's DC
|
||||
* values are up to date.
|
||||
*/
|
||||
JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
|
||||
if (cinfo->input_iMCU_row > cinfo->output_iMCU_row + delta)
|
||||
break;
|
||||
}
|
||||
if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
|
||||
return JPEG_SUSPENDED;
|
||||
}
|
||||
|
||||
/* OK, output from the virtual arrays. */
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
/* Don't bother to IDCT an uninteresting component. */
|
||||
if (!compptr->component_needed)
|
||||
continue;
|
||||
/* Count non-dummy DCT block rows in this iMCU row. */
|
||||
if (cinfo->output_iMCU_row < last_iMCU_row) {
|
||||
block_rows = compptr->v_samp_factor;
|
||||
access_rows = block_rows * 2; /* this and next iMCU row */
|
||||
last_row = FALSE;
|
||||
} else {
|
||||
/* NB: can't use last_row_height here; it is input-side-dependent! */
|
||||
block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
|
||||
if (block_rows == 0) block_rows = compptr->v_samp_factor;
|
||||
access_rows = block_rows; /* this iMCU row only */
|
||||
last_row = TRUE;
|
||||
}
|
||||
/* Align the virtual buffer for this component. */
|
||||
if (cinfo->output_iMCU_row > 0) {
|
||||
access_rows += compptr->v_samp_factor; /* prior iMCU row too */
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
(cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
|
||||
(JDIMENSION)access_rows, FALSE);
|
||||
buffer += compptr->v_samp_factor; /* point to current iMCU row */
|
||||
first_row = FALSE;
|
||||
} else {
|
||||
buffer = (*cinfo->mem->access_virt_barray)
|
||||
((j_common_ptr)cinfo, coef->whole_image[ci],
|
||||
(JDIMENSION)0, (JDIMENSION)access_rows, FALSE);
|
||||
first_row = TRUE;
|
||||
}
|
||||
/* Fetch component-dependent info */
|
||||
coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
|
||||
quanttbl = compptr->quant_table;
|
||||
Q00 = quanttbl->quantval[0];
|
||||
Q01 = quanttbl->quantval[Q01_POS];
|
||||
Q10 = quanttbl->quantval[Q10_POS];
|
||||
Q20 = quanttbl->quantval[Q20_POS];
|
||||
Q11 = quanttbl->quantval[Q11_POS];
|
||||
Q02 = quanttbl->quantval[Q02_POS];
|
||||
inverse_DCT = cinfo->idct->inverse_DCT[ci];
|
||||
output_ptr = output_buf[ci];
|
||||
/* Loop over all DCT blocks to be processed. */
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
|
||||
if (first_row && block_row == 0)
|
||||
prev_block_row = buffer_ptr;
|
||||
else
|
||||
prev_block_row = buffer[block_row - 1];
|
||||
if (last_row && block_row == block_rows - 1)
|
||||
next_block_row = buffer_ptr;
|
||||
else
|
||||
next_block_row = buffer[block_row + 1];
|
||||
/* We fetch the surrounding DC values using a sliding-register approach.
|
||||
* Initialize all nine here so as to do the right thing on narrow pics.
|
||||
*/
|
||||
DC1 = DC2 = DC3 = (int)prev_block_row[0][0];
|
||||
DC4 = DC5 = DC6 = (int)buffer_ptr[0][0];
|
||||
DC7 = DC8 = DC9 = (int)next_block_row[0][0];
|
||||
output_col = 0;
|
||||
last_block_column = compptr->width_in_blocks - 1;
|
||||
for (block_num = cinfo->master->first_MCU_col[ci];
|
||||
block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
|
||||
/* Fetch current DCT block into workspace so we can modify it. */
|
||||
jcopy_block_row(buffer_ptr, (JBLOCKROW)workspace, (JDIMENSION)1);
|
||||
/* Update DC values */
|
||||
if (block_num < last_block_column) {
|
||||
DC3 = (int)prev_block_row[1][0];
|
||||
DC6 = (int)buffer_ptr[1][0];
|
||||
DC9 = (int)next_block_row[1][0];
|
||||
}
|
||||
/* Compute coefficient estimates per K.8.
|
||||
* An estimate is applied only if coefficient is still zero,
|
||||
* and is not known to be fully accurate.
|
||||
*/
|
||||
/* AC01 */
|
||||
if ((Al = coef_bits[1]) != 0 && workspace[1] == 0) {
|
||||
num = 36 * Q00 * (DC4 - DC6);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q01 << 7) + num) / (Q01 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q01 << 7) - num) / (Q01 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[1] = (JCOEF)pred;
|
||||
}
|
||||
/* AC10 */
|
||||
if ((Al = coef_bits[2]) != 0 && workspace[8] == 0) {
|
||||
num = 36 * Q00 * (DC2 - DC8);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q10 << 7) + num) / (Q10 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q10 << 7) - num) / (Q10 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[8] = (JCOEF)pred;
|
||||
}
|
||||
/* AC20 */
|
||||
if ((Al = coef_bits[3]) != 0 && workspace[16] == 0) {
|
||||
num = 9 * Q00 * (DC2 + DC8 - 2 * DC5);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q20 << 7) + num) / (Q20 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q20 << 7) - num) / (Q20 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[16] = (JCOEF)pred;
|
||||
}
|
||||
/* AC11 */
|
||||
if ((Al = coef_bits[4]) != 0 && workspace[9] == 0) {
|
||||
num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q11 << 7) + num) / (Q11 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q11 << 7) - num) / (Q11 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[9] = (JCOEF)pred;
|
||||
}
|
||||
/* AC02 */
|
||||
if ((Al = coef_bits[5]) != 0 && workspace[2] == 0) {
|
||||
num = 9 * Q00 * (DC4 + DC6 - 2 * DC5);
|
||||
if (num >= 0) {
|
||||
pred = (int)(((Q02 << 7) + num) / (Q02 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
} else {
|
||||
pred = (int)(((Q02 << 7) - num) / (Q02 << 8));
|
||||
if (Al > 0 && pred >= (1 << Al))
|
||||
pred = (1 << Al) - 1;
|
||||
pred = -pred;
|
||||
}
|
||||
workspace[2] = (JCOEF)pred;
|
||||
}
|
||||
/* OK, do the IDCT */
|
||||
(*inverse_DCT) (cinfo, compptr, (JCOEFPTR)workspace, output_ptr,
|
||||
output_col);
|
||||
/* Advance for next column */
|
||||
DC1 = DC2; DC2 = DC3;
|
||||
DC4 = DC5; DC5 = DC6;
|
||||
DC7 = DC8; DC8 = DC9;
|
||||
buffer_ptr++, prev_block_row++, next_block_row++;
|
||||
output_col += compptr->_DCT_scaled_size;
|
||||
}
|
||||
output_ptr += compptr->_DCT_scaled_size;
|
||||
}
|
||||
}
|
||||
|
||||
if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
|
||||
return JPEG_ROW_COMPLETED;
|
||||
return JPEG_SCAN_COMPLETED;
|
||||
}
|
||||
|
||||
#endif /* BLOCK_SMOOTHING_SUPPORTED */
|
||||
|
||||
|
||||
/*
|
||||
* Initialize coefficient buffer controller.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_d_coef_controller(j_decompress_ptr cinfo, boolean need_full_buffer)
|
||||
{
|
||||
my_coef_ptr coef;
|
||||
|
||||
coef = (my_coef_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_coef_controller));
|
||||
cinfo->coef = (struct jpeg_d_coef_controller *)coef;
|
||||
coef->pub.start_input_pass = start_input_pass;
|
||||
coef->pub.start_output_pass = start_output_pass;
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
coef->coef_bits_latch = NULL;
|
||||
#endif
|
||||
|
||||
/* Create the coefficient buffer. */
|
||||
if (need_full_buffer) {
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
/* Allocate a full-image virtual array for each component, */
|
||||
/* padded to a multiple of samp_factor DCT blocks in each direction. */
|
||||
/* Note we ask for a pre-zeroed array. */
|
||||
int ci, access_rows;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
access_rows = compptr->v_samp_factor;
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
/* If block smoothing could be used, need a bigger window */
|
||||
if (cinfo->progressive_mode)
|
||||
access_rows *= 3;
|
||||
#endif
|
||||
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
|
||||
((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
|
||||
(JDIMENSION)jround_up((long)compptr->width_in_blocks,
|
||||
(long)compptr->h_samp_factor),
|
||||
(JDIMENSION)jround_up((long)compptr->height_in_blocks,
|
||||
(long)compptr->v_samp_factor),
|
||||
(JDIMENSION)access_rows);
|
||||
}
|
||||
coef->pub.consume_data = consume_data;
|
||||
coef->pub.decompress_data = decompress_data;
|
||||
coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
|
||||
#else
|
||||
ERREXIT(cinfo, JERR_NOT_COMPILED);
|
||||
#endif
|
||||
} else {
|
||||
/* We only need a single-MCU buffer. */
|
||||
JBLOCKROW buffer;
|
||||
int i;
|
||||
|
||||
buffer = (JBLOCKROW)
|
||||
(*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
D_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
|
||||
for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
|
||||
coef->MCU_buffer[i] = buffer + i;
|
||||
}
|
||||
coef->pub.consume_data = dummy_consume_data;
|
||||
coef->pub.decompress_data = decompress_onepass;
|
||||
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
|
||||
}
|
||||
|
||||
/* Allocate the workspace buffer */
|
||||
coef->workspace = (JCOEF *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(JCOEF) * DCTSIZE2);
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* jdcoefct.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/* Block smoothing is only applicable for progressive JPEG, so: */
|
||||
#ifndef D_PROGRESSIVE_SUPPORTED
|
||||
#undef BLOCK_SMOOTHING_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
||||
/* Private buffer controller object */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_d_coef_controller pub; /* public fields */
|
||||
|
||||
/* These variables keep track of the current location of the input side. */
|
||||
/* cinfo->input_iMCU_row is also used for this. */
|
||||
JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
|
||||
int MCU_vert_offset; /* counts MCU rows within iMCU row */
|
||||
int MCU_rows_per_iMCU_row; /* number of such rows needed */
|
||||
|
||||
/* The output side's location is represented by cinfo->output_iMCU_row. */
|
||||
|
||||
/* In single-pass modes, it's sufficient to buffer just one MCU.
|
||||
* We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
|
||||
* and let the entropy decoder write into that workspace each time.
|
||||
* In multi-pass modes, this array points to the current MCU's blocks
|
||||
* within the virtual arrays; it is used only by the input side.
|
||||
*/
|
||||
JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU];
|
||||
|
||||
/* Temporary workspace for one MCU */
|
||||
JCOEF *workspace;
|
||||
|
||||
#ifdef D_MULTISCAN_FILES_SUPPORTED
|
||||
/* In multi-pass modes, we need a virtual block array for each component. */
|
||||
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
|
||||
#endif
|
||||
|
||||
#ifdef BLOCK_SMOOTHING_SUPPORTED
|
||||
/* When doing block smoothing, we latch coefficient Al values here */
|
||||
int *coef_bits_latch;
|
||||
#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
|
||||
#endif
|
||||
} my_coef_controller;
|
||||
|
||||
typedef my_coef_controller *my_coef_ptr;
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
start_iMCU_row(j_decompress_ptr cinfo)
|
||||
/* Reset within-iMCU-row counters for a new row (input side) */
|
||||
{
|
||||
my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
|
||||
|
||||
/* In an interleaved scan, an MCU row is the same as an iMCU row.
|
||||
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
|
||||
* But at the bottom of the image, process only what's left.
|
||||
*/
|
||||
if (cinfo->comps_in_scan > 1) {
|
||||
coef->MCU_rows_per_iMCU_row = 1;
|
||||
} else {
|
||||
if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows - 1))
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
|
||||
else
|
||||
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
|
||||
}
|
||||
|
||||
coef->MCU_ctr = 0;
|
||||
coef->MCU_vert_offset = 0;
|
||||
}
|
||||
+384
@@ -0,0 +1,384 @@
|
||||
/*
|
||||
* jdcol565.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2014-2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains output colorspace conversion routines.
|
||||
*/
|
||||
|
||||
/* This file is included by jdcolor.c */
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
ycc_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
register int *Crrtab = cconvert->Cr_r_tab;
|
||||
register int *Cbbtab = cconvert->Cb_b_tab;
|
||||
register JLONG *Crgtab = cconvert->Cr_g_tab;
|
||||
register JLONG *Cbgtab = cconvert->Cb_g_tab;
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int r, g, b;
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
b = range_limit[y + Cbbtab[cb]];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
b = range_limit[y + Cbbtab[cb]];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
b = range_limit[y + Cbbtab[cb]];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
r = range_limit[y + Crrtab[cr]];
|
||||
g = range_limit[y + ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
b = range_limit[y + Cbbtab[cb]];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
ycc_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
register int *Crrtab = cconvert->Cr_r_tab;
|
||||
register int *Cbbtab = cconvert->Cb_b_tab;
|
||||
register JLONG *Crgtab = cconvert->Cr_g_tab;
|
||||
register JLONG *Cbgtab = cconvert->Cb_g_tab;
|
||||
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int r, g, b;
|
||||
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS)), d0)];
|
||||
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS)), d0)];
|
||||
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS)), d0)];
|
||||
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
r = range_limit[DITHER_565_R(y + Crrtab[cr], d0)];
|
||||
g = range_limit[DITHER_565_G(y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS)), d0)];
|
||||
b = range_limit[DITHER_565_B(y + Cbbtab[cb], d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int r, g, b;
|
||||
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
r = GETJSAMPLE(*inptr0++);
|
||||
g = GETJSAMPLE(*inptr1++);
|
||||
b = GETJSAMPLE(*inptr2++);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
r = GETJSAMPLE(*inptr0);
|
||||
g = GETJSAMPLE(*inptr1);
|
||||
b = GETJSAMPLE(*inptr2);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int r, g, b;
|
||||
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0++), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1++), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2++), d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
r = range_limit[DITHER_565_R(GETJSAMPLE(*inptr0), d0)];
|
||||
g = range_limit[DITHER_565_G(GETJSAMPLE(*inptr1), d0)];
|
||||
b = range_limit[DITHER_565_B(GETJSAMPLE(*inptr2), d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
gray_rgb565_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int g;
|
||||
|
||||
inptr = input_buf[0][input_row++];
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
g = *inptr++;
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
g = *inptr++;
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
g = *inptr++;
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
g = *inptr;
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
gray_rgb565D_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
register JDIMENSION col;
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
JLONG rgb;
|
||||
unsigned int g;
|
||||
|
||||
inptr = input_buf[0][input_row++];
|
||||
outptr = *output_buf++;
|
||||
if (PACK_NEED_ALIGNMENT(outptr)) {
|
||||
g = *inptr++;
|
||||
g = range_limit[DITHER_565_R(g, d0)];
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
outptr += 2;
|
||||
num_cols--;
|
||||
}
|
||||
for (col = 0; col < (num_cols >> 1); col++) {
|
||||
g = *inptr++;
|
||||
g = range_limit[DITHER_565_R(g, d0)];
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
|
||||
g = *inptr++;
|
||||
g = range_limit[DITHER_565_R(g, d0)];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(g, g, g));
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
|
||||
WRITE_TWO_ALIGNED_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
if (num_cols & 1) {
|
||||
g = *inptr;
|
||||
g = range_limit[DITHER_565_R(g, d0)];
|
||||
rgb = PACK_SHORT_565(g, g, g);
|
||||
*(INT16 *)outptr = (INT16)rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* jdcolext.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2011, 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains output colorspace conversion routines.
|
||||
*/
|
||||
|
||||
|
||||
/* This file is included by jdcolor.c */
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the output colorspace.
|
||||
*
|
||||
* Note that we change from noninterleaved, one-plane-per-component format
|
||||
* to interleaved-pixel format. The output buffer is therefore three times
|
||||
* as wide as the input buffer.
|
||||
* 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
|
||||
* offset required on that side.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
ycc_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
register int *Crrtab = cconvert->Cr_r_tab;
|
||||
register int *Cbbtab = cconvert->Cb_b_tab;
|
||||
register JLONG *Crgtab = cconvert->Cr_g_tab;
|
||||
register JLONG *Cbgtab = cconvert->Cb_g_tab;
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
y = GETJSAMPLE(inptr0[col]);
|
||||
cb = GETJSAMPLE(inptr1[col]);
|
||||
cr = GETJSAMPLE(inptr2[col]);
|
||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
||||
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
|
||||
outptr[RGB_GREEN] = range_limit[y +
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS))];
|
||||
outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
|
||||
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
|
||||
/* alpha channel value */
|
||||
#ifdef RGB_ALPHA
|
||||
outptr[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr += RGB_PIXELSIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert grayscale to RGB: just duplicate the graylevel three times.
|
||||
* This is provided to support applications that don't want to cope
|
||||
* with grayscale as a separate case.
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
gray_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = input_buf[0][input_row++];
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
/* We can dispense with GETJSAMPLE() here */
|
||||
outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
|
||||
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
|
||||
/* alpha channel value */
|
||||
#ifdef RGB_ALPHA
|
||||
outptr[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr += RGB_PIXELSIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert RGB to extended RGB: just swap the order of source pixels
|
||||
*/
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb_convert_internal(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JSAMPROW outptr;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
/* We can dispense with GETJSAMPLE() here */
|
||||
outptr[RGB_RED] = inptr0[col];
|
||||
outptr[RGB_GREEN] = inptr1[col];
|
||||
outptr[RGB_BLUE] = inptr2[col];
|
||||
/* Set unused byte to 0xFF so it can be interpreted as an opaque */
|
||||
/* alpha channel value */
|
||||
#ifdef RGB_ALPHA
|
||||
outptr[RGB_ALPHA] = 0xFF;
|
||||
#endif
|
||||
outptr += RGB_PIXELSIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+883
@@ -0,0 +1,883 @@
|
||||
/*
|
||||
* jdcolor.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011-2012, 2014-2015, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file contains output colorspace conversion routines.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jsimd.h"
|
||||
#include "jconfigint.h"
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
struct jpeg_color_deconverter pub; /* public fields */
|
||||
|
||||
/* Private state for YCC->RGB conversion */
|
||||
int *Cr_r_tab; /* => table for Cr to R conversion */
|
||||
int *Cb_b_tab; /* => table for Cb to B conversion */
|
||||
JLONG *Cr_g_tab; /* => table for Cr to G conversion */
|
||||
JLONG *Cb_g_tab; /* => table for Cb to G conversion */
|
||||
|
||||
/* Private state for RGB->Y conversion */
|
||||
JLONG *rgb_y_tab; /* => table for RGB to Y conversion */
|
||||
} my_color_deconverter;
|
||||
|
||||
typedef my_color_deconverter *my_cconvert_ptr;
|
||||
|
||||
|
||||
/**************** YCbCr -> RGB conversion: most common case **************/
|
||||
/**************** RGB -> Y conversion: less common case **************/
|
||||
|
||||
/*
|
||||
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
|
||||
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
||||
* The conversion equations to be implemented are therefore
|
||||
*
|
||||
* R = Y + 1.40200 * Cr
|
||||
* G = Y - 0.34414 * Cb - 0.71414 * Cr
|
||||
* B = Y + 1.77200 * Cb
|
||||
*
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
*
|
||||
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
|
||||
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
|
||||
*
|
||||
* To avoid floating-point arithmetic, we represent the fractional constants
|
||||
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
|
||||
* the products by 2^16, with appropriate rounding, to get the correct answer.
|
||||
* Notice that Y, being an integral input, does not contribute any fraction
|
||||
* so it need not participate in the rounding.
|
||||
*
|
||||
* For even more speed, we avoid doing any multiplications in the inner loop
|
||||
* by precalculating the constants times Cb and Cr for all possible values.
|
||||
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
||||
* for 12-bit samples it is still acceptable. It's not very reasonable for
|
||||
* 16-bit samples, but if you want lossless storage you shouldn't be changing
|
||||
* colorspace anyway.
|
||||
* The Cr=>R and Cb=>B values can be rounded to integers in advance; the
|
||||
* values for the G calculation are left scaled up, since we must add them
|
||||
* together before rounding.
|
||||
*/
|
||||
|
||||
#define SCALEBITS 16 /* speediest right-shift on some machines */
|
||||
#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
|
||||
#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
|
||||
|
||||
/* We allocate one big table for RGB->Y conversion and divide it up into
|
||||
* three parts, instead of doing three alloc_small requests. This lets us
|
||||
* use a single table base address, which can be held in a register in the
|
||||
* inner loops on many machines (more than can hold all three addresses,
|
||||
* anyway).
|
||||
*/
|
||||
|
||||
#define R_Y_OFF 0 /* offset to R => Y section */
|
||||
#define G_Y_OFF (1 * (MAXJSAMPLE + 1)) /* offset to G => Y section */
|
||||
#define B_Y_OFF (2 * (MAXJSAMPLE + 1)) /* etc. */
|
||||
#define TABLE_SIZE (3 * (MAXJSAMPLE + 1))
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions */
|
||||
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extrgb_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extrgb_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extrgb_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extrgbx_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extrgbx_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extrgbx_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extbgr_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extbgr_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extbgr_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extbgrx_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extbgrx_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extbgrx_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extxbgr_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extxbgr_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extxbgr_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define ycc_rgb_convert_internal ycc_extxrgb_convert_internal
|
||||
#define gray_rgb_convert_internal gray_extxrgb_convert_internal
|
||||
#define rgb_rgb_convert_internal rgb_extxrgb_convert_internal
|
||||
#include "jdcolext.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef ycc_rgb_convert_internal
|
||||
#undef gray_rgb_convert_internal
|
||||
#undef rgb_rgb_convert_internal
|
||||
|
||||
|
||||
/*
|
||||
* Initialize tables for YCC->RGB colorspace conversion.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
build_ycc_rgb_table(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
int i;
|
||||
JLONG x;
|
||||
SHIFT_TEMPS
|
||||
|
||||
cconvert->Cr_r_tab = (int *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(MAXJSAMPLE + 1) * sizeof(int));
|
||||
cconvert->Cb_b_tab = (int *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(MAXJSAMPLE + 1) * sizeof(int));
|
||||
cconvert->Cr_g_tab = (JLONG *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(MAXJSAMPLE + 1) * sizeof(JLONG));
|
||||
cconvert->Cb_g_tab = (JLONG *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(MAXJSAMPLE + 1) * sizeof(JLONG));
|
||||
|
||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||
/* 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 */
|
||||
/* Cr=>R value is nearest int to 1.40200 * x */
|
||||
cconvert->Cr_r_tab[i] = (int)
|
||||
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
|
||||
/* Cb=>B value is nearest int to 1.77200 * x */
|
||||
cconvert->Cb_b_tab[i] = (int)
|
||||
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
|
||||
/* Cr=>G value is scaled-up -0.71414 * x */
|
||||
cconvert->Cr_g_tab[i] = (-FIX(0.71414)) * x;
|
||||
/* Cb=>G value is scaled-up -0.34414 * x */
|
||||
/* We also add in ONE_HALF so that need not do it in inner loop */
|
||||
cconvert->Cb_g_tab[i] = (-FIX(0.34414)) * x + ONE_HALF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert some rows of samples to the output colorspace.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
ycc_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
ycc_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
ycc_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
ycc_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
ycc_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
ycc_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
ycc_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************** Cases other than YCbCr -> RGB **************/
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for RGB->grayscale colorspace conversion.
|
||||
*/
|
||||
|
||||
LOCAL(void)
|
||||
build_rgb_y_table(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
JLONG *rgb_y_tab;
|
||||
JLONG i;
|
||||
|
||||
/* Allocate and fill in the conversion tables. */
|
||||
cconvert->rgb_y_tab = rgb_y_tab = (JLONG *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
(TABLE_SIZE * sizeof(JLONG)));
|
||||
|
||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||
rgb_y_tab[i + R_Y_OFF] = FIX(0.29900) * i;
|
||||
rgb_y_tab[i + G_Y_OFF] = FIX(0.58700) * i;
|
||||
rgb_y_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert RGB to grayscale.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_gray_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int r, g, b;
|
||||
register JLONG *ctab = cconvert->rgb_y_tab;
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
r = GETJSAMPLE(inptr0[col]);
|
||||
g = GETJSAMPLE(inptr1[col]);
|
||||
b = GETJSAMPLE(inptr2[col]);
|
||||
/* Y */
|
||||
outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
|
||||
ctab[b + B_Y_OFF]) >> SCALEBITS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Color conversion for no colorspace change: just copy the data,
|
||||
* converting from separate-planes to interleaved representation.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
null_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;
|
||||
register JDIMENSION col;
|
||||
register int num_components = cinfo->num_components;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
int ci;
|
||||
|
||||
if (num_components == 3) {
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
*outptr++ = inptr0[col];
|
||||
*outptr++ = inptr1[col];
|
||||
*outptr++ = inptr2[col];
|
||||
}
|
||||
}
|
||||
} else if (num_components == 4) {
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
inptr3 = input_buf[3][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
*outptr++ = inptr0[col];
|
||||
*outptr++ = inptr1[col];
|
||||
*outptr++ = inptr2[col];
|
||||
*outptr++ = inptr3[col];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
while (--num_rows >= 0) {
|
||||
for (ci = 0; ci < num_components; ci++) {
|
||||
inptr = input_buf[ci][input_row];
|
||||
outptr = *output_buf;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
outptr[ci] = inptr[col];
|
||||
outptr += num_components;
|
||||
}
|
||||
}
|
||||
output_buf++;
|
||||
input_row++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Color conversion for grayscale: just copy the data.
|
||||
* This also works for YCbCr -> grayscale conversion, in which
|
||||
* we just copy the Y (luminance) component and ignore chrominance.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
grayscale_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
jcopy_sample_rows(input_buf[0], (int)input_row, output_buf, 0, num_rows,
|
||||
cinfo->output_width);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert grayscale to RGB
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
gray_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
gray_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
gray_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert plain RGB to extended RGB
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
default:
|
||||
rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
|
||||
num_rows);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Adobe-style YCCK->CMYK conversion.
|
||||
* We convert YCbCr to R=1-C, G=1-M, and B=1-Y using the same
|
||||
* conversion as above, while passing K (black) unchanged.
|
||||
* We assume build_ycc_rgb_table has been called.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2, inptr3;
|
||||
register JDIMENSION col;
|
||||
JDIMENSION num_cols = cinfo->output_width;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE *range_limit = cinfo->sample_range_limit;
|
||||
register int *Crrtab = cconvert->Cr_r_tab;
|
||||
register int *Cbbtab = cconvert->Cb_b_tab;
|
||||
register JLONG *Crgtab = cconvert->Cr_g_tab;
|
||||
register JLONG *Cbgtab = cconvert->Cb_g_tab;
|
||||
SHIFT_TEMPS
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
inptr3 = input_buf[3][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
for (col = 0; col < num_cols; col++) {
|
||||
y = GETJSAMPLE(inptr0[col]);
|
||||
cb = GETJSAMPLE(inptr1[col]);
|
||||
cr = GETJSAMPLE(inptr2[col]);
|
||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
||||
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
|
||||
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
|
||||
((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||
SCALEBITS)))];
|
||||
outptr[2] = range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; /* blue */
|
||||
/* K passes through unchanged */
|
||||
outptr[3] = inptr3[col]; /* don't need GETJSAMPLE here */
|
||||
outptr += 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(int *)(addr)) = pixels)
|
||||
|
||||
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
|
||||
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
|
||||
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
|
||||
|
||||
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficient for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
#define DITHER_ROTATE(x) ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF))
|
||||
static const JLONG dither_matrix[4] = {
|
||||
0x0008020A,
|
||||
0x0C040E06,
|
||||
0x030B0109,
|
||||
0x0F070D05
|
||||
};
|
||||
|
||||
|
||||
static INLINE boolean is_big_endian(void)
|
||||
{
|
||||
int test_value = 1;
|
||||
if (*(char *)&test_value != 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Include inline routines for RGB565 conversion */
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_LE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE
|
||||
#define ycc_rgb565_convert_internal ycc_rgb565_convert_le
|
||||
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_le
|
||||
#define rgb_rgb565_convert_internal rgb_rgb565_convert_le
|
||||
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_le
|
||||
#define gray_rgb565_convert_internal gray_rgb565_convert_le
|
||||
#define gray_rgb565D_convert_internal gray_rgb565D_convert_le
|
||||
#include "jdcol565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef ycc_rgb565_convert_internal
|
||||
#undef ycc_rgb565D_convert_internal
|
||||
#undef rgb_rgb565_convert_internal
|
||||
#undef rgb_rgb565D_convert_internal
|
||||
#undef gray_rgb565_convert_internal
|
||||
#undef gray_rgb565D_convert_internal
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_BE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE
|
||||
#define ycc_rgb565_convert_internal ycc_rgb565_convert_be
|
||||
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_be
|
||||
#define rgb_rgb565_convert_internal rgb_rgb565_convert_be
|
||||
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_be
|
||||
#define gray_rgb565_convert_internal gray_rgb565_convert_be
|
||||
#define gray_rgb565D_convert_internal gray_rgb565D_convert_be
|
||||
#include "jdcol565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef ycc_rgb565_convert_internal
|
||||
#undef ycc_rgb565D_convert_internal
|
||||
#undef rgb_rgb565_convert_internal
|
||||
#undef rgb_rgb565D_convert_internal
|
||||
#undef gray_rgb565_convert_internal
|
||||
#undef gray_rgb565D_convert_internal
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
ycc_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
ycc_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
rgb_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
rgb_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
gray_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565D_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
gray_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Empty method for start_pass.
|
||||
*/
|
||||
|
||||
METHODDEF(void)
|
||||
start_pass_dcolor(j_decompress_ptr cinfo)
|
||||
{
|
||||
/* no work needed */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Module initialization routine for output colorspace conversion.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jinit_color_deconverter(j_decompress_ptr cinfo)
|
||||
{
|
||||
my_cconvert_ptr cconvert;
|
||||
int ci;
|
||||
|
||||
cconvert = (my_cconvert_ptr)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
|
||||
sizeof(my_color_deconverter));
|
||||
cinfo->cconvert = (struct jpeg_color_deconverter *)cconvert;
|
||||
cconvert->pub.start_pass = start_pass_dcolor;
|
||||
|
||||
/* Make sure num_components agrees with jpeg_color_space */
|
||||
switch (cinfo->jpeg_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
if (cinfo->num_components != 1)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
case JCS_YCbCr:
|
||||
if (cinfo->num_components != 3)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
case JCS_YCCK:
|
||||
if (cinfo->num_components != 4)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
break;
|
||||
|
||||
default: /* JCS_UNKNOWN can be anything */
|
||||
if (cinfo->num_components < 1)
|
||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Set out_color_components and conversion method based on requested space.
|
||||
* Also clear the component_needed flags for any unused components,
|
||||
* so that earlier pipeline stages can avoid useless computation.
|
||||
*/
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_GRAYSCALE:
|
||||
cinfo->out_color_components = 1;
|
||||
if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
|
||||
cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
cconvert->pub.color_convert = grayscale_convert;
|
||||
/* For color->grayscale conversion, only the Y (0) component is needed */
|
||||
for (ci = 1; ci < cinfo->num_components; ci++)
|
||||
cinfo->comp_info[ci].component_needed = FALSE;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
||||
cconvert->pub.color_convert = rgb_gray_convert;
|
||||
build_rgb_y_table(cinfo);
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_RGB:
|
||||
case JCS_EXT_RGB:
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_BGR:
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_RGBA:
|
||||
case JCS_EXT_BGRA:
|
||||
case JCS_EXT_ABGR:
|
||||
case JCS_EXT_ARGB:
|
||||
cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
|
||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
if (jsimd_can_ycc_rgb())
|
||||
cconvert->pub.color_convert = jsimd_ycc_rgb_convert;
|
||||
else {
|
||||
cconvert->pub.color_convert = ycc_rgb_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
}
|
||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
||||
cconvert->pub.color_convert = gray_rgb_convert;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
||||
if (rgb_red[cinfo->out_color_space] == 0 &&
|
||||
rgb_green[cinfo->out_color_space] == 1 &&
|
||||
rgb_blue[cinfo->out_color_space] == 2 &&
|
||||
rgb_pixelsize[cinfo->out_color_space] == 3)
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
else
|
||||
cconvert->pub.color_convert = rgb_rgb_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
case JCS_RGB565:
|
||||
cinfo->out_color_components = 3;
|
||||
if (cinfo->dither_mode == JDITHER_NONE) {
|
||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
if (jsimd_can_ycc_rgb565())
|
||||
cconvert->pub.color_convert = jsimd_ycc_rgb565_convert;
|
||||
else {
|
||||
cconvert->pub.color_convert = ycc_rgb565_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
}
|
||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
||||
cconvert->pub.color_convert = gray_rgb565_convert;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
||||
cconvert->pub.color_convert = rgb_rgb565_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
} else {
|
||||
/* only ordered dithering is supported */
|
||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
cconvert->pub.color_convert = ycc_rgb565D_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
||||
cconvert->pub.color_convert = gray_rgb565D_convert;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
||||
cconvert->pub.color_convert = rgb_rgb565D_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
}
|
||||
break;
|
||||
|
||||
case JCS_CMYK:
|
||||
cinfo->out_color_components = 4;
|
||||
if (cinfo->jpeg_color_space == JCS_YCCK) {
|
||||
cconvert->pub.color_convert = ycck_cmyk_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
} else if (cinfo->jpeg_color_space == JCS_CMYK) {
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Permit null conversion to same output space */
|
||||
if (cinfo->out_color_space == cinfo->jpeg_color_space) {
|
||||
cinfo->out_color_components = cinfo->num_components;
|
||||
cconvert->pub.color_convert = null_convert;
|
||||
} else /* unsupported non-null conversion */
|
||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||
break;
|
||||
}
|
||||
|
||||
if (cinfo->quantize_colors)
|
||||
cinfo->output_components = 1; /* single colormapped output component */
|
||||
else
|
||||
cinfo->output_components = cinfo->out_color_components;
|
||||
}
|
||||
Vendored
+208
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* jdct.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This include file contains common declarations for the forward and
|
||||
* inverse DCT modules. These declarations are private to the DCT managers
|
||||
* (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
|
||||
* The individual DCT algorithms are kept in separate files to ease
|
||||
* machine-dependent tuning (e.g., assembly coding).
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* A forward DCT routine is given a pointer to a work area of type DCTELEM[];
|
||||
* the DCT is to be performed in-place in that buffer. Type DCTELEM is int
|
||||
* for 8-bit samples, JLONG for 12-bit samples. (NOTE: Floating-point DCT
|
||||
* implementations use an array of type FAST_FLOAT, instead.)
|
||||
* The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
|
||||
* The DCT outputs are returned scaled up by a factor of 8; they therefore
|
||||
* have a range of +-8K for 8-bit data, +-128K for 12-bit data. This
|
||||
* convention improves accuracy in integer implementations and saves some
|
||||
* work in floating-point ones.
|
||||
* Quantization of the output coefficients is done by jcdctmgr.c. This
|
||||
* step requires an unsigned type and also one with twice the bits.
|
||||
*/
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
#ifndef WITH_SIMD
|
||||
typedef int DCTELEM; /* 16 or 32 bits is fine */
|
||||
typedef unsigned int UDCTELEM;
|
||||
typedef unsigned long long UDCTELEM2;
|
||||
#else
|
||||
typedef short DCTELEM; /* prefer 16 bit with SIMD for parellelism */
|
||||
typedef unsigned short UDCTELEM;
|
||||
typedef unsigned int UDCTELEM2;
|
||||
#endif
|
||||
#else
|
||||
typedef JLONG DCTELEM; /* must have 32 bits */
|
||||
typedef unsigned long long UDCTELEM2;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
|
||||
* to an output sample array. The routine must dequantize the input data as
|
||||
* well as perform the IDCT; for dequantization, it uses the multiplier table
|
||||
* pointed to by compptr->dct_table. The output data is to be placed into the
|
||||
* sample array starting at a specified column. (Any row offset needed will
|
||||
* be applied to the array pointer before it is passed to the IDCT code.)
|
||||
* Note that the number of samples emitted by the IDCT routine is
|
||||
* DCT_scaled_size * DCT_scaled_size.
|
||||
*/
|
||||
|
||||
/* typedef inverse_DCT_method_ptr is declared in jpegint.h */
|
||||
|
||||
/*
|
||||
* Each IDCT routine has its own ideas about the best dct_table element type.
|
||||
*/
|
||||
|
||||
typedef MULTIPLIER ISLOW_MULT_TYPE; /* short or int, whichever is faster */
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
typedef MULTIPLIER IFAST_MULT_TYPE; /* 16 bits is OK, use short if faster */
|
||||
#define IFAST_SCALE_BITS 2 /* fractional bits in scale factors */
|
||||
#else
|
||||
typedef JLONG IFAST_MULT_TYPE; /* need 32 bits for scaled quantizers */
|
||||
#define IFAST_SCALE_BITS 13 /* fractional bits in scale factors */
|
||||
#endif
|
||||
typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
|
||||
|
||||
|
||||
/*
|
||||
* Each IDCT routine is responsible for range-limiting its results and
|
||||
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
||||
* be quite far out of range if the input data is corrupt, so a bulletproof
|
||||
* range-limiting step is required. We use a mask-and-table-lookup method
|
||||
* to do the combined operations quickly. See the comments with
|
||||
* prepare_range_limit_table (in jdmaster.c) for more info.
|
||||
*/
|
||||
|
||||
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
|
||||
|
||||
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
|
||||
|
||||
|
||||
/* Extern declarations for the forward and inverse DCT routines. */
|
||||
|
||||
EXTERN(void) jpeg_fdct_islow(DCTELEM *data);
|
||||
EXTERN(void) jpeg_fdct_ifast(DCTELEM *data);
|
||||
EXTERN(void) jpeg_fdct_float(FAST_FLOAT *data);
|
||||
|
||||
EXTERN(void) jpeg_idct_islow(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_ifast(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_float(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_7x7(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_6x6(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_5x5(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_4x4(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_3x3(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_2x2(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_1x1(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_9x9(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_10x10(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_11x11(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_12x12(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_13x13(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_14x14(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_15x15(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
EXTERN(void) jpeg_idct_16x16(j_decompress_ptr cinfo,
|
||||
jpeg_component_info *compptr, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col);
|
||||
|
||||
|
||||
/*
|
||||
* Macros for handling fixed-point arithmetic; these are used by many
|
||||
* but not all of the DCT/IDCT modules.
|
||||
*
|
||||
* All values are expected to be of type JLONG.
|
||||
* Fractional constants are scaled left by CONST_BITS bits.
|
||||
* CONST_BITS is defined within each module using these macros,
|
||||
* and may differ from one module to the next.
|
||||
*/
|
||||
|
||||
#define ONE ((JLONG)1)
|
||||
#define CONST_SCALE (ONE << CONST_BITS)
|
||||
|
||||
/* Convert a positive real constant to an integer scaled by CONST_SCALE.
|
||||
* Caution: some C compilers fail to reduce "FIX(constant)" at compile time,
|
||||
* thus causing a lot of useless floating-point operations at run time.
|
||||
*/
|
||||
|
||||
#define FIX(x) ((JLONG)((x) * CONST_SCALE + 0.5))
|
||||
|
||||
/* Descale and correctly round a JLONG 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 a JLONG variable by a JLONG constant to yield a JLONG result.
|
||||
* 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
|
||||
* full 32x32 multiply. This provides a useful speedup on many machines.
|
||||
* Unfortunately there is no way to specify a 16x16->32 multiply portably
|
||||
* in C, but some C compilers will do the right thing if you provide the
|
||||
* correct combination of casts.
|
||||
*/
|
||||
|
||||
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
|
||||
#define MULTIPLY16C16(var, const) (((INT16)(var)) * ((INT16)(const)))
|
||||
#endif
|
||||
#ifdef SHORTxLCONST_32 /* known to work with Microsoft C 6.0 */
|
||||
#define MULTIPLY16C16(var, const) (((INT16)(var)) * ((JLONG)(const)))
|
||||
#endif
|
||||
|
||||
#ifndef MULTIPLY16C16 /* default definition */
|
||||
#define MULTIPLY16C16(var, const) ((var) * (const))
|
||||
#endif
|
||||
|
||||
/* Same except both inputs are variables. */
|
||||
|
||||
#ifdef SHORTxSHORT_32 /* may work if 'int' is 32 bits */
|
||||
#define MULTIPLY16V16(var1, var2) (((INT16)(var1)) * ((INT16)(var2)))
|
||||
#endif
|
||||
|
||||
#ifndef MULTIPLY16V16 /* default definition */
|
||||
#define MULTIPLY16V16(var1, var2) ((var1) * (var2))
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user