mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Compare commits
1998 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 01b2c5a77c | |||
| 3a45a65625 | |||
| 0812207db7 | |||
| cf2a3c8e74 | |||
| 1cc1e6fa56 | |||
| 277f0d270f | |||
| 6216bf9221 | |||
| 388a7ce86e | |||
| 5d95a500ad | |||
| 95341c2b1b | |||
| 54063c40de | |||
| 585593e9fc | |||
| f15e885baf | |||
| 9109cb1ec6 | |||
| dc9ee53ff5 | |||
| 1485968fc4 | |||
| 557ac3dbaf | |||
| 09134ac881 | |||
| 433c5199fd | |||
| d448a636f8 | |||
| 396f43d674 | |||
| 3c5fec6746 | |||
| e12b1c2209 | |||
| f6b2b49e4a | |||
| e1322cf503 | |||
| 67dfdee33f | |||
| 61c4cfd896 | |||
| be17f532e1 | |||
| 6d85fa3fd2 | |||
| 95a07ca11c | |||
| 222a48577f | |||
| 353273579b | |||
| 72c5ac37de | |||
| 1eba7f60c2 | |||
| 7373ef0983 | |||
| 2740901378 | |||
| 0c00d082cf | |||
| e661ad2a67 | |||
| 3a4b79173b | |||
| bdc29cccb6 | |||
| 8d78400052 | |||
| b4b4d21212 | |||
| 99502e99cc | |||
| 99436bb8cf | |||
| 7465125f67 | |||
| 340df65fb4 | |||
| 9a463b74dc | |||
| c303aaa94d | |||
| c920b45fb8 | |||
| 2a9a2fff66 | |||
| b0563ce368 | |||
| 673eb2b006 | |||
| ef395c3866 | |||
| 4d3d6230c5 | |||
| a28a520c7f | |||
| 0aac17d9f7 | |||
| ea34b2fefb | |||
| f44a0960df | |||
| b1ed003d08 | |||
| 22d930998b | |||
| d2b0953735 | |||
| 978666c816 | |||
| fa002bde01 | |||
| 13c4dc0e69 | |||
| ad4e5dbd3d | |||
| 0b4c101e8a | |||
| 2d63861c09 | |||
| e8c7d61752 | |||
| 4e8cd4629c | |||
| 467c3ef0ac | |||
| b1f390b170 | |||
| 154fdef965 | |||
| 2f665ec589 | |||
| 801f26c35d | |||
| 6db9f00fd1 | |||
| 39b64fc7d7 | |||
| 4dfa798e75 | |||
| 2aeb32d2d1 | |||
| 8433620295 | |||
| 760e9e0943 | |||
| 7b82ad2918 | |||
| 49d8c0bd52 | |||
| 8253562794 | |||
| d7e839b8c5 | |||
| 2fb1d9d02e | |||
| 4cdb4652cf | |||
| 0fb4f2cc9c | |||
| 183e4d50ed | |||
| 020be63df5 | |||
| 377dd04224 | |||
| 31d624f9a8 | |||
| bf224e61a9 | |||
| 8ac333697d | |||
| dbb30134bc | |||
| 847190b5b8 | |||
| 0f31231872 | |||
| b76aeb40fb | |||
| 8fe9674301 | |||
| 66cf55ea1f | |||
| 4b47c7dbd2 | |||
| 221ddec845 | |||
| 2160f9b20e | |||
| e63af185de | |||
| 11d565ca62 | |||
| 8d69dbdf49 | |||
| 14da5ec311 | |||
| 9cc9237522 | |||
| 25ab141b93 | |||
| 718d7e4b04 | |||
| ca68fac4b2 | |||
| 034a43e7f7 | |||
| ca23c0e630 | |||
| 1d7bfcc958 | |||
| 01ea055d79 | |||
| df74eb4ff6 | |||
| c48473dfe4 | |||
| 77d1c20fb7 | |||
| 05d4975619 | |||
| d4d95bd70d | |||
| 7e7bb3027c | |||
| 8f49b820db | |||
| 3b2e409fa7 | |||
| 1c2ed2876f | |||
| 7f0d90a525 | |||
| 71ec112093 | |||
| e021b85b36 | |||
| 9ea62bfddb | |||
| 00925ad795 | |||
| 683910f579 | |||
| 2645ee90ca | |||
| 0e6ce50131 | |||
| ff70b02efc | |||
| 9b64eadcb6 | |||
| 2a52e44bc6 | |||
| 3af63fe052 | |||
| 3d36f9044d | |||
| a1230ad0a0 | |||
| 448a5452d0 | |||
| 4cebef9090 | |||
| 7080c783d1 | |||
| d3b68b059b | |||
| 866b15ddb8 | |||
| 7d1c42afe1 | |||
| d594e72586 | |||
| 4e56c1326f | |||
| 3ba6b41961 | |||
| 034a5f140c | |||
| 3a99ebb446 | |||
| c1a8fb72b7 | |||
| 11b08b5ff3 | |||
| 850414a501 | |||
| a560ebf09d | |||
| 72fedbe096 | |||
| d00e58cdb0 | |||
| 9f82b74788 | |||
| 764e8ac2c4 | |||
| 612746b4e5 | |||
| 83e1d79403 | |||
| 155b751a75 | |||
| 4966186e10 | |||
| 510a8520c7 | |||
| 09fe66e87f | |||
| 3c85745e22 | |||
| b7ecaceda8 | |||
| 3befdb4ae8 | |||
| db95aec4a7 | |||
| 490908f0ff | |||
| 27b71d6368 | |||
| 9b3be01b83 | |||
| 0bcdf7d03e | |||
| 44560c3e50 | |||
| b927ce18b2 | |||
| 969cc3dd95 | |||
| 198b5096aa | |||
| e0a9468488 | |||
| 7e637c134f | |||
| 619180dffd | |||
| 6d113bd03f | |||
| a76c72acdd | |||
| e9655cf646 | |||
| 34530da66e | |||
| 6271192a32 | |||
| 3a2f40ac6f | |||
| 094a5b0cba | |||
| a55cc07548 | |||
| c9296e599f | |||
| b33ff22988 | |||
| 880d2afb67 | |||
| 9e332dc5fb | |||
| a694e5074f | |||
| 90a4d67e8d | |||
| 23bc89d6fc | |||
| 73ddc091a2 | |||
| bce9837604 | |||
| f3a50224f2 | |||
| d4a17da7b2 | |||
| 4f288a1e28 | |||
| fd09413566 | |||
| ad16c243ca | |||
| da6ad1c640 | |||
| 9ed1332355 | |||
| 90ec651bd7 | |||
| 0aa5391c4b | |||
| 57cf120118 | |||
| 0b85d0ec68 | |||
| e18d5e94c7 | |||
| bc036e1e86 | |||
| 219ef95dd8 | |||
| 8ed89bae84 | |||
| 124bf8339f | |||
| 29d214474f | |||
| 4d0f13544d | |||
| a5ca5f6daf | |||
| b1b78aedd2 | |||
| 9214103564 | |||
| 599a595c6f | |||
| 8559237d4e | |||
| 8808aaccff | |||
| 831153d5fb | |||
| 333a767be4 | |||
| 5012fc5d23 | |||
| f00607c8ac | |||
| 8c24af66bd | |||
| 7ffab23a53 | |||
| 4a39b12a78 | |||
| 1bc607e8d8 | |||
| 98db891851 | |||
| 1f48940a93 | |||
| edcc762f7a | |||
| db5f1c3554 | |||
| 9c4b1d0a51 | |||
| 98b5fb4b9f | |||
| d2cc30e2a5 | |||
| e93c51762b | |||
| b16c1096d1 | |||
| 4d8d152461 | |||
| cc0066d38d | |||
| 5bbe116f89 | |||
| b17e9c614b | |||
| 45d073f889 | |||
| 85c97f772c | |||
| af9ded89d0 | |||
| c13a62ce10 | |||
| d8dea7896b | |||
| 09df7810d1 | |||
| 95aa6d7307 | |||
| 2617c9aa64 | |||
| f48c84eaee | |||
| 84bb67e49b | |||
| 9e4b1d5a75 | |||
| f2d3edec80 | |||
| 53c0189ed7 | |||
| bf96d8239d | |||
| 64588dff46 | |||
| f9bd025722 | |||
| a5d0c7b02c | |||
| 53a853c3c9 | |||
| 43a907ddda | |||
| c2f5f5a202 | |||
| 5e082ab852 | |||
| fce6e7248e | |||
| d54d01ca46 | |||
| 2b96a485e7 | |||
| 8eafddf211 | |||
| 1540ae340f | |||
| 8b5efc6f4c | |||
| c23ab37355 | |||
| 95f0c9b19b | |||
| 01048e5603 | |||
| 102ef39a27 | |||
| 966c2191cb | |||
| 8f3867756c | |||
| b29512032a | |||
| a0f5eb282c | |||
| 07b475062f | |||
| a41cbbdc99 | |||
| 8b2c499be6 | |||
| c87b99e82b | |||
| 96b26dc8f4 | |||
| 4fdf4d380c | |||
| 150c29356a | |||
| 8177adbd54 | |||
| 30331eef4b | |||
| 1f695c4532 | |||
| e007d93d93 | |||
| 77dd40c96c | |||
| f3eef792eb | |||
| 4d14307f5d | |||
| 450b96510e | |||
| 4b0d3316f6 | |||
| 7ac7aca33b | |||
| 6713063a8d | |||
| 331a96c670 | |||
| 1602a38fa9 | |||
| dae1fc8889 | |||
| a6ef9b4584 | |||
| e970eccbf1 | |||
| 5ad9e5f9bc | |||
| 3a546aa380 | |||
| d67a6c1be4 | |||
| d84360e7f3 | |||
| f81fdd58da | |||
| a6f3a21256 | |||
| f3237fdc6e | |||
| cc259e49f6 | |||
| a8c257cecb | |||
| 9a4cafa319 | |||
| c41f50f5f7 | |||
| e48ae883e9 | |||
| 0a91261c7f | |||
| d81a0da3e0 | |||
| ef93aea0da | |||
| 2a6637afdf | |||
| 3efa78311a | |||
| d4422e473a | |||
| aaf9297592 | |||
| 1159453139 | |||
| fb13b87285 | |||
| aa2777ed61 | |||
| 8a588f2c0b | |||
| 1dd24eeec0 | |||
| 5eec3be850 | |||
| 236e3868df | |||
| c3264aa83c | |||
| 9d0f16e8fe | |||
| 867c922bcc | |||
| 41f444a230 | |||
| a631196155 | |||
| e13a73d084 | |||
| 98d96f2cc8 | |||
| bd6ab6d38e | |||
| 80aaed73e6 | |||
| db9f4436e0 | |||
| cd53144ed3 | |||
| f791cf825f | |||
| eb14f9a464 | |||
| 0a691f7840 | |||
| 8ecfb59930 | |||
| 69944cd46b | |||
| 6c8f50d1f3 | |||
| 8d078f63a9 | |||
| bcc9946650 | |||
| d4a28f3bf6 | |||
| 55cdeaa6dd | |||
| 7d998336d3 | |||
| 6ad390a1cd | |||
| 3c2e5583d2 | |||
| d64529f6de | |||
| 3cc07a4411 | |||
| ac0a14631d | |||
| 745153098a | |||
| 981e63d8c2 | |||
| d0d676929d | |||
| 4dffcbd9f0 | |||
| 6d75be03f9 | |||
| fb781834f5 | |||
| 6eba1a4d44 | |||
| fa4871b013 | |||
| 8dd0fd8a13 | |||
| 5baa2c0706 | |||
| 225566da7b | |||
| 0cb3bf95f1 | |||
| d917f889b1 | |||
| e50acb923e | |||
| 4e4dfffe06 | |||
| 85a59ef292 | |||
| f67c8e37d6 | |||
| 17fe63446f | |||
| 0673866ceb | |||
| 0dd1ce1a4f | |||
| c56e91dcc0 | |||
| 5c6d319ebc | |||
| 20fb9281f4 | |||
| edaf4e0104 | |||
| 005f38fb45 | |||
| a173ea36f7 | |||
| e569e9dcbd | |||
| 01c1b341a8 | |||
| 4d291c06f6 | |||
| a9a33d9a5f | |||
| 57c9991413 | |||
| 8519db8efb | |||
| 174022547f | |||
| 579dcf12bd | |||
| f05d5888c9 | |||
| bf2f7b0f8b | |||
| 84c29dce77 | |||
| 126b0d855f | |||
| ac9f8c1f41 | |||
| 86e5e8d765 | |||
| 27edba495a | |||
| 0d456f9111 | |||
| 591f427003 | |||
| 2ced568d34 | |||
| ecbba852cf | |||
| 48c8c95381 | |||
| cd2d6ac935 | |||
| a4bd7506a5 | |||
| 70cbc3d883 | |||
| ec033330df | |||
| e037800e46 | |||
| 7e6bdbad9b | |||
| 5542dcb2bc | |||
| bd531bd828 | |||
| 8facf61bed | |||
| 560f85f8e5 | |||
| f856c964e2 | |||
| 223790e6fc | |||
| 5429b1f5ff | |||
| 24166ac402 | |||
| 02f8a9470a | |||
| 4a19ac5aca | |||
| 4af55e64e9 | |||
| 5790810c3a | |||
| acc089ca64 | |||
| 282a15c9f9 | |||
| 5d01821d9f | |||
| f8f74fc4ae | |||
| 0853085ec6 | |||
| e83438c23d | |||
| 3d5ca3ef75 | |||
| 043b9fbb31 | |||
| 76c21b73aa | |||
| 4d2da2debe | |||
| 84895d2566 | |||
| 4b2363de5c | |||
| ffaf15d0d9 | |||
| 4b35112022 | |||
| bd66f76fea | |||
| 5265db82c7 | |||
| d9474648f0 | |||
| d0e02cccba | |||
| 0687cffe21 | |||
| 504cd8a9f5 | |||
| a3ae69893c | |||
| 55b03dcaba | |||
| 1358c0ae66 | |||
| a6359e49d2 | |||
| f4147c99c8 | |||
| 6670e6b0bb | |||
| 814a5cec41 | |||
| e5ed22bd5b | |||
| 3d14dd4e39 | |||
| 3019927a61 | |||
| 881cee4d8f | |||
| 7e5b5390ba | |||
| b21a861c5b | |||
| 35c24480ae | |||
| 16d8e9e0c8 | |||
| 3fe9dfaa2e | |||
| 832ca0734d | |||
| 15e1acaf67 | |||
| 8b3042da63 | |||
| 8af87d5792 | |||
| 6bc953e911 | |||
| fada959b4b | |||
| c6936f5a77 | |||
| d825caf18e | |||
| 998e355b97 | |||
| 7dad0f23d6 | |||
| 97455f1593 | |||
| 08ba63da02 | |||
| d42e04d0df | |||
| 80ade96c8c | |||
| 00830d9dd8 | |||
| 4e577b8d3c | |||
| 61b6d40539 | |||
| bb91e6999b | |||
| f29bc22005 | |||
| ac30620344 | |||
| 8128f6284a | |||
| 2c0ebf36a9 | |||
| b3a07166ba | |||
| 301626ba26 | |||
| 886220b9be | |||
| 55d54b56bf | |||
| 282fcb90dc | |||
| 09b3383a7e | |||
| b4316af834 | |||
| a696348ec5 | |||
| 3b54ebec3f | |||
| 16b13c6e3b | |||
| f429cee5d1 | |||
| 90e4907b0b | |||
| fb3a334bbe | |||
| 2bd9488475 | |||
| d85e67d3ec | |||
| c30af724ef | |||
| 3e2d8ca0a1 | |||
| 1f8802b94d | |||
| 8b9e8a805d | |||
| 2b9cfe1e1c | |||
| 358139b6b9 | |||
| c6a622542d | |||
| 4ecbcf0885 | |||
| 2638c5e9b7 | |||
| ed377ac1e8 | |||
| ced3df73da | |||
| 4057e81b76 | |||
| 24ca53183d | |||
| fd369a5004 | |||
| f6137292f1 | |||
| a90dacdf75 | |||
| d92a883de1 | |||
| f6a8f7859c | |||
| 4e2ef8c8f5 | |||
| 7cd3615f9f | |||
| 7c741f54fa | |||
| 0d896af8ec | |||
| afc8dd5661 | |||
| 52f930cca7 | |||
| 4cb9faf6c9 | |||
| a67228cd73 | |||
| f4daf14bfa | |||
| abe2ca886d | |||
| 4b93820880 | |||
| be86338a79 | |||
| c1c84d2fd1 | |||
| 3f27f8cf41 | |||
| 31289d2f32 | |||
| f163778da7 | |||
| 8f1e36f7c1 | |||
| 4cc458eb10 | |||
| 55f2370f36 | |||
| a718f2e6ea | |||
| fb61f88b9c | |||
| 38e6d668b1 | |||
| 2c21ea2dd7 | |||
| a9f3acb125 | |||
| 993b9af756 | |||
| e180cc050b | |||
| ea31a14cc5 | |||
| c75d93337e | |||
| 1e32781b54 | |||
| 9ed372b297 | |||
| 4625337179 | |||
| e9e3af0aaa | |||
| a33d50084d | |||
| 7eba3a7c96 | |||
| 1a74de1f9c | |||
| 2d778434f1 | |||
| e57ceea3d3 | |||
| 8b43861217 | |||
| 7d484d21f7 | |||
| 74bc8d351c | |||
| 1f2b2c5242 | |||
| 178c4810e6 | |||
| e4a64760db | |||
| c1cdb2416a | |||
| 40ac72a8f1 | |||
| 43a91f82fe | |||
| ccfca869e5 | |||
| f6ec467f19 | |||
| 039f5ca42e | |||
| 1996ae4a42 | |||
| bb93066558 | |||
| f954f0830c | |||
| dec25e8531 | |||
| 7b28d5b409 | |||
| 1df148aae9 | |||
| 48eecafc89 | |||
| 76cfa65d55 | |||
| ef290366b0 | |||
| b4759d7272 | |||
| 8aebef2459 | |||
| 7b12cbd7dc | |||
| 01f97f150c | |||
| 17a35587e1 | |||
| d76f24567b | |||
| 752653c70b | |||
| 03a602b6ef | |||
| 523f081923 | |||
| 9572895da0 | |||
| 515ec6b98a | |||
| 9ec3d76b21 | |||
| c4c94f891e | |||
| d16cf68a3b | |||
| 4ebd91e637 | |||
| f9c514b391 | |||
| ccb7253818 | |||
| badd0d1ff4 | |||
| 8b55f476be | |||
| 659ffaddb4 | |||
| 07729e396d | |||
| d064079a4e | |||
| cf477f7e9f | |||
| 543e0302d3 | |||
| ffa72fc979 | |||
| 2da7360b63 | |||
| 16bc505d26 | |||
| 6e33769e56 | |||
| 89d3f95a8e | |||
| bda89a6469 | |||
| ee4feb4b09 | |||
| 1fac1421e5 | |||
| 4de1efd3c8 | |||
| 5e2bcc9149 | |||
| 545f8a8c93 | |||
| 97b6068c46 | |||
| 64e6cf9fe5 | |||
| ed788229ed | |||
| 71ef76ecad | |||
| 4c86fc13cb | |||
| b379969c63 | |||
| 9564aa1fdb | |||
| 24b05cb308 | |||
| dff8e29f98 | |||
| 4733a19bab | |||
| 5bf7345743 | |||
| 4342657762 | |||
| e801f0e954 | |||
| 9cd1d087c3 | |||
| 8d22ac200f | |||
| 28a5f7d66b | |||
| a8345133ac | |||
| f5a84f75c4 | |||
| b8e0898c7c | |||
| aa80f754f4 | |||
| 5d15c65e48 | |||
| f8b16fa293 | |||
| af04b422c9 | |||
| c97ff6c0f9 | |||
| 61969dc158 | |||
| 8f910d2d49 | |||
| fd4fac946a | |||
| 287874a444 | |||
| c6c8783c60 | |||
| 971ae00942 | |||
| a11f9e1963 | |||
| d427cebd12 | |||
| e5b58b1020 | |||
| 2c0d9fa81f | |||
| cf93df41fc | |||
| ba7b0f4c54 | |||
| 21ee54c3d1 | |||
| 90a17cf964 | |||
| 17c485eb03 | |||
| 60ba6ef916 | |||
| 424e1150ae | |||
| d1c35e7b61 | |||
| 3d60a9b96c | |||
| 5b0b59ecfb | |||
| 60f81032bb | |||
| a45928045a | |||
| f62241b780 | |||
| 43302c79ca | |||
| 94f73ee680 | |||
| ff4d3d27dd | |||
| 682653c6f8 | |||
| c2b6c67431 | |||
| e6ce752da1 | |||
| 4a4ff6749b | |||
| f270e8d040 | |||
| 3cd8976493 | |||
| 92b9888837 | |||
| 1c4a64f0a1 | |||
| afa072578c | |||
| 5ee7abbe3c | |||
| 121bc50ca9 | |||
| f2cce5fd8c | |||
| 7d61426279 | |||
| 8b97c93f3d | |||
| 0d19fa0720 | |||
| 2a11103a73 | |||
| b8ef2036b0 | |||
| 8b9982a0a5 | |||
| 15612ebd39 | |||
| d1bb2055da | |||
| 6b6c2f6087 | |||
| 416848066c | |||
| 76b5e19eb3 | |||
| a675c4937a | |||
| 6ea29a7696 | |||
| b89581960c | |||
| 4ec4ec844f | |||
| e47f3e5bcc | |||
| 9a27901edc | |||
| 7b298b0995 | |||
| 435c97c7a2 | |||
| 939099b9ce | |||
| 2a19db0f0a | |||
| fe77223dee | |||
| 9a18330f3a | |||
| c89780dfe0 | |||
| 3fddd3bf93 | |||
| 45f6931352 | |||
| b9435b9e38 | |||
| a2642d83d3 | |||
| a4cb914656 | |||
| 2817cbe450 | |||
| c2ca3ee2fa | |||
| 13bc55a015 | |||
| b505cf84de | |||
| 476a02739e | |||
| 544ceedcac | |||
| 766465ce94 | |||
| a011035ed6 | |||
| 734de34b7a | |||
| e0e683aedf | |||
| 883c4c60c3 | |||
| b1b505f783 | |||
| dd3f517fe9 | |||
| 65d606630d | |||
| 816f82682b | |||
| ad56838040 | |||
| 202ba124a5 | |||
| 629d47fcd8 | |||
| beb5b291b9 | |||
| a91eca6ec2 | |||
| c0503718cd | |||
| 51d54ad4f0 | |||
| 1ddcfc5c68 | |||
| 9b8ddba4d1 | |||
| b2b6f52d14 | |||
| fb5db23463 | |||
| 0a35b97e75 | |||
| 15621532b8 | |||
| 774d28efb1 | |||
| eea517be92 | |||
| b369c456f2 | |||
| c3023fb52b | |||
| 660a709840 | |||
| ccf415c341 | |||
| d99d18304a | |||
| 76a27e3399 | |||
| 134094a442 | |||
| 8108fb0575 | |||
| c790779a37 | |||
| 72f35e0626 | |||
| f21bde4d9f | |||
| 986c5084a4 | |||
| 38180c2c97 | |||
| 95e36fd488 | |||
| 36c9f7c3df | |||
| d8e10f3a8d | |||
| b4a3c92867 | |||
| 72315e7b00 | |||
| 1633c29f29 | |||
| 4dfa0a0383 | |||
| 818585fd12 | |||
| 529a241a26 | |||
| 5e3a7ac8a7 | |||
| eb44e0a556 | |||
| 63b154396a | |||
| fbb3f64a1a | |||
| 0dc0bc80ae | |||
| ca1ba7a53d | |||
| 4b0132ed7a | |||
| 7523c777c5 | |||
| 43d58aa760 | |||
| 20ac7f40f6 | |||
| 78c5e41c23 | |||
| 8a18d132fc | |||
| 9a4404276a | |||
| f5b9705c70 | |||
| 101a147496 | |||
| 01a28db949 | |||
| 8d74101f07 | |||
| 41af8aa046 | |||
| 0dfab6bbd0 | |||
| 53b6fb465c | |||
| 873250f5de | |||
| 6c37e10c83 | |||
| 70146700aa | |||
| a7acb8805f | |||
| fb5e7964b3 | |||
| 5af747c6fd | |||
| d9efb55d29 | |||
| 17dfae77af | |||
| af997529a1 | |||
| 5639f5a296 | |||
| 9276f1910b | |||
| 0c644d1ec8 | |||
| a093a0e05c | |||
| cdc469786c | |||
| 5ff1fababc | |||
| 6276b86a78 | |||
| 6e14cc2189 | |||
| 9e906d9e21 | |||
| dc4af58be0 | |||
| 4a3ab8fbdb | |||
| b38547ee9a | |||
| 501ff7f056 | |||
| ad0ab4109a | |||
| 373160ce00 | |||
| 50ac880335 | |||
| 54e6f5c237 | |||
| 3266ac7667 | |||
| ca28274895 | |||
| ec55b6f6db | |||
| 16ad53f354 | |||
| 86042af108 | |||
| e459a5108c | |||
| a2aa8db5a9 | |||
| 75315fb297 | |||
| c40fbad12e | |||
| a4d16acd00 | |||
| 5d96f984b1 | |||
| 744798aadd | |||
| 318cba4ce3 | |||
| 9d14c0b37a | |||
| 2f636b4456 | |||
| e07a488012 | |||
| 77bf5593e5 | |||
| 26513285dd | |||
| de64db3064 | |||
| cf93217365 | |||
| ec8db970f9 | |||
| 09d54c9f52 | |||
| d00eb451bf | |||
| 3f431a16a3 | |||
| 593e240d7c | |||
| fb9d59ab15 | |||
| aff8c9bd28 | |||
| 0867e3188d | |||
| 1261559305 | |||
| 2185bce4b7 | |||
| af230ec133 | |||
| fc41c18c6f | |||
| f4d55d512f | |||
| eff514f8bb | |||
| 955b20230c | |||
| 686ea5c1a6 | |||
| 1acadd363b | |||
| 7ec91aefc1 | |||
| 973b367da6 | |||
| 1d33335e33 | |||
| 1f57eb93fd | |||
| ac2dc29525 | |||
| 6773b938b3 | |||
| d1c4e4b5a5 | |||
| ac4fd4f4ae | |||
| beb14c70da | |||
| 94f1c3d152 | |||
| b5426a8679 | |||
| ad8d7e84b9 | |||
| b48959fa57 | |||
| 7a52a4c134 | |||
| 3cdbcc1645 | |||
| 763b80d5fa | |||
| d0c767428b | |||
| a67248f386 | |||
| c638f085aa | |||
| 7ecdcf6ca6 | |||
| 363976694e | |||
| b6a58818bb | |||
| af92a517a7 | |||
| ba58bba4e8 | |||
| e0b5637474 | |||
| d32d31577c | |||
| e9dcecf9b4 | |||
| fccf284088 | |||
| cfc781949d | |||
| 3755099bd4 | |||
| af23375352 | |||
| 6053996253 | |||
| dd9262c318 | |||
| 35cebbd167 | |||
| d66aa2e0ff | |||
| 5dd3e6052e | |||
| 3d47e043af | |||
| 895fc72a0b | |||
| f42d5399aa | |||
| ad5874779c | |||
| d19bccad74 | |||
| 7c4158d8c2 | |||
| c546a27de7 | |||
| 377fcc062d | |||
| 07ef08e966 | |||
| 2e20f06f8e | |||
| 54d9597522 | |||
| f3e788b8ab | |||
| cdbfdcc363 | |||
| 417034518c | |||
| 2112aa31e6 | |||
| 2c2716de0f | |||
| dcf72e49e2 | |||
| c4c4ac28dc | |||
| 6d5b900324 | |||
| a165f55579 | |||
| 0d7f770996 | |||
| 53139e6ebe | |||
| a893969ec9 | |||
| d5bbb16066 | |||
| 21c38bbdaf | |||
| b7c8e9e874 | |||
| e65b51ca3c | |||
| d56535afce | |||
| 4e156a162f | |||
| ed7e4273cd | |||
| 0ca5f68d72 | |||
| 48073e6d95 | |||
| 657c17bb8c | |||
| cec7cc037b | |||
| 5c12bafe80 | |||
| d2e02779c4 | |||
| c2f2ea6b85 | |||
| af433d0352 | |||
| ee044771a7 | |||
| edc5518f68 | |||
| 79f792ad05 | |||
| 469addeca3 | |||
| c394847c35 | |||
| ea64bb58a5 | |||
| a9d23a6479 | |||
| ea5499fa51 | |||
| bad4e5c3eb | |||
| e86c888a92 | |||
| a71ff50130 | |||
| 278b4ca40c | |||
| cd6d79d106 | |||
| 80c4cedd25 | |||
| 02f4d6ca53 | |||
| 732657cc46 | |||
| 86a8ff6129 | |||
| d8ab83600b | |||
| 6ec5ae0215 | |||
| 8dfba51884 | |||
| 7cf1054d36 | |||
| 42b1d04999 | |||
| 055ffc0425 | |||
| eabe679f78 | |||
| 1ce5a724c7 | |||
| d65fead337 | |||
| 17e2bf5717 | |||
| 87a692b89e | |||
| 5e8d8df847 | |||
| c46f119e0e | |||
| 09619c1c45 | |||
| 1accf3b3f4 | |||
| 8bf5bed0a9 | |||
| 5ffeebabad | |||
| e89c1103ff | |||
| 5a6a49405d | |||
| fe4f27b99b | |||
| 1864b64f64 | |||
| 4bd2ad30c4 | |||
| 6e9eca29e2 | |||
| 471b40040a | |||
| dfe0368835 | |||
| 613c12e590 | |||
| 8ec6544624 | |||
| a8d14e88fe | |||
| 6576e8b927 | |||
| acb3b3bd4d | |||
| da0fec7308 | |||
| af61a15839 | |||
| 3ada597449 | |||
| 938d8dce06 | |||
| 6e85e852d4 | |||
| 70a5553499 | |||
| 90af2835a2 | |||
| 83e2e124a3 | |||
| 2477103707 | |||
| adbd613660 | |||
| 849d8d31fe | |||
| 24ebca5c59 | |||
| ead7d6d80f | |||
| 34df28db2b | |||
| 2ff12c4981 | |||
| a2b3cd9a2c | |||
| d31da08d43 | |||
| 17e9fde75a | |||
| 692e1eccb6 | |||
| 009f5f74ef | |||
| 4c7db02925 | |||
| c4e2e17b0c | |||
| 9255df44d0 | |||
| 0e40c8a031 | |||
| 86e7d82418 | |||
| 3b070517ad | |||
| ad5d14ec0e | |||
| bce653117f | |||
| 194304bbe4 | |||
| ad172726c0 | |||
| cc9b199ecb | |||
| b1a8de0901 | |||
| 823884b064 | |||
| a84969bdcd | |||
| 6a7d1c15d3 | |||
| 823e767eed | |||
| e42560bed5 | |||
| d6630ab35b | |||
| d154fa4b4c | |||
| 47fc889df0 | |||
| 027769bf5d | |||
| 9ca9249992 | |||
| ec91a3d59d | |||
| 2f30c3fd4f | |||
| 2f9351d995 | |||
| 230e44b01d | |||
| 46206b4814 | |||
| 4c71dbf0af | |||
| 0cf77c3916 | |||
| 9efafc3e33 | |||
| 65573784c4 | |||
| dd4f591d54 | |||
| 6bdb9ca725 | |||
| 1ca74c3c03 | |||
| c3a588037a | |||
| 40215f99d7 | |||
| 3fd36c1be1 | |||
| 24effe8cd6 | |||
| 2ff1fb60ad | |||
| 374d952e09 | |||
| 6efdfee3f0 | |||
| 42ac089e12 | |||
| 9ab5e52f04 | |||
| ec37364762 | |||
| 23288b7cb5 | |||
| 4748aca61f | |||
| f2fe6f40c2 | |||
| 7837ae0e19 | |||
| a007220c52 | |||
| ebb77bb311 | |||
| 53400d86e2 | |||
| c0489963bb | |||
| 626bfbf309 | |||
| 98fc098216 | |||
| 953c60829e | |||
| 6d811f9879 | |||
| 22d0c57a1c | |||
| b1485d0337 | |||
| c54753c185 | |||
| bdc097495a | |||
| 8115b004b9 | |||
| feff8bf972 | |||
| 4429352125 | |||
| f301f17b61 | |||
| c13a5ce229 | |||
| c9b2cedebd | |||
| ab5252c18e | |||
| e35fd463e7 | |||
| fd11e3a81d | |||
| f0058bbed3 | |||
| 22d86116ee | |||
| deea46000e | |||
| c99db2b9db | |||
| c69245da1f | |||
| 3c50d24d8e | |||
| 53c88f0f9e | |||
| d50babfc99 | |||
| 2b66495a9d | |||
| 3fb6617d62 | |||
| a105f56957 | |||
| 23bd1866ca | |||
| 59c182ed2b | |||
| c06115cb3f | |||
| 8b483a91bc | |||
| 8814645c8d | |||
| c92f3072b4 | |||
| ffea927ac2 | |||
| 77346d7286 | |||
| 3133bb49aa | |||
| 440a937d24 | |||
| 06067efa3f | |||
| 6aa689f87c | |||
| ba0b3983c6 | |||
| a3144cbadc | |||
| 5c9a624a85 | |||
| fba9fdfd27 | |||
| d88d1c9935 | |||
| 507ca291e1 | |||
| ed9bca969c | |||
| aa61e79615 | |||
| 25dee8383c | |||
| f81e401cd0 | |||
| bc927f9788 | |||
| e2a5a6a05c | |||
| 7ce9428e96 | |||
| 9f4f9000bc | |||
| 677b94c92e | |||
| b88435fdc2 | |||
| 790927bb55 | |||
| e923712d81 | |||
| eacadf0e73 | |||
| 6e246ee58c | |||
| 0a1b957331 | |||
| e3daf489c8 | |||
| 1c17b3281a | |||
| d2cacac07a | |||
| e0be771b64 | |||
| c2096771cb | |||
| 2fef9bc1d8 | |||
| 3cf9185159 | |||
| c8abf2ad14 | |||
| bab8addcbb | |||
| c4d2e3c0b3 | |||
| b40fd6de32 | |||
| 3516d0835e | |||
| fcc69d5a60 | |||
| fef7fc343e | |||
| ad2854c8b3 | |||
| a74fe2ec01 | |||
| eabbe38001 | |||
| b1ea91d8bd | |||
| a052567db8 | |||
| 2d2330382d | |||
| 66842f5a18 | |||
| 33e9fe9312 | |||
| 65c209fad3 | |||
| a9163a53d3 | |||
| c657c6cbac | |||
| ee23a7575d | |||
| 8167d47efc | |||
| 1ecea1f4a6 | |||
| 9fa6c2ac04 | |||
| 3ece62cb9c | |||
| 46fd112f9b | |||
| cd7fa04985 | |||
| bcf7d3160c | |||
| d2872afce0 | |||
| 70c88a2087 | |||
| 7770ba1f10 | |||
| 7b3a752012 | |||
| b8d4664e6e | |||
| bd5d16ce36 | |||
| e98852a389 | |||
| 08e4ffdf79 | |||
| 5a75808516 | |||
| b4c5b50a3e | |||
| 03c4c67dad | |||
| f5f9187720 | |||
| 89b82e796e | |||
| 48fa39f675 | |||
| 69c19dc3d3 | |||
| 5c0502b470 | |||
| f10fce9ab4 | |||
| aaad238c6e | |||
| 3ddb005480 | |||
| 741aee6901 | |||
| 0428f60d66 | |||
| b465c82696 | |||
| 1e410ed826 | |||
| 8609198b05 | |||
| 95a55250a7 | |||
| 349f0cf5e9 | |||
| 57b16a4b6e | |||
| 758156a9b6 | |||
| bf8b5ffeb1 | |||
| 8747082091 | |||
| a17231a6b4 | |||
| b3a0507546 | |||
| 4de115c08c | |||
| f139a0bda8 | |||
| bdf23ce855 | |||
| 60488ffbbd | |||
| a13862e924 | |||
| 6a49887695 | |||
| e7b6753a10 | |||
| 8b42995e8b | |||
| 84c3bbd934 | |||
| a0d227714e | |||
| bea2c75452 | |||
| fafada28eb | |||
| 4ffb5b62ea | |||
| f73395122c | |||
| 0a13633411 | |||
| 76e403cf25 | |||
| 00f36a261b | |||
| fe42933ac5 | |||
| b17d16623a | |||
| 9d4f01626c | |||
| d974d4c6ce | |||
| ba703157cf | |||
| 8bd2720c28 | |||
| 7e46766c8d | |||
| 61cc855564 | |||
| e736f590f7 | |||
| 9ef5373776 | |||
| 6d669dcd7d | |||
| abd7d63b74 | |||
| 55c1720719 | |||
| 6769ee3748 | |||
| 07f0225ca6 | |||
| f7b5900671 | |||
| 8a7e74673e | |||
| 3c62f3a8e3 | |||
| 48d41ab088 | |||
| 0fda243a05 | |||
| 70dfae31a2 | |||
| e98e58c65a | |||
| 3b9f981358 | |||
| 048ddbf9ee | |||
| 2a6527e751 | |||
| 26228e6b4d | |||
| f3aab47f94 | |||
| 1661e83939 | |||
| f224d740a3 | |||
| 700f7a275f | |||
| e319340253 | |||
| 6508bbcef5 | |||
| 9bf8b496d6 | |||
| d4120dd2fe | |||
| 8c849a48cc | |||
| 654d0c29ad | |||
| 8d0b3dad5c | |||
| 90eb529bc4 | |||
| 6506c19ac3 | |||
| 834c992553 | |||
| 30a60d396b | |||
| d134ec54c5 | |||
| ca7640e10f | |||
| 288e6f9c07 | |||
| 70b883cfeb | |||
| ea525d5685 | |||
| 1ae001d10a | |||
| 1b40528e1a | |||
| 4e67eb6c42 | |||
| 824465ea27 | |||
| 4a33014edc | |||
| 57676cf64d | |||
| a7b954f655 | |||
| 114674c3d9 | |||
| c05595e482 | |||
| d4d7ab0620 | |||
| c74206e4de | |||
| 96d5cbd036 | |||
| d0c4a92b4c | |||
| d7409604b5 | |||
| 29dbeb253c | |||
| 5a497077f1 | |||
| 576644a197 | |||
| 410583e5f9 | |||
| 6bf6d1dc6b | |||
| 56e832ee43 | |||
| 601096f360 | |||
| aa09febf79 | |||
| 8aca1934ff | |||
| ccecd3405a | |||
| 8a0b93bc4d | |||
| 8b1fe8f6e0 | |||
| 7243eda2ff | |||
| 3f7cc45686 | |||
| 84b8a2fb05 | |||
| c93e2ff81d | |||
| 0cdfd72529 | |||
| 70ce2bbb9e | |||
| 4700722444 | |||
| 464972855e | |||
| 58ca013b90 | |||
| 869ea22f34 | |||
| 8ef8088686 | |||
| c5e9bbe4f3 | |||
| 0e92ac2af7 | |||
| b77a0039ee | |||
| 33fb253a66 | |||
| 51ceabb2eb | |||
| b2274a63cd | |||
| 6a439ae53d | |||
| b1a5c76215 | |||
| 9612397aa2 | |||
| 04f720d56a | |||
| 19a4b51371 | |||
| b8f35aa109 | |||
| a1e96a7deb | |||
| fcc7d8dd4e | |||
| a41b79d43e | |||
| ec43292e1e | |||
| 7df3141bbc | |||
| ea667d82b3 | |||
| 57ccf14952 | |||
| 0a02dd5f58 | |||
| 13ecd5bb25 | |||
| a703b9ed84 | |||
| 32aba5e64b | |||
| e4a80aee09 | |||
| 26551f178c | |||
| dbf8e22fad | |||
| 0b5d0b83be | |||
| 32772a5436 | |||
| 35e5f00cac | |||
| 290da93845 | |||
| f6bb900259 | |||
| f7f2438478 | |||
| 2ad0487cec | |||
| 72ccb5fe6e | |||
| 7c96857c02 | |||
| 15b8a8d935 | |||
| bf0765fc7f | |||
| 59de4d9ad8 | |||
| e0cb01e2cf | |||
| 4c168e95de | |||
| 183fc43a67 | |||
| c95407f1bc | |||
| f1ea9d86b9 | |||
| e06efd5329 | |||
| 358d69956a | |||
| 935067ee05 | |||
| 212f0fb509 | |||
| d513fb4c8e | |||
| 596b8a5d06 | |||
| 6f267be6f1 | |||
| 76b40a37e7 | |||
| 487d331d74 | |||
| a77275e650 | |||
| 5e527d22e3 | |||
| 40c71a2463 | |||
| 5ef548a985 | |||
| f38a61c66d | |||
| 3f92bcc11a | |||
| b2135be594 | |||
| 816929c704 | |||
| a9839af903 | |||
| 6193e403e7 | |||
| 32da0705cf | |||
| ba1a48c2ce | |||
| 821f17d666 | |||
| 0e1ef8f8e1 | |||
| 96a27f4266 | |||
| 26ac5a3bdc | |||
| cf93a05d2d | |||
| 174b4ce29d | |||
| 90ccd2f37c | |||
| a4b4432015 | |||
| bca49b99ca | |||
| 6427744063 | |||
| 365323afec | |||
| 99f709ca96 | |||
| 3fc02353be | |||
| 0757a51e2b | |||
| 290078e0d0 | |||
| ca79f75b32 | |||
| 987bb2ca61 | |||
| 960bb540ec | |||
| b9d6fc9dad | |||
| 1031b7f4bc | |||
| 406313bbc5 | |||
| cadb4dee14 | |||
| d2c64b566b | |||
| c5069266dc | |||
| 59b0314a0e | |||
| d6ba235655 | |||
| 63775320ae | |||
| 95eb199f41 | |||
| d659eb9327 | |||
| f17a6b478b | |||
| f18cbd036a | |||
| b584c23061 | |||
| ba934ff1ce | |||
| b811420d28 | |||
| b231e91d87 | |||
| f9cefc84a3 | |||
| 977d2c4330 | |||
| 3f4004ae45 | |||
| fc85f3644d | |||
| 03fe1cb7fc | |||
| 4dadf17bd9 | |||
| 6d5ac67681 | |||
| 1275248f39 | |||
| d3cf0d2c06 | |||
| 304e3ac12f | |||
| 778f42ad34 | |||
| f482050f9a | |||
| 5ef7325874 | |||
| 5a6b23e8f3 | |||
| e90438fe3c | |||
| f7d5b39ec9 | |||
| eec9fa9d5e | |||
| 4d3989817c | |||
| 59864a3bbc | |||
| f9f160404a | |||
| 4e998c9ade | |||
| ebaefbb745 | |||
| 47c5ee5d9c | |||
| 77d4e3e8d2 | |||
| a0c3bb70a9 | |||
| 3debb98805 | |||
| ddbd10c001 | |||
| 7c0a43d425 | |||
| 0cf479dd5c | |||
| 2693ed9b22 | |||
| 4a7ca5a291 | |||
| 7295983964 | |||
| 39a6889767 | |||
| 0db4fb1835 | |||
| ac425f67e4 | |||
| a2125594ea | |||
| 1f736a95a7 | |||
| 79859ebca3 | |||
| 416c693b3f | |||
| 321c74ccd6 | |||
| 5691d998ea | |||
| 6158bd2afa | |||
| d2911a8d41 | |||
| b10ec8ef8b | |||
| 8313209704 | |||
| 89f23a35c5 | |||
| 2ee00e7f7d | |||
| 293729f48a | |||
| 79310a0051 | |||
| b69bf8a897 | |||
| 426482e05b | |||
| ad092bf1ce | |||
| 557990fdcf | |||
| a66a1a24d7 | |||
| 099f4f9e7c | |||
| 2734291b35 | |||
| 8bac8b513c | |||
| 781f4d439e | |||
| a8a71eb200 | |||
| 95c65aff75 | |||
| 61f589ddd0 | |||
| 3361c59576 | |||
| 8936d55675 | |||
| c6de84d868 | |||
| 228af2d617 | |||
| 199ddff13b | |||
| 985e5014bc | |||
| 002904e445 | |||
| e0f8bb83a6 | |||
| 12fdaf895e | |||
| 8b341884d2 | |||
| a897fc91ec | |||
| e7bb0ecee0 | |||
| c12e26ff28 | |||
| 4a28ef8034 | |||
| 0d2bc7b5fd | |||
| f6ec0cd827 | |||
| add1df4bcb | |||
| 65d148d9a8 | |||
| c9bd43c0f6 | |||
| c11423df1e | |||
| e4e0bb533d | |||
| e629785a97 | |||
| 3a2a74b655 | |||
| f5e01f7b49 | |||
| c9fcc12e3b | |||
| 97e88bd769 | |||
| d4501f08b8 | |||
| 2df7736562 | |||
| 4ea8526e9f | |||
| ee1de8f30d | |||
| 5ccb2a4cbd | |||
| bee510dbce | |||
| c3b838b738 | |||
| 571b69bdb6 | |||
| 095f44f4b2 | |||
| 95415ac3a5 | |||
| f6c573880e | |||
| 054c796213 | |||
| 245c256b1c | |||
| 6aa07cdc7e | |||
| 894ad33bf4 | |||
| 34f6b05467 | |||
| 32c6e58bdb | |||
| 8bcd7e122a | |||
| f663e8f903 | |||
| 3c086fb2fe | |||
| 32b6ebb670 | |||
| de4d304d90 | |||
| 4997a6bf06 | |||
| 2a9521661e | |||
| 693877212d | |||
| 1e9e2aa95c | |||
| b9399a5df8 | |||
| 8408587341 | |||
| 0fc584961c | |||
| eedbd1ad59 | |||
| 7589225fc0 | |||
| 39a975cb29 | |||
| 594a95839c | |||
| 3998b41d68 | |||
| 57fae4a6a1 | |||
| d7744aca02 | |||
| db211446f3 | |||
| 43eba3d750 | |||
| ad49138fae | |||
| 3200fe0e53 | |||
| 82e5b961d3 | |||
| e00b0f6f47 | |||
| 6dfe2ddc21 | |||
| fee87c5fdb | |||
| 07fe1cd6b8 | |||
| ac14cee71c | |||
| f795878d1a | |||
| bc95c609ff | |||
| ca022fdb4c | |||
| 206b546e5a | |||
| 097d81363b | |||
| 2370079220 | |||
| 02936dcf86 | |||
| ff877af2af | |||
| 9a24886282 | |||
| 350532ea2c | |||
| 3b8701e97e | |||
| a37201abee | |||
| e3e8a58799 | |||
| 275579a835 | |||
| 2bf8793632 | |||
| db6a6ccaba | |||
| 69560588fe | |||
| edf2cbd5f7 | |||
| b00e19a8da | |||
| 6dea8309c5 | |||
| 9befb7a1d7 | |||
| bff90d4684 | |||
| 44836c7f78 | |||
| 65552bf403 | |||
| 97681d0607 | |||
| 3e4a195b61 | |||
| 915427621f | |||
| e9a2e665b2 | |||
| 6fdce865b8 | |||
| 25d62cc929 | |||
| 93ef27aeba | |||
| a04ab2298b | |||
| 43e457c883 | |||
| bc79f477dd | |||
| e3aa96ccf2 | |||
| 453466eb1a | |||
| 49805f976a | |||
| 1666195984 | |||
| 3d345ca4c4 | |||
| 8dd596b7ba | |||
| 0a45b8c478 | |||
| 75f4c1abf2 | |||
| e10c01047c | |||
| 719912e46e | |||
| 75c567b6ab | |||
| 0e9a865bbf | |||
| 8937e8756e | |||
| a743de0e24 | |||
| c531e275cc | |||
| e59c6caee5 | |||
| 54fc60eb37 | |||
| 031e57b359 | |||
| 96a2f80bf2 | |||
| f2f600f807 | |||
| b95e93c20a | |||
| 24790e4061 | |||
| c251915198 | |||
| 4112866821 | |||
| 5b521bb778 | |||
| 3cfd8cc1fe | |||
| 411ca87a86 | |||
| 2172544bb7 | |||
| df7049d465 | |||
| 01a41d86bc | |||
| 0a461e7922 | |||
| daa308f81c | |||
| 333e51b217 | |||
| 8fd87033ef | |||
| 44d146af9a | |||
| f3e9eb3371 | |||
| 63e4b35c19 | |||
| e8a703a71d | |||
| 9b9e04a061 | |||
| 4a6888ccf6 | |||
| e755c66418 | |||
| b58b2c5ae8 | |||
| e8ff5cac1d | |||
| de60600126 | |||
| d17d3b66aa | |||
| f4ca2c8e72 | |||
| 46205a7235 | |||
| 5620306c70 | |||
| e8283f94ed | |||
| 894f208de3 | |||
| f8c96cb18a | |||
| e72f451173 | |||
| 5c63be3c6e | |||
| 974491f93d | |||
| e21f89a16d | |||
| 16294437d5 | |||
| d75a089690 | |||
| 442bc80cd7 | |||
| f84b08ff08 | |||
| f33f88de31 | |||
| 4b205680df | |||
| 779f59da6b | |||
| f5ddaef46b | |||
| aa6c66aa54 | |||
| e69ff71302 | |||
| 6b32bd5f15 | |||
| 2b2633c11f | |||
| 31a22c27fe | |||
| 0ae053fdf8 | |||
| d8c5bd92ae | |||
| 2a67375239 | |||
| 5ac55fc132 | |||
| 729848caeb | |||
| 13a782c039 | |||
| 8ab6efb8c0 | |||
| ab24325df3 | |||
| 681e0323f2 | |||
| baf372ad3d | |||
| 9cb239247d | |||
| 1b7b2c3a62 | |||
| 7c0a9ff4c1 | |||
| 95d9cfb5c3 | |||
| 8d75bfae47 | |||
| 1d2ef6b2a1 | |||
| 264679a725 | |||
| 7f9a9f2a09 | |||
| 26dfa5e77c | |||
| 7b099e0fe2 | |||
| bb7dc5f992 | |||
| 66d7956e67 | |||
| 1f519eea89 | |||
| b8c080de12 | |||
| b6e41ebf27 | |||
| ba0ed79635 | |||
| 8ca4252303 | |||
| b909df5531 | |||
| 3df83dce7e | |||
| 3697ebef47 | |||
| 549c53121a | |||
| dfdc91f8c9 | |||
| d3c0f4ef98 | |||
| eba696a41e | |||
| 54a14c877c | |||
| cf9bddcb89 | |||
| fc0498b5bd | |||
| 3af1b6ecdc | |||
| 4623e6220f | |||
| a29e59a770 | |||
| ae31115017 | |||
| f9eab2de5e | |||
| e9ed7eb68d | |||
| 6389303c1c | |||
| 5015829ce8 | |||
| 3f5c85e933 | |||
| 6aab6a251c | |||
| 81fad9e247 | |||
| 1c661e7548 | |||
| a457fbdb58 | |||
| e7dbc4ff28 | |||
| d2aadabc5e | |||
| f8791f072d | |||
| db7f689728 | |||
| b4d3ff378e | |||
| 6c8ffe81d0 | |||
| 1706a7609a | |||
| b3e6c97d98 | |||
| d60ac98ef2 | |||
| 10d61a2b44 | |||
| 3f67623c26 | |||
| 59f4a2e0f3 | |||
| d3d13c41c4 | |||
| f6230ae019 | |||
| 11b020b9f9 | |||
| 878af7ada8 | |||
| 987061d800 | |||
| f99f58d99f | |||
| 1aefa6779f | |||
| d2f9cfcf81 | |||
| 52644f067e | |||
| 417ac94456 | |||
| 02bfd20760 | |||
| 6d916c5bb4 | |||
| 1e9ad5476d | |||
| 5e80191d27 | |||
| 058367f34c | |||
| ddcf388270 | |||
| 254f88f805 | |||
| 60fb1fde75 | |||
| 00367289bd | |||
| a9769b9202 | |||
| 6d62be55b3 | |||
| 002925466b | |||
| 8fae361768 | |||
| 65919ed839 | |||
| cdee3d33b4 | |||
| f5ca9d3fe1 | |||
| 4a8fd71a2e | |||
| 1e6e18ff05 | |||
| 5c05b7bc01 | |||
| a51d46cbf9 | |||
| c6deba6003 | |||
| 08019732e2 | |||
| aab9ef4290 | |||
| 03382d29cc | |||
| 3833d86f0f | |||
| 94ec0e9b74 | |||
| e8e020ffb7 | |||
| e9b8571afc | |||
| f3de2b4be7 | |||
| 51631b90af | |||
| a2445c44cb | |||
| 5c56b8ce92 | |||
| 1aca1d582e | |||
| 3efd2df87f | |||
| f1fb002682 | |||
| d5a0d6783a | |||
| 5fde16ba90 | |||
| 394bc91e07 | |||
| edb3337ead | |||
| 25e4bce1a6 | |||
| fa96507fe7 | |||
| e329c84d5e | |||
| 1febb12942 | |||
| 03a3be0844 | |||
| 9802b4e123 | |||
| e1ef7a2288 | |||
| f768f89803 | |||
| 1f75c67c56 | |||
| f1b6228d4f | |||
| d58f9ae824 | |||
| 76fca0e755 | |||
| a38157a1f4 | |||
| f355b3505f | |||
| 3b015dfc7d | |||
| 0ec72cbd10 | |||
| 68e220e7bb | |||
| 143b3d2b5b | |||
| e96c94c4e4 | |||
| 9c0af1f675 | |||
| db900af8c7 | |||
| 9fd95b93f7 | |||
| ae279966c2 | |||
| 3289a0aff9 | |||
| 723165f878 | |||
| 805ab6331f | |||
| 738435b1dd | |||
| d8b42792a6 | |||
| f94253b82b | |||
| 3ccb1d67c2 | |||
| 8ea2f59d33 | |||
| d6d4571628 | |||
| 43de95eb19 | |||
| 0ecc2b8c17 | |||
| 52548bde05 | |||
| d2d8535a31 | |||
| 29b3f66507 | |||
| 419a6d51b3 | |||
| 081d9bc73f | |||
| 9f68376c91 | |||
| 216988b0b1 | |||
| 53c771551c | |||
| 43467a2ac7 | |||
| 0d477d7364 | |||
| e0d88cb7a4 | |||
| 571dfa7605 | |||
| ca8a1d2cff | |||
| 38a3c1ce6b | |||
| a3be8d7cd7 | |||
| 483e9f341c | |||
| aaf56c2839 | |||
| ed96864892 | |||
| 05563f5bc4 | |||
| 61d3222a22 | |||
| a81c0e6db9 | |||
| d73261844e | |||
| b07f951e6b | |||
| 42484f3bcb | |||
| d7c465d49e | |||
| c5204a74c0 | |||
| 4a2544ff4b | |||
| c9b3e718db | |||
| 44d21e5a79 | |||
| 8c698262ea | |||
| 1094ed64e9 | |||
| 791ebd05fc | |||
| 483f28723c | |||
| a550e50683 | |||
| 472f3b7347 | |||
| d1615ba11a | |||
| 898cf70210 | |||
| b958498074 | |||
| 171dd9eff5 | |||
| 6c6dd16acf | |||
| a6144b8e1a | |||
| e07ffe902e | |||
| 9b130efbb3 | |||
| 22701f0c27 | |||
| f0fb91f2d4 | |||
| f9564e053d | |||
| 166ecaeda8 | |||
| 2acc7c96e7 | |||
| 1810702bf0 | |||
| 96e2126ade | |||
| fb9c083a51 | |||
| dc28a1aba2 | |||
| 2080e06f7b | |||
| f3319f6140 | |||
| 1050b5351e | |||
| def8fa2248 | |||
| 2fd1a4eef7 | |||
| 8bf9dda604 | |||
| 54ff72a1cc | |||
| cbb699efd2 | |||
| d9dac9cd1b | |||
| fff7b7e459 | |||
| bcf7286ad9 | |||
| 7ed858e38e | |||
| 935c02c0a3 | |||
| f629cdfe2c | |||
| 26e426adb1 | |||
| 190467b6c1 | |||
| eb243847eb | |||
| de977cc9c8 | |||
| a433394870 | |||
| e90e0ef9aa | |||
| bc4b2d521c | |||
| f0f50b757d | |||
| 33cb9c5ca5 | |||
| e4b9a58c15 | |||
| 3c1267dbe6 | |||
| 132253c9f3 | |||
| 9340af1a8a | |||
| 447116a93c | |||
| d848594deb | |||
| b4ec8fe3ef | |||
| 6fc6207e93 | |||
| dbc7faca46 | |||
| b5e2ec4ea4 | |||
| 7b4aefedea | |||
| 30a595789c | |||
| 9003b60d65 | |||
| d93588dfeb | |||
| 6ca3c7f59f | |||
| e21262deba | |||
| 84fd8190f3 | |||
| 7a55f2af3b | |||
| 88996323b6 | |||
| 8b192b76c0 | |||
| 962d57b4d6 | |||
| 18151e79bb | |||
| a70e1eecd9 | |||
| 3e876c5066 | |||
| 6bff0e24f8 | |||
| b8f9076de0 | |||
| 47c45e5bd3 | |||
| 8936a0f3a5 | |||
| d784b40e24 | |||
| 68012bfbf9 | |||
| 9fabc3406f | |||
| e7338024f6 | |||
| 63bb97cc19 | |||
| 1220dd4877 | |||
| 96ab78dc4f | |||
| 50af4df1d7 | |||
| 3201ea89d6 | |||
| dfa753c6b4 | |||
| 6389dfe49c | |||
| dadb1473c1 | |||
| c3b0a68a2b | |||
| f024425dd0 | |||
| 1b294c013a | |||
| b2abd8ca41 | |||
| b998c06d08 | |||
| 5ba8aa781c | |||
| 455323ed58 | |||
| eb161942de | |||
| fa8e301c69 | |||
| 2aed9aea47 | |||
| 55c02ff628 | |||
| 9a81ff7315 | |||
| c2e26c1527 | |||
| 5acfa524cb | |||
| 94c7d99d0d | |||
| 471b83ccd5 | |||
| 7bb8d89ef3 | |||
| 6b6222bfbb | |||
| 5a77f4cee3 | |||
| adc1ef9308 | |||
| 610f5481c1 | |||
| 03ec1ca0a4 | |||
| 04caf0549d | |||
| 0e1dd63f5e | |||
| fc57129300 | |||
| b7ca3d77a6 | |||
| ceff82877d | |||
| 1aff378ae8 | |||
| e28e3c9491 | |||
| 163d5e4d39 | |||
| bc9893799d | |||
| 076ee65c85 | |||
| 1c092a181d | |||
| a6ed8f268a | |||
| ddfaa41f07 | |||
| 834d438d6e | |||
| 77fa59c3da | |||
| 3bcbd2a078 | |||
| 85ea37ac01 | |||
| dac31e84fb | |||
| 138a80611c | |||
| 2da00161c5 | |||
| f5801ee7da | |||
| 9408c3e640 | |||
| 1c180f4c7f | |||
| cd4926778e | |||
| 38c0278be3 | |||
| ffd4a27901 | |||
| 683acd9ae2 | |||
| faca45a7ea | |||
| 643d9df42d | |||
| 84847cf4c3 | |||
| 61b928d9bd | |||
| e8a626d43a | |||
| 025f679dbc | |||
| afb157df67 | |||
| 82be2d6210 | |||
| e8ac7a34dd | |||
| b95fdc1992 | |||
| d17699363c | |||
| 90c34c5c17 | |||
| c9f3f4d1d3 | |||
| 7b8ce63730 | |||
| ffaf4d5da4 | |||
| fb326a3589 | |||
| f81886d17c | |||
| 0023d8a106 | |||
| 4f6be11c0e | |||
| a164a131f9 | |||
| 0431ecb9e2 | |||
| 18d10d6b86 | |||
| cd879bedb4 | |||
| 45ced8e022 | |||
| 520e351489 | |||
| 2f7fc1a598 | |||
| ec39f0dc9e | |||
| e98222dfb3 | |||
| 3b3347857f | |||
| 7d2190a5d4 | |||
| c1981f28ad | |||
| d0032b0717 | |||
| 8eb685de9d | |||
| 9bfaf4fe40 | |||
| 8120595c3e | |||
| de4be8e610 | |||
| 0bbd28e0d4 | |||
| 8fac166b66 | |||
| 5c404bb142 | |||
| 9b635830bc | |||
| 319e891d7d | |||
| 44bd849697 | |||
| 4a54aa3fbd | |||
| 3f9343e238 | |||
| 8af96248bf | |||
| f7856a0f35 | |||
| f439fc4306 | |||
| 25247b9f6e | |||
| 5c0a98cfb6 | |||
| 269c28e69e | |||
| a5c92c2029 | |||
| c024edb9a8 | |||
| 3abae3c511 | |||
| 2e4d771005 | |||
| 4f764b812e | |||
| f7b6e30156 | |||
| 9dccfe2a96 | |||
| 2b84039a16 | |||
| 96610c7ee1 | |||
| 1f517b8a02 | |||
| 52f16e0f55 | |||
| dedd966002 | |||
| 6d3ae8d4ca | |||
| c667de9b68 | |||
| 621e3eaed8 | |||
| 3ef046b6c9 | |||
| 74d5cdb6d8 | |||
| 7ad5d21900 | |||
| ebe13a9613 | |||
| 7c1d9fea8b | |||
| 59e4f85898 | |||
| a304069687 | |||
| 62d079fa69 | |||
| 3902694075 | |||
| 00861b668a | |||
| 0d747daf47 | |||
| 78384d8923 | |||
| a56c12278e | |||
| c9a76ede94 | |||
| 246733382f | |||
| d1387b25eb | |||
| 86561fef90 | |||
| 64fd1c95a5 | |||
| 4635356435 | |||
| ef16e4203e | |||
| 92cbec6fb1 | |||
| 0cfd95c097 | |||
| 169dc9c311 | |||
| 60a841c797 | |||
| a246d8d8e9 | |||
| 64629cb94e | |||
| 9515137cb2 | |||
| 5f500692f1 | |||
| 227ec19929 | |||
| a2bbfa1db5 | |||
| a9ddf12187 | |||
| d68e722b71 | |||
| 5cb0eded64 | |||
| 39630e076a | |||
| 7621b91769 | |||
| c8056b3e27 | |||
| a0a1fb5fec | |||
| 15bb0b86ce | |||
| 7ce2397b62 | |||
| e0841f3d6e | |||
| b38de57f9a | |||
| 64168fc20a | |||
| 072b524e02 | |||
| e0b664f390 | |||
| 3d1dbd2ccd | |||
| 576ab3df9a | |||
| f6ee03471d |
+41
-17
@@ -1,23 +1,8 @@
|
||||
<!--
|
||||
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
|
||||
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).
|
||||
|
||||
Please:
|
||||
|
||||
* Read the documentation to test with the latest developer build.
|
||||
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
|
||||
* Try to be as detailed as possible in your report.
|
||||
* Report only one problem per created issue.
|
||||
|
||||
|
||||
This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
|
||||
-->
|
||||
|
||||
##### System information (version)
|
||||
<!-- Example
|
||||
- OpenCV => 3.1
|
||||
- OpenCV => 4.2
|
||||
- Operating System / Platform => Windows 64 Bit
|
||||
- Compiler => Visual Studio 2015
|
||||
- Compiler => Visual Studio 2017
|
||||
-->
|
||||
|
||||
- OpenCV => :grey_question:
|
||||
@@ -36,3 +21,42 @@ This is a template helping you to create an issue which can be processed as quic
|
||||
```
|
||||
or attach as .txt or .zip file
|
||||
-->
|
||||
|
||||
##### Issue submission checklist
|
||||
|
||||
- [ ] I report the issue, it's not a question
|
||||
<!--
|
||||
OpenCV team works with answers.opencv.org, Stack Overflow and other communities
|
||||
to discuss problems. Tickets with question without real issue statement will be
|
||||
closed.
|
||||
-->
|
||||
- [ ] I checked the problem with documentation, FAQ, open issues,
|
||||
answers.opencv.org, Stack Overflow, etc and have not found solution
|
||||
<!--
|
||||
Places to check:
|
||||
* OpenCV documentation: https://docs.opencv.org
|
||||
* FAQ page: https://github.com/opencv/opencv/wiki/FAQ
|
||||
* OpenCV forum: https://answers.opencv.org
|
||||
* OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
|
||||
* Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
|
||||
-->
|
||||
- [ ] I updated to latest OpenCV version and the issue is still there
|
||||
<!--
|
||||
master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
|
||||
OpenCV team supports only latest release for each branch.
|
||||
The ticket is closed, if the problem is not reproduced with modern version.
|
||||
-->
|
||||
- [ ] There is reproducer code and related data files: videos, images, onnx, etc
|
||||
<!--
|
||||
The best reproducer -- test case for OpenCV that we can add to the library.
|
||||
Recommendations for media files and binary files:
|
||||
* Try to reproduce the issue with images and videos in opencv_extra repository
|
||||
to reduce attachment size
|
||||
* Use PNG for images, if you report some CV related bug, but not image reader
|
||||
issue
|
||||
* Attach the image as archite to the ticket, if you report some reader issue.
|
||||
Image hosting services compress images and it breaks the repro code.
|
||||
* Provide ONNX file for some public model or ONNX file with with random weights,
|
||||
if you report ONNX parsing or handling issue. Architecture details diagram
|
||||
from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
|
||||
-->
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
<!-- Please use this line to close one or multiple issues when this pullrequest gets merged
|
||||
You can add another line right under the first one:
|
||||
resolves #1234
|
||||
resolves #1235
|
||||
-->
|
||||
### Pull Request Readiness Checklist
|
||||
|
||||
### This pullrequest changes
|
||||
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
|
||||
|
||||
<!-- Please describe what your pullrequest is changing -->
|
||||
- [ ] I agree to contribute to the project under OpenCV (BSD) License.
|
||||
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
|
||||
- [ ] The PR is proposed to proper branch
|
||||
- [ ] There is reference to original bug report and related work
|
||||
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
|
||||
Patch to opencv_extra has the same branch name.
|
||||
- [ ] The feature is well documented and sample code can be built with the project CMake
|
||||
|
||||
@@ -22,3 +22,5 @@ bin/
|
||||
*.log
|
||||
*.tlog
|
||||
build
|
||||
node_modules
|
||||
CMakeSettings.json
|
||||
|
||||
Vendored
+5
-2
@@ -20,8 +20,11 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
# - matchTemplate about 5-10%
|
||||
# - goodFeaturesToTrack 10-20%
|
||||
# - cornerHarris 30% for some cases
|
||||
|
||||
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
|
||||
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
else()
|
||||
set_source_files_properties(${carotene_sources} COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(carotene_objs OBJECT
|
||||
|
||||
Vendored
+5
-17
@@ -60,22 +60,6 @@ function(compile_carotene)
|
||||
endif()
|
||||
|
||||
add_subdirectory("${CAROTENE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/carotene")
|
||||
|
||||
if(ARM OR AARCH64)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
check_cxx_compiler_flag("-mfpu=neon" CXX_HAS_MFPU_NEON)
|
||||
check_c_compiler_flag("-mfpu=neon" C_HAS_MFPU_NEON)
|
||||
if(${CXX_HAS_MFPU_NEON} AND ${C_HAS_MFPU_NEON} AND NOT "${CMAKE_CXX_FLAGS} " MATCHES "-mfpu=neon[^ ]*")
|
||||
get_target_property(old_flags "carotene_objs" COMPILE_FLAGS)
|
||||
if(old_flags)
|
||||
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "${old_flags} -mfpu=neon")
|
||||
else()
|
||||
set_target_properties("carotene_objs" PROPERTIES COMPILE_FLAGS "-mfpu=neon")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
compile_carotene()
|
||||
@@ -90,7 +74,11 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
||||
# matchTemplate about 5-10%
|
||||
# goodFeaturesToTrack 10-20%
|
||||
# cornerHarris 30% for some cases
|
||||
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0.0")
|
||||
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
else()
|
||||
set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipa-cp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
endif()
|
||||
# set_source_files_properties(impl.cpp $<TARGET_OBJECTS:carotene_objs> COMPILE_FLAGS "--param ipcp-unit-growth=100000 --param inline-unit-growth=100000 --param large-stack-frame-growth=5000")
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+2
@@ -1127,6 +1127,7 @@ inline int TEGRA_FILTERINIT(cvhalFilter2D **context, uchar *kernel_data, size_t
|
||||
{
|
||||
std::memcpy(ctx->kernel_data + kernel_width * j, kernel_data + kernel_step * j, kernel_width * sizeof(int16_t));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
delete[] ctx->kernel_data;
|
||||
delete ctx;
|
||||
@@ -1243,6 +1244,7 @@ inline int TEGRA_SEPFILTERINIT(cvhalFilter2D **context, int src_type, int dst_ty
|
||||
ctx->kernely_data[0]=((int16_t*)kernely_data)[0];
|
||||
ctx->kernely_data[1]=((int16_t*)kernely_data)[1];
|
||||
ctx->kernely_data[2]=((int16_t*)kernely_data)[2];
|
||||
break;
|
||||
default:
|
||||
delete ctx;
|
||||
return CV_HAL_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_ffmpeg_64.dll"
|
||||
$url = "https://raw.githubusercontent.com/opencv/opencv_3rdparty/@FFMPEG_BINARIES_COMMIT@/ffmpeg/opencv_videoio_ffmpeg_64.dll"
|
||||
$expected_md5 = "@FFMPEG_FILE_HASH_BIN64@"
|
||||
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_ffmpeg@OPENCV_DLLVERSION@_64.dll"
|
||||
$output = "$PSScriptRoot\@OPENCV_BIN_INSTALL_PATH@\opencv_videoio_ffmpeg@OPENCV_DLLVERSION@_64.dll"
|
||||
|
||||
Write-Output ("=" * 120)
|
||||
try {
|
||||
|
||||
Vendored
+8
-8
@@ -1,16 +1,16 @@
|
||||
# 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")
|
||||
# Binaries branch name: ffmpeg/master_20200311
|
||||
# Binaries were created for OpenCV: 850414a501d5e6dba111c92d73fdd05794c7061d
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "3d2e97081683265950316c65a52c2e8858ffba1b")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "3b094c37d270a30f0b20a0bc8d3ecafb")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "388ee23a7ca44eef2344e265fafd5940")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "ad57c038ba34b868277ccbe6dd0f9602")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
set(${script_var} "" PARENT_SCOPE)
|
||||
|
||||
set(ids BIN32 BIN64 CMAKE)
|
||||
set(name_BIN32 "opencv_ffmpeg.dll")
|
||||
set(name_BIN64 "opencv_ffmpeg_64.dll")
|
||||
set(name_BIN32 "opencv_videoio_ffmpeg.dll")
|
||||
set(name_BIN64 "opencv_videoio_ffmpeg_64.dll")
|
||||
set(name_CMAKE "ffmpeg_version.cmake")
|
||||
|
||||
set(FFMPEG_DOWNLOAD_DIR "${OpenCV_BINARY_DIR}/3rdparty/ffmpeg")
|
||||
|
||||
Vendored
+4
-4
@@ -13,10 +13,10 @@
|
||||
|
||||
* On Windows OpenCV uses pre-built ffmpeg binaries, built with proper flags (without GPL components) and
|
||||
wrapped with simple, stable OpenCV-compatible API.
|
||||
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
||||
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
||||
The binaries are opencv_videoio_ffmpeg.dll (version for 32-bit Windows) and
|
||||
opencv_videoio_ffmpeg_64.dll (version for 64-bit Windows).
|
||||
|
||||
The pre-built opencv_ffmpeg*.dll is:
|
||||
The pre-built opencv_videoio_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;
|
||||
@@ -30,7 +30,7 @@
|
||||
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
|
||||
opencv_videoio_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
|
||||
decode/encode videos using FFMPEG (though, it may still be able to do that using other API,
|
||||
such as Video for Windows, Windows Media Foundation or our self-contained motion jpeg codec).
|
||||
|
||||
|
||||
Vendored
+11
-16
@@ -2,37 +2,32 @@ function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "32e315a5b106a7b89dbed51c28f8120a48b368b4")
|
||||
set(IPPICV_COMMIT "a56b6ac6f030c312b2dce17430eef13aed9af274")
|
||||
# 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_2019_mac_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_mac_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "b5dfa78c87eb75c64470cbe5ec876f4f")
|
||||
endif()
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_mac_intel64_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "1c3d675c2a2395d094d523024896e01b")
|
||||
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_2019_lnx_intel64_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "c0bd78adb4156bbf552c1dfe90599607")
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_lnx_intel64_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "7421de0095c7a39162ae13a6098782f9")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_lnx_ia32_general_20180723.tgz")
|
||||
set(OPENCV_ICV_HASH "4f38432c30bfd6423164b7a24bbc98a0")
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_lnx_ia32_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "ad189a940fb60eb71f291321322fe3e8")
|
||||
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_2019_win_intel64_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "1d222685246896fe089f88b8858e4b2f")
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_win_intel64_20191018_general.zip")
|
||||
set(OPENCV_ICV_HASH "879741a7946b814455eee6c6ffde2984")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2019_win_ia32_20180723_general.zip")
|
||||
set(OPENCV_ICV_HASH "0157251a2eb9cd63a3ebc7eed0f3e59e")
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_win_ia32_20191018_general.zip")
|
||||
set(OPENCV_ICV_HASH "cd39bdf0c2e1cac9a61101dad7a2413e")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
|
||||
+7
-1
@@ -196,6 +196,10 @@
|
||||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
|
||||
# define ITT_ARCH_AARCH64 6
|
||||
#endif /* ITT_ARCH_AARCH64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
# define ITT_ARCH ITT_ARCH_IA32
|
||||
@@ -205,6 +209,8 @@
|
||||
# define ITT_ARCH ITT_ARCH_IA64
|
||||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __aarch64__
|
||||
# define ITT_ARCH ITT_ARCH_AARCH64
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
@@ -359,7 +365,7 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
|
||||
+6
@@ -17,6 +17,12 @@
|
||||
#if !defined(JAS_WIN_MSVC_BUILD)
|
||||
/* A configure-based build is being used. */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// uClibc-ng workaround: https://github.com/opencv/opencv/pull/15279
|
||||
#ifndef L_tmpnam
|
||||
#define L_tmpnam 20
|
||||
#endif
|
||||
|
||||
|
||||
/* Extra debugging support */
|
||||
|
||||
+5
-4
@@ -4,9 +4,9 @@ ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-6
|
||||
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 0)
|
||||
set(VERSION_REVISION 2)
|
||||
set(VERSION_REVISION 4)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000002)
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2000004)
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -78,10 +78,11 @@ 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
|
||||
set(JPEG_SOURCES
|
||||
jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcicc.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
|
||||
Vendored
+36
-26
@@ -1,14 +1,14 @@
|
||||
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 is a JPEG image codec that uses SIMD instructions to accelerate
|
||||
baseline JPEG compression and decompression on x86, x86-64, ARM, PowerPC, and
|
||||
MIPS 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
|
||||
@@ -135,25 +135,24 @@ without recompiling. libjpeg-turbo does not claim to support all of the
|
||||
libjpeg v7+ features, nor to produce identical output to libjpeg v7+ in all
|
||||
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.
|
||||
By passing 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 API: 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 API: Arithmetic coding**
|
||||
|
||||
- **libjpeg: In-memory source and destination managers**<br>
|
||||
- **libjpeg API: In-memory source and destination managers**<br>
|
||||
See notes below.
|
||||
|
||||
- **cjpeg: Separate quality settings for luminance and chrominance**<br>
|
||||
@@ -185,14 +184,14 @@ means of quality improvement. The reader is invited to peruse the research at
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
- **libjpeg: DCT scaling in compressor**<br>
|
||||
- **libjpeg API: DCT scaling in compressor**<br>
|
||||
`cinfo.scale_num` and `cinfo.scale_denom` are silently ignored.
|
||||
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>
|
||||
- **libjpeg API: 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
|
||||
@@ -205,7 +204,7 @@ demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
interest in providing this feature would be as a means of supporting
|
||||
additional DCT scaling factors.
|
||||
|
||||
- **libjpeg: Fancy downsampling in compressor**<br>
|
||||
- **libjpeg API: Fancy downsampling in compressor**<br>
|
||||
`cinfo.do_fancy_downsampling` is silently ignored.
|
||||
This requires the DCT scaling feature, which is not supported.
|
||||
|
||||
@@ -247,15 +246,14 @@ don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
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
|
||||
v6b or v7 API can pass 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.
|
||||
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
@@ -331,7 +329,7 @@ in a way that makes the rest of the libjpeg infrastructure happy, so it is
|
||||
necessary to use the slow Huffman decoder when decompressing a JPEG image that
|
||||
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
|
||||
libjpeg. Many consumer packages, such as Photoshop, use restart markers when
|
||||
generating JPEG images, so images generated by those programs will experience
|
||||
this issue.
|
||||
|
||||
@@ -344,3 +342,15 @@ quality of 98-100. Thus, libjpeg-turbo must use the non-SIMD quantization
|
||||
function in those cases. This causes performance to drop by as much as 40%.
|
||||
It is therefore strongly advised that you use the slow integer forward DCT
|
||||
whenever encoding images with a JPEG quality of 98 or higher.
|
||||
|
||||
|
||||
Memory Debugger Pitfalls
|
||||
========================
|
||||
|
||||
Valgrind and Memory Sanitizer (MSan) can generate false positives
|
||||
(specifically, incorrect reports of uninitialized memory accesses) when used
|
||||
with libjpeg-turbo's SIMD extensions. It is generally recommended that the
|
||||
SIMD extensions be disabled, either by passing an argument of `-DWITH_SIMD=0`
|
||||
to `cmake` when configuring the build or by setting the environment variable
|
||||
`JSIMD_FORCENONE` to `1` at run time, when testing libjpeg-turbo with Valgrind,
|
||||
MSan, or other memory debuggers.
|
||||
|
||||
Vendored
+8
-4
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2014-2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2014-2016, 2018-2019, D. R. Commander.
|
||||
* Copyright (C) 2015, Matthieu Darbois.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
@@ -43,8 +43,8 @@
|
||||
*/
|
||||
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#if !defined __thumb__ || defined __thumb2__
|
||||
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||
#if !defined(__thumb__) || defined(__thumb2__)
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
#endif
|
||||
@@ -356,6 +356,8 @@ dump_buffer(working_state *state)
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
|
||||
#if SIZEOF_SIZE_T != 8 && !defined(_WIN64)
|
||||
|
||||
#define CHECKBUF15() { \
|
||||
if (put_bits > 15) { \
|
||||
EMIT_BYTE() \
|
||||
@@ -363,6 +365,8 @@ dump_buffer(working_state *state)
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define CHECKBUF31() { \
|
||||
if (put_bits > 31) { \
|
||||
EMIT_BYTE() \
|
||||
@@ -428,7 +432,7 @@ dump_buffer(working_state *state)
|
||||
* scanning order-- 1, 8, 16, etc.), then this will produce an encoded block
|
||||
* larger than 200 bytes.
|
||||
*/
|
||||
#define BUFSIZE (DCTSIZE2 * 4)
|
||||
#define BUFSIZE (DCTSIZE2 * 8)
|
||||
|
||||
#define LOAD_BUFFER() { \
|
||||
if (state->free_in_buffer < BUFSIZE) { \
|
||||
|
||||
Vendored
+105
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* jcicc.c
|
||||
*
|
||||
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||
* Copyright (C) 2017, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file provides code to write International Color Consortium (ICC) device
|
||||
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
|
||||
* for including such data in JPEG "APP2" markers. The code given here does
|
||||
* not know anything about the internal structure of the ICC profile data; it
|
||||
* just knows how to embed the profile data in a JPEG file while writing it.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
|
||||
|
||||
/*
|
||||
* Since an ICC profile can be larger than the maximum size of a JPEG marker
|
||||
* (64K), we need provisions to split it into multiple markers. The format
|
||||
* defined by the ICC specifies one or more APP2 markers containing the
|
||||
* following data:
|
||||
* Identifying string ASCII "ICC_PROFILE\0" (12 bytes)
|
||||
* Marker sequence number 1 for first APP2, 2 for next, etc (1 byte)
|
||||
* Number of markers Total number of APP2's used (1 byte)
|
||||
* Profile data (remainder of APP2 data)
|
||||
* Decoders should use the marker sequence numbers to reassemble the profile,
|
||||
* rather than assuming that the APP2 markers appear in the correct sequence.
|
||||
*/
|
||||
|
||||
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
|
||||
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
|
||||
#define MAX_BYTES_IN_MARKER 65533 /* maximum data len of a JPEG marker */
|
||||
#define MAX_DATA_BYTES_IN_MARKER (MAX_BYTES_IN_MARKER - ICC_OVERHEAD_LEN)
|
||||
|
||||
|
||||
/*
|
||||
* This routine writes the given ICC profile data into a JPEG file. It *must*
|
||||
* be called AFTER calling jpeg_start_compress() and BEFORE the first call to
|
||||
* jpeg_write_scanlines(). (This ordering ensures that the APP2 marker(s) will
|
||||
* appear after the SOI and JFIF or Adobe markers, but before all else.)
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_write_icc_profile(j_compress_ptr cinfo, const JOCTET *icc_data_ptr,
|
||||
unsigned int icc_data_len)
|
||||
{
|
||||
unsigned int num_markers; /* total number of markers we'll write */
|
||||
int cur_marker = 1; /* per spec, counting starts at 1 */
|
||||
unsigned int length; /* number of bytes to write in this marker */
|
||||
|
||||
if (icc_data_ptr == NULL || icc_data_len == 0)
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
if (cinfo->global_state < CSTATE_SCANNING)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
/* Calculate the number of markers we'll need, rounding up of course */
|
||||
num_markers = icc_data_len / MAX_DATA_BYTES_IN_MARKER;
|
||||
if (num_markers * MAX_DATA_BYTES_IN_MARKER != icc_data_len)
|
||||
num_markers++;
|
||||
|
||||
while (icc_data_len > 0) {
|
||||
/* length of profile to put in this marker */
|
||||
length = icc_data_len;
|
||||
if (length > MAX_DATA_BYTES_IN_MARKER)
|
||||
length = MAX_DATA_BYTES_IN_MARKER;
|
||||
icc_data_len -= length;
|
||||
|
||||
/* Write the JPEG marker header (APP2 code and marker length) */
|
||||
jpeg_write_m_header(cinfo, ICC_MARKER,
|
||||
(unsigned int)(length + ICC_OVERHEAD_LEN));
|
||||
|
||||
/* Write the marker identifying string "ICC_PROFILE" (null-terminated). We
|
||||
* code it in this less-than-transparent way so that the code works even if
|
||||
* the local character set is not ASCII.
|
||||
*/
|
||||
jpeg_write_m_byte(cinfo, 0x49);
|
||||
jpeg_write_m_byte(cinfo, 0x43);
|
||||
jpeg_write_m_byte(cinfo, 0x43);
|
||||
jpeg_write_m_byte(cinfo, 0x5F);
|
||||
jpeg_write_m_byte(cinfo, 0x50);
|
||||
jpeg_write_m_byte(cinfo, 0x52);
|
||||
jpeg_write_m_byte(cinfo, 0x4F);
|
||||
jpeg_write_m_byte(cinfo, 0x46);
|
||||
jpeg_write_m_byte(cinfo, 0x49);
|
||||
jpeg_write_m_byte(cinfo, 0x4C);
|
||||
jpeg_write_m_byte(cinfo, 0x45);
|
||||
jpeg_write_m_byte(cinfo, 0x0);
|
||||
|
||||
/* Add the sequencing info */
|
||||
jpeg_write_m_byte(cinfo, cur_marker);
|
||||
jpeg_write_m_byte(cinfo, (int)num_markers);
|
||||
|
||||
/* Add the profile data */
|
||||
while (length--) {
|
||||
jpeg_write_m_byte(cinfo, *icc_data_ptr);
|
||||
icc_data_ptr++;
|
||||
}
|
||||
cur_marker++;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -492,8 +492,8 @@ prepare_for_pass(j_compress_ptr cinfo)
|
||||
*/
|
||||
master->pass_type = output_pass;
|
||||
master->pass_number++;
|
||||
/*FALLTHROUGH*/
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case output_pass:
|
||||
/* Do a data-output pass. */
|
||||
/* We need not repeat per-scan setup if prior optimization pass did it. */
|
||||
|
||||
Vendored
+2
-2
@@ -52,8 +52,8 @@
|
||||
*/
|
||||
|
||||
/* NOTE: Both GCC and Clang define __GNUC__ */
|
||||
#if defined __GNUC__ && (defined __arm__ || defined __aarch64__)
|
||||
#if !defined __thumb__ || defined __thumb2__
|
||||
#if defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))
|
||||
#if !defined(__thumb__) || defined(__thumb2__)
|
||||
#define USE_CLZ_INTRINSIC
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Vendored
+7
-3
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, 2016, 2018, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2016, 2018-2019, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -589,7 +589,11 @@ decode_mcu_slow(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
if (entropy->dc_needed[blkn]) {
|
||||
/* Convert DC difference to actual value, update last_dc_val */
|
||||
int ci = cinfo->MCU_membership[blkn];
|
||||
s += state.last_dc_val[ci];
|
||||
/* This is really just
|
||||
* s += state.last_dc_val[ci];
|
||||
* It is written this way in order to shut up UBSan.
|
||||
*/
|
||||
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
|
||||
state.last_dc_val[ci] = s;
|
||||
if (block) {
|
||||
/* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
|
||||
@@ -684,7 +688,7 @@ decode_mcu_fast(j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
|
||||
if (entropy->dc_needed[blkn]) {
|
||||
int ci = cinfo->MCU_membership[blkn];
|
||||
s += state.last_dc_val[ci];
|
||||
s = (int)((unsigned int)s + (unsigned int)state.last_dc_val[ci]);
|
||||
state.last_dc_val[ci] = s;
|
||||
if (block)
|
||||
(*block)[0] = (JCOEF)s;
|
||||
|
||||
Vendored
+171
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* jdicc.c
|
||||
*
|
||||
* Copyright (C) 1997-1998, Thomas G. Lane, Todd Newman.
|
||||
* Copyright (C) 2017, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
* This file provides code to read International Color Consortium (ICC) device
|
||||
* profiles embedded in JFIF JPEG image files. The ICC has defined a standard
|
||||
* for including such data in JPEG "APP2" markers. The code given here does
|
||||
* not know anything about the internal structure of the ICC profile data; it
|
||||
* just knows how to get the profile data from a JPEG file while reading it.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "jinclude.h"
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
|
||||
#ifndef HAVE_STDLIB_H /* <stdlib.h> should declare malloc() */
|
||||
extern void *malloc(size_t size);
|
||||
#endif
|
||||
|
||||
|
||||
#define ICC_MARKER (JPEG_APP0 + 2) /* JPEG marker code for ICC */
|
||||
#define ICC_OVERHEAD_LEN 14 /* size of non-profile data in APP2 */
|
||||
|
||||
|
||||
/*
|
||||
* Handy subroutine to test whether a saved marker is an ICC profile marker.
|
||||
*/
|
||||
|
||||
LOCAL(boolean)
|
||||
marker_is_icc(jpeg_saved_marker_ptr marker)
|
||||
{
|
||||
return
|
||||
marker->marker == ICC_MARKER &&
|
||||
marker->data_length >= ICC_OVERHEAD_LEN &&
|
||||
/* verify the identifying string */
|
||||
GETJOCTET(marker->data[0]) == 0x49 &&
|
||||
GETJOCTET(marker->data[1]) == 0x43 &&
|
||||
GETJOCTET(marker->data[2]) == 0x43 &&
|
||||
GETJOCTET(marker->data[3]) == 0x5F &&
|
||||
GETJOCTET(marker->data[4]) == 0x50 &&
|
||||
GETJOCTET(marker->data[5]) == 0x52 &&
|
||||
GETJOCTET(marker->data[6]) == 0x4F &&
|
||||
GETJOCTET(marker->data[7]) == 0x46 &&
|
||||
GETJOCTET(marker->data[8]) == 0x49 &&
|
||||
GETJOCTET(marker->data[9]) == 0x4C &&
|
||||
GETJOCTET(marker->data[10]) == 0x45 &&
|
||||
GETJOCTET(marker->data[11]) == 0x0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* See if there was an ICC profile in the JPEG file being read; if so,
|
||||
* reassemble and return the profile data.
|
||||
*
|
||||
* TRUE is returned if an ICC profile was found, FALSE if not. If TRUE is
|
||||
* returned, *icc_data_ptr is set to point to the returned data, and
|
||||
* *icc_data_len is set to its length.
|
||||
*
|
||||
* IMPORTANT: the data at *icc_data_ptr is allocated with malloc() and must be
|
||||
* freed by the caller with free() when the caller no longer needs it.
|
||||
* (Alternatively, we could write this routine to use the IJG library's memory
|
||||
* allocator, so that the data would be freed implicitly when
|
||||
* jpeg_finish_decompress() is called. But it seems likely that many
|
||||
* applications will prefer to have the data stick around after decompression
|
||||
* finishes.)
|
||||
*/
|
||||
|
||||
GLOBAL(boolean)
|
||||
jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr,
|
||||
unsigned int *icc_data_len)
|
||||
{
|
||||
jpeg_saved_marker_ptr marker;
|
||||
int num_markers = 0;
|
||||
int seq_no;
|
||||
JOCTET *icc_data;
|
||||
unsigned int total_length;
|
||||
#define MAX_SEQ_NO 255 /* sufficient since marker numbers are bytes */
|
||||
char marker_present[MAX_SEQ_NO + 1]; /* 1 if marker found */
|
||||
unsigned int data_length[MAX_SEQ_NO + 1]; /* size of profile data in marker */
|
||||
unsigned int data_offset[MAX_SEQ_NO + 1]; /* offset for data in marker */
|
||||
|
||||
if (icc_data_ptr == NULL || icc_data_len == NULL)
|
||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||
if (cinfo->global_state < DSTATE_READY)
|
||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||
|
||||
*icc_data_ptr = NULL; /* avoid confusion if FALSE return */
|
||||
*icc_data_len = 0;
|
||||
|
||||
/* This first pass over the saved markers discovers whether there are
|
||||
* any ICC markers and verifies the consistency of the marker numbering.
|
||||
*/
|
||||
|
||||
for (seq_no = 1; seq_no <= MAX_SEQ_NO; seq_no++)
|
||||
marker_present[seq_no] = 0;
|
||||
|
||||
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
|
||||
if (marker_is_icc(marker)) {
|
||||
if (num_markers == 0)
|
||||
num_markers = GETJOCTET(marker->data[13]);
|
||||
else if (num_markers != GETJOCTET(marker->data[13])) {
|
||||
WARNMS(cinfo, JWRN_BOGUS_ICC); /* inconsistent num_markers fields */
|
||||
return FALSE;
|
||||
}
|
||||
seq_no = GETJOCTET(marker->data[12]);
|
||||
if (seq_no <= 0 || seq_no > num_markers) {
|
||||
WARNMS(cinfo, JWRN_BOGUS_ICC); /* bogus sequence number */
|
||||
return FALSE;
|
||||
}
|
||||
if (marker_present[seq_no]) {
|
||||
WARNMS(cinfo, JWRN_BOGUS_ICC); /* duplicate sequence numbers */
|
||||
return FALSE;
|
||||
}
|
||||
marker_present[seq_no] = 1;
|
||||
data_length[seq_no] = marker->data_length - ICC_OVERHEAD_LEN;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_markers == 0)
|
||||
return FALSE;
|
||||
|
||||
/* Check for missing markers, count total space needed,
|
||||
* compute offset of each marker's part of the data.
|
||||
*/
|
||||
|
||||
total_length = 0;
|
||||
for (seq_no = 1; seq_no <= num_markers; seq_no++) {
|
||||
if (marker_present[seq_no] == 0) {
|
||||
WARNMS(cinfo, JWRN_BOGUS_ICC); /* missing sequence number */
|
||||
return FALSE;
|
||||
}
|
||||
data_offset[seq_no] = total_length;
|
||||
total_length += data_length[seq_no];
|
||||
}
|
||||
|
||||
if (total_length == 0) {
|
||||
WARNMS(cinfo, JWRN_BOGUS_ICC); /* found only empty markers? */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Allocate space for assembled data */
|
||||
icc_data = (JOCTET *)malloc(total_length * sizeof(JOCTET));
|
||||
if (icc_data == NULL)
|
||||
ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 11); /* oops, out of memory */
|
||||
|
||||
/* and fill it in */
|
||||
for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
|
||||
if (marker_is_icc(marker)) {
|
||||
JOCTET FAR *src_ptr;
|
||||
JOCTET *dst_ptr;
|
||||
unsigned int length;
|
||||
seq_no = GETJOCTET(marker->data[12]);
|
||||
dst_ptr = icc_data + data_offset[seq_no];
|
||||
src_ptr = marker->data + ICC_OVERHEAD_LEN;
|
||||
length = data_length[seq_no];
|
||||
while (length--) {
|
||||
*dst_ptr++ = *src_ptr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*icc_data_ptr = icc_data;
|
||||
*icc_data_len = total_length;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
Vendored
-2
@@ -429,8 +429,6 @@ h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
|
||||
((INT16 *)(addr))[0] = (INT16)(pixels); \
|
||||
((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
|
||||
|
||||
+9
-5
@@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2010, 2015-2016, D. R. Commander.
|
||||
* Copyright (C) 2014, MIPS Technologies, Inc., California.
|
||||
* Copyright (C) 2015, Google, Inc.
|
||||
* Copyright (C) 2019, Arm Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr0, inptr1, outptr;
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
int thiscolsum;
|
||||
int thiscolsum, bias;
|
||||
#else
|
||||
JLONG thiscolsum;
|
||||
JLONG thiscolsum, bias;
|
||||
#endif
|
||||
JDIMENSION colctr;
|
||||
int inrow, outrow, v;
|
||||
@@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
for (v = 0; v < 2; v++) {
|
||||
/* inptr0 points to nearest input row, inptr1 points to next nearest */
|
||||
inptr0 = input_data[inrow];
|
||||
if (v == 0) /* next nearest is row above */
|
||||
if (v == 0) { /* next nearest is row above */
|
||||
inptr1 = input_data[inrow - 1];
|
||||
else /* next nearest is row below */
|
||||
bias = 1;
|
||||
} else { /* next nearest is row below */
|
||||
inptr1 = input_data[inrow + 1];
|
||||
bias = 2;
|
||||
}
|
||||
outptr = output_data[outrow++];
|
||||
|
||||
for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
|
||||
thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2);
|
||||
*outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
|
||||
}
|
||||
}
|
||||
inrow++;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jfdctint.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jidctint.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modification developed 2002-2009 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jidctred.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software.
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2015, D. R. Commander.
|
||||
|
||||
Vendored
-7
@@ -15,13 +15,6 @@ else()
|
||||
ocv_list_filterout(lib_srcs jmemnobs.c)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
add_definitions(-DNO_GETENV)
|
||||
get_directory_property( DirDefs COMPILE_DEFINITIONS )
|
||||
message(STATUS "Adding NO_GETENV to compiler definitions for WINRT:")
|
||||
message(STATUS " COMPILE_DEFINITIONS = ${DirDefs}")
|
||||
endif()
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
# Define the library target:
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+9
-6
@@ -1,7 +1,7 @@
|
||||
The Independent JPEG Group's JPEG software
|
||||
==========================================
|
||||
|
||||
README for release 9b of 17-Jan-2016
|
||||
README for release 9c of 14-Jan-2018
|
||||
====================================
|
||||
|
||||
This distribution contains the ninth public release of the Independent JPEG
|
||||
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
|
||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||
its user, assume the entire risk as to its quality and accuracy.
|
||||
|
||||
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
This software is copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
|
||||
All Rights Reserved except as specified below.
|
||||
|
||||
Permission is hereby granted to use, copy, modify, and distribute this
|
||||
@@ -246,8 +246,8 @@ ARCHIVE LOCATIONS
|
||||
The "official" archive site for this software is www.ijg.org.
|
||||
The most recent released version can always be found there in
|
||||
directory "files". This particular version will be archived as
|
||||
http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
|
||||
http://www.ijg.org/files/jpegsrc.v9c.tar.gz, and in Windows-compatible
|
||||
"zip" archive format as http://www.ijg.org/files/jpegsr9c.zip.
|
||||
|
||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||
general information about JPEG.
|
||||
@@ -293,8 +293,11 @@ communication about JPEG configuration in Sigma Photo Pro software.
|
||||
|
||||
Thank to Andrew Finkenstadt for hosting the ijg.org site.
|
||||
|
||||
Last but not least special thank to Thomas G. Lane for the original
|
||||
design and development of this singular software package.
|
||||
Thank to Thomas G. Lane for the original design and development of
|
||||
this singular software package.
|
||||
|
||||
Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
|
||||
Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
|
||||
|
||||
|
||||
FILE FORMAT WARS
|
||||
|
||||
Vendored
+21
@@ -1,6 +1,27 @@
|
||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||
|
||||
|
||||
Version 9c 14-Jan-2018
|
||||
-----------------------
|
||||
|
||||
jpegtran: add an option to the -wipe switch to fill the region
|
||||
with the average of adjacent blocks, instead of gray out.
|
||||
Thank to Caitlyn Feddock and Maddie Ziegler for inspiration.
|
||||
|
||||
Make range extension bits adjustable (in jpegint.h).
|
||||
Thank to Robin Watts for suggestion.
|
||||
|
||||
Provide macros for fflush() and ferror() in jinclude.h in order
|
||||
to facilitate adaption by applications using an own FILE class.
|
||||
Thank to Gerhard Huber for suggestion.
|
||||
|
||||
Add libjpeg pkg-config file. Thank to Mark Lavi, Vincent Torri,
|
||||
Patrick McMunn, and Huw Davies for suggestion.
|
||||
|
||||
Add sanity checks in cjpeg image reader modules.
|
||||
Thank to Bingchang, Liu for reports.
|
||||
|
||||
|
||||
Version 9b 17-Jan-2016
|
||||
-----------------------
|
||||
|
||||
|
||||
Vendored
+167
-2
@@ -2,7 +2,7 @@
|
||||
* jcinit.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2013 by Guido Vollbeding.
|
||||
* Modified 2003-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -21,6 +21,168 @@
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
/*
|
||||
* Compute JPEG image dimensions and related values.
|
||||
* NOTE: this is exported for possible use by application.
|
||||
* Hence it mustn't do anything that can't be done twice.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
/* Sanity check on input image dimensions to prevent overflow in
|
||||
* following calculations.
|
||||
* We do check jpeg_width and jpeg_height in initial_setup in jcmaster.c,
|
||||
* but image_width and image_height can come from arbitrary data,
|
||||
* and we need some space for multiplication by block_size.
|
||||
*/
|
||||
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
|
||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
||||
|
||||
#ifdef DCT_SCALING_SUPPORTED
|
||||
|
||||
/* Compute actual JPEG image dimensions and DCT scaling choices. */
|
||||
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/1 scaling */
|
||||
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
|
||||
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
|
||||
cinfo->min_DCT_h_scaled_size = 1;
|
||||
cinfo->min_DCT_v_scaled_size = 1;
|
||||
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/2 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
|
||||
cinfo->min_DCT_h_scaled_size = 2;
|
||||
cinfo->min_DCT_v_scaled_size = 2;
|
||||
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/3 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
|
||||
cinfo->min_DCT_h_scaled_size = 3;
|
||||
cinfo->min_DCT_v_scaled_size = 3;
|
||||
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/4 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
|
||||
cinfo->min_DCT_h_scaled_size = 4;
|
||||
cinfo->min_DCT_v_scaled_size = 4;
|
||||
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/5 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
|
||||
cinfo->min_DCT_h_scaled_size = 5;
|
||||
cinfo->min_DCT_v_scaled_size = 5;
|
||||
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/6 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
|
||||
cinfo->min_DCT_h_scaled_size = 6;
|
||||
cinfo->min_DCT_v_scaled_size = 6;
|
||||
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/7 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
|
||||
cinfo->min_DCT_h_scaled_size = 7;
|
||||
cinfo->min_DCT_v_scaled_size = 7;
|
||||
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/8 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
|
||||
cinfo->min_DCT_h_scaled_size = 8;
|
||||
cinfo->min_DCT_v_scaled_size = 8;
|
||||
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/9 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
|
||||
cinfo->min_DCT_h_scaled_size = 9;
|
||||
cinfo->min_DCT_v_scaled_size = 9;
|
||||
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/10 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
|
||||
cinfo->min_DCT_h_scaled_size = 10;
|
||||
cinfo->min_DCT_v_scaled_size = 10;
|
||||
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/11 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
|
||||
cinfo->min_DCT_h_scaled_size = 11;
|
||||
cinfo->min_DCT_v_scaled_size = 11;
|
||||
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/12 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
|
||||
cinfo->min_DCT_h_scaled_size = 12;
|
||||
cinfo->min_DCT_v_scaled_size = 12;
|
||||
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/13 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
|
||||
cinfo->min_DCT_h_scaled_size = 13;
|
||||
cinfo->min_DCT_v_scaled_size = 13;
|
||||
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/14 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
|
||||
cinfo->min_DCT_h_scaled_size = 14;
|
||||
cinfo->min_DCT_v_scaled_size = 14;
|
||||
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/15 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
|
||||
cinfo->min_DCT_h_scaled_size = 15;
|
||||
cinfo->min_DCT_v_scaled_size = 15;
|
||||
} else {
|
||||
/* Provide block_size/16 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
|
||||
cinfo->min_DCT_h_scaled_size = 16;
|
||||
cinfo->min_DCT_v_scaled_size = 16;
|
||||
}
|
||||
|
||||
#else /* !DCT_SCALING_SUPPORTED */
|
||||
|
||||
/* Hardwire it to "no scaling" */
|
||||
cinfo->jpeg_width = cinfo->image_width;
|
||||
cinfo->jpeg_height = cinfo->image_height;
|
||||
cinfo->min_DCT_h_scaled_size = DCTSIZE;
|
||||
cinfo->min_DCT_v_scaled_size = DCTSIZE;
|
||||
|
||||
#endif /* DCT_SCALING_SUPPORTED */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Master selection of compression modules.
|
||||
* This is done once at the start of processing an image. We determine
|
||||
@@ -37,7 +199,7 @@ jinit_compress_master (j_compress_ptr cinfo)
|
||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||
|
||||
/* Sanity check on image dimensions */
|
||||
/* Sanity check on input image dimensions */
|
||||
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
||||
cinfo->input_components <= 0)
|
||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||
@@ -48,6 +210,9 @@ jinit_compress_master (j_compress_ptr cinfo)
|
||||
if ((long) jd_samplesperrow != samplesperrow)
|
||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||
|
||||
/* Compute JPEG image dimensions and related values. */
|
||||
jpeg_calc_jpeg_dimensions(cinfo);
|
||||
|
||||
/* Initialize master control (includes parameter checking/processing) */
|
||||
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
||||
|
||||
|
||||
Vendored
+5
-187
@@ -2,7 +2,7 @@
|
||||
* jcmaster.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2003-2013 by Guido Vollbeding.
|
||||
* Modified 2003-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -43,191 +43,13 @@ typedef my_comp_master * my_master_ptr;
|
||||
* Support routines that do various essential calculations.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Compute JPEG image dimensions and related values.
|
||||
* NOTE: this is exported for possible use by application.
|
||||
* Hence it mustn't do anything that can't be done twice.
|
||||
*/
|
||||
|
||||
GLOBAL(void)
|
||||
jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
#ifdef DCT_SCALING_SUPPORTED
|
||||
|
||||
/* Sanity check on input image dimensions to prevent overflow in
|
||||
* following calculation.
|
||||
* We do check jpeg_width and jpeg_height in initial_setup below,
|
||||
* but image_width and image_height can come from arbitrary data,
|
||||
* and we need some space for multiplication by block_size.
|
||||
*/
|
||||
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
|
||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
||||
|
||||
/* Compute actual JPEG image dimensions and DCT scaling choices. */
|
||||
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/1 scaling */
|
||||
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
|
||||
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
|
||||
cinfo->min_DCT_h_scaled_size = 1;
|
||||
cinfo->min_DCT_v_scaled_size = 1;
|
||||
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/2 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
|
||||
cinfo->min_DCT_h_scaled_size = 2;
|
||||
cinfo->min_DCT_v_scaled_size = 2;
|
||||
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/3 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
|
||||
cinfo->min_DCT_h_scaled_size = 3;
|
||||
cinfo->min_DCT_v_scaled_size = 3;
|
||||
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/4 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
|
||||
cinfo->min_DCT_h_scaled_size = 4;
|
||||
cinfo->min_DCT_v_scaled_size = 4;
|
||||
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/5 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
|
||||
cinfo->min_DCT_h_scaled_size = 5;
|
||||
cinfo->min_DCT_v_scaled_size = 5;
|
||||
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/6 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
|
||||
cinfo->min_DCT_h_scaled_size = 6;
|
||||
cinfo->min_DCT_v_scaled_size = 6;
|
||||
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/7 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
|
||||
cinfo->min_DCT_h_scaled_size = 7;
|
||||
cinfo->min_DCT_v_scaled_size = 7;
|
||||
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/8 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
|
||||
cinfo->min_DCT_h_scaled_size = 8;
|
||||
cinfo->min_DCT_v_scaled_size = 8;
|
||||
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/9 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
|
||||
cinfo->min_DCT_h_scaled_size = 9;
|
||||
cinfo->min_DCT_v_scaled_size = 9;
|
||||
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/10 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
|
||||
cinfo->min_DCT_h_scaled_size = 10;
|
||||
cinfo->min_DCT_v_scaled_size = 10;
|
||||
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/11 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
|
||||
cinfo->min_DCT_h_scaled_size = 11;
|
||||
cinfo->min_DCT_v_scaled_size = 11;
|
||||
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/12 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
|
||||
cinfo->min_DCT_h_scaled_size = 12;
|
||||
cinfo->min_DCT_v_scaled_size = 12;
|
||||
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/13 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
|
||||
cinfo->min_DCT_h_scaled_size = 13;
|
||||
cinfo->min_DCT_v_scaled_size = 13;
|
||||
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/14 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
|
||||
cinfo->min_DCT_h_scaled_size = 14;
|
||||
cinfo->min_DCT_v_scaled_size = 14;
|
||||
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
|
||||
/* Provide block_size/15 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
|
||||
cinfo->min_DCT_h_scaled_size = 15;
|
||||
cinfo->min_DCT_v_scaled_size = 15;
|
||||
} else {
|
||||
/* Provide block_size/16 scaling */
|
||||
cinfo->jpeg_width = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
|
||||
cinfo->jpeg_height = (JDIMENSION)
|
||||
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
|
||||
cinfo->min_DCT_h_scaled_size = 16;
|
||||
cinfo->min_DCT_v_scaled_size = 16;
|
||||
}
|
||||
|
||||
#else /* !DCT_SCALING_SUPPORTED */
|
||||
|
||||
/* Hardwire it to "no scaling" */
|
||||
cinfo->jpeg_width = cinfo->image_width;
|
||||
cinfo->jpeg_height = cinfo->image_height;
|
||||
cinfo->min_DCT_h_scaled_size = DCTSIZE;
|
||||
cinfo->min_DCT_v_scaled_size = DCTSIZE;
|
||||
|
||||
#endif /* DCT_SCALING_SUPPORTED */
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
|
||||
{
|
||||
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
|
||||
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
|
||||
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
|
||||
|
||||
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
||||
initial_setup (j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
int ci, ssize;
|
||||
jpeg_component_info *compptr;
|
||||
|
||||
if (transcode_only)
|
||||
jpeg_calc_trans_dimensions(cinfo);
|
||||
else
|
||||
jpeg_calc_jpeg_dimensions(cinfo);
|
||||
|
||||
/* Sanity check on block_size */
|
||||
if (cinfo->block_size < 1 || cinfo->block_size > 16)
|
||||
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
|
||||
@@ -414,13 +236,9 @@ validate_script (j_compress_ptr cinfo)
|
||||
* out-of-range reconstructed DC values during the first DC scan,
|
||||
* 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)
|
||||
Ah < 0 || Ah > (cinfo->data_precision > 8 ? 13 : 10) ||
|
||||
Al < 0 || Al > (cinfo->data_precision > 8 ? 13 : 10))
|
||||
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
|
||||
if (Ss == 0) {
|
||||
if (Se != 0) /* DC and AC together not OK */
|
||||
@@ -812,7 +630,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
master->pub.is_last_pass = FALSE;
|
||||
|
||||
/* Validate parameters, determine derived values */
|
||||
initial_setup(cinfo, transcode_only);
|
||||
initial_setup(cinfo);
|
||||
|
||||
if (cinfo->scan_info != NULL) {
|
||||
#ifdef C_MULTISCAN_FILES_SUPPORTED
|
||||
|
||||
Vendored
+21
-3
@@ -2,7 +2,7 @@
|
||||
* jctrans.c
|
||||
*
|
||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||
* Modified 2000-2013 by Guido Vollbeding.
|
||||
* Modified 2000-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -85,12 +85,15 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
||||
jpeg_set_defaults(dstinfo);
|
||||
/* jpeg_set_defaults may choose wrong colorspace, eg YCbCr if input is RGB.
|
||||
* Fix it to get the right header markers for the image colorspace.
|
||||
* Note: Entropy table assignment in jpeg_set_colorspace depends
|
||||
* on color_transform.
|
||||
* Note: Entropy table assignment in jpeg_set_colorspace
|
||||
* depends on color_transform.
|
||||
* Adaption is also required for setting the appropriate
|
||||
* entropy coding mode dependent on image data precision.
|
||||
*/
|
||||
dstinfo->color_transform = srcinfo->color_transform;
|
||||
jpeg_set_colorspace(dstinfo, srcinfo->jpeg_color_space);
|
||||
dstinfo->data_precision = srcinfo->data_precision;
|
||||
dstinfo->arith_code = srcinfo->data_precision > 8 ? TRUE : FALSE;
|
||||
dstinfo->CCIR601_sampling = srcinfo->CCIR601_sampling;
|
||||
/* Copy the source's quantization tables. */
|
||||
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
|
||||
@@ -157,6 +160,18 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
||||
}
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
|
||||
/* Do computations that are needed before master selection phase */
|
||||
{
|
||||
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
|
||||
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
|
||||
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
|
||||
|
||||
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Master selection of compression modules for transcoding.
|
||||
* This substitutes for jcinit.c's initialization of the full compressor.
|
||||
@@ -166,6 +181,9 @@ LOCAL(void)
|
||||
transencode_master_selection (j_compress_ptr cinfo,
|
||||
jvirt_barray_ptr * coef_arrays)
|
||||
{
|
||||
/* Do computations that are needed before master selection phase */
|
||||
jpeg_calc_trans_dimensions(cinfo);
|
||||
|
||||
/* Initialize master control (includes parameter checking/processing) */
|
||||
jinit_c_master_control(cinfo, TRUE /* transcode only */);
|
||||
|
||||
|
||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
||||
* jdatadst.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2009-2012 by Guido Vollbeding.
|
||||
* Modified 2009-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -170,9 +170,9 @@ term_destination (j_compress_ptr cinfo)
|
||||
if (JFWRITE(dest->outfile, dest->buffer, datacount) != datacount)
|
||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||
}
|
||||
fflush(dest->outfile);
|
||||
JFFLUSH(dest->outfile);
|
||||
/* Make sure we wrote the output file OK */
|
||||
if (ferror(dest->outfile))
|
||||
if (JFERROR(dest->outfile))
|
||||
ERREXIT(cinfo, JERR_FILE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
Vendored
+7
-1
@@ -2,7 +2,7 @@
|
||||
* jdcolor.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2011-2015 by Guido Vollbeding.
|
||||
* Modified 2011-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -14,6 +14,12 @@
|
||||
#include "jpeglib.h"
|
||||
|
||||
|
||||
#if RANGE_BITS < 2
|
||||
/* Deliberate syntax err */
|
||||
Sorry, this code requires 2 or more range extension bits.
|
||||
#endif
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
|
||||
Vendored
+5
-6
@@ -2,7 +2,7 @@
|
||||
* jdct.h
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2002-2015 by Guido Vollbeding.
|
||||
* Modified 2002-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -79,13 +79,12 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
|
||||
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
||||
* 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, assuming that MAXJSAMPLE+1
|
||||
* is a power of 2. See the comments with prepare_range_limit_table
|
||||
* (in jdmaster.c) for more info.
|
||||
* to do the combined operations quickly, assuming that RANGE_CENTER
|
||||
* (defined in jpegint.h) is a power of 2. See the comments with
|
||||
* prepare_range_limit_table (in jdmaster.c) for more info.
|
||||
*/
|
||||
|
||||
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
|
||||
#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
|
||||
#define RANGE_MASK (RANGE_CENTER * 2 - 1)
|
||||
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
|
||||
|
||||
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
|
||||
|
||||
Vendored
+4
-5
@@ -2,7 +2,7 @@
|
||||
* jdhuff.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2006-2013 by Guido Vollbeding.
|
||||
* Modified 2006-2016 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -799,10 +799,6 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
*/
|
||||
if (! entropy->insufficient_data) {
|
||||
|
||||
Se = cinfo->Se;
|
||||
Al = cinfo->Al;
|
||||
natural_order = cinfo->natural_order;
|
||||
|
||||
/* Load up working state.
|
||||
* We can avoid loading/saving bitread state if in an EOB run.
|
||||
*/
|
||||
@@ -814,6 +810,9 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||
EOBRUN--; /* ...process it now (we do nothing) */
|
||||
else {
|
||||
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
||||
Se = cinfo->Se;
|
||||
Al = cinfo->Al;
|
||||
natural_order = cinfo->natural_order;
|
||||
block = MCU_data[0];
|
||||
tbl = entropy->ac_derived_tbl;
|
||||
|
||||
|
||||
Vendored
+20
-26
@@ -2,7 +2,7 @@
|
||||
* jdmainct.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2002-2012 by Guido Vollbeding.
|
||||
* Modified 2002-2016 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -26,8 +26,8 @@
|
||||
* trivial. Its responsibility is to provide context rows for upsampling/
|
||||
* rescaling, and doing this in an efficient fashion is a bit tricky.
|
||||
*
|
||||
* Postprocessor input data is counted in "row groups". A row group
|
||||
* is defined to be (v_samp_factor * DCT_scaled_size / min_DCT_scaled_size)
|
||||
* Postprocessor input data is counted in "row groups". A row group is
|
||||
* defined to be (v_samp_factor * DCT_v_scaled_size / min_DCT_v_scaled_size)
|
||||
* sample rows of each component. (We require DCT_scaled_size values to be
|
||||
* chosen such that these numbers are integers. In practice DCT_scaled_size
|
||||
* values will likely be powers of two, so we actually have the stronger
|
||||
@@ -37,8 +37,8 @@
|
||||
* applying).
|
||||
*
|
||||
* The coefficient controller will deliver data to us one iMCU row at a time;
|
||||
* each iMCU row contains v_samp_factor * DCT_scaled_size sample rows, or
|
||||
* exactly min_DCT_scaled_size row groups. (This amount of data corresponds
|
||||
* each iMCU row contains v_samp_factor * DCT_v_scaled_size sample rows, or
|
||||
* exactly min_DCT_v_scaled_size row groups. (This amount of data corresponds
|
||||
* to one row of MCUs when the image is fully interleaved.) Note that the
|
||||
* number of sample rows varies across components, but the number of row
|
||||
* groups does not. Some garbage sample rows may be included in the last iMCU
|
||||
@@ -75,7 +75,7 @@
|
||||
* We could do this most simply by copying data around in our buffer, but
|
||||
* that'd be very slow. We can avoid copying any data by creating a rather
|
||||
* strange pointer structure. Here's how it works. We allocate a workspace
|
||||
* consisting of M+2 row groups (where M = min_DCT_scaled_size is the number
|
||||
* consisting of M+2 row groups (where M = min_DCT_v_scaled_size is the number
|
||||
* of row groups per iMCU row). We create two sets of redundant pointers to
|
||||
* the workspace. Labeling the physical row groups 0 to M+1, the synthesized
|
||||
* pointer lists look like this:
|
||||
@@ -100,11 +100,11 @@
|
||||
* the first or last sample row as necessary (this is cheaper than copying
|
||||
* sample rows around).
|
||||
*
|
||||
* This scheme breaks down if M < 2, ie, min_DCT_scaled_size is 1. In that
|
||||
* This scheme breaks down if M < 2, ie, min_DCT_v_scaled_size is 1. In that
|
||||
* situation each iMCU row provides only one row group so the buffering logic
|
||||
* must be different (eg, we must read two iMCU rows before we can emit the
|
||||
* first row group). For now, we simply do not support providing context
|
||||
* rows when min_DCT_scaled_size is 1. That combination seems unlikely to
|
||||
* rows when min_DCT_v_scaled_size is 1. That combination seems unlikely to
|
||||
* be worth providing --- if someone wants a 1/8th-size preview, they probably
|
||||
* want it quick and dirty, so a context-free upsampler is sufficient.
|
||||
*/
|
||||
@@ -118,17 +118,18 @@ typedef struct {
|
||||
/* Pointer to allocated workspace (M or M+2 row groups). */
|
||||
JSAMPARRAY buffer[MAX_COMPONENTS];
|
||||
|
||||
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
|
||||
JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */
|
||||
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
|
||||
|
||||
/* Remaining fields are only used in the context case. */
|
||||
|
||||
boolean buffer_full; /* Have we gotten an iMCU row from decoder? */
|
||||
|
||||
/* These are the master pointers to the funny-order pointer lists. */
|
||||
JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */
|
||||
|
||||
int whichptr; /* indicates which pointer set is now in use */
|
||||
int context_state; /* process_data state machine status */
|
||||
JDIMENSION rowgroups_avail; /* row groups available to postprocessor */
|
||||
JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */
|
||||
} my_main_controller;
|
||||
|
||||
@@ -195,7 +196,7 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
|
||||
LOCAL(void)
|
||||
make_funny_pointers (j_decompress_ptr cinfo)
|
||||
/* Create the funny pointer lists discussed in the comments above.
|
||||
* The actual workspace is already allocated (in main->buffer),
|
||||
* The actual workspace is already allocated (in mainp->buffer),
|
||||
* and the space for the pointer lists is allocated too.
|
||||
* This routine just fills in the curiously ordered lists.
|
||||
* This will be repeated at the beginning of each pass.
|
||||
@@ -317,12 +318,12 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
|
||||
mainp->whichptr = 0; /* Read first iMCU row into xbuffer[0] */
|
||||
mainp->context_state = CTX_PREPARE_FOR_IMCU;
|
||||
mainp->iMCU_row_ctr = 0;
|
||||
mainp->buffer_full = FALSE; /* Mark buffer empty */
|
||||
} else {
|
||||
/* Simple case with no context needed */
|
||||
mainp->pub.process_data = process_data_simple_main;
|
||||
mainp->rowgroup_ctr = mainp->rowgroups_avail; /* Mark buffer empty */
|
||||
}
|
||||
mainp->buffer_full = FALSE; /* Mark buffer empty */
|
||||
mainp->rowgroup_ctr = 0;
|
||||
break;
|
||||
#ifdef QUANT_2PASS_SUPPORTED
|
||||
case JBUF_CRANK_DEST:
|
||||
@@ -348,17 +349,14 @@ process_data_simple_main (j_decompress_ptr cinfo,
|
||||
JDIMENSION out_rows_avail)
|
||||
{
|
||||
my_main_ptr mainp = (my_main_ptr) cinfo->main;
|
||||
JDIMENSION rowgroups_avail;
|
||||
|
||||
/* Read input data if we haven't filled the main buffer yet */
|
||||
if (! mainp->buffer_full) {
|
||||
if (mainp->rowgroup_ctr >= mainp->rowgroups_avail) {
|
||||
if (! (*cinfo->coef->decompress_data) (cinfo, mainp->buffer))
|
||||
return; /* suspension forced, can do nothing more */
|
||||
mainp->buffer_full = TRUE; /* OK, we have an iMCU row to work with */
|
||||
mainp->rowgroup_ctr = 0; /* OK, we have an iMCU row to work with */
|
||||
}
|
||||
|
||||
/* There are always min_DCT_scaled_size row groups in an iMCU row. */
|
||||
rowgroups_avail = (JDIMENSION) cinfo->min_DCT_v_scaled_size;
|
||||
/* Note: at the bottom of the image, we may pass extra garbage row groups
|
||||
* to the postprocessor. The postprocessor has to check for bottom
|
||||
* of image anyway (at row resolution), so no point in us doing it too.
|
||||
@@ -366,14 +364,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
|
||||
|
||||
/* Feed the postprocessor */
|
||||
(*cinfo->post->post_process_data) (cinfo, mainp->buffer,
|
||||
&mainp->rowgroup_ctr, rowgroups_avail,
|
||||
output_buf, out_row_ctr, out_rows_avail);
|
||||
|
||||
/* Has postprocessor consumed all the data yet? If so, mark buffer empty */
|
||||
if (mainp->rowgroup_ctr >= rowgroups_avail) {
|
||||
mainp->buffer_full = FALSE;
|
||||
mainp->rowgroup_ctr = 0;
|
||||
}
|
||||
&mainp->rowgroup_ctr, mainp->rowgroups_avail,
|
||||
output_buf, out_row_ctr, out_rows_avail);
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +490,9 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
|
||||
alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
|
||||
ngroups = cinfo->min_DCT_v_scaled_size + 2;
|
||||
} else {
|
||||
/* There are always min_DCT_v_scaled_size row groups in an iMCU row. */
|
||||
ngroups = cinfo->min_DCT_v_scaled_size;
|
||||
mainp->rowgroups_avail = (JDIMENSION) ngroups;
|
||||
}
|
||||
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
|
||||
Vendored
+6
-7
@@ -2,7 +2,7 @@
|
||||
* jdmaster.c
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 2002-2015 by Guido Vollbeding.
|
||||
* Modified 2002-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -237,18 +237,17 @@ prepare_range_limit_table (j_decompress_ptr cinfo)
|
||||
JSAMPLE * table;
|
||||
int i;
|
||||
|
||||
table = (JSAMPLE *)
|
||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
||||
table = (JSAMPLE *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
|
||||
JPOOL_IMAGE, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
|
||||
/* First segment of range limit table: limit[x] = 0 for x < 0 */
|
||||
MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
||||
table += 2 * (MAXJSAMPLE+1); /* allow negative subscripts of table */
|
||||
MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
|
||||
table += RANGE_CENTER; /* allow negative subscripts of table */
|
||||
cinfo->sample_range_limit = table;
|
||||
/* Main part of range limit table: limit[x] = x */
|
||||
for (i = 0; i <= MAXJSAMPLE; i++)
|
||||
table[i] = (JSAMPLE) i;
|
||||
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
|
||||
for (; i < 3 * (MAXJSAMPLE+1); i++)
|
||||
for (; i <= MAXJSAMPLE + RANGE_CENTER; i++)
|
||||
table[i] = MAXJSAMPLE;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+7
-1
@@ -2,7 +2,7 @@
|
||||
* jdmerge.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2013-2015 by Guido Vollbeding.
|
||||
* Modified 2013-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -40,6 +40,12 @@
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
#if RANGE_BITS < 2
|
||||
/* Deliberate syntax err */
|
||||
Sorry, this code requires 2 or more range extension bits.
|
||||
#endif
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
|
||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
||||
* jfdctflt.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2003-2015 by Guido Vollbeding.
|
||||
* Modified 2003-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
#if DCTSIZE != 8
|
||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
||||
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
||||
* jfdctfst.c
|
||||
*
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2003-2015 by Guido Vollbeding.
|
||||
* Modified 2003-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#if DCTSIZE != 8
|
||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
||||
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
||||
* jidctflt.c
|
||||
*
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2010-2015 by Guido Vollbeding.
|
||||
* Modified 2010-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
#if DCTSIZE != 8
|
||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
||||
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
||||
* jidctfst.c
|
||||
*
|
||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||
* Modified 2015 by Guido Vollbeding.
|
||||
* Modified 2015-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -46,7 +46,7 @@
|
||||
*/
|
||||
|
||||
#if DCTSIZE != 8
|
||||
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
|
||||
Sorry, this code only copes with 8x8 DCT blocks. /* deliberate syntax err */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Vendored
+18
-17
@@ -2,7 +2,7 @@
|
||||
* jidctint.c
|
||||
*
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modification developed 2002-2015 by Guido Vollbeding.
|
||||
* Modification developed 2002-2016 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -166,6 +166,7 @@
|
||||
/*
|
||||
* Perform dequantization and inverse DCT on one block of coefficients.
|
||||
*
|
||||
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
||||
* cK represents sqrt(2) * cos(K*pi/16).
|
||||
*/
|
||||
|
||||
@@ -428,7 +429,7 @@ jpeg_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
|
||||
/*
|
||||
* Perform dequantization and inverse DCT on one block of coefficients,
|
||||
* producing a 7x7 output block.
|
||||
* producing a reduced-size 7x7 output block.
|
||||
*
|
||||
* Optimized algorithm with 12 multiplications in the 1-D kernel.
|
||||
* cK represents sqrt(2) * cos(K*pi/14).
|
||||
@@ -2623,7 +2624,7 @@ jpeg_idct_16x16 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||
tmp0 <<= CONST_BITS;
|
||||
/* Add fudge factor here for final descale. */
|
||||
tmp0 += 1 << (CONST_BITS-PASS1_BITS-1);
|
||||
tmp0 += ONE << (CONST_BITS-PASS1_BITS-1);
|
||||
|
||||
z1 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||
tmp1 = MULTIPLY(z1, FIX(1.306562965)); /* c4[16] = c2[8] */
|
||||
@@ -2920,13 +2921,6 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
* The rotator is c(-6).
|
||||
*/
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||
|
||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||
z2 <<= CONST_BITS;
|
||||
@@ -2937,6 +2931,13 @@ jpeg_idct_16x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
tmp0 = z2 + z3;
|
||||
tmp1 = z2 - z3;
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||
|
||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||
|
||||
tmp10 = tmp0 + tmp2;
|
||||
tmp13 = tmp0 - tmp2;
|
||||
tmp11 = tmp1 + tmp3;
|
||||
@@ -4883,13 +4884,6 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
* The rotator is c(-6).
|
||||
*/
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||
|
||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
|
||||
z2 <<= CONST_BITS;
|
||||
@@ -4900,6 +4894,13 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
tmp0 = z2 + z3;
|
||||
tmp1 = z2 - z3;
|
||||
|
||||
z2 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);
|
||||
z3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);
|
||||
|
||||
z1 = MULTIPLY(z2 + z3, FIX_0_541196100); /* c6 */
|
||||
tmp2 = z1 + MULTIPLY(z2, FIX_0_765366865); /* c2-c6 */
|
||||
tmp3 = z1 - MULTIPLY(z3, FIX_1_847759065); /* c2+c6 */
|
||||
|
||||
tmp10 = tmp0 + tmp2;
|
||||
tmp13 = tmp0 - tmp2;
|
||||
tmp11 = tmp1 + tmp3;
|
||||
|
||||
Vendored
+6
@@ -2,6 +2,7 @@
|
||||
* jinclude.h
|
||||
*
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* Modified 2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -83,9 +84,14 @@
|
||||
* The modules that use fread() and fwrite() always invoke them through
|
||||
* these macros. On some systems you may need to twiddle the argument casts.
|
||||
* CAUTION: argument order is different from underlying functions!
|
||||
*
|
||||
* Furthermore, macros are provided for fflush() and ferror() in order
|
||||
* to facilitate adaption by applications using an own FILE class.
|
||||
*/
|
||||
|
||||
#define JFREAD(file,buf,sizeofbuf) \
|
||||
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
#define JFWRITE(file,buf,sizeofbuf) \
|
||||
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
#define JFFLUSH(file) fflush(file)
|
||||
#define JFERROR(file) ferror(file)
|
||||
|
||||
Vendored
+14
-1
@@ -2,7 +2,7 @@
|
||||
* jpegint.h
|
||||
*
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modified 1997-2013 by Guido Vollbeding.
|
||||
* Modified 1997-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -260,6 +260,19 @@ struct jpeg_color_quantizer {
|
||||
};
|
||||
|
||||
|
||||
/* Definition of range extension bits for decompression processes.
|
||||
* See the comments with prepare_range_limit_table (in jdmaster.c)
|
||||
* for more info.
|
||||
* The recommended default value for normal applications is 2.
|
||||
* Applications with special requirements may use a different value.
|
||||
* For example, Ghostscript wants to use 3 for proper handling of
|
||||
* wacky images with oversize coefficient values.
|
||||
*/
|
||||
|
||||
#define RANGE_BITS 2
|
||||
#define RANGE_CENTER (CENTERJSAMPLE << RANGE_BITS)
|
||||
|
||||
|
||||
/* Miscellaneous useful macros */
|
||||
|
||||
#undef MAX
|
||||
|
||||
Vendored
+14
-14
@@ -2,7 +2,7 @@
|
||||
* jpeglib.h
|
||||
*
|
||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||
* Modified 2002-2015 by Guido Vollbeding.
|
||||
* Modified 2002-2017 by Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -39,7 +39,7 @@ extern "C" {
|
||||
|
||||
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
|
||||
#define JPEG_LIB_VERSION_MAJOR 9
|
||||
#define JPEG_LIB_VERSION_MINOR 2
|
||||
#define JPEG_LIB_VERSION_MINOR 3
|
||||
|
||||
|
||||
/* Various constants determining the sizes of things.
|
||||
@@ -137,9 +137,9 @@ typedef struct {
|
||||
/* The decompressor output side may not use these variables. */
|
||||
int dc_tbl_no; /* DC entropy table selector (0..3) */
|
||||
int ac_tbl_no; /* AC entropy table selector (0..3) */
|
||||
|
||||
|
||||
/* Remaining fields should be treated as private by applications. */
|
||||
|
||||
|
||||
/* These values are computed during compression or decompression startup: */
|
||||
/* Component's size in DCT blocks.
|
||||
* Any dummy blocks added to complete an MCU are not counted; therefore
|
||||
@@ -411,10 +411,10 @@ struct jpeg_compress_struct {
|
||||
JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
|
||||
/* The coefficient controller receives data in units of MCU rows as defined
|
||||
* for fully interleaved scans (whether the JPEG file is interleaved or not).
|
||||
* There are v_samp_factor * DCTSIZE sample rows of each component in an
|
||||
* "iMCU" (interleaved MCU) row.
|
||||
* There are v_samp_factor * DCT_v_scaled_size sample rows of each component
|
||||
* in an "iMCU" (interleaved MCU) row.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* These fields are valid during any one scan.
|
||||
* They describe the components and MCUs actually appearing in the scan.
|
||||
@@ -422,10 +422,10 @@ struct jpeg_compress_struct {
|
||||
int comps_in_scan; /* # of JPEG components in this scan */
|
||||
jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
|
||||
/* *cur_comp_info[i] describes component that appears i'th in SOS */
|
||||
|
||||
|
||||
JDIMENSION MCUs_per_row; /* # of MCUs across the image */
|
||||
JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
|
||||
|
||||
|
||||
int blocks_in_MCU; /* # of DCT blocks per MCU */
|
||||
int MCU_membership[C_MAX_BLOCKS_IN_MCU];
|
||||
/* MCU_membership[i] is index in cur_comp_info of component owning */
|
||||
@@ -636,7 +636,7 @@ struct jpeg_decompress_struct {
|
||||
* in fully interleaved JPEG scans, but are used whether the scan is
|
||||
* interleaved or not. We define an iMCU row as v_samp_factor DCT block
|
||||
* rows of each component. Therefore, the IDCT output contains
|
||||
* v_samp_factor*DCT_v_scaled_size sample rows of a component per iMCU row.
|
||||
* v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row.
|
||||
*/
|
||||
|
||||
JSAMPLE * sample_range_limit; /* table for fast range-limiting */
|
||||
@@ -711,7 +711,7 @@ struct jpeg_error_mgr {
|
||||
#define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
|
||||
/* Reset error state variables at start of a new image */
|
||||
JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
|
||||
|
||||
|
||||
/* The message ID code and any parameters are saved here.
|
||||
* A message can have one string parameter or up to 8 int parameters.
|
||||
*/
|
||||
@@ -721,11 +721,11 @@ struct jpeg_error_mgr {
|
||||
int i[8];
|
||||
char s[JMSG_STR_PARM_MAX];
|
||||
} msg_parm;
|
||||
|
||||
|
||||
/* Standard state variables for error facility */
|
||||
|
||||
|
||||
int trace_level; /* max msg_level that will be displayed */
|
||||
|
||||
|
||||
/* For recoverable corrupt-data errors, we emit a warning message,
|
||||
* but keep going unless emit_message chooses to abort. emit_message
|
||||
* should count warnings in num_warnings. The surrounding application
|
||||
|
||||
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* jversion.h
|
||||
*
|
||||
* Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||
* Copyright (C) 1991-2018, Thomas G. Lane, Guido Vollbeding.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -9,6 +9,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#define JVERSION "9b 17-Jan-2016"
|
||||
#define JVERSION "9c 14-Jan-2018"
|
||||
|
||||
#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"
|
||||
#define JCOPYRIGHT "Copyright (C) 2018, Thomas G. Lane, Guido Vollbeding"
|
||||
|
||||
Vendored
+26
-13
@@ -6066,31 +6066,44 @@ Version 1.6.35 [July 15, 2018]
|
||||
Version 1.6.36 [December 1, 2018]
|
||||
Optimized png_do_expand_palette for ARM processors.
|
||||
Improved performance by around 10-22% on a recent ARM Chromebook.
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
(Contributed by Richard Townsend, ARM Holdings)
|
||||
Fixed manipulation of machine-specific optimization options.
|
||||
(Contributed by Vicki Pfau)
|
||||
(Contributed by Vicki Pfau)
|
||||
Used memcpy instead of manual pointer arithmetic on Intel SSE2.
|
||||
(Contributed by Samuel Williams)
|
||||
(Contributed by Samuel Williams)
|
||||
Fixed build errors with MSVC on ARM64.
|
||||
(Contributed by Zhijie Liang)
|
||||
(Contributed by Zhijie Liang)
|
||||
Fixed detection of libm in CMakeLists.
|
||||
(Contributed by Cameron Cawley)
|
||||
(Contributed by Cameron Cawley)
|
||||
Fixed incorrect creation of pkg-config file in CMakeLists.
|
||||
(Contributed by Kyle Bentley)
|
||||
(Contributed by Kyle Bentley)
|
||||
Fixed the CMake build on Windows MSYS by avoiding symlinks.
|
||||
Fixed a build warning on OpenBSD.
|
||||
(Contributed by Theo Buehler)
|
||||
(Contributed by Theo Buehler)
|
||||
Fixed various typos in comments.
|
||||
(Contributed by "luz.paz")
|
||||
(Contributed by "luz.paz")
|
||||
Raised the minimum required CMake version from 3.0.2 to 3.1.
|
||||
Removed yet more of the vestigial support for pre-ANSI C compilers.
|
||||
Removed ancient makefiles for ancient systems that have been broken
|
||||
across all previous libpng-1.6.x versions.
|
||||
across all previous libpng-1.6.x versions.
|
||||
Removed the Y2K compliance statement and the export control
|
||||
information.
|
||||
information.
|
||||
Applied various code style and documentation fixes.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
Version 1.6.37 [April 14, 2019]
|
||||
Fixed a use-after-free vulnerability (CVE-2019-7317) in png_image_free.
|
||||
Fixed a memory leak in the ARM NEON implementation of png_do_expand_palette.
|
||||
Fixed a memory leak in pngtest.c.
|
||||
Fixed two vulnerabilities (CVE-2018-14048, CVE-2018-14550) in
|
||||
contrib/pngminus; refactor.
|
||||
Changed the license of contrib/pngminus to MIT; refresh makefile and docs.
|
||||
(Contributed by Willem van Schaik)
|
||||
Fixed a typo in the libpng license v2.
|
||||
(Contributed by Miguel Ojeda)
|
||||
Added makefiles for AddressSanitizer-enabled builds.
|
||||
Cleaned up various makefiles.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
|
||||
Subscription is required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe).
|
||||
to subscribe.
|
||||
|
||||
Vendored
+12
-1
@@ -46,8 +46,19 @@ if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
|
||||
add_definitions(-DPNG_INTEL_SSE)
|
||||
endif()
|
||||
|
||||
# set definitions and sources for MIPS
|
||||
if(";${CPU_BASELINE_FINAL};" MATCHES "MSA")
|
||||
list(APPEND lib_srcs mips/mips_init.c mips/filter_msa_intrinsics.c)
|
||||
add_definitions(-DPNG_MIPS_MSA_OPT=2)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wshadow)
|
||||
else()
|
||||
add_definitions(-DPNG_MIPS_MSA_OPT=0)
|
||||
endif()
|
||||
|
||||
if(PPC64LE OR PPC64)
|
||||
if(ENABLE_VSX AND NOT PPC64)
|
||||
# VSX3 features are backwards compatible
|
||||
if(";${CPU_BASELINE_FINAL};" MATCHES "VSX.*"
|
||||
AND NOT PPC64)
|
||||
list(APPEND lib_srcs powerpc/powerpc_init.c powerpc/filter_vsx_intrinsics.c)
|
||||
add_definitions(-DPNG_POWERPC_VSX_OPT=2)
|
||||
else()
|
||||
|
||||
Vendored
+4
-4
@@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
|
||||
PNG Reference Library License version 2
|
||||
---------------------------------------
|
||||
|
||||
* Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018 Cosmin Truta.
|
||||
* Copyright (c) 1995-2019 The PNG Reference Library Authors.
|
||||
* Copyright (c) 2018-2019 Cosmin Truta.
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||
* Copyright (c) 1996-1997 Andreas Dilger.
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -13,7 +13,7 @@ PNG Reference Library License version 2
|
||||
The software is supplied "as is", without warranty of any kind,
|
||||
express or implied, including, without limitation, the warranties
|
||||
of merchantability, fitness for a particular purpose, title, and
|
||||
non-infringement. In no even shall the Copyright owners, or
|
||||
non-infringement. In no event shall the Copyright owners, or
|
||||
anyone distributing the software, be liable for any damages or
|
||||
other liability, whether in contract, tort or otherwise, arising
|
||||
from, out of, or in connection with the software, or the use or
|
||||
@@ -39,7 +39,7 @@ subject to the following restrictions:
|
||||
PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||
Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
derived from libpng-1.0.6, and are distributed according to the same
|
||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
README for libpng version 1.6.36 - December 1, 2018
|
||||
===================================================
|
||||
README for libpng version 1.6.37 - April 14, 2019
|
||||
=================================================
|
||||
|
||||
See the note about version numbers near the top of png.h.
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
+16
-16
@@ -1,7 +1,7 @@
|
||||
|
||||
/* palette_neon_intrinsics.c - NEON optimised palette expansion functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
|
||||
* Written by Richard Townsend <Richard.Townsend@arm.com>, February 2017.
|
||||
*
|
||||
@@ -20,9 +20,9 @@
|
||||
# include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
/* Build an RGBA palette from the RGB and separate alpha palettes. */
|
||||
/* Build an RGBA8 palette from the separate RGB and alpha palettes. */
|
||||
void
|
||||
png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
|
||||
png_riffle_palette_neon(png_structrp png_ptr)
|
||||
{
|
||||
png_const_colorp palette = png_ptr->palette;
|
||||
png_bytep riffled_palette = png_ptr->riffled_palette;
|
||||
@@ -30,6 +30,8 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
|
||||
int num_trans = png_ptr->num_trans;
|
||||
int i;
|
||||
|
||||
png_debug(1, "in png_riffle_palette_neon");
|
||||
|
||||
/* Initially black, opaque. */
|
||||
uint8x16x4_t w = {{
|
||||
vdupq_n_u8(0x00),
|
||||
@@ -38,16 +40,10 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
|
||||
vdupq_n_u8(0xff),
|
||||
}};
|
||||
|
||||
if (row_info->bit_depth != 8)
|
||||
{
|
||||
png_error(png_ptr, "bit_depth must be 8 for png_riffle_palette_rgba");
|
||||
return;
|
||||
}
|
||||
|
||||
/* First, riffle the RGB colours into a RGBA palette, the A value is
|
||||
* set to opaque for now.
|
||||
/* First, riffle the RGB colours into an RGBA8 palette.
|
||||
* The alpha component is set to opaque for now.
|
||||
*/
|
||||
for (i = 0; i < (1 << row_info->bit_depth); i += 16)
|
||||
for (i = 0; i < 256; i += 16)
|
||||
{
|
||||
uint8x16x3_t v = vld3q_u8((png_const_bytep)(palette + i));
|
||||
w.val[0] = v.val[0];
|
||||
@@ -61,9 +57,9 @@ png_riffle_palette_rgba(png_structrp png_ptr, png_row_infop row_info)
|
||||
riffled_palette[(i << 2) + 3] = trans_alpha[i];
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGBA. */
|
||||
/* Expands a palettized row into RGBA8. */
|
||||
int
|
||||
png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
@@ -72,6 +68,8 @@ png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
|
||||
const png_int_32 pixels_per_chunk = 4;
|
||||
int i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgba8_neon");
|
||||
|
||||
if (row_width < pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
@@ -103,9 +101,9 @@ png_do_expand_palette_neon_rgba(png_structrp png_ptr, png_row_infop row_info,
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Expands a palettized row into RGB format. */
|
||||
/* Expands a palettized row into RGB8. */
|
||||
int
|
||||
png_do_expand_palette_neon_rgb(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_do_expand_palette_rgb8_neon(png_structrp png_ptr, png_row_infop row_info,
|
||||
png_const_bytep row, png_bytepp ssp, png_bytepp ddp)
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
@@ -113,6 +111,8 @@ png_do_expand_palette_neon_rgb(png_structrp png_ptr, png_row_infop row_info,
|
||||
const png_uint_32 pixels_per_chunk = 8;
|
||||
int i;
|
||||
|
||||
png_debug(1, "in png_do_expand_palette_rgb8_neon");
|
||||
|
||||
if (row_width <= pixels_per_chunk)
|
||||
return 0;
|
||||
|
||||
|
||||
+808
@@ -0,0 +1,808 @@
|
||||
|
||||
/* filter_msa_intrinsics.c - MSA optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2016 Glenn Randers-Pehrson
|
||||
* Written by Mandar Sahastrabuddhe, August 2016.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* This code requires -mfpu=msa on the command line: */
|
||||
#if PNG_MIPS_MSA_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
|
||||
|
||||
#include <msa.h>
|
||||
|
||||
/* libpng row pointers are not necessarily aligned to any particular boundary,
|
||||
* however this code will only work with appropriate alignment. mips/mips_init.c
|
||||
* checks for this (and will not compile unless it is done). This code uses
|
||||
* variants of png_aligncast to avoid compiler warnings.
|
||||
*/
|
||||
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
|
||||
#define png_ptrc(type,pointer) png_aligncastconst(const type *,pointer)
|
||||
|
||||
/* The following relies on a variable 'temp_pointer' being declared with type
|
||||
* 'type'. This is written this way just to hide the GCC strict aliasing
|
||||
* warning; note that the code is safe because there never is an alias between
|
||||
* the input and output pointers.
|
||||
*/
|
||||
#define png_ldr(type,pointer)\
|
||||
(temp_pointer = png_ptr(type,pointer), *temp_pointer)
|
||||
|
||||
#if PNG_MIPS_MSA_OPT > 0
|
||||
|
||||
#ifdef CLANG_BUILD
|
||||
#define MSA_SRLI_B(a, b) __msa_srli_b((v16i8) a, b)
|
||||
|
||||
#define LW(psrc) \
|
||||
( { \
|
||||
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
|
||||
uint32_t val_m; \
|
||||
\
|
||||
asm volatile ( \
|
||||
"lw %[val_m], %[psrc_lw_m] \n\t" \
|
||||
\
|
||||
: [val_m] "=r" (val_m) \
|
||||
: [psrc_lw_m] "m" (*psrc_lw_m) \
|
||||
); \
|
||||
\
|
||||
val_m; \
|
||||
} )
|
||||
|
||||
#define SH(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
|
||||
uint16_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sh %[val_m], %[pdst_sh_m] \n\t" \
|
||||
\
|
||||
: [pdst_sh_m] "=m" (*pdst_sh_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define SW(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
|
||||
uint32_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sw %[val_m], %[pdst_sw_m] \n\t" \
|
||||
\
|
||||
: [pdst_sw_m] "=m" (*pdst_sw_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#if (__mips == 64)
|
||||
#define SD(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
|
||||
uint64_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sd %[val_m], %[pdst_sd_m] \n\t" \
|
||||
\
|
||||
: [pdst_sd_m] "=m" (*pdst_sd_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
#else
|
||||
#define SD(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
|
||||
uint32_t val0_m, val1_m; \
|
||||
\
|
||||
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
|
||||
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
|
||||
\
|
||||
SW(val0_m, pdst_sd_m); \
|
||||
SW(val1_m, pdst_sd_m + 4); \
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
#define MSA_SRLI_B(a, b) (a >> b)
|
||||
|
||||
#if (__mips_isa_rev >= 6)
|
||||
#define LW(psrc) \
|
||||
( { \
|
||||
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
|
||||
uint32_t val_m; \
|
||||
\
|
||||
asm volatile ( \
|
||||
"lw %[val_m], %[psrc_lw_m] \n\t" \
|
||||
\
|
||||
: [val_m] "=r" (val_m) \
|
||||
: [psrc_lw_m] "m" (*psrc_lw_m) \
|
||||
); \
|
||||
\
|
||||
val_m; \
|
||||
} )
|
||||
|
||||
#define SH(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
|
||||
uint16_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sh %[val_m], %[pdst_sh_m] \n\t" \
|
||||
\
|
||||
: [pdst_sh_m] "=m" (*pdst_sh_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define SW(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
|
||||
uint32_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sw %[val_m], %[pdst_sw_m] \n\t" \
|
||||
\
|
||||
: [pdst_sw_m] "=m" (*pdst_sw_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#if (__mips == 64)
|
||||
#define SD(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
|
||||
uint64_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"sd %[val_m], %[pdst_sd_m] \n\t" \
|
||||
\
|
||||
: [pdst_sd_m] "=m" (*pdst_sd_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
#else
|
||||
#define SD(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
|
||||
uint32_t val0_m, val1_m; \
|
||||
\
|
||||
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
|
||||
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
|
||||
\
|
||||
SW(val0_m, pdst_sd_m); \
|
||||
SW(val1_m, pdst_sd_m + 4); \
|
||||
}
|
||||
#endif
|
||||
#else // !(__mips_isa_rev >= 6)
|
||||
#define LW(psrc) \
|
||||
( { \
|
||||
uint8_t *psrc_lw_m = (uint8_t *) (psrc); \
|
||||
uint32_t val_m; \
|
||||
\
|
||||
asm volatile ( \
|
||||
"ulw %[val_m], %[psrc_lw_m] \n\t" \
|
||||
\
|
||||
: [val_m] "=r" (val_m) \
|
||||
: [psrc_lw_m] "m" (*psrc_lw_m) \
|
||||
); \
|
||||
\
|
||||
val_m; \
|
||||
} )
|
||||
|
||||
#define SH(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sh_m = (uint8_t *) (pdst); \
|
||||
uint16_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"ush %[val_m], %[pdst_sh_m] \n\t" \
|
||||
\
|
||||
: [pdst_sh_m] "=m" (*pdst_sh_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define SW(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sw_m = (uint8_t *) (pdst); \
|
||||
uint32_t val_m = (val); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"usw %[val_m], %[pdst_sw_m] \n\t" \
|
||||
\
|
||||
: [pdst_sw_m] "=m" (*pdst_sw_m) \
|
||||
: [val_m] "r" (val_m) \
|
||||
); \
|
||||
}
|
||||
|
||||
#define SD(val, pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_sd_m = (uint8_t *) (pdst); \
|
||||
uint32_t val0_m, val1_m; \
|
||||
\
|
||||
val0_m = (uint32_t) ((val) & 0x00000000FFFFFFFF); \
|
||||
val1_m = (uint32_t) (((val) >> 32) & 0x00000000FFFFFFFF); \
|
||||
\
|
||||
SW(val0_m, pdst_sd_m); \
|
||||
SW(val1_m, pdst_sd_m + 4); \
|
||||
}
|
||||
|
||||
#define SW_ZERO(pdst) \
|
||||
{ \
|
||||
uint8_t *pdst_m = (uint8_t *) (pdst); \
|
||||
\
|
||||
asm volatile ( \
|
||||
"usw $0, %[pdst_m] \n\t" \
|
||||
\
|
||||
: [pdst_m] "=m" (*pdst_m) \
|
||||
: \
|
||||
); \
|
||||
}
|
||||
#endif // (__mips_isa_rev >= 6)
|
||||
#endif
|
||||
|
||||
#define LD_B(RTYPE, psrc) *((RTYPE *) (psrc))
|
||||
#define LD_UB(...) LD_B(v16u8, __VA_ARGS__)
|
||||
#define LD_B2(RTYPE, psrc, stride, out0, out1) \
|
||||
{ \
|
||||
out0 = LD_B(RTYPE, (psrc)); \
|
||||
out1 = LD_B(RTYPE, (psrc) + stride); \
|
||||
}
|
||||
#define LD_UB2(...) LD_B2(v16u8, __VA_ARGS__)
|
||||
#define LD_B4(RTYPE, psrc, stride, out0, out1, out2, out3) \
|
||||
{ \
|
||||
LD_B2(RTYPE, (psrc), stride, out0, out1); \
|
||||
LD_B2(RTYPE, (psrc) + 2 * stride , stride, out2, out3); \
|
||||
}
|
||||
#define LD_UB4(...) LD_B4(v16u8, __VA_ARGS__)
|
||||
|
||||
#define ST_B(RTYPE, in, pdst) *((RTYPE *) (pdst)) = (in)
|
||||
#define ST_UB(...) ST_B(v16u8, __VA_ARGS__)
|
||||
#define ST_B2(RTYPE, in0, in1, pdst, stride) \
|
||||
{ \
|
||||
ST_B(RTYPE, in0, (pdst)); \
|
||||
ST_B(RTYPE, in1, (pdst) + stride); \
|
||||
}
|
||||
#define ST_UB2(...) ST_B2(v16u8, __VA_ARGS__)
|
||||
#define ST_B4(RTYPE, in0, in1, in2, in3, pdst, stride) \
|
||||
{ \
|
||||
ST_B2(RTYPE, in0, in1, (pdst), stride); \
|
||||
ST_B2(RTYPE, in2, in3, (pdst) + 2 * stride, stride); \
|
||||
}
|
||||
#define ST_UB4(...) ST_B4(v16u8, __VA_ARGS__)
|
||||
|
||||
#define ADD2(in0, in1, in2, in3, out0, out1) \
|
||||
{ \
|
||||
out0 = in0 + in1; \
|
||||
out1 = in2 + in3; \
|
||||
}
|
||||
#define ADD3(in0, in1, in2, in3, in4, in5, \
|
||||
out0, out1, out2) \
|
||||
{ \
|
||||
ADD2(in0, in1, in2, in3, out0, out1); \
|
||||
out2 = in4 + in5; \
|
||||
}
|
||||
#define ADD4(in0, in1, in2, in3, in4, in5, in6, in7, \
|
||||
out0, out1, out2, out3) \
|
||||
{ \
|
||||
ADD2(in0, in1, in2, in3, out0, out1); \
|
||||
ADD2(in4, in5, in6, in7, out2, out3); \
|
||||
}
|
||||
|
||||
#define ILVR_B2(RTYPE, in0, in1, in2, in3, out0, out1) \
|
||||
{ \
|
||||
out0 = (RTYPE) __msa_ilvr_b((v16i8) in0, (v16i8) in1); \
|
||||
out1 = (RTYPE) __msa_ilvr_b((v16i8) in2, (v16i8) in3); \
|
||||
}
|
||||
#define ILVR_B2_SH(...) ILVR_B2(v8i16, __VA_ARGS__)
|
||||
|
||||
#define HSUB_UB2(RTYPE, in0, in1, out0, out1) \
|
||||
{ \
|
||||
out0 = (RTYPE) __msa_hsub_u_h((v16u8) in0, (v16u8) in0); \
|
||||
out1 = (RTYPE) __msa_hsub_u_h((v16u8) in1, (v16u8) in1); \
|
||||
}
|
||||
#define HSUB_UB2_SH(...) HSUB_UB2(v8i16, __VA_ARGS__)
|
||||
|
||||
#define SLDI_B2_0(RTYPE, in0, in1, out0, out1, slide_val) \
|
||||
{ \
|
||||
v16i8 zero_m = { 0 }; \
|
||||
out0 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in0, slide_val); \
|
||||
out1 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in1, slide_val); \
|
||||
}
|
||||
#define SLDI_B2_0_UB(...) SLDI_B2_0(v16u8, __VA_ARGS__)
|
||||
|
||||
#define SLDI_B3_0(RTYPE, in0, in1, in2, out0, out1, out2, slide_val) \
|
||||
{ \
|
||||
v16i8 zero_m = { 0 }; \
|
||||
SLDI_B2_0(RTYPE, in0, in1, out0, out1, slide_val); \
|
||||
out2 = (RTYPE) __msa_sldi_b((v16i8) zero_m, (v16i8) in2, slide_val); \
|
||||
}
|
||||
#define SLDI_B3_0_UB(...) SLDI_B3_0(v16u8, __VA_ARGS__)
|
||||
|
||||
#define ILVEV_W2(RTYPE, in0, in1, in2, in3, out0, out1) \
|
||||
{ \
|
||||
out0 = (RTYPE) __msa_ilvev_w((v4i32) in1, (v4i32) in0); \
|
||||
out1 = (RTYPE) __msa_ilvev_w((v4i32) in3, (v4i32) in2); \
|
||||
}
|
||||
#define ILVEV_W2_UB(...) ILVEV_W2(v16u8, __VA_ARGS__)
|
||||
|
||||
#define ADD_ABS_H3(RTYPE, in0, in1, in2, out0, out1, out2) \
|
||||
{ \
|
||||
RTYPE zero = {0}; \
|
||||
\
|
||||
out0 = __msa_add_a_h((v8i16) zero, in0); \
|
||||
out1 = __msa_add_a_h((v8i16) zero, in1); \
|
||||
out2 = __msa_add_a_h((v8i16) zero, in2); \
|
||||
}
|
||||
#define ADD_ABS_H3_SH(...) ADD_ABS_H3(v8i16, __VA_ARGS__)
|
||||
|
||||
#define VSHF_B2(RTYPE, in0, in1, in2, in3, mask0, mask1, out0, out1) \
|
||||
{ \
|
||||
out0 = (RTYPE) __msa_vshf_b((v16i8) mask0, (v16i8) in1, (v16i8) in0); \
|
||||
out1 = (RTYPE) __msa_vshf_b((v16i8) mask1, (v16i8) in3, (v16i8) in2); \
|
||||
}
|
||||
#define VSHF_B2_UB(...) VSHF_B2(v16u8, __VA_ARGS__)
|
||||
|
||||
#define CMP_AND_SELECT(inp0, inp1, inp2, inp3, inp4, inp5, out0) \
|
||||
{ \
|
||||
v8i16 _sel_h0, _sel_h1; \
|
||||
v16u8 _sel_b0, _sel_b1; \
|
||||
_sel_h0 = (v8i16) __msa_clt_u_h((v8u16) inp1, (v8u16) inp0); \
|
||||
_sel_b0 = (v16u8) __msa_pckev_b((v16i8) _sel_h0, (v16i8) _sel_h0); \
|
||||
inp0 = (v8i16) __msa_bmnz_v((v16u8) inp0, (v16u8) inp1, (v16u8) _sel_h0); \
|
||||
inp4 = (v16u8) __msa_bmnz_v(inp3, inp4, _sel_b0); \
|
||||
_sel_h1 = (v8i16) __msa_clt_u_h((v8u16) inp2, (v8u16) inp0); \
|
||||
_sel_b1 = (v16u8) __msa_pckev_b((v16i8) _sel_h1, (v16i8) _sel_h1); \
|
||||
inp4 = (v16u8) __msa_bmnz_v(inp4, inp5, _sel_b1); \
|
||||
out0 += inp4; \
|
||||
}
|
||||
|
||||
void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
size_t i, cnt, cnt16, cnt32;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_bytep rp = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
v16u8 src0, src1, src2, src3, src4, src5, src6, src7;
|
||||
|
||||
for (i = 0; i < (istop >> 6); i++)
|
||||
{
|
||||
LD_UB4(rp, 16, src0, src1, src2, src3);
|
||||
LD_UB4(pp, 16, src4, src5, src6, src7);
|
||||
pp += 64;
|
||||
|
||||
ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
src0, src1, src2, src3);
|
||||
|
||||
ST_UB4(src0, src1, src2, src3, rp, 16);
|
||||
rp += 64;
|
||||
}
|
||||
|
||||
if (istop & 0x3F)
|
||||
{
|
||||
cnt32 = istop & 0x20;
|
||||
cnt16 = istop & 0x10;
|
||||
cnt = istop & 0xF;
|
||||
|
||||
if(cnt32)
|
||||
{
|
||||
if (cnt16 && cnt)
|
||||
{
|
||||
LD_UB4(rp, 16, src0, src1, src2, src3);
|
||||
LD_UB4(pp, 16, src4, src5, src6, src7);
|
||||
|
||||
ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
|
||||
src0, src1, src2, src3);
|
||||
|
||||
ST_UB4(src0, src1, src2, src3, rp, 16);
|
||||
rp += 64;
|
||||
}
|
||||
else if (cnt16 || cnt)
|
||||
{
|
||||
LD_UB2(rp, 16, src0, src1);
|
||||
LD_UB2(pp, 16, src4, src5);
|
||||
pp += 32;
|
||||
src2 = LD_UB(rp + 32);
|
||||
src6 = LD_UB(pp);
|
||||
|
||||
ADD3(src0, src4, src1, src5, src2, src6, src0, src1, src2);
|
||||
|
||||
ST_UB2(src0, src1, rp, 16);
|
||||
rp += 32;
|
||||
ST_UB(src2, rp);
|
||||
rp += 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
LD_UB2(rp, 16, src0, src1);
|
||||
LD_UB2(pp, 16, src4, src5);
|
||||
|
||||
ADD2(src0, src4, src1, src5, src0, src1);
|
||||
|
||||
ST_UB2(src0, src1, rp, 16);
|
||||
rp += 32;
|
||||
}
|
||||
}
|
||||
else if (cnt16 && cnt)
|
||||
{
|
||||
LD_UB2(rp, 16, src0, src1);
|
||||
LD_UB2(pp, 16, src4, src5);
|
||||
|
||||
ADD2(src0, src4, src1, src5, src0, src1);
|
||||
|
||||
ST_UB2(src0, src1, rp, 16);
|
||||
rp += 32;
|
||||
}
|
||||
else if (cnt16 || cnt)
|
||||
{
|
||||
src0 = LD_UB(rp);
|
||||
src4 = LD_UB(pp);
|
||||
pp += 16;
|
||||
|
||||
src0 += src4;
|
||||
|
||||
ST_UB(src0, rp);
|
||||
rp += 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_sub4_msa(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
size_t count;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_bytep src = row;
|
||||
png_bytep nxt = row + 4;
|
||||
int32_t inp0;
|
||||
v16u8 src0, src1, src2, src3, src4;
|
||||
v16u8 dst0, dst1;
|
||||
v16u8 zero = { 0 };
|
||||
|
||||
istop -= 4;
|
||||
|
||||
inp0 = LW(src);
|
||||
src += 4;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
|
||||
for (count = 0; count < istop; count += 16)
|
||||
{
|
||||
src1 = LD_UB(src);
|
||||
src += 16;
|
||||
|
||||
src2 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 4);
|
||||
src3 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 8);
|
||||
src4 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 12);
|
||||
src1 += src0;
|
||||
src2 += src1;
|
||||
src3 += src2;
|
||||
src4 += src3;
|
||||
src0 = src4;
|
||||
ILVEV_W2_UB(src1, src2, src3, src4, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
|
||||
|
||||
ST_UB(dst0, nxt);
|
||||
nxt += 16;
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_sub3_msa(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
size_t count;
|
||||
size_t istop = row_info->rowbytes;
|
||||
png_bytep src = row;
|
||||
png_bytep nxt = row + 3;
|
||||
int64_t out0;
|
||||
int32_t inp0, out1;
|
||||
v16u8 src0, src1, src2, src3, src4, dst0, dst1;
|
||||
v16u8 zero = { 0 };
|
||||
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
|
||||
|
||||
istop -= 3;
|
||||
|
||||
inp0 = LW(src);
|
||||
src += 3;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
|
||||
for (count = 0; count < istop; count += 12)
|
||||
{
|
||||
src1 = LD_UB(src);
|
||||
src += 12;
|
||||
|
||||
src2 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 3);
|
||||
src3 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 6);
|
||||
src4 = (v16u8) __msa_sldi_b((v16i8) zero, (v16i8) src1, 9);
|
||||
src1 += src0;
|
||||
src2 += src1;
|
||||
src3 += src2;
|
||||
src4 += src3;
|
||||
src0 = src4;
|
||||
VSHF_B2_UB(src1, src2, src3, src4, mask0, mask0, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
|
||||
out0 = __msa_copy_s_d((v2i64) dst0, 0);
|
||||
out1 = __msa_copy_s_w((v4i32) dst0, 2);
|
||||
|
||||
SD(out0, nxt);
|
||||
nxt += 8;
|
||||
SW(out1, nxt);
|
||||
nxt += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_avg4_msa(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
size_t i;
|
||||
png_bytep src = row;
|
||||
png_bytep nxt = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
size_t istop = row_info->rowbytes - 4;
|
||||
int32_t inp0, inp1, out0;
|
||||
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
|
||||
v16u8 zero = { 0 };
|
||||
|
||||
inp0 = LW(pp);
|
||||
pp += 4;
|
||||
inp1 = LW(src);
|
||||
src += 4;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
|
||||
src0 = (v16u8) MSA_SRLI_B(src0, 1);
|
||||
src1 += src0;
|
||||
out0 = __msa_copy_s_w((v4i32) src1, 0);
|
||||
SW(out0, nxt);
|
||||
nxt += 4;
|
||||
|
||||
for (i = 0; i < istop; i += 16)
|
||||
{
|
||||
src2 = LD_UB(pp);
|
||||
pp += 16;
|
||||
src6 = LD_UB(src);
|
||||
src += 16;
|
||||
|
||||
SLDI_B2_0_UB(src2, src6, src3, src7, 4);
|
||||
SLDI_B2_0_UB(src2, src6, src4, src8, 8);
|
||||
SLDI_B2_0_UB(src2, src6, src5, src9, 12);
|
||||
src2 = __msa_ave_u_b(src2, src1);
|
||||
src6 += src2;
|
||||
src3 = __msa_ave_u_b(src3, src6);
|
||||
src7 += src3;
|
||||
src4 = __msa_ave_u_b(src4, src7);
|
||||
src8 += src4;
|
||||
src5 = __msa_ave_u_b(src5, src8);
|
||||
src9 += src5;
|
||||
src1 = src9;
|
||||
ILVEV_W2_UB(src6, src7, src8, src9, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
|
||||
|
||||
ST_UB(dst0, nxt);
|
||||
nxt += 16;
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_avg3_msa(png_row_infop row_info, png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
size_t i;
|
||||
png_bytep src = row;
|
||||
png_bytep nxt = row;
|
||||
png_const_bytep pp = prev_row;
|
||||
size_t istop = row_info->rowbytes - 3;
|
||||
int64_t out0;
|
||||
int32_t inp0, inp1, out1;
|
||||
int16_t out2;
|
||||
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
|
||||
v16u8 zero = { 0 };
|
||||
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
|
||||
|
||||
inp0 = LW(pp);
|
||||
pp += 3;
|
||||
inp1 = LW(src);
|
||||
src += 3;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
|
||||
src0 = (v16u8) MSA_SRLI_B(src0, 1);
|
||||
src1 += src0;
|
||||
out2 = __msa_copy_s_h((v8i16) src1, 0);
|
||||
SH(out2, nxt);
|
||||
nxt += 2;
|
||||
nxt[0] = src1[2];
|
||||
nxt++;
|
||||
|
||||
for (i = 0; i < istop; i += 12)
|
||||
{
|
||||
src2 = LD_UB(pp);
|
||||
pp += 12;
|
||||
src6 = LD_UB(src);
|
||||
src += 12;
|
||||
|
||||
SLDI_B2_0_UB(src2, src6, src3, src7, 3);
|
||||
SLDI_B2_0_UB(src2, src6, src4, src8, 6);
|
||||
SLDI_B2_0_UB(src2, src6, src5, src9, 9);
|
||||
src2 = __msa_ave_u_b(src2, src1);
|
||||
src6 += src2;
|
||||
src3 = __msa_ave_u_b(src3, src6);
|
||||
src7 += src3;
|
||||
src4 = __msa_ave_u_b(src4, src7);
|
||||
src8 += src4;
|
||||
src5 = __msa_ave_u_b(src5, src8);
|
||||
src9 += src5;
|
||||
src1 = src9;
|
||||
VSHF_B2_UB(src6, src7, src8, src9, mask0, mask0, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
|
||||
out0 = __msa_copy_s_d((v2i64) dst0, 0);
|
||||
out1 = __msa_copy_s_w((v4i32) dst0, 2);
|
||||
|
||||
SD(out0, nxt);
|
||||
nxt += 8;
|
||||
SW(out1, nxt);
|
||||
nxt += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_paeth4_msa(png_row_infop row_info,
|
||||
png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
int32_t count, rp_end;
|
||||
png_bytep nxt;
|
||||
png_const_bytep prev_nxt;
|
||||
int32_t inp0, inp1, res0;
|
||||
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9;
|
||||
v16u8 src10, src11, src12, src13, dst0, dst1;
|
||||
v8i16 vec0, vec1, vec2;
|
||||
v16u8 zero = { 0 };
|
||||
|
||||
nxt = row;
|
||||
prev_nxt = prev_row;
|
||||
|
||||
inp0 = LW(nxt);
|
||||
inp1 = LW(prev_nxt);
|
||||
prev_nxt += 4;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
|
||||
|
||||
src1 += src0;
|
||||
res0 = __msa_copy_s_w((v4i32) src1, 0);
|
||||
|
||||
SW(res0, nxt);
|
||||
nxt += 4;
|
||||
|
||||
/* Remainder */
|
||||
rp_end = row_info->rowbytes - 4;
|
||||
|
||||
for (count = 0; count < rp_end; count += 16)
|
||||
{
|
||||
src2 = LD_UB(prev_nxt);
|
||||
prev_nxt += 16;
|
||||
src6 = LD_UB(prev_row);
|
||||
prev_row += 16;
|
||||
src10 = LD_UB(nxt);
|
||||
|
||||
SLDI_B3_0_UB(src2, src6, src10, src3, src7, src11, 4);
|
||||
SLDI_B3_0_UB(src2, src6, src10, src4, src8, src12, 8);
|
||||
SLDI_B3_0_UB(src2, src6, src10, src5, src9, src13, 12);
|
||||
ILVR_B2_SH(src2, src6, src1, src6, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src1, src2, src6, src10);
|
||||
ILVR_B2_SH(src3, src7, src10, src7, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src10, src3, src7, src11);
|
||||
ILVR_B2_SH(src4, src8, src11, src8, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src11, src4, src8, src12);
|
||||
ILVR_B2_SH(src5, src9, src12, src9, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src12, src5, src9, src13);
|
||||
src1 = src13;
|
||||
ILVEV_W2_UB(src10, src11, src12, src1, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_pckev_d((v2i64) dst1, (v2i64) dst0);
|
||||
|
||||
ST_UB(dst0, nxt);
|
||||
nxt += 16;
|
||||
}
|
||||
}
|
||||
|
||||
void png_read_filter_row_paeth3_msa(png_row_infop row_info,
|
||||
png_bytep row,
|
||||
png_const_bytep prev_row)
|
||||
{
|
||||
int32_t count, rp_end;
|
||||
png_bytep nxt;
|
||||
png_const_bytep prev_nxt;
|
||||
int64_t out0;
|
||||
int32_t inp0, inp1, out1;
|
||||
int16_t out2;
|
||||
v16u8 src0, src1, src2, src3, src4, src5, src6, src7, src8, src9, dst0, dst1;
|
||||
v16u8 src10, src11, src12, src13;
|
||||
v8i16 vec0, vec1, vec2;
|
||||
v16u8 zero = { 0 };
|
||||
v16i8 mask0 = { 0, 1, 2, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
v16i8 mask1 = { 0, 1, 2, 3, 4, 5, 16, 17, 18, 19, 20, 21, 0, 0, 0, 0 };
|
||||
|
||||
nxt = row;
|
||||
prev_nxt = prev_row;
|
||||
|
||||
inp0 = LW(nxt);
|
||||
inp1 = LW(prev_nxt);
|
||||
prev_nxt += 3;
|
||||
src0 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp0);
|
||||
src1 = (v16u8) __msa_insert_w((v4i32) zero, 0, inp1);
|
||||
|
||||
src1 += src0;
|
||||
out2 = __msa_copy_s_h((v8i16) src1, 0);
|
||||
|
||||
SH(out2, nxt);
|
||||
nxt += 2;
|
||||
nxt[0] = src1[2];
|
||||
nxt++;
|
||||
|
||||
/* Remainder */
|
||||
rp_end = row_info->rowbytes - 3;
|
||||
|
||||
for (count = 0; count < rp_end; count += 12)
|
||||
{
|
||||
src2 = LD_UB(prev_nxt);
|
||||
prev_nxt += 12;
|
||||
src6 = LD_UB(prev_row);
|
||||
prev_row += 12;
|
||||
src10 = LD_UB(nxt);
|
||||
|
||||
SLDI_B3_0_UB(src2, src6, src10, src3, src7, src11, 3);
|
||||
SLDI_B3_0_UB(src2, src6, src10, src4, src8, src12, 6);
|
||||
SLDI_B3_0_UB(src2, src6, src10, src5, src9, src13, 9);
|
||||
ILVR_B2_SH(src2, src6, src1, src6, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src1, src2, src6, src10);
|
||||
ILVR_B2_SH(src3, src7, src10, src7, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src10, src3, src7, src11);
|
||||
ILVR_B2_SH(src4, src8, src11, src8, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src11, src4, src8, src12);
|
||||
ILVR_B2_SH(src5, src9, src12, src9, vec0, vec1);
|
||||
HSUB_UB2_SH(vec0, vec1, vec0, vec1);
|
||||
vec2 = vec0 + vec1;
|
||||
ADD_ABS_H3_SH(vec0, vec1, vec2, vec0, vec1, vec2);
|
||||
CMP_AND_SELECT(vec0, vec1, vec2, src12, src5, src9, src13);
|
||||
src1 = src13;
|
||||
VSHF_B2_UB(src10, src11, src12, src13, mask0, mask0, dst0, dst1);
|
||||
dst0 = (v16u8) __msa_vshf_b(mask1, (v16i8) dst1, (v16i8) dst0);
|
||||
out0 = __msa_copy_s_d((v2i64) dst0, 0);
|
||||
out1 = __msa_copy_s_w((v4i32) dst0, 2);
|
||||
|
||||
SD(out0, nxt);
|
||||
nxt += 8;
|
||||
SW(out1, nxt);
|
||||
nxt += 4;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PNG_MIPS_MSA_OPT > 0 */
|
||||
#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 (intrinsics) */
|
||||
#endif /* READ */
|
||||
Vendored
+127
@@ -0,0 +1,127 @@
|
||||
|
||||
/* mips_init.c - MSA optimised filter functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2016 Glenn Randers-Pehrson
|
||||
* Written by Mandar Sahastrabuddhe, 2016.
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* Below, after checking __linux__, various non-C90 POSIX 1003.1 functions are
|
||||
* called.
|
||||
*/
|
||||
#define _POSIX_SOURCE 1
|
||||
|
||||
#include <stdio.h>
|
||||
#include "../pngpriv.h"
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
#if PNG_MIPS_MSA_OPT > 0
|
||||
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do run-time checks */
|
||||
/* WARNING: it is strongly recommended that you do not build libpng with
|
||||
* run-time checks for CPU features if at all possible. In the case of the MIPS
|
||||
* MSA instructions there is no processor-specific way of detecting the
|
||||
* presence of the required support, therefore run-time detection is extremely
|
||||
* OS specific.
|
||||
*
|
||||
* You may set the macro PNG_MIPS_MSA_FILE to the file name of file containing
|
||||
* a fragment of C source code which defines the png_have_msa function. There
|
||||
* are a number of implementations in contrib/mips-msa, but the only one that
|
||||
* has partial support is contrib/mips-msa/linux.c - a generic Linux
|
||||
* implementation which reads /proc/cpufino.
|
||||
*/
|
||||
#ifndef PNG_MIPS_MSA_FILE
|
||||
# ifdef __linux__
|
||||
# define PNG_MIPS_MSA_FILE "contrib/mips-msa/linux.c"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_MIPS_MSA_FILE
|
||||
|
||||
#include <signal.h> /* for sig_atomic_t */
|
||||
static int png_have_msa(png_structp png_ptr);
|
||||
#include PNG_MIPS_MSA_FILE
|
||||
|
||||
#else /* PNG_MIPS_MSA_FILE */
|
||||
# error "PNG_MIPS_MSA_FILE undefined: no support for run-time MIPS MSA checks"
|
||||
#endif /* PNG_MIPS_MSA_FILE */
|
||||
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
|
||||
|
||||
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
|
||||
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
|
||||
#endif
|
||||
|
||||
void
|
||||
png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
|
||||
{
|
||||
/* The switch statement is compiled in for MIPS_MSA_API, the call to
|
||||
* png_have_msa is compiled in for MIPS_MSA_CHECK. If both are defined
|
||||
* the check is only performed if the API has not set the MSA option on
|
||||
* or off explicitly. In this case the check controls what happens.
|
||||
*/
|
||||
|
||||
#ifdef PNG_MIPS_MSA_API_SUPPORTED
|
||||
switch ((pp->options >> PNG_MIPS_MSA) & 3)
|
||||
{
|
||||
case PNG_OPTION_UNSET:
|
||||
/* Allow the run-time check to execute if it has been enabled -
|
||||
* thus both API and CHECK can be turned on. If it isn't supported
|
||||
* this case will fall through to the 'default' below, which just
|
||||
* returns.
|
||||
*/
|
||||
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
|
||||
{
|
||||
static volatile sig_atomic_t no_msa = -1; /* not checked */
|
||||
|
||||
if (no_msa < 0)
|
||||
no_msa = !png_have_msa(pp);
|
||||
|
||||
if (no_msa)
|
||||
return;
|
||||
}
|
||||
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
|
||||
break;
|
||||
|
||||
default: /* OFF or INVALID */
|
||||
return;
|
||||
|
||||
case PNG_OPTION_ON:
|
||||
/* Option turned on */
|
||||
break;
|
||||
}
|
||||
/* IMPORTANT: any new external functions used here must be declared using
|
||||
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
|
||||
* 'prefix' option to configure works:
|
||||
*
|
||||
* ./configure --with-libpng-prefix=foobar_
|
||||
*
|
||||
* Verify you have got this right by running the above command, doing a build
|
||||
* and examining pngprefix.h; it must contain a #define for every external
|
||||
* function you add. (Notice that this happens automatically for the
|
||||
* initialization function.)
|
||||
*/
|
||||
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_msa;
|
||||
|
||||
if (bpp == 3)
|
||||
{
|
||||
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_msa;
|
||||
}
|
||||
else if (bpp == 4)
|
||||
{
|
||||
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
|
||||
}
|
||||
#else
|
||||
(void)pp;
|
||||
(void)bpp;
|
||||
#endif /* PNG_MIPS_MSA_API_SUPPORTED */
|
||||
}
|
||||
#endif /* PNG_MIPS_MSA_OPT > 0 */
|
||||
#endif /* READ */
|
||||
@@ -0,0 +1,17 @@
|
||||
diff --git a/3rdparty/libpng/pngrutil.c b/3rdparty/libpng/pngrutil.c
|
||||
index d5fa08c397..4db3de990b 100644
|
||||
--- a/3rdparty/libpng/pngrutil.c
|
||||
+++ b/3rdparty/libpng/pngrutil.c
|
||||
@@ -2087,10 +2087,8 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
}
|
||||
}
|
||||
|
||||
- if (png_crc_finish(png_ptr, 0) != 0)
|
||||
- return;
|
||||
-
|
||||
- png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
|
||||
+ if (png_crc_finish(png_ptr, 0) == 0)
|
||||
+ png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
|
||||
|
||||
png_free(png_ptr, info_ptr->eXIf_buf);
|
||||
info_ptr->eXIf_buf = NULL;
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
diff --git a/3rdparty/libpng/mips/mips_init.c b/3rdparty/libpng/mips/mips_init.c
|
||||
index 8dd283deef..6a061cccfa 100644
|
||||
--- a/3rdparty/libpng/mips/mips_init.c
|
||||
+++ b/3rdparty/libpng/mips/mips_init.c
|
||||
@@ -73,7 +73,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
|
||||
* this case will fall through to the 'default' below, which just
|
||||
* returns.
|
||||
*/
|
||||
-#endif /* PNG_MIPS_MSA_API_SUPPORTED */
|
||||
#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED
|
||||
{
|
||||
static volatile sig_atomic_t no_msa = -1; /* not checked */
|
||||
@@ -84,12 +83,9 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
|
||||
if (no_msa)
|
||||
return;
|
||||
}
|
||||
-#ifdef PNG_MIPS_MSA_API_SUPPORTED
|
||||
- break;
|
||||
-#endif
|
||||
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
|
||||
+ break;
|
||||
|
||||
-#ifdef PNG_MIPS_MSA_API_SUPPORTED
|
||||
default: /* OFF or INVALID */
|
||||
return;
|
||||
|
||||
@@ -97,8 +93,6 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
|
||||
/* Option turned on */
|
||||
break;
|
||||
}
|
||||
-#endif
|
||||
-
|
||||
/* IMPORTANT: any new external functions used here must be declared using
|
||||
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
|
||||
* 'prefix' option to configure works:
|
||||
@@ -118,13 +112,16 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_msa;
|
||||
}
|
||||
-
|
||||
else if (bpp == 4)
|
||||
{
|
||||
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
|
||||
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
|
||||
}
|
||||
+#else
|
||||
+ (void)pp;
|
||||
+ (void)bpp;
|
||||
+#endif /* PNG_MIPS_MSA_API_SUPPORTED */
|
||||
}
|
||||
#endif /* PNG_MIPS_MSA_OPT > 0 */
|
||||
#endif /* READ */
|
||||
Vendored
+5
-6
@@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_6_36 Your_png_h_is_not_version_1_6_36;
|
||||
typedef png_libpng_version_1_6_37 Your_png_h_is_not_version_1_6_37;
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* The version tests may need to be added to, but the problem warning has
|
||||
@@ -815,8 +815,8 @@ png_get_copyright(png_const_structrp png_ptr)
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.36" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.37" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 2018-2019 Cosmin Truta" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
|
||||
PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
@@ -4588,8 +4588,7 @@ png_image_free(png_imagep image)
|
||||
if (image != NULL && image->opaque != NULL &&
|
||||
image->opaque->error_buf == NULL)
|
||||
{
|
||||
/* Ignore errors here: */
|
||||
(void)png_safe_execute(image, png_image_free_function, image);
|
||||
png_image_free_function(image);
|
||||
image->opaque = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+17
-17
@@ -1,9 +1,9 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.36 - December 1, 2018
|
||||
* libpng version 1.6.37 - April 14, 2019
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -14,8 +14,9 @@
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
|
||||
* Glenn Randers-Pehrson.
|
||||
* libpng version 1.6.36, December 1, 2018: Cosmin Truta
|
||||
* Glenn Randers-Pehrson
|
||||
* libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
|
||||
* Cosmin Truta
|
||||
* See also "Contributing Authors", below.
|
||||
*/
|
||||
|
||||
@@ -26,8 +27,8 @@
|
||||
* PNG Reference Library License version 2
|
||||
* ---------------------------------------
|
||||
*
|
||||
* * Copyright (c) 1995-2018 The PNG Reference Library Authors.
|
||||
* * Copyright (c) 2018 Cosmin Truta.
|
||||
* * Copyright (c) 1995-2019 The PNG Reference Library Authors.
|
||||
* * Copyright (c) 2018-2019 Cosmin Truta.
|
||||
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
|
||||
* * Copyright (c) 1996-1997 Andreas Dilger.
|
||||
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -35,7 +36,7 @@
|
||||
* The software is supplied "as is", without warranty of any kind,
|
||||
* express or implied, including, without limitation, the warranties
|
||||
* of merchantability, fitness for a particular purpose, title, and
|
||||
* non-infringement. In no even shall the Copyright owners, or
|
||||
* non-infringement. In no event shall the Copyright owners, or
|
||||
* anyone distributing the software, be liable for any damages or
|
||||
* other liability, whether in contract, tort or otherwise, arising
|
||||
* from, out of, or in connection with the software, or the use or
|
||||
@@ -61,7 +62,7 @@
|
||||
* PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
|
||||
* -----------------------------------------------------------------------
|
||||
*
|
||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.35, July 15, 2018 are
|
||||
* libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
|
||||
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
|
||||
* derived from libpng-1.0.6, and are distributed according to the same
|
||||
* disclaimer and license as libpng-1.0.6 with the following individuals
|
||||
@@ -238,7 +239,7 @@
|
||||
* ...
|
||||
* 1.5.30 15 10530 15.so.15.30[.0]
|
||||
* ...
|
||||
* 1.6.36 16 10636 16.so.16.36[.0]
|
||||
* 1.6.37 16 10637 16.so.16.37[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major and
|
||||
* minor numbers; the shared-library major version number will be used for
|
||||
@@ -277,8 +278,8 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.36"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.36 - December 1, 2018\n"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.37"
|
||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
@@ -286,12 +287,11 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 6
|
||||
#define PNG_LIBPNG_VER_RELEASE 36
|
||||
#define PNG_LIBPNG_VER_RELEASE 37
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
/* This should be zero for a public release, or non-zero for a
|
||||
* development version. [Deprecated]
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 0
|
||||
|
||||
/* Release Status */
|
||||
@@ -318,7 +318,7 @@
|
||||
* From version 1.0.1 it is:
|
||||
* XXYYZZ, where XX=major, YY=minor, ZZ=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10636 /* 1.6.36 */
|
||||
#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
@@ -428,7 +428,7 @@ extern "C" {
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_6_36;
|
||||
typedef char* png_libpng_version_1_6_37;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
|
||||
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
/* pngconf.h - machine-configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.36
|
||||
* libpng version 1.6.37
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.6.36 */
|
||||
/* libpng version 1.6.37 */
|
||||
|
||||
/* Copyright (c) 2018 Cosmin Truta */
|
||||
/* Copyright (c) 2018-2019 Cosmin Truta */
|
||||
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
|
||||
|
||||
/* This code is released under the libpng license. */
|
||||
|
||||
Vendored
+5
-5
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -2119,11 +2119,11 @@ PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
|
||||
|
||||
#if PNG_ARM_NEON_IMPLEMENTATION == 1
|
||||
PNG_INTERNAL_FUNCTION(void,
|
||||
png_riffle_palette_rgba,
|
||||
(png_structrp, png_row_infop),
|
||||
png_riffle_palette_neon,
|
||||
(png_structrp),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgba,
|
||||
png_do_expand_palette_rgba8_neon,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
@@ -2131,7 +2131,7 @@ PNG_INTERNAL_FUNCTION(int,
|
||||
const png_bytepp),
|
||||
PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,
|
||||
png_do_expand_palette_neon_rgb,
|
||||
png_do_expand_palette_rgb8_neon,
|
||||
(png_structrp,
|
||||
png_row_infop,
|
||||
png_const_bytep,
|
||||
|
||||
Vendored
+7
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -994,6 +994,12 @@ png_read_destroy(png_structrp png_ptr)
|
||||
png_ptr->chunk_list = NULL;
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
|
||||
defined(PNG_ARM_NEON_IMPLEMENTATION)
|
||||
png_free(png_ptr, png_ptr->riffled_palette);
|
||||
png_ptr->riffled_palette = NULL;
|
||||
#endif
|
||||
|
||||
/* NOTE: the 'setjmp' buffer may still be allocated and the memory and error
|
||||
* callbacks are still set at this point. They are required to complete the
|
||||
* destruction of the png_struct itself.
|
||||
|
||||
Vendored
+25
-23
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -1182,20 +1182,20 @@ png_init_palette_transformations(png_structrp png_ptr)
|
||||
png_ptr->palette[png_ptr->background.index].blue;
|
||||
|
||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
|
||||
{
|
||||
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
|
||||
{
|
||||
/* Invert the alpha channel (in tRNS) unless the pixels are
|
||||
* going to be expanded, in which case leave it for later
|
||||
*/
|
||||
int i, istop = png_ptr->num_trans;
|
||||
if ((png_ptr->transformations & PNG_INVERT_ALPHA) != 0)
|
||||
{
|
||||
if ((png_ptr->transformations & PNG_EXPAND_tRNS) == 0)
|
||||
{
|
||||
/* Invert the alpha channel (in tRNS) unless the pixels are
|
||||
* going to be expanded, in which case leave it for later
|
||||
*/
|
||||
int i, istop = png_ptr->num_trans;
|
||||
|
||||
for (i=0; i<istop; i++)
|
||||
png_ptr->trans_alpha[i] = (png_byte)(255 -
|
||||
png_ptr->trans_alpha[i]);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < istop; i++)
|
||||
png_ptr->trans_alpha[i] =
|
||||
(png_byte)(255 - png_ptr->trans_alpha[i]);
|
||||
}
|
||||
}
|
||||
#endif /* READ_INVERT_ALPHA */
|
||||
}
|
||||
} /* background expand and (therefore) no alpha association. */
|
||||
@@ -4320,9 +4320,11 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
|
||||
* but sometimes row_info->bit_depth has been changed to 8.
|
||||
* In these cases, the palette hasn't been riffled.
|
||||
*/
|
||||
i = png_do_expand_palette_neon_rgba(png_ptr, row_info, row,
|
||||
i = png_do_expand_palette_rgba8_neon(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
}
|
||||
#else
|
||||
PNG_UNUSED(png_ptr)
|
||||
#endif
|
||||
|
||||
for (; i < row_width; i++)
|
||||
@@ -4349,8 +4351,10 @@ png_do_expand_palette(png_structrp png_ptr, png_row_infop row_info,
|
||||
dp = row + (size_t)(row_width * 3) - 1;
|
||||
i = 0;
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
i = png_do_expand_palette_neon_rgb(png_ptr, row_info, row,
|
||||
i = png_do_expand_palette_rgb8_neon(png_ptr, row_info, row,
|
||||
&sp, &dp);
|
||||
#else
|
||||
PNG_UNUSED(png_ptr)
|
||||
#endif
|
||||
|
||||
for (; i < row_width; i++)
|
||||
@@ -4770,19 +4774,17 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||
#ifdef PNG_ARM_NEON_INTRINSICS_AVAILABLE
|
||||
if ((png_ptr->num_trans > 0) && (png_ptr->bit_depth == 8))
|
||||
{
|
||||
/* Allocate space for the decompressed full palette. */
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
{
|
||||
png_ptr->riffled_palette = png_malloc(png_ptr, 256*4);
|
||||
if (png_ptr->riffled_palette == NULL)
|
||||
png_error(png_ptr, "NULL row buffer");
|
||||
/* Build the RGBA palette. */
|
||||
png_riffle_palette_rgba(png_ptr, row_info);
|
||||
/* Initialize the accelerated palette expansion. */
|
||||
png_ptr->riffled_palette =
|
||||
(png_bytep)png_malloc(png_ptr, 256 * 4);
|
||||
png_riffle_palette_neon(png_ptr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
png_do_expand_palette(png_ptr, row_info, png_ptr->row_buf + 1,
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
Vendored
+2
-4
@@ -2087,10 +2087,8 @@ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
|
||||
}
|
||||
}
|
||||
|
||||
if (png_crc_finish(png_ptr, 0) != 0)
|
||||
return;
|
||||
|
||||
png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
|
||||
if (png_crc_finish(png_ptr, 0) == 0)
|
||||
png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
|
||||
|
||||
png_free(png_ptr, info_ptr->eXIf_buf);
|
||||
info_ptr->eXIf_buf = NULL;
|
||||
|
||||
Vendored
+7
-5
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngstruct.h - header file for PNG reference library
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -228,10 +228,6 @@ struct png_struct_def
|
||||
* big_row_buf; while writing it is separately
|
||||
* allocated.
|
||||
*/
|
||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||
/* Buffer to accelerate palette transformations. */
|
||||
png_bytep riffled_palette;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_bytep try_row; /* buffer to save trial row when filtering */
|
||||
png_bytep tst_row; /* buffer to save best trial row when filtering */
|
||||
@@ -396,6 +392,12 @@ struct png_struct_def
|
||||
/* deleted in 1.5.5: rgb_to_gray_blue_coeff; */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.6.36 */
|
||||
#if defined(PNG_READ_EXPAND_SUPPORTED) && \
|
||||
defined(PNG_ARM_NEON_IMPLEMENTATION)
|
||||
png_bytep riffled_palette; /* buffer for accelerated palette expansion */
|
||||
#endif
|
||||
|
||||
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
|
||||
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
|
||||
|
||||
Vendored
+1
-5
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Copyright (c) 2018 Cosmin Truta
|
||||
* Copyright (c) 2018-2019 Cosmin Truta
|
||||
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1996-1997 Andreas Dilger
|
||||
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
@@ -948,10 +948,6 @@ png_write_destroy(png_structrp png_ptr)
|
||||
png_free_buffer_list(png_ptr, &png_ptr->zbuffer_list);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
png_ptr->row_buf = NULL;
|
||||
#ifdef PNG_READ_EXPANDED_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->riffled_palette);
|
||||
png_ptr->riffled_palette = NULL;
|
||||
#endif
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->try_row);
|
||||
|
||||
Vendored
+91
@@ -0,0 +1,91 @@
|
||||
# COPYRIGHT
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# License); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
# Copyright (c) 2020, OPEN AI LAB
|
||||
# Author: qtang@openailab.com or https://github.com/BUG1989
|
||||
# qli@openailab.com
|
||||
# sqfu@openailab.com
|
||||
#
|
||||
|
||||
SET(TENGINE_COMMIT_VERSION "2f3cd86217f3530c8e4a82f3ed5af14c7a4e3943")
|
||||
SET(OCV_TENGINE_DIR "${OpenCV_BINARY_DIR}/3rdparty/libtengine")
|
||||
SET(OCV_TENGINE_SOURCE_PATH "${OCV_TENGINE_DIR}/Tengine-${TENGINE_COMMIT_VERSION}")
|
||||
|
||||
IF(EXISTS "${OCV_TENGINE_SOURCE_PATH}")
|
||||
MESSAGE(STATUS "Tengine is exist already at: ${OCV_TENGINE_SOURCE_PATH}")
|
||||
|
||||
SET(Tengine_FOUND ON)
|
||||
SET(BUILD_TENGINE ON)
|
||||
ELSE()
|
||||
SET(OCV_TENGINE_FILENAME "${TENGINE_COMMIT_VERSION}.zip")#name2
|
||||
SET(OCV_TENGINE_URL "https://github.com/OAID/Tengine/archive/") #url2
|
||||
SET(tengine_md5sum 9124324b6e2b350012e46ae1db4bad7d) #md5sum2
|
||||
|
||||
#MESSAGE(STATUS "**** TENGINE DOWNLOAD BEGIN ****")
|
||||
ocv_download(FILENAME ${OCV_TENGINE_FILENAME}
|
||||
HASH ${tengine_md5sum}
|
||||
URL
|
||||
"${OPENCV_TENGINE_URL}"
|
||||
"$ENV{OPENCV_TENGINE_URL}"
|
||||
"${OCV_TENGINE_URL}"
|
||||
DESTINATION_DIR "${OCV_TENGINE_DIR}"
|
||||
ID TENGINE
|
||||
STATUS res
|
||||
UNPACK RELATIVE_URL)
|
||||
|
||||
if (NOT res)
|
||||
MESSAGE(STATUS "TENGINE DOWNLOAD FAILED. Turning Tengine_FOUND off.")
|
||||
SET(Tengine_FOUND OFF)
|
||||
else ()
|
||||
MESSAGE(STATUS "TENGINE DOWNLOAD success . ")
|
||||
|
||||
SET(Tengine_FOUND ON)
|
||||
SET(BUILD_TENGINE ON)
|
||||
endif()
|
||||
ENDIF()
|
||||
|
||||
if(BUILD_TENGINE)
|
||||
SET(HAVE_TENGINE 1)
|
||||
|
||||
# android system
|
||||
if(ANDROID)
|
||||
if(${ANDROID_ABI} STREQUAL "armeabi-v7a")
|
||||
SET(CONFIG_ARCH_ARM32 ON)
|
||||
elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
|
||||
SET(CONFIG_ARCH_ARM64 ON)
|
||||
endif()
|
||||
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
|
||||
else()
|
||||
# linux system
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL arm)
|
||||
SET(CONFIG_ARCH_ARM32 ON)
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64) ## AARCH64
|
||||
SET(CONFIG_ARCH_ARM64 ON)
|
||||
endif()
|
||||
SET(Tengine_LIB "tengine" CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
SET(BUILT_IN_OPENCV ON) ## set for tengine compile discern .
|
||||
SET(Tengine_INCLUDE_DIR "${OCV_TENGINE_SOURCE_PATH}/core/include" CACHE INTERNAL "")
|
||||
if(EXISTS "${OCV_TENGINE_SOURCE_PATH}/CMakeLists.txt")
|
||||
add_subdirectory("${OCV_TENGINE_SOURCE_PATH}" "${OCV_TENGINE_DIR}/build")
|
||||
else()
|
||||
message(WARNING "TENGINE: Missing 'CMakeLists.txt' in source code package: ${OCV_TENGINE_SOURCE_PATH}")
|
||||
SET(HAVE_TENGINE 1)
|
||||
endif()
|
||||
endif()
|
||||
Vendored
+8
-6
@@ -126,30 +126,30 @@ endif()
|
||||
if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
|
||||
set(TIFF_SIZE_T "unsigned int")
|
||||
set(TIFF_SIZE_FORMAT "%u")
|
||||
set(TIFF_SSIZE_T "signed int")
|
||||
set(TIFF_SSIZE_FORMAT "%d")
|
||||
elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
|
||||
set(TIFF_SIZE_T "unsigned long")
|
||||
set(TIFF_SIZE_FORMAT "%lu")
|
||||
set(TIFF_SSIZE_T "signed long")
|
||||
set(TIFF_SSIZE_FORMAT "%ld")
|
||||
elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
|
||||
set(TIFF_SIZE_T "unsigned long")
|
||||
if(MINGW)
|
||||
set(TIFF_SIZE_FORMAT "%I64u")
|
||||
set(TIFF_SSIZE_FORMAT "%I64d")
|
||||
else()
|
||||
set(TIFF_SIZE_FORMAT "%llu")
|
||||
set(TIFF_SSIZE_FORMAT "%lld")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(SIZEOF_SIGNED_INT EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||
set(TIFF_SSIZE_T "signed int")
|
||||
set(TIFF_SSIZE_FORMAT "%d")
|
||||
elseif(SIZEOF_SIGNED_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||
set(TIFF_SSIZE_T "signed long")
|
||||
set(TIFF_SSIZE_FORMAT "%ld")
|
||||
elseif(SIZEOF_SIGNED_LONG_LONG EQUAL SIZEOF_UNSIGNED_CHAR_P)
|
||||
set(TIFF_SSIZE_T "signed long long")
|
||||
if(MINGW)
|
||||
set(TIFF_SSIZE_FORMAT "%I64d")
|
||||
else()
|
||||
set(TIFF_SSIZE_FORMAT "%lld")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -216,6 +216,8 @@ endif()
|
||||
set(fillorder FILLORDER_MSB2LSB)
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
|
||||
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
|
||||
# AMD64 on Windows
|
||||
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
|
||||
CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
|
||||
set(fillorder FILLORDER_LSB2MSB)
|
||||
endif()
|
||||
|
||||
Vendored
+4
@@ -16,7 +16,11 @@ int _TIFF_vsnprintf_f(char* str, size_t size, const char* format, va_list ap)
|
||||
int count = -1;
|
||||
|
||||
if (size != 0)
|
||||
#if _MSC_VER <= 1310
|
||||
count = _vsnprintf(str, size, format, ap);
|
||||
#else
|
||||
count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
|
||||
#endif
|
||||
if (count == -1)
|
||||
count = _vscprintf(format, ap);
|
||||
|
||||
|
||||
Vendored
+10
@@ -30,6 +30,7 @@
|
||||
#include "tiffiop.h"
|
||||
#include "tif_predict.h"
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
|
||||
uint32
|
||||
_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
|
||||
@@ -357,6 +358,15 @@ _TIFFUInt64ToDouble(uint64 ui64)
|
||||
}
|
||||
}
|
||||
|
||||
float _TIFFClampDoubleToFloat( double val )
|
||||
{
|
||||
if( val > FLT_MAX )
|
||||
return FLT_MAX;
|
||||
if( val < -FLT_MAX )
|
||||
return -FLT_MAX;
|
||||
return (float)val;
|
||||
}
|
||||
|
||||
int _TIFFSeekOK(TIFF* tif, toff_t off)
|
||||
{
|
||||
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
//disabled for OpenCV CMakeLists.txt: #define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
|
||||
#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
|
||||
|
||||
/* Define to `__inline__' or `__inline' if that's what the C compiler
|
||||
calls it, or to nothing if 'inline' is not supported under any name. */
|
||||
|
||||
Vendored
+33
-17
@@ -29,7 +29,6 @@
|
||||
* (and also some miscellaneous stuff)
|
||||
*/
|
||||
#include "tiffiop.h"
|
||||
#include <float.h>
|
||||
|
||||
/*
|
||||
* These are used in the backwards compatibility code...
|
||||
@@ -88,13 +87,15 @@ setDoubleArrayOneValue(double** vpp, double value, size_t nmemb)
|
||||
* Install extra samples information.
|
||||
*/
|
||||
static int
|
||||
setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
|
||||
setExtraSamples(TIFF* tif, va_list ap, uint32* v)
|
||||
{
|
||||
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
|
||||
#define EXTRASAMPLE_COREL_UNASSALPHA 999
|
||||
|
||||
uint16* va;
|
||||
uint32 i;
|
||||
TIFFDirectory* td = &tif->tif_dir;
|
||||
static const char module[] = "setExtraSamples";
|
||||
|
||||
*v = (uint16) va_arg(ap, uint16_vap);
|
||||
if ((uint16) *v > td->td_samplesperpixel)
|
||||
@@ -116,6 +117,18 @@ setExtraSamples(TIFFDirectory* td, va_list ap, uint32* v)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ( td->td_transferfunction[0] != NULL && (td->td_samplesperpixel - *v > 1) &&
|
||||
!(td->td_samplesperpixel - td->td_extrasamples > 1))
|
||||
{
|
||||
TIFFWarningExt(tif->tif_clientdata,module,
|
||||
"ExtraSamples tag value is changing, "
|
||||
"but TransferFunction was read with a different value. Cancelling it");
|
||||
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
|
||||
_TIFFfree(td->td_transferfunction[0]);
|
||||
td->td_transferfunction[0] = NULL;
|
||||
}
|
||||
|
||||
td->td_extrasamples = (uint16) *v;
|
||||
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
|
||||
return 1;
|
||||
@@ -153,15 +166,6 @@ bad:
|
||||
return (0);
|
||||
}
|
||||
|
||||
static float TIFFClampDoubleToFloat( double val )
|
||||
{
|
||||
if( val > FLT_MAX )
|
||||
return FLT_MAX;
|
||||
if( val < -FLT_MAX )
|
||||
return -FLT_MAX;
|
||||
return (float)val;
|
||||
}
|
||||
|
||||
static int
|
||||
_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
{
|
||||
@@ -285,6 +289,18 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
_TIFFfree(td->td_smaxsamplevalue);
|
||||
td->td_smaxsamplevalue = NULL;
|
||||
}
|
||||
/* Test if 3 transfer functions instead of just one are now needed
|
||||
See http://bugzilla.maptools.org/show_bug.cgi?id=2820 */
|
||||
if( td->td_transferfunction[0] != NULL && (v - td->td_extrasamples > 1) &&
|
||||
!(td->td_samplesperpixel - td->td_extrasamples > 1))
|
||||
{
|
||||
TIFFWarningExt(tif->tif_clientdata,module,
|
||||
"SamplesPerPixel tag value is changing, "
|
||||
"but TransferFunction was read with a different value. Cancelling it");
|
||||
TIFFClrFieldBit(tif,FIELD_TRANSFERFUNCTION);
|
||||
_TIFFfree(td->td_transferfunction[0]);
|
||||
td->td_transferfunction[0] = NULL;
|
||||
}
|
||||
}
|
||||
td->td_samplesperpixel = (uint16) v;
|
||||
break;
|
||||
@@ -320,13 +336,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
dblval = va_arg(ap, double);
|
||||
if( dblval < 0 )
|
||||
goto badvaluedouble;
|
||||
td->td_xresolution = TIFFClampDoubleToFloat( dblval );
|
||||
td->td_xresolution = _TIFFClampDoubleToFloat( dblval );
|
||||
break;
|
||||
case TIFFTAG_YRESOLUTION:
|
||||
dblval = va_arg(ap, double);
|
||||
if( dblval < 0 )
|
||||
goto badvaluedouble;
|
||||
td->td_yresolution = TIFFClampDoubleToFloat( dblval );
|
||||
td->td_yresolution = _TIFFClampDoubleToFloat( dblval );
|
||||
break;
|
||||
case TIFFTAG_PLANARCONFIG:
|
||||
v = (uint16) va_arg(ap, uint16_vap);
|
||||
@@ -335,10 +351,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
td->td_planarconfig = (uint16) v;
|
||||
break;
|
||||
case TIFFTAG_XPOSITION:
|
||||
td->td_xposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||
td->td_xposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||
break;
|
||||
case TIFFTAG_YPOSITION:
|
||||
td->td_yposition = TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||
td->td_yposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
|
||||
break;
|
||||
case TIFFTAG_RESOLUTIONUNIT:
|
||||
v = (uint16) va_arg(ap, uint16_vap);
|
||||
@@ -361,7 +377,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
_TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
|
||||
break;
|
||||
case TIFFTAG_EXTRASAMPLES:
|
||||
if (!setExtraSamples(td, ap, &v))
|
||||
if (!setExtraSamples(tif, ap, &v))
|
||||
goto badvalue;
|
||||
break;
|
||||
case TIFFTAG_MATTEING:
|
||||
@@ -684,7 +700,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
case TIFF_SRATIONAL:
|
||||
case TIFF_FLOAT:
|
||||
{
|
||||
float v2 = TIFFClampDoubleToFloat(va_arg(ap, double));
|
||||
float v2 = _TIFFClampDoubleToFloat(va_arg(ap, double));
|
||||
_TIFFmemcpy(val, &v2, tv_size);
|
||||
}
|
||||
break;
|
||||
|
||||
Vendored
+169
-41
@@ -164,6 +164,7 @@ static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover);
|
||||
static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
|
||||
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
|
||||
static void ChopUpSingleUncompressedStrip(TIFF*);
|
||||
static void TryChopUpUncompressedBigTiff(TIFF*);
|
||||
static uint64 TIFFReadUInt64(const uint8 *value);
|
||||
static int _TIFFGetMaxColorChannels(uint16 photometric);
|
||||
|
||||
@@ -4246,6 +4247,19 @@ TIFFReadDirectory(TIFF* tif)
|
||||
ChopUpSingleUncompressedStrip(tif);
|
||||
}
|
||||
|
||||
/* There are also uncompressed stripped files with strips larger than */
|
||||
/* 2 GB, which make them unfriendly with a lot of code. If possible, */
|
||||
/* try to expose smaller "virtual" strips. */
|
||||
if( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG &&
|
||||
tif->tif_dir.td_compression == COMPRESSION_NONE &&
|
||||
(tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP &&
|
||||
TIFFStripSize64(tif) > 0x7FFFFFFFUL )
|
||||
{
|
||||
if ( !_TIFFFillStriles(tif) || !tif->tif_dir.td_stripbytecount )
|
||||
return 0;
|
||||
TryChopUpUncompressedBigTiff(tif);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear the dirty directory flag.
|
||||
*/
|
||||
@@ -5699,6 +5713,63 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
|
||||
}
|
||||
}
|
||||
|
||||
static void allocChoppedUpStripArrays(TIFF* tif, uint32 nstrips,
|
||||
uint64 stripbytes, uint32 rowsperstrip)
|
||||
{
|
||||
TIFFDirectory *td = &tif->tif_dir;
|
||||
uint64 bytecount;
|
||||
uint64 offset;
|
||||
uint32 i;
|
||||
uint64 *newcounts;
|
||||
uint64 *newoffsets;
|
||||
|
||||
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||
"for chopped \"StripByteCounts\" array");
|
||||
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||
"for chopped \"StripOffsets\" array");
|
||||
if (newcounts == NULL || newoffsets == NULL) {
|
||||
/*
|
||||
* Unable to allocate new strip information, give up and use
|
||||
* the original one strip information.
|
||||
*/
|
||||
if (newcounts != NULL)
|
||||
_TIFFfree(newcounts);
|
||||
if (newoffsets != NULL)
|
||||
_TIFFfree(newoffsets);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill the strip information arrays with new bytecounts and offsets
|
||||
* that reflect the broken-up format.
|
||||
*/
|
||||
offset = td->td_stripoffset[0];
|
||||
bytecount = td->td_stripoffset[td->td_nstrips-1] +
|
||||
td->td_stripbytecount[td->td_nstrips-1] - offset;
|
||||
for (i = 0; i < nstrips; i++)
|
||||
{
|
||||
if (stripbytes > bytecount)
|
||||
stripbytes = bytecount;
|
||||
newcounts[i] = stripbytes;
|
||||
newoffsets[i] = stripbytes ? offset : 0;
|
||||
offset += stripbytes;
|
||||
bytecount -= stripbytes;
|
||||
}
|
||||
|
||||
/*
|
||||
* Replace old single strip info with multi-strip info.
|
||||
*/
|
||||
td->td_stripsperimage = td->td_nstrips = nstrips;
|
||||
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
|
||||
|
||||
_TIFFfree(td->td_stripbytecount);
|
||||
_TIFFfree(td->td_stripoffset);
|
||||
td->td_stripbytecount = newcounts;
|
||||
td->td_stripoffset = newoffsets;
|
||||
td->td_stripbytecountsorted = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Replace a single strip (tile) of uncompressed data by multiple strips
|
||||
* (tiles), each approximately STRIP_SIZE_DEFAULT bytes. This is useful for
|
||||
@@ -5714,11 +5785,8 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
|
||||
uint32 rowblock;
|
||||
uint64 rowblockbytes;
|
||||
uint64 stripbytes;
|
||||
uint32 strip;
|
||||
uint32 nstrips;
|
||||
uint32 rowsperstrip;
|
||||
uint64* newcounts;
|
||||
uint64* newoffsets;
|
||||
|
||||
bytecount = td->td_stripbytecount[0];
|
||||
/* On a newly created file, just re-opened to be filled, we */
|
||||
@@ -5769,46 +5837,106 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
|
||||
return;
|
||||
}
|
||||
|
||||
newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||
"for chopped \"StripByteCounts\" array");
|
||||
newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
|
||||
"for chopped \"StripOffsets\" array");
|
||||
if (newcounts == NULL || newoffsets == NULL) {
|
||||
/*
|
||||
* Unable to allocate new strip information, give up and use
|
||||
* the original one strip information.
|
||||
*/
|
||||
if (newcounts != NULL)
|
||||
_TIFFfree(newcounts);
|
||||
if (newoffsets != NULL)
|
||||
_TIFFfree(newoffsets);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* Fill the strip information arrays with new bytecounts and offsets
|
||||
* that reflect the broken-up format.
|
||||
*/
|
||||
for (strip = 0; strip < nstrips; strip++) {
|
||||
if (stripbytes > bytecount)
|
||||
stripbytes = bytecount;
|
||||
newcounts[strip] = stripbytes;
|
||||
newoffsets[strip] = stripbytes ? offset : 0;
|
||||
offset += stripbytes;
|
||||
bytecount -= stripbytes;
|
||||
}
|
||||
/*
|
||||
* Replace old single strip info with multi-strip info.
|
||||
*/
|
||||
td->td_stripsperimage = td->td_nstrips = nstrips;
|
||||
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
|
||||
|
||||
_TIFFfree(td->td_stripbytecount);
|
||||
_TIFFfree(td->td_stripoffset);
|
||||
td->td_stripbytecount = newcounts;
|
||||
td->td_stripoffset = newoffsets;
|
||||
td->td_stripbytecountsorted = 1;
|
||||
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Replace a file with contiguous strips > 2 GB of uncompressed data by
|
||||
* multiple smaller strips. This is useful for
|
||||
* dealing with large images or for dealing with machines with a limited
|
||||
* amount memory.
|
||||
*/
|
||||
static void TryChopUpUncompressedBigTiff( TIFF* tif )
|
||||
{
|
||||
TIFFDirectory *td = &tif->tif_dir;
|
||||
uint32 rowblock;
|
||||
uint64 rowblockbytes;
|
||||
uint32 i;
|
||||
uint64 stripsize;
|
||||
uint32 rowblocksperstrip;
|
||||
uint32 rowsperstrip;
|
||||
uint64 stripbytes;
|
||||
uint32 nstrips;
|
||||
|
||||
stripsize = TIFFStripSize64(tif);
|
||||
|
||||
assert( tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG );
|
||||
assert( tif->tif_dir.td_compression == COMPRESSION_NONE );
|
||||
assert( (tif->tif_flags&(TIFF_STRIPCHOP|TIFF_ISTILED)) == TIFF_STRIPCHOP );
|
||||
assert( stripsize > 0x7FFFFFFFUL );
|
||||
|
||||
/* On a newly created file, just re-opened to be filled, we */
|
||||
/* don't want strip chop to trigger as it is going to cause issues */
|
||||
/* later ( StripOffsets and StripByteCounts improperly filled) . */
|
||||
if( td->td_stripbytecount[0] == 0 && tif->tif_mode != O_RDONLY )
|
||||
return;
|
||||
|
||||
if ((td->td_photometric == PHOTOMETRIC_YCBCR)&&
|
||||
(!isUpSampled(tif)))
|
||||
rowblock = td->td_ycbcrsubsampling[1];
|
||||
else
|
||||
rowblock = 1;
|
||||
rowblockbytes = TIFFVStripSize64(tif, rowblock);
|
||||
if( rowblockbytes == 0 || rowblockbytes > 0x7FFFFFFFUL )
|
||||
{
|
||||
/* In case of file with gigantic width */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check that the strips are contiguous and of the expected size */
|
||||
for( i = 0; i < td->td_nstrips; i++ )
|
||||
{
|
||||
if( i == td->td_nstrips - 1 )
|
||||
{
|
||||
if( td->td_stripbytecount[i] < TIFFVStripSize64(
|
||||
tif, td->td_imagelength - i * td->td_rowsperstrip ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( td->td_stripbytecount[i] != stripsize )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if( i > 0 && td->td_stripoffset[i] !=
|
||||
td->td_stripoffset[i-1] + td->td_stripbytecount[i - 1] )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Aim for 512 MB strips (that will still be manageable by 32 bit builds */
|
||||
rowblocksperstrip = (uint32) (512 * 1024 * 1024 / rowblockbytes);
|
||||
if( rowblocksperstrip == 0 )
|
||||
rowblocksperstrip = 1;
|
||||
rowsperstrip = rowblocksperstrip * rowblock;
|
||||
stripbytes = rowblocksperstrip * rowblockbytes;
|
||||
assert( stripbytes <= 0x7FFFFFFFUL );
|
||||
|
||||
nstrips = TIFFhowmany_32(td->td_imagelength, rowsperstrip);
|
||||
if( nstrips == 0 )
|
||||
return;
|
||||
|
||||
/* If we are going to allocate a lot of memory, make sure that the */
|
||||
/* file is as big as needed */
|
||||
if( tif->tif_mode == O_RDONLY &&
|
||||
nstrips > 1000000 &&
|
||||
(td->td_stripoffset[td->td_nstrips-1] > TIFFGetFileSize(tif) ||
|
||||
td->td_stripoffset[td->td_nstrips-1] +
|
||||
td->td_stripbytecount[td->td_nstrips-1] > TIFFGetFileSize(tif)) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
allocChoppedUpStripArrays(tif, nstrips, stripbytes, rowsperstrip);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _TIFFFillStriles( TIFF *tif )
|
||||
{
|
||||
return _TIFFFillStrilesInternal( tif, 1 );
|
||||
|
||||
Vendored
+5
-13
@@ -28,7 +28,6 @@
|
||||
* Directory Write Support Routines.
|
||||
*/
|
||||
#include "tiffiop.h"
|
||||
#include <float.h>
|
||||
|
||||
#ifdef HAVE_IEEEFP
|
||||
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
|
||||
@@ -946,15 +945,6 @@ bad:
|
||||
return(0);
|
||||
}
|
||||
|
||||
static float TIFFClampDoubleToFloat( double val )
|
||||
{
|
||||
if( val > FLT_MAX )
|
||||
return FLT_MAX;
|
||||
if( val < -FLT_MAX )
|
||||
return -FLT_MAX;
|
||||
return (float)val;
|
||||
}
|
||||
|
||||
static int8 TIFFClampDoubleToInt8( double val )
|
||||
{
|
||||
if( val > 127 )
|
||||
@@ -1029,7 +1019,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
|
||||
if (tif->tif_dir.td_bitspersample<=32)
|
||||
{
|
||||
for (i = 0; i < count; ++i)
|
||||
((float*)conv)[i] = TIFFClampDoubleToFloat(value[i]);
|
||||
((float*)conv)[i] = _TIFFClampDoubleToFloat(value[i]);
|
||||
ok = TIFFWriteDirectoryTagFloatArray(tif,ndir,dir,tag,count,(float*)conv);
|
||||
}
|
||||
else
|
||||
@@ -1893,12 +1883,14 @@ TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
|
||||
n=3;
|
||||
if (n==3)
|
||||
{
|
||||
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
|
||||
if (tif->tif_dir.td_transferfunction[2] == NULL ||
|
||||
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
|
||||
n=2;
|
||||
}
|
||||
if (n==2)
|
||||
{
|
||||
if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
|
||||
if (tif->tif_dir.td_transferfunction[1] == NULL ||
|
||||
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
|
||||
n=1;
|
||||
}
|
||||
if (n==0)
|
||||
|
||||
Vendored
+8
-3
@@ -742,9 +742,14 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
||||
#undef exp2 /* Conflict with C'99 function */
|
||||
#define exp2(x) exp(M_LN2*(x))
|
||||
|
||||
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \
|
||||
(int)(x) : \
|
||||
(int)((x) + rand()*(1./RAND_MAX) - .5))
|
||||
static int itrunc(double x, int m)
|
||||
{
|
||||
if( m == SGILOGENCODE_NODITHER )
|
||||
return (int)x;
|
||||
/* Silence CoverityScan warning about bad crypto function */
|
||||
/* coverity[dont_call] */
|
||||
return (int)(x + rand()*(1./RAND_MAX) - .5);
|
||||
}
|
||||
|
||||
#if !LOGLUV_PUBLIC
|
||||
static
|
||||
|
||||
Vendored
+2
@@ -247,6 +247,8 @@ LZWSetupDecode(TIFF* tif)
|
||||
/*
|
||||
* Zero-out the unused entries
|
||||
*/
|
||||
/* Silence false positive */
|
||||
/* coverity[overrun-buffer-arg] */
|
||||
_TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
|
||||
(CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -640,6 +640,7 @@ PixarLogGuessDataFmt(TIFFDirectory *td)
|
||||
static tmsize_t
|
||||
multiply_ms(tmsize_t m1, tmsize_t m2)
|
||||
{
|
||||
assert(m1 >= 0 && m2 >= 0);
|
||||
if( m1 == 0 || m2 > TIFF_TMSIZE_T_MAX / m1 )
|
||||
return 0;
|
||||
return m1 * m2;
|
||||
@@ -648,6 +649,7 @@ multiply_ms(tmsize_t m1, tmsize_t m2)
|
||||
static tmsize_t
|
||||
add_ms(tmsize_t m1, tmsize_t m2)
|
||||
{
|
||||
assert(m1 >= 0 && m2 >= 0);
|
||||
/* if either input is zero, assume overflow already occurred */
|
||||
if (m1 == 0 || m2 == 0)
|
||||
return 0;
|
||||
@@ -817,9 +819,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Decoding error at scanline %lu, %s",
|
||||
(unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
|
||||
if (inflateSync(&sp->stream) != Z_OK)
|
||||
return (0);
|
||||
continue;
|
||||
return (0);
|
||||
}
|
||||
if (state != Z_OK) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib error: %s",
|
||||
|
||||
Vendored
+7
-1
@@ -103,6 +103,11 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
|
||||
}
|
||||
tif->tif_rawdata = new_rawdata;
|
||||
}
|
||||
if( tif->tif_rawdata == NULL )
|
||||
{
|
||||
/* should not happen in practice but helps CoverityScan */
|
||||
return 0;
|
||||
}
|
||||
|
||||
bytes_read = TIFFReadFile(tif,
|
||||
tif->tif_rawdata + rawdata_offset + already_read, to_read);
|
||||
@@ -1367,7 +1372,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
|
||||
tif->tif_rawdataoff = 0;
|
||||
tif->tif_rawdataloaded = bytecountm;
|
||||
|
||||
if (!isFillOrder(tif, td->td_fillorder) &&
|
||||
if (tif->tif_rawdata != NULL &&
|
||||
!isFillOrder(tif, td->td_fillorder) &&
|
||||
(tif->tif_flags & TIFF_NOBITREV) == 0)
|
||||
TIFFReverseBits(tif->tif_rawdata,
|
||||
tif->tif_rawdataloaded);
|
||||
|
||||
Vendored
+28
-17
@@ -349,6 +349,12 @@ TWebPSetupEncode(TIFF* tif)
|
||||
|
||||
sp->state |= LSTATE_INIT_ENCODE;
|
||||
|
||||
if (!WebPPictureInit(&sp->sPicture)) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Error initializing WebP picture.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!WebPConfigInitInternal(&sp->sEncoderConfig, WEBP_PRESET_DEFAULT,
|
||||
sp->quality_level,
|
||||
WEBP_ENCODER_ABI_VERSION)) {
|
||||
@@ -357,9 +363,13 @@ TWebPSetupEncode(TIFF* tif)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||
sp->sEncoderConfig.lossless = sp->lossless;
|
||||
#endif
|
||||
// WebPConfigInitInternal above sets lossless to false
|
||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||
sp->sEncoderConfig.lossless = sp->lossless;
|
||||
if (sp->lossless) {
|
||||
sp->sPicture.use_argb = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!WebPValidateConfig(&sp->sEncoderConfig)) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
@@ -367,12 +377,6 @@ TWebPSetupEncode(TIFF* tif)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!WebPPictureInit(&sp->sPicture)) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Error initializing WebP picture.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -415,6 +419,12 @@ TWebPPreEncode(TIFF* tif, uint16 s)
|
||||
/* set up buffer for raw data */
|
||||
/* given above check and that nSamples <= 4, buffer_size is <= 1 GB */
|
||||
sp->buffer_size = segment_width * segment_height * sp->nSamples;
|
||||
|
||||
if (sp->pBuffer != NULL) {
|
||||
_TIFFfree(sp->pBuffer);
|
||||
sp->pBuffer = NULL;
|
||||
}
|
||||
|
||||
sp->pBuffer = _TIFFmalloc(sp->buffer_size);
|
||||
if( !sp->pBuffer) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "Cannot allocate buffer");
|
||||
@@ -460,7 +470,7 @@ TWebPPostEncode(TIFF* tif)
|
||||
"WebPPictureImportRGB() failed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (!WebPEncode(&sp->sEncoderConfig, &sp->sPicture)) {
|
||||
|
||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||
@@ -540,15 +550,13 @@ TWebPCleanup(TIFF* tif)
|
||||
}
|
||||
|
||||
if (sp->pBuffer != NULL) {
|
||||
_TIFFfree(sp->pBuffer);
|
||||
sp->pBuffer = NULL;
|
||||
_TIFFfree(sp->pBuffer);
|
||||
sp->pBuffer = NULL;
|
||||
}
|
||||
|
||||
if (tif->tif_data) {
|
||||
_TIFFfree(tif->tif_data);
|
||||
tif->tif_data = NULL;
|
||||
}
|
||||
|
||||
_TIFFfree(tif->tif_data);
|
||||
tif->tif_data = NULL;
|
||||
|
||||
_TIFFSetDefaultCompressionState(tif);
|
||||
}
|
||||
|
||||
@@ -570,6 +578,9 @@ TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
|
||||
case TIFFTAG_WEBP_LOSSLESS:
|
||||
#if WEBP_ENCODER_ABI_VERSION >= 0x0100
|
||||
sp->lossless = va_arg(ap, int);
|
||||
if (sp->lossless){
|
||||
sp->quality_level = 100.0f;
|
||||
}
|
||||
return 1;
|
||||
#else
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
|
||||
Vendored
+20
-38
@@ -124,7 +124,6 @@ ZIPSetupDecode(TIFF* tif)
|
||||
static int
|
||||
ZIPPreDecode(TIFF* tif, uint16 s)
|
||||
{
|
||||
static const char module[] = "ZIPPreDecode";
|
||||
ZIPState* sp = DecoderState(tif);
|
||||
|
||||
(void) s;
|
||||
@@ -138,12 +137,7 @@ ZIPPreDecode(TIFF* tif, uint16 s)
|
||||
we need to simplify this code to reflect a ZLib that is likely updated
|
||||
to deal with 8byte memory sizes, though this code will respond
|
||||
appropriately even before we simplify it */
|
||||
sp->stream.avail_in = (uInt) tif->tif_rawcc;
|
||||
if ((tmsize_t)sp->stream.avail_in != tif->tif_rawcc)
|
||||
{
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
||||
return (0);
|
||||
}
|
||||
sp->stream.avail_in = (uint64)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
|
||||
return (inflateReset(&sp->stream) == Z_OK);
|
||||
}
|
||||
|
||||
@@ -158,46 +152,43 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
|
||||
assert(sp->state == ZSTATE_INIT_DECODE);
|
||||
|
||||
sp->stream.next_in = tif->tif_rawcp;
|
||||
sp->stream.avail_in = (uInt) tif->tif_rawcc;
|
||||
|
||||
sp->stream.next_out = op;
|
||||
assert(sizeof(sp->stream.avail_out)==4); /* if this assert gets raised,
|
||||
we need to simplify this code to reflect a ZLib that is likely updated
|
||||
to deal with 8byte memory sizes, though this code will respond
|
||||
appropriately even before we simplify it */
|
||||
sp->stream.avail_out = (uInt) occ;
|
||||
if ((tmsize_t)sp->stream.avail_out != occ)
|
||||
{
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
||||
return (0);
|
||||
}
|
||||
do {
|
||||
int state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
|
||||
int state;
|
||||
uInt avail_in_before = (uint64)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
|
||||
uInt avail_out_before = (uint64)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
|
||||
sp->stream.avail_in = avail_in_before;
|
||||
sp->stream.avail_out = avail_out_before;
|
||||
state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
|
||||
tif->tif_rawcc -= (avail_in_before - sp->stream.avail_in);
|
||||
occ -= (avail_out_before - sp->stream.avail_out);
|
||||
if (state == Z_STREAM_END)
|
||||
break;
|
||||
if (state == Z_DATA_ERROR) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Decoding error at scanline %lu, %s",
|
||||
(unsigned long) tif->tif_row, SAFE_MSG(sp));
|
||||
if (inflateSync(&sp->stream) != Z_OK)
|
||||
return (0);
|
||||
continue;
|
||||
return (0);
|
||||
}
|
||||
if (state != Z_OK) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"ZLib error: %s", SAFE_MSG(sp));
|
||||
return (0);
|
||||
}
|
||||
} while (sp->stream.avail_out > 0);
|
||||
if (sp->stream.avail_out != 0) {
|
||||
} while (occ > 0);
|
||||
if (occ != 0) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
|
||||
(unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out);
|
||||
(unsigned long) tif->tif_row, (TIFF_UINT64_T) occ);
|
||||
return (0);
|
||||
}
|
||||
|
||||
tif->tif_rawcp = sp->stream.next_in;
|
||||
tif->tif_rawcc = sp->stream.avail_in;
|
||||
|
||||
return (1);
|
||||
}
|
||||
@@ -229,7 +220,6 @@ ZIPSetupEncode(TIFF* tif)
|
||||
static int
|
||||
ZIPPreEncode(TIFF* tif, uint16 s)
|
||||
{
|
||||
static const char module[] = "ZIPPreEncode";
|
||||
ZIPState *sp = EncoderState(tif);
|
||||
|
||||
(void) s;
|
||||
@@ -242,12 +232,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
|
||||
we need to simplify this code to reflect a ZLib that is likely updated
|
||||
to deal with 8byte memory sizes, though this code will respond
|
||||
appropriately even before we simplify it */
|
||||
sp->stream.avail_out = (uInt)tif->tif_rawdatasize;
|
||||
if ((tmsize_t)sp->stream.avail_out != tif->tif_rawdatasize)
|
||||
{
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
||||
return (0);
|
||||
}
|
||||
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||
return (deflateReset(&sp->stream) == Z_OK);
|
||||
}
|
||||
|
||||
@@ -269,13 +254,9 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
||||
we need to simplify this code to reflect a ZLib that is likely updated
|
||||
to deal with 8byte memory sizes, though this code will respond
|
||||
appropriately even before we simplify it */
|
||||
sp->stream.avail_in = (uInt) cc;
|
||||
if ((tmsize_t)sp->stream.avail_in != cc)
|
||||
{
|
||||
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
|
||||
return (0);
|
||||
}
|
||||
do {
|
||||
uInt avail_in_before = (uint64)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
|
||||
sp->stream.avail_in = avail_in_before;
|
||||
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
|
||||
TIFFErrorExt(tif->tif_clientdata, module,
|
||||
"Encoder error: %s",
|
||||
@@ -286,9 +267,10 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
|
||||
tif->tif_rawcc = tif->tif_rawdatasize;
|
||||
TIFFFlushData1(tif);
|
||||
sp->stream.next_out = tif->tif_rawdata;
|
||||
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
|
||||
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||
}
|
||||
} while (sp->stream.avail_in > 0);
|
||||
cc -= (avail_in_before - sp->stream.avail_in);
|
||||
} while (cc > 0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -314,7 +296,7 @@ ZIPPostEncode(TIFF* tif)
|
||||
tif->tif_rawcc = tif->tif_rawdatasize - sp->stream.avail_out;
|
||||
TIFFFlushData1(tif);
|
||||
sp->stream.next_out = tif->tif_rawdata;
|
||||
sp->stream.avail_out = (uInt) tif->tif_rawdatasize; /* this is a safe typecast, as check is made already in ZIPPreEncode */
|
||||
sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Vendored
+2
@@ -374,6 +374,8 @@ extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
|
||||
extern double _TIFFUInt64ToDouble(uint64);
|
||||
extern float _TIFFUInt64ToFloat(uint64);
|
||||
|
||||
extern float _TIFFClampDoubleToFloat(double);
|
||||
|
||||
extern tmsize_t
|
||||
_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
|
||||
void **buf, tmsize_t bufsizetoalloc,
|
||||
|
||||
Vendored
+5
@@ -21,6 +21,11 @@ if(ANDROID AND ARMEABI_V7A AND NOT NEON)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# FIX for quant.h - requires C99 for() loops
|
||||
ocv_check_flag_support(C "-std=c99" _varname "${CMAKE_C_FLAGS}")
|
||||
if(${_varname})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
||||
endif()
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
Copyright (c) 2010, Google Inc. 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 Google 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
|
||||
HOLDER 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.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
diff --git a/3rdparty/libwebp/src/dsp/msa_macro.h b/3rdparty/libwebp/src/dsp/msa_macro.h
|
||||
index de026a1d9e..a16c0bb300 100644
|
||||
--- a/3rdparty/libwebp/src/dsp/msa_macro.h
|
||||
+++ b/3rdparty/libwebp/src/dsp/msa_macro.h
|
||||
@@ -73,7 +73,7 @@
|
||||
static inline TYPE FUNC_NAME(const void* const psrc) { \
|
||||
const uint8_t* const psrc_m = (const uint8_t*)psrc; \
|
||||
TYPE val_m; \
|
||||
- asm volatile ( \
|
||||
+ __asm__ volatile ( \
|
||||
"" #INSTR " %[val_m], %[psrc_m] \n\t" \
|
||||
: [val_m] "=r" (val_m) \
|
||||
: [psrc_m] "m" (*psrc_m)); \
|
||||
@@ -86,7 +86,7 @@
|
||||
static inline void FUNC_NAME(TYPE val, void* const pdst) { \
|
||||
uint8_t* const pdst_m = (uint8_t*)pdst; \
|
||||
TYPE val_m = val; \
|
||||
- asm volatile ( \
|
||||
+ __asm__ volatile ( \
|
||||
" " #INSTR " %[val_m], %[pdst_m] \n\t" \
|
||||
: [pdst_m] "=m" (*pdst_m) \
|
||||
: [val_m] "r" (val_m)); \
|
||||
+1
-1
@@ -51,4 +51,4 @@ void WebPDeallocateAlphaMemory(VP8Decoder* const dec);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* WEBP_DEC_ALPHAI_DEC_H_ */
|
||||
#endif // WEBP_DEC_ALPHAI_DEC_H_
|
||||
|
||||
+2
-1
@@ -74,7 +74,8 @@ static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) {
|
||||
} else { // RGB checks
|
||||
const WebPRGBABuffer* const buf = &buffer->u.RGBA;
|
||||
const int stride = abs(buf->stride);
|
||||
const uint64_t size = MIN_BUFFER_SIZE(width, height, stride);
|
||||
const uint64_t size =
|
||||
MIN_BUFFER_SIZE(width * kModeBpp[mode], height, stride);
|
||||
ok &= (size <= buf->size);
|
||||
ok &= (stride >= width * kModeBpp[mode]);
|
||||
ok &= (buf->rgba != NULL);
|
||||
|
||||
+1
-1
@@ -51,4 +51,4 @@ enum { MB_FEATURE_TREE_PROBS = 3,
|
||||
NUM_PROBAS = 11
|
||||
};
|
||||
|
||||
#endif // WEBP_DEC_COMMON_DEC_H_
|
||||
#endif // WEBP_DEC_COMMON_DEC_H_
|
||||
|
||||
Vendored
+2
-9
@@ -338,7 +338,6 @@ void VP8InitDithering(const WebPDecoderOptions* const options,
|
||||
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
|
||||
VP8QuantMatrix* const dqm = &dec->dqm_[s];
|
||||
if (dqm->uv_quant_ < DITHER_AMP_TAB_SIZE) {
|
||||
// TODO(skal): should we specially dither more for uv_quant_ < 0?
|
||||
const int idx = (dqm->uv_quant_ < 0) ? 0 : dqm->uv_quant_;
|
||||
dqm->dither_ = (f * kQuantToDitherAmp[idx]) >> 3;
|
||||
}
|
||||
@@ -669,15 +668,9 @@ int VP8GetThreadMethod(const WebPDecoderOptions* const options,
|
||||
(void)height;
|
||||
assert(headers == NULL || !headers->is_lossless);
|
||||
#if defined(WEBP_USE_THREAD)
|
||||
if (width < MIN_WIDTH_FOR_THREADS) return 0;
|
||||
// TODO(skal): tune the heuristic further
|
||||
#if 0
|
||||
if (height < 2 * width) return 2;
|
||||
if (width >= MIN_WIDTH_FOR_THREADS) return 2;
|
||||
#endif
|
||||
return 2;
|
||||
#else // !WEBP_USE_THREAD
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef MT_CACHE_LINES
|
||||
@@ -739,7 +732,7 @@ static int AllocateMemory(VP8Decoder* const dec) {
|
||||
mem += f_info_size;
|
||||
dec->thread_ctx_.id_ = 0;
|
||||
dec->thread_ctx_.f_info_ = dec->f_info_;
|
||||
if (dec->mt_method_ > 0) {
|
||||
if (dec->filter_type_ > 0 && dec->mt_method_ > 0) {
|
||||
// secondary cache line. The deblocking process need to make use of the
|
||||
// filtering strength from previous macroblock row, while the new ones
|
||||
// are being decoded in parallel. We'll just swap the pointers.
|
||||
|
||||
Vendored
+26
-10
@@ -140,10 +140,9 @@ static void DoRemap(WebPIDecoder* const idec, ptrdiff_t offset) {
|
||||
if (NeedCompressedAlpha(idec)) {
|
||||
ALPHDecoder* const alph_dec = dec->alph_dec_;
|
||||
dec->alpha_data_ += offset;
|
||||
if (alph_dec != NULL) {
|
||||
if (alph_dec != NULL && alph_dec->vp8l_dec_ != NULL) {
|
||||
if (alph_dec->method_ == ALPHA_LOSSLESS_COMPRESSION) {
|
||||
VP8LDecoder* const alph_vp8l_dec = alph_dec->vp8l_dec_;
|
||||
assert(alph_vp8l_dec != NULL);
|
||||
assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN);
|
||||
VP8LBitReaderSetBuffer(&alph_vp8l_dec->br_,
|
||||
dec->alpha_data_ + ALPHA_HEADER_LEN,
|
||||
@@ -167,9 +166,11 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
||||
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
|
||||
MemBuffer* const mem = &idec->mem_;
|
||||
const int need_compressed_alpha = NeedCompressedAlpha(idec);
|
||||
const uint8_t* const old_start = mem->buf_ + mem->start_;
|
||||
const uint8_t* const old_start =
|
||||
(mem->buf_ == NULL) ? NULL : mem->buf_ + mem->start_;
|
||||
const uint8_t* const old_base =
|
||||
need_compressed_alpha ? dec->alpha_data_ : old_start;
|
||||
assert(mem->buf_ != NULL || mem->start_ == 0);
|
||||
assert(mem->mode_ == MEM_MODE_APPEND);
|
||||
if (data_size > MAX_CHUNK_PAYLOAD) {
|
||||
// security safeguard: trying to allocate more than what the format
|
||||
@@ -185,7 +186,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
||||
uint8_t* const new_buf =
|
||||
(uint8_t*)WebPSafeMalloc(extra_size, sizeof(*new_buf));
|
||||
if (new_buf == NULL) return 0;
|
||||
memcpy(new_buf, old_base, current_size);
|
||||
if (old_base != NULL) memcpy(new_buf, old_base, current_size);
|
||||
WebPSafeFree(mem->buf_);
|
||||
mem->buf_ = new_buf;
|
||||
mem->buf_size_ = (size_t)extra_size;
|
||||
@@ -193,6 +194,7 @@ static int AppendToMemBuffer(WebPIDecoder* const idec,
|
||||
mem->end_ = current_size;
|
||||
}
|
||||
|
||||
assert(mem->buf_ != NULL);
|
||||
memcpy(mem->buf_ + mem->end_, data, data_size);
|
||||
mem->end_ += data_size;
|
||||
assert(mem->end_ <= mem->buf_size_);
|
||||
@@ -205,7 +207,9 @@ static int RemapMemBuffer(WebPIDecoder* const idec,
|
||||
const uint8_t* const data, size_t data_size) {
|
||||
MemBuffer* const mem = &idec->mem_;
|
||||
const uint8_t* const old_buf = mem->buf_;
|
||||
const uint8_t* const old_start = old_buf + mem->start_;
|
||||
const uint8_t* const old_start =
|
||||
(old_buf == NULL) ? NULL : old_buf + mem->start_;
|
||||
assert(old_buf != NULL || mem->start_ == 0);
|
||||
assert(mem->mode_ == MEM_MODE_MAP);
|
||||
|
||||
if (data_size < mem->buf_size_) return 0; // can't remap to a shorter buffer!
|
||||
@@ -283,10 +287,8 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec,
|
||||
|
||||
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
|
||||
if (idec->state_ == STATE_VP8_DATA) {
|
||||
VP8Io* const io = &idec->io_;
|
||||
if (io->teardown != NULL) {
|
||||
io->teardown(io);
|
||||
}
|
||||
// Synchronize the thread, clean-up and check for errors.
|
||||
VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);
|
||||
}
|
||||
idec->state_ = STATE_ERROR;
|
||||
return error;
|
||||
@@ -451,7 +453,10 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
|
||||
VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
|
||||
VP8Io* const io = &idec->io_;
|
||||
|
||||
assert(dec->ready_);
|
||||
// Make sure partition #0 has been read before, to set dec to ready_.
|
||||
if (!dec->ready_) {
|
||||
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
|
||||
}
|
||||
for (; dec->mb_y_ < dec->mb_h_; ++dec->mb_y_) {
|
||||
if (idec->last_mb_y_ != dec->mb_y_) {
|
||||
if (!VP8ParseIntraModeRow(&dec->br_, dec)) {
|
||||
@@ -473,6 +478,12 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
|
||||
MemDataSize(&idec->mem_) > MAX_MB_SIZE) {
|
||||
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
|
||||
}
|
||||
// Synchronize the threads.
|
||||
if (dec->mt_method_ > 0) {
|
||||
if (!WebPGetWorkerInterface()->Sync(&dec->worker_)) {
|
||||
return IDecError(idec, VP8_STATUS_BITSTREAM_ERROR);
|
||||
}
|
||||
}
|
||||
RestoreContext(&context, dec, token_br);
|
||||
return VP8_STATUS_SUSPENDED;
|
||||
}
|
||||
@@ -491,6 +502,7 @@ static VP8StatusCode DecodeRemaining(WebPIDecoder* const idec) {
|
||||
}
|
||||
// Synchronize the thread and check for errors.
|
||||
if (!VP8ExitCritical(dec, io)) {
|
||||
idec->state_ = STATE_ERROR; // prevent re-entry in IDecError
|
||||
return IDecError(idec, VP8_STATUS_USER_ABORT);
|
||||
}
|
||||
dec->ready_ = 0;
|
||||
@@ -571,6 +583,10 @@ static VP8StatusCode IDecode(WebPIDecoder* idec) {
|
||||
status = DecodePartition0(idec);
|
||||
}
|
||||
if (idec->state_ == STATE_VP8_DATA) {
|
||||
const VP8Decoder* const dec = (VP8Decoder*)idec->dec_;
|
||||
if (dec == NULL) {
|
||||
return VP8_STATUS_SUSPENDED; // can't continue if we have no decoder.
|
||||
}
|
||||
status = DecodeRemaining(idec);
|
||||
}
|
||||
if (idec->state_ == STATE_VP8L_HEADER) {
|
||||
|
||||
Vendored
+11
-6
@@ -61,12 +61,17 @@ static const uint16_t kAcTable[128] = {
|
||||
|
||||
void VP8ParseQuant(VP8Decoder* const dec) {
|
||||
VP8BitReader* const br = &dec->br_;
|
||||
const int base_q0 = VP8GetValue(br, 7);
|
||||
const int dqy1_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
|
||||
const int dqy2_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
|
||||
const int dqy2_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
|
||||
const int dquv_dc = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
|
||||
const int dquv_ac = VP8Get(br) ? VP8GetSignedValue(br, 4) : 0;
|
||||
const int base_q0 = VP8GetValue(br, 7, "global-header");
|
||||
const int dqy1_dc = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 4, "global-header") : 0;
|
||||
const int dqy2_dc = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 4, "global-header") : 0;
|
||||
const int dqy2_ac = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 4, "global-header") : 0;
|
||||
const int dquv_dc = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 4, "global-header") : 0;
|
||||
const int dquv_ac = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 4, "global-header") : 0;
|
||||
|
||||
const VP8SegmentHeader* const hdr = &dec->segment_hdr_;
|
||||
int i;
|
||||
|
||||
Vendored
+31
-26
@@ -296,20 +296,21 @@ static void ParseIntraMode(VP8BitReader* const br,
|
||||
// to decode more than 1 keyframe.
|
||||
if (dec->segment_hdr_.update_map_) {
|
||||
// Hardcoded tree parsing
|
||||
block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0])
|
||||
? VP8GetBit(br, dec->proba_.segments_[1])
|
||||
: 2 + VP8GetBit(br, dec->proba_.segments_[2]);
|
||||
block->segment_ = !VP8GetBit(br, dec->proba_.segments_[0], "segments")
|
||||
? VP8GetBit(br, dec->proba_.segments_[1], "segments")
|
||||
: VP8GetBit(br, dec->proba_.segments_[2], "segments") + 2;
|
||||
} else {
|
||||
block->segment_ = 0; // default for intra
|
||||
}
|
||||
if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_);
|
||||
if (dec->use_skip_proba_) block->skip_ = VP8GetBit(br, dec->skip_p_, "skip");
|
||||
|
||||
block->is_i4x4_ = !VP8GetBit(br, 145); // decide for B_PRED first
|
||||
block->is_i4x4_ = !VP8GetBit(br, 145, "block-size");
|
||||
if (!block->is_i4x4_) {
|
||||
// Hardcoded 16x16 intra-mode decision tree.
|
||||
const int ymode =
|
||||
VP8GetBit(br, 156) ? (VP8GetBit(br, 128) ? TM_PRED : H_PRED)
|
||||
: (VP8GetBit(br, 163) ? V_PRED : DC_PRED);
|
||||
VP8GetBit(br, 156, "pred-modes") ?
|
||||
(VP8GetBit(br, 128, "pred-modes") ? TM_PRED : H_PRED) :
|
||||
(VP8GetBit(br, 163, "pred-modes") ? V_PRED : DC_PRED);
|
||||
block->imodes_[0] = ymode;
|
||||
memset(top, ymode, 4 * sizeof(*top));
|
||||
memset(left, ymode, 4 * sizeof(*left));
|
||||
@@ -323,22 +324,25 @@ static void ParseIntraMode(VP8BitReader* const br,
|
||||
const uint8_t* const prob = kBModesProba[top[x]][ymode];
|
||||
#if (USE_GENERIC_TREE == 1)
|
||||
// Generic tree-parsing
|
||||
int i = kYModesIntra4[VP8GetBit(br, prob[0])];
|
||||
int i = kYModesIntra4[VP8GetBit(br, prob[0], "pred-modes")];
|
||||
while (i > 0) {
|
||||
i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i])];
|
||||
i = kYModesIntra4[2 * i + VP8GetBit(br, prob[i], "pred-modes")];
|
||||
}
|
||||
ymode = -i;
|
||||
#else
|
||||
// Hardcoded tree parsing
|
||||
ymode = !VP8GetBit(br, prob[0]) ? B_DC_PRED :
|
||||
!VP8GetBit(br, prob[1]) ? B_TM_PRED :
|
||||
!VP8GetBit(br, prob[2]) ? B_VE_PRED :
|
||||
!VP8GetBit(br, prob[3]) ?
|
||||
(!VP8GetBit(br, prob[4]) ? B_HE_PRED :
|
||||
(!VP8GetBit(br, prob[5]) ? B_RD_PRED : B_VR_PRED)) :
|
||||
(!VP8GetBit(br, prob[6]) ? B_LD_PRED :
|
||||
(!VP8GetBit(br, prob[7]) ? B_VL_PRED :
|
||||
(!VP8GetBit(br, prob[8]) ? B_HD_PRED : B_HU_PRED)));
|
||||
ymode = !VP8GetBit(br, prob[0], "pred-modes") ? B_DC_PRED :
|
||||
!VP8GetBit(br, prob[1], "pred-modes") ? B_TM_PRED :
|
||||
!VP8GetBit(br, prob[2], "pred-modes") ? B_VE_PRED :
|
||||
!VP8GetBit(br, prob[3], "pred-modes") ?
|
||||
(!VP8GetBit(br, prob[4], "pred-modes") ? B_HE_PRED :
|
||||
(!VP8GetBit(br, prob[5], "pred-modes") ? B_RD_PRED
|
||||
: B_VR_PRED)) :
|
||||
(!VP8GetBit(br, prob[6], "pred-modes") ? B_LD_PRED :
|
||||
(!VP8GetBit(br, prob[7], "pred-modes") ? B_VL_PRED :
|
||||
(!VP8GetBit(br, prob[8], "pred-modes") ? B_HD_PRED
|
||||
: B_HU_PRED))
|
||||
);
|
||||
#endif // USE_GENERIC_TREE
|
||||
top[x] = ymode;
|
||||
}
|
||||
@@ -348,9 +352,9 @@ static void ParseIntraMode(VP8BitReader* const br,
|
||||
}
|
||||
}
|
||||
// Hardcoded UVMode decision tree
|
||||
block->uvmode_ = !VP8GetBit(br, 142) ? DC_PRED
|
||||
: !VP8GetBit(br, 114) ? V_PRED
|
||||
: VP8GetBit(br, 183) ? TM_PRED : H_PRED;
|
||||
block->uvmode_ = !VP8GetBit(br, 142, "pred-modes-uv") ? DC_PRED
|
||||
: !VP8GetBit(br, 114, "pred-modes-uv") ? V_PRED
|
||||
: VP8GetBit(br, 183, "pred-modes-uv") ? TM_PRED : H_PRED;
|
||||
}
|
||||
|
||||
int VP8ParseIntraModeRow(VP8BitReader* const br, VP8Decoder* const dec) {
|
||||
@@ -514,8 +518,10 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) {
|
||||
for (b = 0; b < NUM_BANDS; ++b) {
|
||||
for (c = 0; c < NUM_CTX; ++c) {
|
||||
for (p = 0; p < NUM_PROBAS; ++p) {
|
||||
const int v = VP8GetBit(br, CoeffsUpdateProba[t][b][c][p]) ?
|
||||
VP8GetValue(br, 8) : CoeffsProba0[t][b][c][p];
|
||||
const int v =
|
||||
VP8GetBit(br, CoeffsUpdateProba[t][b][c][p], "global-header") ?
|
||||
VP8GetValue(br, 8, "global-header") :
|
||||
CoeffsProba0[t][b][c][p];
|
||||
proba->bands_[t][b].probas_[c][p] = v;
|
||||
}
|
||||
}
|
||||
@@ -524,9 +530,8 @@ void VP8ParseProba(VP8BitReader* const br, VP8Decoder* const dec) {
|
||||
proba->bands_ptr_[t][b] = &proba->bands_[t][kBands[b]];
|
||||
}
|
||||
}
|
||||
dec->use_skip_proba_ = VP8Get(br);
|
||||
dec->use_skip_proba_ = VP8Get(br, "global-header");
|
||||
if (dec->use_skip_proba_) {
|
||||
dec->skip_p_ = VP8GetValue(br, 8);
|
||||
dec->skip_p_ = VP8GetValue(br, 8, "global-header");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+42
-39
@@ -161,23 +161,26 @@ static int ParseSegmentHeader(VP8BitReader* br,
|
||||
VP8SegmentHeader* hdr, VP8Proba* proba) {
|
||||
assert(br != NULL);
|
||||
assert(hdr != NULL);
|
||||
hdr->use_segment_ = VP8Get(br);
|
||||
hdr->use_segment_ = VP8Get(br, "global-header");
|
||||
if (hdr->use_segment_) {
|
||||
hdr->update_map_ = VP8Get(br);
|
||||
if (VP8Get(br)) { // update data
|
||||
hdr->update_map_ = VP8Get(br, "global-header");
|
||||
if (VP8Get(br, "global-header")) { // update data
|
||||
int s;
|
||||
hdr->absolute_delta_ = VP8Get(br);
|
||||
hdr->absolute_delta_ = VP8Get(br, "global-header");
|
||||
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
|
||||
hdr->quantizer_[s] = VP8Get(br) ? VP8GetSignedValue(br, 7) : 0;
|
||||
hdr->quantizer_[s] = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 7, "global-header") : 0;
|
||||
}
|
||||
for (s = 0; s < NUM_MB_SEGMENTS; ++s) {
|
||||
hdr->filter_strength_[s] = VP8Get(br) ? VP8GetSignedValue(br, 6) : 0;
|
||||
hdr->filter_strength_[s] = VP8Get(br, "global-header") ?
|
||||
VP8GetSignedValue(br, 6, "global-header") : 0;
|
||||
}
|
||||
}
|
||||
if (hdr->update_map_) {
|
||||
int s;
|
||||
for (s = 0; s < MB_FEATURE_TREE_PROBS; ++s) {
|
||||
proba->segments_[s] = VP8Get(br) ? VP8GetValue(br, 8) : 255u;
|
||||
proba->segments_[s] = VP8Get(br, "global-header") ?
|
||||
VP8GetValue(br, 8, "global-header") : 255u;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -205,7 +208,7 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec,
|
||||
size_t last_part;
|
||||
size_t p;
|
||||
|
||||
dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2)) - 1;
|
||||
dec->num_parts_minus_one_ = (1 << VP8GetValue(br, 2, "global-header")) - 1;
|
||||
last_part = dec->num_parts_minus_one_;
|
||||
if (size < 3 * last_part) {
|
||||
// we can't even read the sizes with sz[]! That's a failure.
|
||||
@@ -229,21 +232,21 @@ static VP8StatusCode ParsePartitions(VP8Decoder* const dec,
|
||||
// Paragraph 9.4
|
||||
static int ParseFilterHeader(VP8BitReader* br, VP8Decoder* const dec) {
|
||||
VP8FilterHeader* const hdr = &dec->filter_hdr_;
|
||||
hdr->simple_ = VP8Get(br);
|
||||
hdr->level_ = VP8GetValue(br, 6);
|
||||
hdr->sharpness_ = VP8GetValue(br, 3);
|
||||
hdr->use_lf_delta_ = VP8Get(br);
|
||||
hdr->simple_ = VP8Get(br, "global-header");
|
||||
hdr->level_ = VP8GetValue(br, 6, "global-header");
|
||||
hdr->sharpness_ = VP8GetValue(br, 3, "global-header");
|
||||
hdr->use_lf_delta_ = VP8Get(br, "global-header");
|
||||
if (hdr->use_lf_delta_) {
|
||||
if (VP8Get(br)) { // update lf-delta?
|
||||
if (VP8Get(br, "global-header")) { // update lf-delta?
|
||||
int i;
|
||||
for (i = 0; i < NUM_REF_LF_DELTAS; ++i) {
|
||||
if (VP8Get(br)) {
|
||||
hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6);
|
||||
if (VP8Get(br, "global-header")) {
|
||||
hdr->ref_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
|
||||
}
|
||||
}
|
||||
for (i = 0; i < NUM_MODE_LF_DELTAS; ++i) {
|
||||
if (VP8Get(br)) {
|
||||
hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6);
|
||||
if (VP8Get(br, "global-header")) {
|
||||
hdr->mode_lf_delta_[i] = VP8GetSignedValue(br, 6, "global-header");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,8 +355,8 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) {
|
||||
buf_size -= frm_hdr->partition_length_;
|
||||
|
||||
if (frm_hdr->key_frame_) {
|
||||
pic_hdr->colorspace_ = VP8Get(br);
|
||||
pic_hdr->clamp_type_ = VP8Get(br);
|
||||
pic_hdr->colorspace_ = VP8Get(br, "global-header");
|
||||
pic_hdr->clamp_type_ = VP8Get(br, "global-header");
|
||||
}
|
||||
if (!ParseSegmentHeader(br, &dec->segment_hdr_, &dec->proba_)) {
|
||||
return VP8SetError(dec, VP8_STATUS_BITSTREAM_ERROR,
|
||||
@@ -378,7 +381,7 @@ int VP8GetHeaders(VP8Decoder* const dec, VP8Io* const io) {
|
||||
"Not a key frame.");
|
||||
}
|
||||
|
||||
VP8Get(br); // ignore the value of update_proba_
|
||||
VP8Get(br, "global-header"); // ignore the value of update_proba_
|
||||
|
||||
VP8ParseProba(br, dec);
|
||||
|
||||
@@ -403,28 +406,28 @@ static const uint8_t kZigzag[16] = {
|
||||
// See section 13-2: http://tools.ietf.org/html/rfc6386#section-13.2
|
||||
static int GetLargeValue(VP8BitReader* const br, const uint8_t* const p) {
|
||||
int v;
|
||||
if (!VP8GetBit(br, p[3])) {
|
||||
if (!VP8GetBit(br, p[4])) {
|
||||
if (!VP8GetBit(br, p[3], "coeffs")) {
|
||||
if (!VP8GetBit(br, p[4], "coeffs")) {
|
||||
v = 2;
|
||||
} else {
|
||||
v = 3 + VP8GetBit(br, p[5]);
|
||||
v = 3 + VP8GetBit(br, p[5], "coeffs");
|
||||
}
|
||||
} else {
|
||||
if (!VP8GetBit(br, p[6])) {
|
||||
if (!VP8GetBit(br, p[7])) {
|
||||
v = 5 + VP8GetBit(br, 159);
|
||||
if (!VP8GetBit(br, p[6], "coeffs")) {
|
||||
if (!VP8GetBit(br, p[7], "coeffs")) {
|
||||
v = 5 + VP8GetBit(br, 159, "coeffs");
|
||||
} else {
|
||||
v = 7 + 2 * VP8GetBit(br, 165);
|
||||
v += VP8GetBit(br, 145);
|
||||
v = 7 + 2 * VP8GetBit(br, 165, "coeffs");
|
||||
v += VP8GetBit(br, 145, "coeffs");
|
||||
}
|
||||
} else {
|
||||
const uint8_t* tab;
|
||||
const int bit1 = VP8GetBit(br, p[8]);
|
||||
const int bit0 = VP8GetBit(br, p[9 + bit1]);
|
||||
const int bit1 = VP8GetBit(br, p[8], "coeffs");
|
||||
const int bit0 = VP8GetBit(br, p[9 + bit1], "coeffs");
|
||||
const int cat = 2 * bit1 + bit0;
|
||||
v = 0;
|
||||
for (tab = kCat3456[cat]; *tab; ++tab) {
|
||||
v += v + VP8GetBit(br, *tab);
|
||||
v += v + VP8GetBit(br, *tab, "coeffs");
|
||||
}
|
||||
v += 3 + (8 << cat);
|
||||
}
|
||||
@@ -438,24 +441,24 @@ static int GetCoeffsFast(VP8BitReader* const br,
|
||||
int ctx, const quant_t dq, int n, int16_t* out) {
|
||||
const uint8_t* p = prob[n]->probas_[ctx];
|
||||
for (; n < 16; ++n) {
|
||||
if (!VP8GetBit(br, p[0])) {
|
||||
if (!VP8GetBit(br, p[0], "coeffs")) {
|
||||
return n; // previous coeff was last non-zero coeff
|
||||
}
|
||||
while (!VP8GetBit(br, p[1])) { // sequence of zero coeffs
|
||||
while (!VP8GetBit(br, p[1], "coeffs")) { // sequence of zero coeffs
|
||||
p = prob[++n]->probas_[0];
|
||||
if (n == 16) return 16;
|
||||
}
|
||||
{ // non zero coeff
|
||||
const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0];
|
||||
int v;
|
||||
if (!VP8GetBit(br, p[2])) {
|
||||
if (!VP8GetBit(br, p[2], "coeffs")) {
|
||||
v = 1;
|
||||
p = p_ctx[1];
|
||||
} else {
|
||||
v = GetLargeValue(br, p);
|
||||
p = p_ctx[2];
|
||||
}
|
||||
out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0];
|
||||
out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0];
|
||||
}
|
||||
}
|
||||
return 16;
|
||||
@@ -468,24 +471,24 @@ static int GetCoeffsAlt(VP8BitReader* const br,
|
||||
int ctx, const quant_t dq, int n, int16_t* out) {
|
||||
const uint8_t* p = prob[n]->probas_[ctx];
|
||||
for (; n < 16; ++n) {
|
||||
if (!VP8GetBitAlt(br, p[0])) {
|
||||
if (!VP8GetBitAlt(br, p[0], "coeffs")) {
|
||||
return n; // previous coeff was last non-zero coeff
|
||||
}
|
||||
while (!VP8GetBitAlt(br, p[1])) { // sequence of zero coeffs
|
||||
while (!VP8GetBitAlt(br, p[1], "coeffs")) { // sequence of zero coeffs
|
||||
p = prob[++n]->probas_[0];
|
||||
if (n == 16) return 16;
|
||||
}
|
||||
{ // non zero coeff
|
||||
const VP8ProbaArray* const p_ctx = &prob[n + 1]->probas_[0];
|
||||
int v;
|
||||
if (!VP8GetBitAlt(br, p[2])) {
|
||||
if (!VP8GetBitAlt(br, p[2], "coeffs")) {
|
||||
v = 1;
|
||||
p = p_ctx[1];
|
||||
} else {
|
||||
v = GetLargeValue(br, p);
|
||||
p = p_ctx[2];
|
||||
}
|
||||
out[kZigzag[n]] = VP8GetSigned(br, v) * dq[n > 0];
|
||||
out[kZigzag[n]] = VP8GetSigned(br, v, "coeffs") * dq[n > 0];
|
||||
}
|
||||
}
|
||||
return 16;
|
||||
|
||||
Vendored
+1
-1
@@ -182,4 +182,4 @@ WEBP_EXTERN int VP8LGetInfo(
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* WEBP_DEC_VP8_DEC_H_ */
|
||||
#endif // WEBP_DEC_VP8_DEC_H_
|
||||
|
||||
Vendored
+2
-2
@@ -31,7 +31,7 @@ extern "C" {
|
||||
|
||||
// version numbers
|
||||
#define DEC_MAJ_VERSION 1
|
||||
#define DEC_MIN_VERSION 0
|
||||
#define DEC_MIN_VERSION 1
|
||||
#define DEC_REV_VERSION 0
|
||||
|
||||
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
||||
@@ -316,4 +316,4 @@ const uint8_t* VP8DecompressAlphaRows(VP8Decoder* const dec,
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* WEBP_DEC_VP8I_DEC_H_ */
|
||||
#endif // WEBP_DEC_VP8I_DEC_H_
|
||||
|
||||
Vendored
+116
-66
@@ -363,11 +363,14 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
uint32_t* huffman_image = NULL;
|
||||
HTreeGroup* htree_groups = NULL;
|
||||
HuffmanCode* huffman_tables = NULL;
|
||||
HuffmanCode* next = NULL;
|
||||
HuffmanCode* huffman_table = NULL;
|
||||
int num_htree_groups = 1;
|
||||
int num_htree_groups_max = 1;
|
||||
int max_alphabet_size = 0;
|
||||
int* code_lengths = NULL;
|
||||
const int table_size = kTableSize[color_cache_bits];
|
||||
int* mapping = NULL;
|
||||
int ok = 0;
|
||||
|
||||
if (allow_recursion && VP8LReadBits(br, 1)) {
|
||||
// use meta Huffman codes.
|
||||
@@ -384,10 +387,36 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
// The huffman data is stored in red and green bytes.
|
||||
const int group = (huffman_image[i] >> 8) & 0xffff;
|
||||
huffman_image[i] = group;
|
||||
if (group >= num_htree_groups) {
|
||||
num_htree_groups = group + 1;
|
||||
if (group >= num_htree_groups_max) {
|
||||
num_htree_groups_max = group + 1;
|
||||
}
|
||||
}
|
||||
// Check the validity of num_htree_groups_max. If it seems too big, use a
|
||||
// smaller value for later. This will prevent big memory allocations to end
|
||||
// up with a bad bitstream anyway.
|
||||
// The value of 1000 is totally arbitrary. We know that num_htree_groups_max
|
||||
// is smaller than (1 << 16) and should be smaller than the number of pixels
|
||||
// (though the format allows it to be bigger).
|
||||
if (num_htree_groups_max > 1000 || num_htree_groups_max > xsize * ysize) {
|
||||
// Create a mapping from the used indices to the minimal set of used
|
||||
// values [0, num_htree_groups)
|
||||
mapping = (int*)WebPSafeMalloc(num_htree_groups_max, sizeof(*mapping));
|
||||
if (mapping == NULL) {
|
||||
dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
|
||||
goto Error;
|
||||
}
|
||||
// -1 means a value is unmapped, and therefore unused in the Huffman
|
||||
// image.
|
||||
memset(mapping, 0xff, num_htree_groups_max * sizeof(*mapping));
|
||||
for (num_htree_groups = 0, i = 0; i < huffman_pixs; ++i) {
|
||||
// Get the current mapping for the group and remap the Huffman image.
|
||||
int* const mapped_group = &mapping[huffman_image[i]];
|
||||
if (*mapped_group == -1) *mapped_group = num_htree_groups++;
|
||||
huffman_image[i] = *mapped_group;
|
||||
}
|
||||
} else {
|
||||
num_htree_groups = num_htree_groups_max;
|
||||
}
|
||||
}
|
||||
|
||||
if (br->eos_) goto Error;
|
||||
@@ -403,83 +432,100 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
}
|
||||
}
|
||||
|
||||
code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
|
||||
sizeof(*code_lengths));
|
||||
huffman_tables = (HuffmanCode*)WebPSafeMalloc(num_htree_groups * table_size,
|
||||
sizeof(*huffman_tables));
|
||||
htree_groups = VP8LHtreeGroupsNew(num_htree_groups);
|
||||
code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
|
||||
sizeof(*code_lengths));
|
||||
|
||||
if (htree_groups == NULL || code_lengths == NULL || huffman_tables == NULL) {
|
||||
dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
next = huffman_tables;
|
||||
for (i = 0; i < num_htree_groups; ++i) {
|
||||
HTreeGroup* const htree_group = &htree_groups[i];
|
||||
HuffmanCode** const htrees = htree_group->htrees;
|
||||
int size;
|
||||
int total_size = 0;
|
||||
int is_trivial_literal = 1;
|
||||
int max_bits = 0;
|
||||
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
|
||||
int alphabet_size = kAlphabetSize[j];
|
||||
htrees[j] = next;
|
||||
if (j == 0 && color_cache_bits > 0) {
|
||||
alphabet_size += 1 << color_cache_bits;
|
||||
}
|
||||
size = ReadHuffmanCode(alphabet_size, dec, code_lengths, next);
|
||||
if (size == 0) {
|
||||
goto Error;
|
||||
}
|
||||
if (is_trivial_literal && kLiteralMap[j] == 1) {
|
||||
is_trivial_literal = (next->bits == 0);
|
||||
}
|
||||
total_size += next->bits;
|
||||
next += size;
|
||||
if (j <= ALPHA) {
|
||||
int local_max_bits = code_lengths[0];
|
||||
int k;
|
||||
for (k = 1; k < alphabet_size; ++k) {
|
||||
if (code_lengths[k] > local_max_bits) {
|
||||
local_max_bits = code_lengths[k];
|
||||
}
|
||||
huffman_table = huffman_tables;
|
||||
for (i = 0; i < num_htree_groups_max; ++i) {
|
||||
// If the index "i" is unused in the Huffman image, just make sure the
|
||||
// coefficients are valid but do not store them.
|
||||
if (mapping != NULL && mapping[i] == -1) {
|
||||
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
|
||||
int alphabet_size = kAlphabetSize[j];
|
||||
if (j == 0 && color_cache_bits > 0) {
|
||||
alphabet_size += (1 << color_cache_bits);
|
||||
}
|
||||
// Passing in NULL so that nothing gets filled.
|
||||
if (!ReadHuffmanCode(alphabet_size, dec, code_lengths, NULL)) {
|
||||
goto Error;
|
||||
}
|
||||
max_bits += local_max_bits;
|
||||
}
|
||||
}
|
||||
htree_group->is_trivial_literal = is_trivial_literal;
|
||||
htree_group->is_trivial_code = 0;
|
||||
if (is_trivial_literal) {
|
||||
const int red = htrees[RED][0].value;
|
||||
const int blue = htrees[BLUE][0].value;
|
||||
const int alpha = htrees[ALPHA][0].value;
|
||||
htree_group->literal_arb =
|
||||
((uint32_t)alpha << 24) | (red << 16) | blue;
|
||||
if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) {
|
||||
htree_group->is_trivial_code = 1;
|
||||
htree_group->literal_arb |= htrees[GREEN][0].value << 8;
|
||||
} else {
|
||||
HTreeGroup* const htree_group =
|
||||
&htree_groups[(mapping == NULL) ? i : mapping[i]];
|
||||
HuffmanCode** const htrees = htree_group->htrees;
|
||||
int size;
|
||||
int total_size = 0;
|
||||
int is_trivial_literal = 1;
|
||||
int max_bits = 0;
|
||||
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
|
||||
int alphabet_size = kAlphabetSize[j];
|
||||
htrees[j] = huffman_table;
|
||||
if (j == 0 && color_cache_bits > 0) {
|
||||
alphabet_size += (1 << color_cache_bits);
|
||||
}
|
||||
size = ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_table);
|
||||
if (size == 0) {
|
||||
goto Error;
|
||||
}
|
||||
if (is_trivial_literal && kLiteralMap[j] == 1) {
|
||||
is_trivial_literal = (huffman_table->bits == 0);
|
||||
}
|
||||
total_size += huffman_table->bits;
|
||||
huffman_table += size;
|
||||
if (j <= ALPHA) {
|
||||
int local_max_bits = code_lengths[0];
|
||||
int k;
|
||||
for (k = 1; k < alphabet_size; ++k) {
|
||||
if (code_lengths[k] > local_max_bits) {
|
||||
local_max_bits = code_lengths[k];
|
||||
}
|
||||
}
|
||||
max_bits += local_max_bits;
|
||||
}
|
||||
}
|
||||
htree_group->is_trivial_literal = is_trivial_literal;
|
||||
htree_group->is_trivial_code = 0;
|
||||
if (is_trivial_literal) {
|
||||
const int red = htrees[RED][0].value;
|
||||
const int blue = htrees[BLUE][0].value;
|
||||
const int alpha = htrees[ALPHA][0].value;
|
||||
htree_group->literal_arb = ((uint32_t)alpha << 24) | (red << 16) | blue;
|
||||
if (total_size == 0 && htrees[GREEN][0].value < NUM_LITERAL_CODES) {
|
||||
htree_group->is_trivial_code = 1;
|
||||
htree_group->literal_arb |= htrees[GREEN][0].value << 8;
|
||||
}
|
||||
}
|
||||
htree_group->use_packed_table =
|
||||
!htree_group->is_trivial_code && (max_bits < HUFFMAN_PACKED_BITS);
|
||||
if (htree_group->use_packed_table) BuildPackedTable(htree_group);
|
||||
}
|
||||
htree_group->use_packed_table = !htree_group->is_trivial_code &&
|
||||
(max_bits < HUFFMAN_PACKED_BITS);
|
||||
if (htree_group->use_packed_table) BuildPackedTable(htree_group);
|
||||
}
|
||||
WebPSafeFree(code_lengths);
|
||||
ok = 1;
|
||||
|
||||
// All OK. Finalize pointers and return.
|
||||
// All OK. Finalize pointers.
|
||||
hdr->huffman_image_ = huffman_image;
|
||||
hdr->num_htree_groups_ = num_htree_groups;
|
||||
hdr->htree_groups_ = htree_groups;
|
||||
hdr->huffman_tables_ = huffman_tables;
|
||||
return 1;
|
||||
|
||||
Error:
|
||||
WebPSafeFree(code_lengths);
|
||||
WebPSafeFree(huffman_image);
|
||||
WebPSafeFree(huffman_tables);
|
||||
VP8LHtreeGroupsFree(htree_groups);
|
||||
return 0;
|
||||
WebPSafeFree(mapping);
|
||||
if (!ok) {
|
||||
WebPSafeFree(huffman_image);
|
||||
WebPSafeFree(huffman_tables);
|
||||
VP8LHtreeGroupsFree(htree_groups);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -708,11 +754,11 @@ static WEBP_INLINE HTreeGroup* GetHtreeGroupForPos(VP8LMetadata* const hdr,
|
||||
|
||||
typedef void (*ProcessRowsFunc)(VP8LDecoder* const dec, int row);
|
||||
|
||||
static void ApplyInverseTransforms(VP8LDecoder* const dec, int num_rows,
|
||||
static void ApplyInverseTransforms(VP8LDecoder* const dec,
|
||||
int start_row, int num_rows,
|
||||
const uint32_t* const rows) {
|
||||
int n = dec->next_transform_;
|
||||
const int cache_pixs = dec->width_ * num_rows;
|
||||
const int start_row = dec->last_row_;
|
||||
const int end_row = start_row + num_rows;
|
||||
const uint32_t* rows_in = rows;
|
||||
uint32_t* const rows_out = dec->argb_cache_;
|
||||
@@ -743,8 +789,7 @@ static void ProcessRows(VP8LDecoder* const dec, int row) {
|
||||
VP8Io* const io = dec->io_;
|
||||
uint8_t* rows_data = (uint8_t*)dec->argb_cache_;
|
||||
const int in_stride = io->width * sizeof(uint32_t); // in unit of RGBA
|
||||
|
||||
ApplyInverseTransforms(dec, num_rows, rows);
|
||||
ApplyInverseTransforms(dec, dec->last_row_, num_rows, rows);
|
||||
if (!SetCropWindow(io, dec->last_row_, row, &rows_data, in_stride)) {
|
||||
// Nothing to output (this time).
|
||||
} else {
|
||||
@@ -884,7 +929,11 @@ static WEBP_INLINE void CopyBlock8b(uint8_t* const dst, int dist, int length) {
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
#if !defined(WORDS_BIGENDIAN)
|
||||
memcpy(&pattern, src, sizeof(uint16_t));
|
||||
#else
|
||||
pattern = ((uint32_t)src[0] << 8) | src[1];
|
||||
#endif
|
||||
#if defined(__arm__) || defined(_M_ARM)
|
||||
pattern |= pattern << 16;
|
||||
#elif defined(WEBP_USE_MIPS_DSP_R2)
|
||||
@@ -1143,6 +1192,7 @@ static int DecodeImageData(VP8LDecoder* const dec, uint32_t* const data,
|
||||
VP8LFillBitWindow(br);
|
||||
dist_code = GetCopyDistance(dist_symbol, br);
|
||||
dist = PlaneCodeToDistance(width, dist_code);
|
||||
|
||||
if (VP8LIsEndOfStream(br)) break;
|
||||
if (src - data < (ptrdiff_t)dist || src_end - src < (ptrdiff_t)length) {
|
||||
goto Error;
|
||||
@@ -1503,7 +1553,7 @@ static void ExtractAlphaRows(VP8LDecoder* const dec, int last_row) {
|
||||
const int cache_pixs = width * num_rows_to_process;
|
||||
uint8_t* const dst = output + width * cur_row;
|
||||
const uint32_t* const src = dec->argb_cache_;
|
||||
ApplyInverseTransforms(dec, num_rows_to_process, in);
|
||||
ApplyInverseTransforms(dec, cur_row, num_rows_to_process, in);
|
||||
WebPExtractGreen(src, dst, cache_pixs);
|
||||
AlphaApplyFilter(alph_dec,
|
||||
cur_row, cur_row + num_rows_to_process, dst, width);
|
||||
@@ -1523,7 +1573,6 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,
|
||||
if (dec == NULL) return 0;
|
||||
|
||||
assert(alph_dec != NULL);
|
||||
alph_dec->vp8l_dec_ = dec;
|
||||
|
||||
dec->width_ = alph_dec->width_;
|
||||
dec->height_ = alph_dec->height_;
|
||||
@@ -1555,11 +1604,12 @@ int VP8LDecodeAlphaHeader(ALPHDecoder* const alph_dec,
|
||||
|
||||
if (!ok) goto Err;
|
||||
|
||||
// Only set here, once we are sure it is valid (to avoid thread races).
|
||||
alph_dec->vp8l_dec_ = dec;
|
||||
return 1;
|
||||
|
||||
Err:
|
||||
VP8LDelete(alph_dec->vp8l_dec_);
|
||||
alph_dec->vp8l_dec_ = NULL;
|
||||
VP8LDelete(dec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+11
-11
@@ -37,7 +37,7 @@ struct VP8LTransform {
|
||||
int bits_; // subsampling bits defining transform window.
|
||||
int xsize_; // transform window X index.
|
||||
int ysize_; // transform window Y index.
|
||||
uint32_t *data_; // transform data.
|
||||
uint32_t* data_; // transform data.
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -48,23 +48,23 @@ typedef struct {
|
||||
int huffman_mask_;
|
||||
int huffman_subsample_bits_;
|
||||
int huffman_xsize_;
|
||||
uint32_t *huffman_image_;
|
||||
uint32_t* huffman_image_;
|
||||
int num_htree_groups_;
|
||||
HTreeGroup *htree_groups_;
|
||||
HuffmanCode *huffman_tables_;
|
||||
HTreeGroup* htree_groups_;
|
||||
HuffmanCode* huffman_tables_;
|
||||
} VP8LMetadata;
|
||||
|
||||
typedef struct VP8LDecoder VP8LDecoder;
|
||||
struct VP8LDecoder {
|
||||
VP8StatusCode status_;
|
||||
VP8LDecodeState state_;
|
||||
VP8Io *io_;
|
||||
VP8Io* io_;
|
||||
|
||||
const WebPDecBuffer *output_; // shortcut to io->opaque->output
|
||||
const WebPDecBuffer* output_; // shortcut to io->opaque->output
|
||||
|
||||
uint32_t *pixels_; // Internal data: either uint8_t* for alpha
|
||||
uint32_t* pixels_; // Internal data: either uint8_t* for alpha
|
||||
// or uint32_t* for BGRA.
|
||||
uint32_t *argb_cache_; // Scratch buffer for temporary BGRA storage.
|
||||
uint32_t* argb_cache_; // Scratch buffer for temporary BGRA storage.
|
||||
|
||||
VP8LBitReader br_;
|
||||
int incremental_; // if true, incremental decoding is expected
|
||||
@@ -86,8 +86,8 @@ struct VP8LDecoder {
|
||||
// or'd bitset storing the transforms types.
|
||||
uint32_t transforms_seen_;
|
||||
|
||||
uint8_t *rescaler_memory; // Working memory for rescaling work.
|
||||
WebPRescaler *rescaler; // Common rescaler for all channels.
|
||||
uint8_t* rescaler_memory; // Working memory for rescaling work.
|
||||
WebPRescaler* rescaler; // Common rescaler for all channels.
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -132,4 +132,4 @@ void VP8LDelete(VP8LDecoder* const dec);
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* WEBP_DEC_VP8LI_DEC_H_ */
|
||||
#endif // WEBP_DEC_VP8LI_DEC_H_
|
||||
|
||||
Vendored
+1
-1
@@ -130,4 +130,4 @@ int WebPAvoidSlowMemory(const WebPDecBuffer* const output,
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* WEBP_DEC_WEBPI_DEC_H_ */
|
||||
#endif // WEBP_DEC_WEBPI_DEC_H_
|
||||
|
||||
Vendored
+1
-1
@@ -24,7 +24,7 @@
|
||||
#include "src/webp/format_constants.h"
|
||||
|
||||
#define DMUX_MAJ_VERSION 1
|
||||
#define DMUX_MIN_VERSION 0
|
||||
#define DMUX_MIN_VERSION 1
|
||||
#define DMUX_REV_VERSION 0
|
||||
|
||||
typedef struct {
|
||||
|
||||
+2
-2
@@ -214,7 +214,7 @@ static void ApplyAlphaMultiply_SSE2(uint8_t* rgba, int alpha_first,
|
||||
// Alpha detection
|
||||
|
||||
static int HasAlpha8b_SSE2(const uint8_t* src, int length) {
|
||||
const __m128i all_0xff = _mm_set1_epi8(0xff);
|
||||
const __m128i all_0xff = _mm_set1_epi8((char)0xff);
|
||||
int i = 0;
|
||||
for (; i + 16 <= length; i += 16) {
|
||||
const __m128i v = _mm_loadu_si128((const __m128i*)(src + i));
|
||||
@@ -228,7 +228,7 @@ static int HasAlpha8b_SSE2(const uint8_t* src, int length) {
|
||||
|
||||
static int HasAlpha32b_SSE2(const uint8_t* src, int length) {
|
||||
const __m128i alpha_mask = _mm_set1_epi32(0xff);
|
||||
const __m128i all_0xff = _mm_set1_epi8(0xff);
|
||||
const __m128i all_0xff = _mm_set1_epi8((char)0xff);
|
||||
int i = 0;
|
||||
// We don't know if we can access the last 3 bytes after the last alpha
|
||||
// value 'src[4 * length - 4]' (because we don't know if alpha is the first
|
||||
|
||||
Vendored
+6
@@ -377,6 +377,7 @@ VP8SetResidualCoeffsFunc VP8SetResidualCoeffs;
|
||||
extern void VP8EncDspCostInitMIPS32(void);
|
||||
extern void VP8EncDspCostInitMIPSdspR2(void);
|
||||
extern void VP8EncDspCostInitSSE2(void);
|
||||
extern void VP8EncDspCostInitNEON(void);
|
||||
|
||||
WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) {
|
||||
VP8GetResidualCost = GetResidualCost_C;
|
||||
@@ -398,6 +399,11 @@ WEBP_DSP_INIT_FUNC(VP8EncDspCostInit) {
|
||||
if (VP8GetCPUInfo(kSSE2)) {
|
||||
VP8EncDspCostInitSSE2();
|
||||
}
|
||||
#endif
|
||||
#if defined(WEBP_USE_NEON)
|
||||
if (VP8GetCPUInfo(kNEON)) {
|
||||
VP8EncDspCostInitNEON();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user