mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Compare commits
1349 Commits
3.3.0-cvsdk
...
3.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d4f66472e | |||
| eba176c299 | |||
| 00e43a9022 | |||
| 9148a37624 | |||
| 019b7c5a66 | |||
| 59e825ee02 | |||
| bcc669f3f7 | |||
| e5313246a7 | |||
| 97af608030 | |||
| 181b448c4d | |||
| 289a8da39e | |||
| b85c77283b | |||
| 0742e12f0b | |||
| 9b659736da | |||
| 69a6765bf7 | |||
| 3f68d6d8a7 | |||
| 83b8cd0152 | |||
| 4e542a65a3 | |||
| aa46e31c6d | |||
| ddbd074678 | |||
| 5fdb42a7c9 | |||
| 6c252d8cdc | |||
| 636b7ec0c4 | |||
| 534645a12f | |||
| 09c84a0164 | |||
| 325cbd7c84 | |||
| b19cd93738 | |||
| 019162486c | |||
| fe7b3f1228 | |||
| 1bc1f3d311 | |||
| a8a51db42b | |||
| 70d49446e9 | |||
| a2620f72c7 | |||
| 50d44e06e3 | |||
| c5fc8e03ff | |||
| 0aa5e43a14 | |||
| c67e75b68f | |||
| 047ad4ff71 | |||
| ae8bb718cd | |||
| 7bbe1a53cf | |||
| b6fe4cc807 | |||
| eecb64a973 | |||
| e72a053cca | |||
| e43997dbb5 | |||
| 813ff37967 | |||
| b8a24b36ce | |||
| d2f13a8259 | |||
| 94d84c5fad | |||
| 1eb2fa9efb | |||
| 7e48fa58eb | |||
| 59ec224009 | |||
| 0ed2cbc931 | |||
| 1ff33e6e4d | |||
| b450811e4b | |||
| 87160cb297 | |||
| dcdd6af5a8 | |||
| badc3bd312 | |||
| b1ed8bc0d1 | |||
| 3b84acfc48 | |||
| 436d7e4eaf | |||
| 910d7dab1f | |||
| b0e9d76ced | |||
| 05b259fe2e | |||
| 6aabd6cc7a | |||
| 19c914db51 | |||
| c057d29192 | |||
| e29de5dd2b | |||
| 1654dfe3a9 | |||
| d3a124c820 | |||
| 86cc4f3aa4 | |||
| 9de87d96cc | |||
| 65f502bc99 | |||
| fcb537bacd | |||
| 3dbf392d48 | |||
| 2b43d4f477 | |||
| cac4a7e5b5 | |||
| 3fddce67c6 | |||
| a5c04baec1 | |||
| 361bb1197f | |||
| 0b33eb0929 | |||
| 8ed1a274e1 | |||
| 70e1b4ddf0 | |||
| bab86d65cb | |||
| aef3019152 | |||
| 28b19d6e3e | |||
| e728ffd5bf | |||
| 4b1455579f | |||
| 1033f2b1bd | |||
| 0a439570a0 | |||
| 50365b7741 | |||
| 62359f70ff | |||
| c5ed507737 | |||
| 7d4a67f2a8 | |||
| d5f152494b | |||
| 1b8acd662f | |||
| 7ad308ea47 | |||
| 6df8ac0342 | |||
| 08112f3821 | |||
| 18ff806d5b | |||
| d0684ac139 | |||
| a8ae9cab08 | |||
| 84535a60f2 | |||
| ca1a0a1108 | |||
| 7d18f49a49 | |||
| 0da947e6b3 | |||
| 6cedc82799 | |||
| b417fb0939 | |||
| cd4176104d | |||
| 5c709f4aaa | |||
| ae5e1f8ece | |||
| a9de6900e5 | |||
| 83b5b86f7d | |||
| ca46171246 | |||
| d4e2e6279c | |||
| 197078e331 | |||
| d0d2faf551 | |||
| a4b5eabccf | |||
| 7b701fee60 | |||
| 99183e98d3 | |||
| c231472ad6 | |||
| 9930076dc5 | |||
| ecb6bcf2e0 | |||
| 74f1295756 | |||
| 3966595f9a | |||
| 0fcc6f5d60 | |||
| 3e45795232 | |||
| 51cb56ef2c | |||
| f39ee9c6a1 | |||
| 84ee4d701a | |||
| 267c5a747b | |||
| edadcfa7d9 | |||
| 62ed6cdc74 | |||
| ce20efb8e7 | |||
| 825b14278e | |||
| 8d4777c81d | |||
| c0b6061a5e | |||
| 2324674dfb | |||
| 53b5afbba9 | |||
| d48d2d7fe2 | |||
| b0bce60c16 | |||
| eff42f6387 | |||
| 5404930112 | |||
| e49febb70f | |||
| 7e680bd9ff | |||
| 766a0c0f25 | |||
| 9fa505027a | |||
| 61c2f094b9 | |||
| 558b17dede | |||
| 86b128dbb3 | |||
| 5560db73bf | |||
| 7349b8f5ce | |||
| 88507fa051 | |||
| 9665dde678 | |||
| 768f4cb7bc | |||
| b15bc194ef | |||
| be4fa03fac | |||
| 164a77e7ad | |||
| 6174f62710 | |||
| d715badbde | |||
| 912de363f4 | |||
| 66e09bc9a4 | |||
| cd7526c973 | |||
| c24f10d647 | |||
| 4bee238cf8 | |||
| f503515082 | |||
| e307065c8e | |||
| 6185f7209e | |||
| a2811d93dd | |||
| 9c5b231b2d | |||
| f2070c9f5d | |||
| 34e414dc31 | |||
| 92d23fb1a8 | |||
| f8b14a1612 | |||
| 8f1345091e | |||
| 17dcf0e82d | |||
| d329674f68 | |||
| cadd1a0074 | |||
| 1625ffa2cf | |||
| 72de03d749 | |||
| 0be1bf551b | |||
| ef0650179b | |||
| 38c62f6461 | |||
| 6fb9d42c3f | |||
| ef04ca9e0f | |||
| 6074f92d48 | |||
| 0b688cd23f | |||
| 59cbaca4d3 | |||
| 66feea6cac | |||
| 7707c9bfba | |||
| 85b1c4060c | |||
| 07bec6bdcd | |||
| 159ea22b6b | |||
| 682bd2eedf | |||
| d8a737b4b0 | |||
| af1ea1f7ac | |||
| 3a8a73ef6c | |||
| 4781f0a337 | |||
| 4b8275061e | |||
| 7933fff0dd | |||
| 2c4d3d92c7 | |||
| 15b909e80b | |||
| a82d2363f4 | |||
| 13c4a02157 | |||
| 0042bacd88 | |||
| ffe49bdebe | |||
| 4d721e368a | |||
| 7b7033ac60 | |||
| 552c3ba869 | |||
| 5b41599911 | |||
| b833d512ec | |||
| 5ce38e516e | |||
| 611cf8d86f | |||
| df5ec54fb8 | |||
| a3ec2ac3c5 | |||
| 69830b1851 | |||
| bbbec300a6 | |||
| 6d06fcb414 | |||
| 2aa380752c | |||
| 03850008b9 | |||
| fc9e031454 | |||
| 74d321d901 | |||
| 7bfb38055c | |||
| 81519537ae | |||
| 0f12351a41 | |||
| 7aadbc9607 | |||
| ce65975625 | |||
| a25c443d1f | |||
| c2c7333107 | |||
| cb9e110adb | |||
| 0595ab3eef | |||
| 800294ad4b | |||
| ac58405a71 | |||
| 9bf6ec6fe1 | |||
| 7ae19467b5 | |||
| fe95d5a720 | |||
| 0105518422 | |||
| 22c0bb7dc9 | |||
| b19f81b35b | |||
| 28717d0437 | |||
| 5ea50d1e8d | |||
| e703c3090a | |||
| a79d0e19ad | |||
| 872500c4a5 | |||
| 7eb1065944 | |||
| cdc2aca2cc | |||
| cc2ee923e4 | |||
| f5dba12762 | |||
| 86ff4a1ccf | |||
| 614e254331 | |||
| 6fe6436162 | |||
| 29e4a4940d | |||
| f7913e2c84 | |||
| 73ac5321f5 | |||
| 2e56a47f8c | |||
| 666fc0ba69 | |||
| cfd845ac07 | |||
| 2a8344f75b | |||
| 762138e77e | |||
| d381e499ea | |||
| 0ed3209b00 | |||
| bc547c4290 | |||
| 9e4a8a31e1 | |||
| b900496c40 | |||
| abad8977b6 | |||
| 6c135261b2 | |||
| a44573c43b | |||
| cd689c640d | |||
| 378e05c16b | |||
| 486cfd1040 | |||
| 3c795a0dab | |||
| 6fbf0758bc | |||
| 89d855c0b7 | |||
| 1f465a0ef9 | |||
| a47fbd2610 | |||
| 99ed085752 | |||
| c95bc0c7fd | |||
| 11ddb9332c | |||
| 606a5fd537 | |||
| c4b158ff91 | |||
| ec076bfba3 | |||
| 92be112388 | |||
| a83c12c3d5 | |||
| 7f554f3cc4 | |||
| 92b35e6758 | |||
| 91c1d7697f | |||
| 5b27fb506a | |||
| f2b3e5f517 | |||
| 807f5e33ad | |||
| 11330b9253 | |||
| 2af6f68452 | |||
| c38620e966 | |||
| 8254169cf5 | |||
| b6abf0d3f9 | |||
| bd6a6690f2 | |||
| cdbbccbef8 | |||
| cbf2b51e40 | |||
| 13f374660f | |||
| e34b64c979 | |||
| c180047bc1 | |||
| f071a48ec7 | |||
| a1479cc2c1 | |||
| 2feb0c2f61 | |||
| 107582c767 | |||
| 636d6368ee | |||
| 04edc8fe3a | |||
| 559235ac74 | |||
| 5d369afe27 | |||
| 49a5280198 | |||
| e5d1790b7b | |||
| 5b17410f7c | |||
| fed2a277e0 | |||
| d59472bf40 | |||
| 6f48dc2482 | |||
| 8082011546 | |||
| 7628c143f4 | |||
| 5d0a8d2aaf | |||
| 019de554a0 | |||
| 3ee8079f35 | |||
| e4aa2ccd66 | |||
| f37f4cf3b4 | |||
| e7d62d6ef3 | |||
| b29893b938 | |||
| 1c88a566e0 | |||
| 3f37be5a30 | |||
| 9db5cbf9a4 | |||
| 8e6280fc8e | |||
| f8ad289311 | |||
| a9b5233f67 | |||
| e57f22a386 | |||
| 12662e064b | |||
| 1c46034166 | |||
| 2178c5e95e | |||
| b3018ba89e | |||
| e75056a084 | |||
| 51fc891a5c | |||
| 0f34628af7 | |||
| c3cced0f89 | |||
| 397b57dd72 | |||
| 01b581048d | |||
| 438e456ce9 | |||
| b389c1cfe7 | |||
| f19f2bbcde | |||
| f6d927ef3b | |||
| 75b980ac64 | |||
| f723cede2e | |||
| 6c5dd5cf6d | |||
| 3a09da71d8 | |||
| 3cbe60cca2 | |||
| 2674c6b5e0 | |||
| 45d11dde57 | |||
| c7f1843584 | |||
| b1d208891b | |||
| 017a38a54e | |||
| b45403ed75 | |||
| f50ec229de | |||
| 3e33820ee5 | |||
| 73d4f12c14 | |||
| 20c08eab73 | |||
| eb136ebba6 | |||
| 1a9d8e9447 | |||
| 0eb1bfa874 | |||
| 5ebb234746 | |||
| 394101d6ed | |||
| 3c6983a2bd | |||
| 56bda8917d | |||
| 6936ec7dbd | |||
| e730048f69 | |||
| 751cee8e67 | |||
| 0608227e10 | |||
| 2210ed4fdd | |||
| 65061948af | |||
| 55dabd2858 | |||
| 88e6daa315 | |||
| baff521b63 | |||
| bbba9ac121 | |||
| 1fbdca83f5 | |||
| 3a0039d204 | |||
| aa70199ce1 | |||
| fcdd833059 | |||
| ba940dec38 | |||
| 42f449880c | |||
| 2610a47c89 | |||
| 55260a8d3c | |||
| 43e4e1b624 | |||
| e89501a3ad | |||
| 992a81dcaa | |||
| 2e772510ea | |||
| c6fb99357c | |||
| 7190028b23 | |||
| bafdc44d37 | |||
| 1af16afb89 | |||
| b9cf65e905 | |||
| 8a3a75cc16 | |||
| fbe18e80f6 | |||
| 06bda58a2c | |||
| e89ae986fa | |||
| 8f99083726 | |||
| 51cef2651e | |||
| 0205238dca | |||
| a0c658b012 | |||
| 22dfc1daf1 | |||
| e51a8e047c | |||
| 0a7c60b439 | |||
| a0e1def83b | |||
| 2fc1edfc96 | |||
| 3921fab285 | |||
| 48ed769b18 | |||
| bffe254a81 | |||
| 63fb79b519 | |||
| c51567ae45 | |||
| 97181a90ba | |||
| 981009ac1f | |||
| 96aebbe7f9 | |||
| ed71f62181 | |||
| 888d0cda40 | |||
| 4085bbf758 | |||
| 49f214b275 | |||
| 8e21f808be | |||
| ac22d3c817 | |||
| afa633b7bc | |||
| 62737c777c | |||
| 42d942e19c | |||
| 7267e94be7 | |||
| 184daa155f | |||
| d7a1d2230f | |||
| 9c4f0a984f | |||
| 8fb48c09f7 | |||
| 6e4f9433d0 | |||
| c624967049 | |||
| 20a2dc6ac5 | |||
| b1b2528e50 | |||
| 1bd865120c | |||
| bacc96f4e8 | |||
| cc3f9323bb | |||
| c964aa3333 | |||
| f9ac1665b6 | |||
| 942672ad91 | |||
| 9cceccd645 | |||
| 47ae5197a9 | |||
| c9c759f700 | |||
| 7db612a545 | |||
| 18a4ced07a | |||
| b9b553b8bc | |||
| 0c79f4a00f | |||
| cc626a3b5a | |||
| 14af2a0c0c | |||
| bc348eb8ab | |||
| 6e4dacc0b3 | |||
| e1ebc4e991 | |||
| 67acfc6e25 | |||
| 87984f2c6a | |||
| 15df161b22 | |||
| 988a5626f6 | |||
| 22496742b4 | |||
| bc9c9abab0 | |||
| c6fc7ccb5e | |||
| 93813fec6e | |||
| 7809c4156f | |||
| 37d99201ca | |||
| 5feb1c94a7 | |||
| fd1eb63fee | |||
| cd428fb798 | |||
| 476c513447 | |||
| 639b800787 | |||
| 712689e81a | |||
| 03cefa7bfe | |||
| 2dc76d5009 | |||
| def444d99f | |||
| 5f80e42dac | |||
| 7b0d2d189f | |||
| e0e40405ed | |||
| ff037ebe5f | |||
| 91c0b13743 | |||
| eb9fcf4f08 | |||
| 1f214d232d | |||
| ede39b85f6 | |||
| ff190b1ef4 | |||
| 1a495a5817 | |||
| 09d283a39d | |||
| 8b1b126e3e | |||
| 5384d2f090 | |||
| b4813e6bdf | |||
| 4b52b8df34 | |||
| 60cbc46da1 | |||
| 9e6ef99422 | |||
| 58a83e99c0 | |||
| cc9ab7e582 | |||
| bc93775385 | |||
| b4367c92f3 | |||
| 825c0ffdb4 | |||
| 69f2590359 | |||
| 7060ee4d00 | |||
| 390be6d5b5 | |||
| a385fff3bf | |||
| 7b8fb64f21 | |||
| 0c291c7768 | |||
| 5bf39ceb5d | |||
| 48e07437f0 | |||
| e5766513a4 | |||
| 9cdeb6dfbf | |||
| f9aa411c92 | |||
| 436a1f72a5 | |||
| 7e3e9144de | |||
| c704942b8a | |||
| acedb4a579 | |||
| db0a159229 | |||
| 2eb61a4a99 | |||
| 868ad16041 | |||
| 21c8e6d02d | |||
| a871f9e4f7 | |||
| fb5cd42c6b | |||
| a36ebaecdc | |||
| bf418ba342 | |||
| be9767e014 | |||
| ab5e09e428 | |||
| 607231641f | |||
| 91323549f4 | |||
| 9e9881aacc | |||
| 734ea77c9a | |||
| d96cac1341 | |||
| 0622146a93 | |||
| db980b0eca | |||
| d1c5e79ec3 | |||
| cca99bf824 | |||
| dcaad315e7 | |||
| 08a5fe3661 | |||
| c95f3eff6e | |||
| 9ae86a922c | |||
| 276459e57e | |||
| 223830a5ee | |||
| 410d44d67d | |||
| d7cbe6e947 | |||
| ad051cdd99 | |||
| b1fe298764 | |||
| a6c02af099 | |||
| c97c1a2454 | |||
| 9b1b281c7b | |||
| 185faf99bd | |||
| b903ff8992 | |||
| face2ea612 | |||
| 3fd03964a3 | |||
| ccea108806 | |||
| 8d5a5d5ceb | |||
| a3a446c197 | |||
| c63b4433f4 | |||
| 505c90e104 | |||
| 97b8a089c7 | |||
| 69e5ac6f02 | |||
| 3da9598add | |||
| 437da0a3d9 | |||
| d026d7dcfb | |||
| 110af09bf9 | |||
| 73af899b7c | |||
| 2d8f2c2aea | |||
| b066dd36ff | |||
| 1563300197 | |||
| 2914443685 | |||
| fef1f9b0a7 | |||
| 2808bea7fa | |||
| d30a0c6f03 | |||
| 0246cffc34 | |||
| 22dece8146 | |||
| 4566105578 | |||
| fee2049642 | |||
| e2499e5b2f | |||
| 60bcb16ca8 | |||
| 2a781bb616 | |||
| 4eb9f175a4 | |||
| b2b56b6896 | |||
| 5ed354221c | |||
| 827c7515c9 | |||
| 23f26fb4a8 | |||
| d4ef5bc16a | |||
| 26fe8bd4f2 | |||
| 4857cae6ed | |||
| 1ba29cc95d | |||
| df5b2224d7 | |||
| f1fe873375 | |||
| b0c6bd0a5b | |||
| 4ae30ecdd9 | |||
| 937b8e4277 | |||
| e356ca2369 | |||
| e955bcb872 | |||
| 88225eb65e | |||
| ec24091578 | |||
| 024be9b8c9 | |||
| af9c8377eb | |||
| 29c186a022 | |||
| baf9e32af3 | |||
| 8b168175ec | |||
| 83655ba9be | |||
| 0873ebb9b0 | |||
| 5e82c98a9f | |||
| babd21c764 | |||
| 47e1133e71 | |||
| a972f0d4ea | |||
| f7175f5050 | |||
| 1ea1ff197d | |||
| 5ea8ea440b | |||
| 050916fd6b | |||
| ada753a54c | |||
| a96c5b5d90 | |||
| b2d8e8c508 | |||
| b2673a19cf | |||
| 905a9dada2 | |||
| 3935e13603 | |||
| af8ed9d09f | |||
| 638a91f92f | |||
| 3562a05d90 | |||
| 6c1247b38c | |||
| b7ff9ddcdd | |||
| 25161fc56f | |||
| 0739f28e56 | |||
| 046045239c | |||
| 7d55c09a9f | |||
| 0be1f4a573 | |||
| af4d6f34d8 | |||
| bd6fb497bc | |||
| 949ec486c5 | |||
| 556768ead1 | |||
| 2cfe29276e | |||
| 752f232335 | |||
| 92a0808379 | |||
| 3ae7515955 | |||
| ecc34dc521 | |||
| eabf728682 | |||
| 29b0ef44aa | |||
| 3010cc5971 | |||
| bfb12acde6 | |||
| 44699c59b3 | |||
| fee87ea3f7 | |||
| 6a80834ed4 | |||
| 593329401a | |||
| ef332dc550 | |||
| 746d5f5021 | |||
| cb5bc1832b | |||
| 5a22d81fe5 | |||
| 0a19b07055 | |||
| dbe9ee0924 | |||
| 4b968d1fe2 | |||
| d077778074 | |||
| e615fafe2d | |||
| e4aa39f9e5 | |||
| 8ac2c5d620 | |||
| 6be25727ec | |||
| 04b4495493 | |||
| 9661d60f74 | |||
| 8a05c195f7 | |||
| 2c1b4f5711 | |||
| ffb9554787 | |||
| b638aa74d7 | |||
| fdc4344acb | |||
| 421c5dee12 | |||
| d25ee8a273 | |||
| 6c6900a6cd | |||
| 21bd834a59 | |||
| b969d86415 | |||
| fe58b58937 | |||
| 87595a6b3a | |||
| b9f94c9315 | |||
| 56fe2dc1ed | |||
| e268606e26 | |||
| 0d979a741b | |||
| 9a2317e063 | |||
| d99ced6ec8 | |||
| 9ff33dacfc | |||
| a6f5e1f0ca | |||
| 08515281b9 | |||
| f7d85bfed8 | |||
| 3250f11f0c | |||
| d068e27420 | |||
| 18bc4db75c | |||
| bc18fb481f | |||
| 5f6ce6f4b0 | |||
| 558e4d9c2d | |||
| 440e8d4efa | |||
| bc7f649d68 | |||
| ad8bbaf008 | |||
| ed397cfbea | |||
| 5669ee815b | |||
| 2a21c10837 | |||
| 800da724a3 | |||
| 0136711cf4 | |||
| 2a2537725a | |||
| 49afb28738 | |||
| ab748188b1 | |||
| e340ff9c3a | |||
| 629a06d9b6 | |||
| f646f61dad | |||
| ca9a3af704 | |||
| eca5906a75 | |||
| b872d14376 | |||
| d3e3d0996c | |||
| 20c11d3b7b | |||
| 089aac61f3 | |||
| 1f18282f04 | |||
| 529632f8d0 | |||
| a13cbced2e | |||
| a9effeeb35 | |||
| 69103a9fab | |||
| a729f985fd | |||
| d43087cafe | |||
| 0bf823e1eb | |||
| 39ee07b8f6 | |||
| e187219699 | |||
| a56d7592f0 | |||
| 5e93c82023 | |||
| a6d634b5b8 | |||
| af8fc3e209 | |||
| 22467599c4 | |||
| 68cc2e292d | |||
| 45365e4df1 | |||
| 139b32734e | |||
| 488d4df520 | |||
| 5f6fb16fda | |||
| 06d22af2bf | |||
| 6e593cd1f0 | |||
| 386f402e0c | |||
| 9efb24943e | |||
| 55b7073aae | |||
| bf6548dc1a | |||
| 0f0f5652fb | |||
| d4c905bf77 | |||
| 7ff294dbe6 | |||
| 332588fcee | |||
| 2fd0229493 | |||
| 18c1e32047 | |||
| 315dac4878 | |||
| c58152d94b | |||
| a0d7cf89f2 | |||
| 7475d23fec | |||
| 3dee92ec50 | |||
| 587df6d942 | |||
| 513c2b92a4 | |||
| 84cec17913 | |||
| e8ee284710 | |||
| ea2c13c91e | |||
| f57106b00a | |||
| ef8c919e3f | |||
| d9107601c3 | |||
| a08044d6f2 | |||
| aea25e7f90 | |||
| 89b6e68e1e | |||
| 62c4cf3ac6 | |||
| 945706a8e8 | |||
| 78788e1efb | |||
| b143f7100a | |||
| 5a9461056b | |||
| 08b5dc64af | |||
| 8f05af8d05 | |||
| e932160a8d | |||
| 39e742765a | |||
| 50aa4f8887 | |||
| c67ad49378 | |||
| b8af7c5f86 | |||
| 3f794cd951 | |||
| 222149b9c6 | |||
| 22fcbaed64 | |||
| a0d3d11470 | |||
| f1695bdc38 | |||
| c39b4b8be1 | |||
| 242cf538b4 | |||
| 4059f8b3a3 | |||
| 9a70fd0123 | |||
| 17a85b16fc | |||
| 50b651655d | |||
| cc547e8260 | |||
| bb679f978d | |||
| 2ad27f5757 | |||
| 8a31a37434 | |||
| bf718b0865 | |||
| 2d813910de | |||
| 3b993431be | |||
| c57aef75de | |||
| e70b75b51a | |||
| 8755a19e02 | |||
| bdd8cc697a | |||
| 2c7a123ed8 | |||
| a936ec325b | |||
| e5890fc92a | |||
| 1283d62e49 | |||
| d9ab31490c | |||
| 6a5298a532 | |||
| 8129f5378f | |||
| fb8143d55d | |||
| fd20529686 | |||
| 92deccbf41 | |||
| 48c4bea57c | |||
| 2e68f89225 | |||
| 2d0611bc01 | |||
| fa109b94d9 | |||
| ca245e995a | |||
| 0624411875 | |||
| 63584bc4d0 | |||
| f7df5dd32c | |||
| 70c5d69640 | |||
| e012ccda4a | |||
| f4136679ea | |||
| 3358b8910b | |||
| 73298ea875 | |||
| bd8e6b7e14 | |||
| 6757101f55 | |||
| 37ba1d6f2d | |||
| 7ec59fc097 | |||
| 0e44ad5543 | |||
| 4196543cd5 | |||
| 6da62f56fa | |||
| 99fae8146f | |||
| 2f0036c918 | |||
| 9dea296241 | |||
| 2566ef3515 | |||
| d891e9b1d8 | |||
| 8646d5fb84 | |||
| d343a58580 | |||
| ed3d2cd122 | |||
| 6bf8fe815d | |||
| a391871cce | |||
| 41b23fde9f | |||
| 48cc1b351d | |||
| 5707304777 | |||
| cb0d695984 | |||
| d60de63fa0 | |||
| a90a93b454 | |||
| 6857870412 | |||
| 3c229aa2eb | |||
| 62df5e8c8b | |||
| 4435ec5f26 | |||
| b421ebef86 | |||
| 701c7e5685 | |||
| 0ce7c33bc8 | |||
| 7dc6b1d7d4 | |||
| 58b890b9f7 | |||
| 6639348c5e | |||
| 9640bbe76d | |||
| 7d168d3d6f | |||
| 32bb71d686 | |||
| 822d33d64b | |||
| d547c6b1a2 | |||
| 31348f8c30 | |||
| bc09d1ba3b | |||
| f1aa180a40 | |||
| 8c7f19850f | |||
| da257f3397 | |||
| 622318aeae | |||
| b8b5d83ad0 | |||
| 93c3f20deb | |||
| 258b13f2e0 | |||
| 42cd061af0 | |||
| f6daaccccf | |||
| 18ca3d1e62 | |||
| 2457bfc1e3 | |||
| f6a165d10f | |||
| 92093a6e6c | |||
| f1e8aa70a0 | |||
| d25344c257 | |||
| 62ee92e3e2 | |||
| 375ec5ed7e | |||
| 758f914249 | |||
| 121fa04906 | |||
| 5ea1c72291 | |||
| f5dff87242 | |||
| f0ef7bd149 | |||
| 0e6c335077 | |||
| ce41a15437 | |||
| d9e364f31f | |||
| 32bf712102 | |||
| 98e0d13f99 | |||
| c9d3c0f206 | |||
| 9e381d0782 | |||
| 169add5aa6 | |||
| 597b3f4456 | |||
| 26ad229bd6 | |||
| 45afd29b72 | |||
| 954e2f9b9c | |||
| 13317bdfda | |||
| c4c1e94088 | |||
| 30ff197f78 | |||
| 8877e3aedb | |||
| 9c973144d8 | |||
| 576a85368d | |||
| 2d34443834 | |||
| f8598e173b | |||
| d63f698cbe | |||
| 44b75eb116 | |||
| 248e2c7d47 | |||
| 37ab318657 | |||
| cad7c4d51d | |||
| fda1e76776 | |||
| eeba5c3603 | |||
| 3eb9a655c7 | |||
| d25cbaaba8 | |||
| 4970a56341 | |||
| f080d9390a | |||
| f4265d251a | |||
| f2105419fa | |||
| 89bb028bfc | |||
| c92c99ed0b | |||
| 570083fb9f | |||
| b32685c714 | |||
| 2ac57a2b1f | |||
| b05789ff0b | |||
| 572a7bf6ce | |||
| 200c8a0d3a | |||
| 4832c24ef7 | |||
| 8b094755fa | |||
| 1caca2112b | |||
| 42fbbfecc6 | |||
| 46a668c565 | |||
| 164a41b399 | |||
| 791a11f949 | |||
| 334241d82e | |||
| 7791839f22 | |||
| 2f94637899 | |||
| 936234d5b1 | |||
| e1b102e9a6 | |||
| 72001dc13c | |||
| 3df41b3263 | |||
| 7b4f323b8b | |||
| ee6aacee9c | |||
| 62c6656130 | |||
| 4acdcfd008 | |||
| 273add5d5d | |||
| f7a273cfb3 | |||
| d57321f7c1 | |||
| 146be78390 | |||
| cc17400849 | |||
| 1114cbf671 | |||
| 82ad0749af | |||
| 0451629e22 | |||
| 86b55b3923 | |||
| 01519313d7 | |||
| 7e12c879c2 | |||
| d0f902053f | |||
| da208216ee | |||
| 235b00b6ee | |||
| e8caa9b5c0 | |||
| 05b99a4dde | |||
| e6ee800fde | |||
| 72f789bf34 | |||
| f6265500fb | |||
| b1f46b6d69 | |||
| d991054202 | |||
| 0c4e294504 | |||
| 5c572ffa1f | |||
| cae467cda0 | |||
| 3e9a659f4c | |||
| 33ba7867f6 | |||
| 80519a0278 | |||
| d743a4c969 | |||
| 02d98d3242 | |||
| efa0e75eac | |||
| e1ab227b6d | |||
| 7067c1597d | |||
| a0e26817e2 | |||
| dde04d5d3e | |||
| 91ef0b9537 | |||
| 964dda2ef2 | |||
| e3b12bdb59 | |||
| 3571e8f263 | |||
| 91e56abcf1 | |||
| 4ee3034496 | |||
| 034aaa7a70 | |||
| 8f05126619 | |||
| 6531fd142c | |||
| 518c6ae8c6 | |||
| 048feeb3f0 | |||
| b00dff83de | |||
| 4a81492b68 | |||
| d861c03366 | |||
| 52a60526f1 | |||
| ee26889205 | |||
| 537ab13842 | |||
| 01acb08c7b | |||
| 11fa0094ff | |||
| 5c43a394c5 | |||
| 183081ccd3 | |||
| 897b071b97 | |||
| 6258ff36bc | |||
| c7516b840a | |||
| 8ffa29473f | |||
| e0ff5106d3 | |||
| 603fa03ac6 | |||
| 8a094a5f54 | |||
| ef7833a271 | |||
| da3da84a20 | |||
| b18983a005 | |||
| bee5cb504b | |||
| 717b2f496f | |||
| a2f7132648 | |||
| 7555ab194f | |||
| 91f680aff6 | |||
| 3202bbe17c | |||
| bc3280d64d | |||
| 8e7e24ac80 | |||
| cc5da83474 | |||
| c515e878ab | |||
| d195f2775a | |||
| b7fa6d84bc | |||
| 9c14a2f0aa | |||
| e80766abf0 | |||
| 25a4559565 | |||
| dcfc1fe17e | |||
| 63cd581d75 | |||
| c48807c383 | |||
| d0509f6702 | |||
| 1fc9425bb1 | |||
| 8285924cf3 | |||
| 97aaaf50b8 | |||
| c5f2170ce8 | |||
| 6fc5697950 | |||
| aacae20657 | |||
| c9fe702671 | |||
| 7123d9c376 | |||
| a893b147dc | |||
| a57718e1ac | |||
| 8b1146deb2 | |||
| 97ec91ad67 | |||
| f6deaf5f2a | |||
| 1e3052d3cd | |||
| b67c64e2c8 | |||
| 301ab43897 | |||
| a710317aa0 | |||
| 8f301151e4 | |||
| 688fcf14f3 | |||
| f0fb665407 | |||
| e74c475162 | |||
| cc5b99c236 | |||
| af09cb2834 | |||
| 5adc0bf3a7 | |||
| 58dc58aa51 | |||
| 2eb3c02059 | |||
| 179ef0a975 | |||
| ea6fe71a50 | |||
| 76f7fb5231 | |||
| 54f0616a13 | |||
| f694192878 | |||
| ea4bcadb38 | |||
| 9b173e2db1 | |||
| 89172c08a2 | |||
| 336996152a | |||
| 588ca5d126 | |||
| a2120263de | |||
| 8c84763ed3 | |||
| 87a98e4562 | |||
| e63d3dd25f | |||
| b6949c5088 | |||
| 870d9502bb | |||
| d5e64f4eb2 | |||
| 3b38eeaccf | |||
| 2b8f888ea4 | |||
| 316fb26f5b | |||
| a835517049 | |||
| 5c325466e0 | |||
| 98db804541 | |||
| 71e1889825 | |||
| 4e28c00e7b | |||
| a5b5684670 | |||
| 78a310630f | |||
| 999f41fb4f | |||
| 3a8dbebd37 | |||
| 0d854db361 | |||
| fdb3d4ff60 | |||
| 9e5c9dad55 | |||
| e7b9cfa8f2 | |||
| 1d4a29f149 | |||
| e5f129424c | |||
| 66b0651607 | |||
| 803274e207 | |||
| b7ff13b603 | |||
| 9e239c7a1e | |||
| 19270103ec | |||
| 7f1114d935 | |||
| bdcb81e81e | |||
| d1e7a7e06b | |||
| 6b2510d312 | |||
| a048cb9f0d | |||
| 87598c8749 | |||
| ca9a88785e | |||
| 2072168a1c | |||
| 6ff9fc67bb | |||
| 800f656402 | |||
| e2bfd1a036 | |||
| 7f9fe6f1f2 | |||
| ef2b73043d | |||
| 7a10369f4b | |||
| 14b76a5bca | |||
| 8bb3863f52 | |||
| fa288af58b | |||
| 0e7edca7e3 | |||
| 9e5a8ba9f5 | |||
| c9fb1434c0 | |||
| a5ea5888b8 | |||
| 2c7a15b195 | |||
| 0ebabe17df | |||
| 5ada462773 | |||
| 69e19b88c2 | |||
| 41519d3ac0 | |||
| 9a10bdbae5 | |||
| 4bbe67451d | |||
| 651a1d2869 | |||
| 7c334f45c6 | |||
| 0f8faa3441 | |||
| 5e68b28ad3 | |||
| aa54acd54d | |||
| 87c27a074d | |||
| 4af3ca4e4d | |||
| 953160ddd6 | |||
| 5c961169cc | |||
| 94dbc35d92 | |||
| ad2e864a9a | |||
| e0489cb4a6 | |||
| 922ac1a1ec | |||
| c95a97389d | |||
| 2a8322ddbb | |||
| cfb964834c | |||
| 73c3d14a66 | |||
| f6ceeaa2e5 | |||
| 6847cc9f1c | |||
| 411d36ff13 | |||
| 63ae5f00b1 | |||
| 43e0912516 | |||
| 64533009b3 | |||
| 8aca8d90d6 | |||
| 9ca39821c8 | |||
| 2e608b1c97 | |||
| dcc63d7408 | |||
| 5e32de8173 | |||
| 5375a77f84 | |||
| 2f4a3e40eb | |||
| 15aa0df23c | |||
| 3166d0c667 | |||
| 339793143c | |||
| 8be1ba708e | |||
| 0bd357e7ec | |||
| cfe849bd43 | |||
| d8c70e2e73 | |||
| 03bf0a89b5 | |||
| 1ce9ffcc7f | |||
| b1ef44b1ac | |||
| da0a36c323 | |||
| 8d6b8b45b6 | |||
| 5d699e9ba5 | |||
| 321c0ec533 | |||
| 4ad45af53f | |||
| 37a7e08b38 | |||
| bab4bc0968 | |||
| f6c4901b8f | |||
| bb6496d9e5 | |||
| c2de5cf735 | |||
| 2959e7aba9 | |||
| ce1cc352d9 | |||
| 350d483a70 | |||
| d34eec3ab3 | |||
| 2be955a0ef | |||
| 830bff1241 | |||
| 16fb74425e | |||
| 3786d30320 | |||
| adb62403ec | |||
| 50b9a5afa9 | |||
| 230f22b1cd | |||
| 06a9c16961 | |||
| d22506092e | |||
| 728bd68977 | |||
| 65519ab786 | |||
| 886b1f39d9 | |||
| cbced23de4 | |||
| e58a778bd5 | |||
| 1c49796e8e | |||
| 6b0661cca1 | |||
| 46f05f2db6 | |||
| 15a6586062 | |||
| bdb6b45c91 | |||
| 1170d74868 | |||
| 6ae5a9f07a | |||
| cc1a95d161 | |||
| fffd0f5b68 | |||
| 89480801b8 | |||
| 9deb206e74 | |||
| 27cf941284 | |||
| 04cd09a30a | |||
| 3ea889050b | |||
| b46e741c95 | |||
| 34f9c039c5 | |||
| d35422b523 | |||
| d61f5d160d | |||
| 68ef903a7c | |||
| 06407b4d14 | |||
| 12213f9985 | |||
| caa5e3b4c5 | |||
| 2e17251160 | |||
| 3f102e5d3a | |||
| aad6d28e13 | |||
| 1650c664bc | |||
| d17b099994 | |||
| 1516103a15 | |||
| bf0173bf38 | |||
| b4e300b78b | |||
| 402a77e7f7 | |||
| 2ca561f104 | |||
| 174cb06a7a | |||
| 583b327523 | |||
| 1081cee35f | |||
| 69fd57bc96 | |||
| 8e6e05ed3f | |||
| c512bf6c66 | |||
| bcff9fd067 | |||
| 0d7aeacc34 | |||
| 3515f6ec33 | |||
| 602f047fe8 | |||
| 7f3eea6325 | |||
| 878a6906cc | |||
| 0194d5a2d5 | |||
| d219709cfa | |||
| c2e281f8cf | |||
| 07334bc25c | |||
| 94fdd45b75 | |||
| 70ff3804e9 | |||
| 8741d97a4f | |||
| 432d0fd707 | |||
| e45d5446f2 | |||
| 0f91faddae | |||
| 5e6e12600f | |||
| 92f182bc3b | |||
| bc3c7e80a6 | |||
| 32683ee6e0 | |||
| 544eb4be1f | |||
| d9e092325b | |||
| ec7ce81401 | |||
| 5bc291937f | |||
| 9313978f61 | |||
| ce6b06efb9 | |||
| f01c029446 | |||
| 928552ac9e | |||
| ab58cac236 | |||
| 71496e3be4 | |||
| e63d628677 | |||
| dcb3c4ff1e | |||
| 488b5d95dc | |||
| 22f12dc93c | |||
| ad183481c0 | |||
| 08c94aa5c0 | |||
| 1989bc33a7 | |||
| 46bee83005 | |||
| 2360291c3e | |||
| 12ed7ca63e | |||
| ca479c3f5b | |||
| 02829f73e0 | |||
| a44c0fd51f | |||
| 773365405f | |||
| cb0a61b9ba | |||
| 8a9a9403a3 | |||
| 7d1140340e | |||
| 862242aa8d | |||
| 1ff6c758ec | |||
| 6ba22dea46 | |||
| 70b984434d | |||
| e5ed9cc612 | |||
| 1fbf914348 | |||
| 09436df1ad | |||
| 4bb4a349c9 | |||
| b4716b1d92 | |||
| acc8589083 | |||
| c0dc2f2bb3 | |||
| 66ab4e15db | |||
| c10d08f795 | |||
| 4b75be801e | |||
| ac64713881 | |||
| c455fc0334 | |||
| 42c0914382 | |||
| 49e1f6b161 | |||
| 1a4c22fc46 | |||
| 5f4c7372c0 | |||
| d07eb9ad60 | |||
| 5a54acef4e | |||
| e5fbb4f5d2 | |||
| 11626fe32c | |||
| 63e89bc326 | |||
| 96a3c7954d | |||
| 25af743902 | |||
| 6d1cdcf601 | |||
| dc59476c34 | |||
| 4e39d0371d | |||
| 11feae6631 | |||
| eef78f5664 | |||
| 9ef742bbf4 | |||
| 928bfe0b93 | |||
| 86e8a105a5 | |||
| a586ef725c | |||
| fe7fd4c312 | |||
| 0488d9bdb2 | |||
| 431e2e6d68 | |||
| 9439872a62 | |||
| f6dd549e58 | |||
| 454bc7a674 | |||
| 8f4b534937 | |||
| e251ed7773 | |||
| 0e6ebafdb3 | |||
| 7d17d20dce | |||
| 1d2baf0bd3 | |||
| 10e6491c22 | |||
| f448d75aa8 | |||
| 19c9174543 | |||
| bb0f9d6bc4 | |||
| df7fb00c21 | |||
| fa17267e05 | |||
| a683a496ea | |||
| 6dd9e18b2e | |||
| 5b833db558 | |||
| fce018e7a9 | |||
| 7c65f7ef11 | |||
| a4a47b538c | |||
| d098048aba | |||
| 309c962169 | |||
| e7d5dbfec0 | |||
| 600b7a30e6 | |||
| 526d1d6db1 | |||
| aa621d6f3c | |||
| 704c688225 | |||
| 6c71988c54 | |||
| 82811d0706 | |||
| c5b5d5c8d3 | |||
| cc862e996e | |||
| 635342ab73 | |||
| 98c78e0acd | |||
| 6833b46a05 | |||
| 0ef5c8c541 | |||
| 359bd21bd7 | |||
| fadf25acd6 | |||
| 77264dcca9 | |||
| 5448d9186a | |||
| 2a2a1dc5b4 | |||
| 4d0f789e0a | |||
| d3c14ce3ea | |||
| 42936d3227 | |||
| 3681dcef1a | |||
| b3f5e3bf94 | |||
| b66c349bba | |||
| c45d3568ae | |||
| 6a6222d21c | |||
| 880052d3f3 | |||
| 85afbd409b | |||
| 03c3e0edcf | |||
| 4f558e8b89 | |||
| 6512a4b7e3 | |||
| 582bb3c311 | |||
| d53a5210a8 | |||
| 1ed9a58b64 | |||
| d0ab595f52 | |||
| 5a4f2b5d27 |
+4
-4
@@ -1,10 +1,11 @@
|
|||||||
|
# ignore dot files/directories
|
||||||
|
.*
|
||||||
|
!.gitignore
|
||||||
|
|
||||||
*.autosave
|
*.autosave
|
||||||
*.pyc
|
*.pyc
|
||||||
*.user
|
*.user
|
||||||
*~
|
*~
|
||||||
.*.swp
|
|
||||||
.DS_Store
|
|
||||||
.sw[a-z]
|
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
tags
|
tags
|
||||||
tegra/
|
tegra/
|
||||||
@@ -21,4 +22,3 @@ bin/
|
|||||||
*.log
|
*.log
|
||||||
*.tlog
|
*.tlog
|
||||||
build
|
build
|
||||||
.cache
|
|
||||||
|
|||||||
Vendored
-2
@@ -37,6 +37,4 @@ if(WITH_NEON)
|
|||||||
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
target_compile_definitions(carotene_objs PRIVATE "-DWITH_NEON")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(carotene_objs PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
|
||||||
|
|
||||||
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
|
add_library(carotene STATIC EXCLUDE_FROM_ALL "$<TARGET_OBJECTS:carotene_objs>")
|
||||||
|
|||||||
Vendored
-3
@@ -3,8 +3,6 @@ cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
|
|||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
||||||
|
|
||||||
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
set(TEGRA_HAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
|
set(CAROTENE_DIR "${TEGRA_HAL_DIR}/../")
|
||||||
|
|
||||||
@@ -95,7 +93,6 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${carotene_defs})
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
|
add_library(tegra_hal STATIC $<TARGET_OBJECTS:carotene_objs>)
|
||||||
set_target_properties(tegra_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
|
||||||
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
set_target_properties(tegra_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH})
|
||||||
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
set(OPENCV_SRC_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
|
|||||||
Vendored
+5
-5
@@ -1341,8 +1341,8 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
|||||||
ctx->anchor_y = anchor_y;
|
ctx->anchor_y = anchor_y;
|
||||||
switch(operation)
|
switch(operation)
|
||||||
{
|
{
|
||||||
case MORPH_ERODE:
|
case CV_HAL_MORPH_ERODE:
|
||||||
case MORPH_DILATE:
|
case CV_HAL_MORPH_DILATE:
|
||||||
ctx->operation = operation;
|
ctx->operation = operation;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1355,7 +1355,7 @@ inline int TEGRA_MORPHINIT(cvhalFilter2D **context, int operation, int src_type,
|
|||||||
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
|
ctx->border = CAROTENE_NS::BORDER_MODE_CONSTANT;
|
||||||
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
|
if( borderValue[0] == DBL_MAX && borderValue[1] == DBL_MAX && borderValue[2] == DBL_MAX && borderValue[3] == DBL_MAX )
|
||||||
{
|
{
|
||||||
if( operation == MORPH_ERODE )
|
if( operation == CV_HAL_MORPH_ERODE )
|
||||||
for(int i = 0; i < ctx->channels; ++i)
|
for(int i = 0; i < ctx->channels; ++i)
|
||||||
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
|
ctx->borderValues[i] = (CAROTENE_NS::u8)UCHAR_MAX;
|
||||||
else
|
else
|
||||||
@@ -1404,14 +1404,14 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
|
|||||||
( \
|
( \
|
||||||
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
|
(void)dst_full_width, (void)dst_full_height, (void)dst_roi_x, (void)dst_roi_y, \
|
||||||
context && CAROTENE_NS::isSupportedConfiguration() ? \
|
context && CAROTENE_NS::isSupportedConfiguration() ? \
|
||||||
((MorphCtx*)context)->operation == MORPH_ERODE ? \
|
((MorphCtx*)context)->operation == CV_HAL_MORPH_ERODE ? \
|
||||||
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
CAROTENE_NS::erode(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||||
src_data, src_step, dst_data, dst_step, \
|
src_data, src_step, dst_data, dst_step, \
|
||||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||||
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
|
((MorphCtx*)context)->border, ((MorphCtx*)context)->border, ((MorphCtx*)context)->borderValues, \
|
||||||
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
|
CAROTENE_NS::Margin(src_roi_x, src_full_width - width - src_roi_x, src_roi_y, src_full_height - height - src_roi_y)), \
|
||||||
CV_HAL_ERROR_OK : \
|
CV_HAL_ERROR_OK : \
|
||||||
((MorphCtx*)context)->operation == MORPH_DILATE ? \
|
((MorphCtx*)context)->operation == CV_HAL_MORPH_DILATE ? \
|
||||||
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
CAROTENE_NS::dilate(CAROTENE_NS::Size2D(width, height), ((MorphCtx*)context)->channels, \
|
||||||
src_data, src_step, dst_data, dst_step, \
|
src_data, src_step, dst_data, dst_step, \
|
||||||
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
((MorphCtx*)context)->ksize, ((MorphCtx*)context)->anchor_x, ((MorphCtx*)context)->anchor_y, \
|
||||||
|
|||||||
+8
-8
@@ -49,7 +49,7 @@ void extract2(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -60,7 +60,7 @@ void extract2(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; dj < roiw32; sj += 64, dj += 32)
|
for (; dj < roiw32; sj += 64, dj += 32)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -101,7 +101,7 @@ void extract3(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -112,7 +112,7 @@ void extract3(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; dj < roiw32; sj += 96, dj += 32)
|
for (; dj < roiw32; sj += 96, dj += 32)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -153,7 +153,7 @@ void extract4(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -164,7 +164,7 @@ void extract4(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; dj < roiw32; sj += 128, dj += 32)
|
for (; dj < roiw32; sj += 128, dj += 32)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -231,7 +231,7 @@ void extract4(const Size2D &size,
|
|||||||
srcStride == dst2Stride && \
|
srcStride == dst2Stride && \
|
||||||
srcStride == dst3Stride &&
|
srcStride == dst3Stride &&
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
|
|
||||||
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
|
#define SPLIT_ASM2(sgn, bits) __asm__ ( \
|
||||||
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
|
"vld2." #bits " {d0, d2}, [%[in0]] \n\t" \
|
||||||
@@ -351,7 +351,7 @@ void extract4(const Size2D &size,
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
|
|
||||||
#define ALPHA_QUAD(sgn, bits) { \
|
#define ALPHA_QUAD(sgn, bits) { \
|
||||||
internal::prefetch(src + sj); \
|
internal::prefetch(src + sj); \
|
||||||
|
|||||||
+5
-5
@@ -77,7 +77,7 @@ namespace CAROTENE_NS {
|
|||||||
dstStride == src2Stride && \
|
dstStride == src2Stride && \
|
||||||
dstStride == src3Stride &&
|
dstStride == src3Stride &&
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
|
|
||||||
#define MERGE_ASM2(sgn, bits) __asm__ ( \
|
#define MERGE_ASM2(sgn, bits) __asm__ ( \
|
||||||
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
|
"vld1." #bits " {d0-d1}, [%[in0]] \n\t" \
|
||||||
@@ -240,7 +240,7 @@ void combineYUYV(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -253,7 +253,7 @@ void combineYUYV(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||||
{
|
{
|
||||||
internal::prefetch(srcy + syj);
|
internal::prefetch(srcy + syj);
|
||||||
@@ -317,7 +317,7 @@ void combineUYVY(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
size_t roiw32 = size.width >= 31 ? size.width - 31 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -330,7 +330,7 @@ void combineUYVY(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t syj = 0u, sj = 0u, dj = 0u;
|
size_t syj = 0u, sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
for (; sj < roiw32; sj += 32, syj += 64, dj += 128)
|
||||||
{
|
{
|
||||||
internal::prefetch(srcy + syj);
|
internal::prefetch(srcy + syj);
|
||||||
|
|||||||
+58
-58
@@ -97,7 +97,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||||
@@ -116,7 +116,7 @@ void rgb2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
for (; dj < roiw8; sj += 24, dj += 8)
|
for (; dj < roiw8; sj += 24, dj += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -198,7 +198,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||||
@@ -217,7 +217,7 @@ void rgbx2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
for (; dj < roiw8; sj += 32, dj += 8)
|
for (; dj < roiw8; sj += 32, dj += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -300,7 +300,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||||
@@ -319,7 +319,7 @@ void bgr2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
for (; dj < roiw8; sj += 24, dj += 8)
|
for (; dj < roiw8; sj += 24, dj += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -402,7 +402,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
const u32 G2Y = color_space == COLOR_SPACE_BT601 ? G2Y_BT601 : G2Y_BT709;
|
||||||
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
const u32 B2Y = color_space == COLOR_SPACE_BT601 ? B2Y_BT601 : B2Y_BT709;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
register int16x4_t v_r2y asm ("d31") = vmov_n_s16(R2Y);
|
||||||
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
register int16x4_t v_g2y asm ("d30") = vmov_n_s16(G2Y);
|
||||||
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
register int16x4_t v_b2y asm ("d29") = vmov_n_s16(B2Y);
|
||||||
@@ -421,7 +421,7 @@ void bgrx2gray(const Size2D &size, COLOR_SPACE color_space,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u;
|
size_t sj = 0u, dj = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
for (; dj < roiw8; sj += 32, dj += 8)
|
for (; dj < roiw8; sj += 32, dj += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -512,7 +512,7 @@ void gray2rgb(const Size2D &size,
|
|||||||
for (; sj < roiw16; sj += 16, dj += 48)
|
for (; sj < roiw16; sj += 16, dj += 48)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||||
"vmov.8 q1, q0 \n\t"
|
"vmov.8 q1, q0 \n\t"
|
||||||
@@ -538,7 +538,7 @@ void gray2rgb(const Size2D &size,
|
|||||||
|
|
||||||
if (sj < roiw8)
|
if (sj < roiw8)
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.8 {d0}, [%[in]] \n\t"
|
"vld1.8 {d0}, [%[in]] \n\t"
|
||||||
"vmov.8 d1, d0 \n\t"
|
"vmov.8 d1, d0 \n\t"
|
||||||
@@ -584,7 +584,7 @@ void gray2rgbx(const Size2D &size,
|
|||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
|
register uint8x16_t vc255 asm ("q4") = vmovq_n_u8(255);
|
||||||
#else
|
#else
|
||||||
uint8x16x4_t vRgba;
|
uint8x16x4_t vRgba;
|
||||||
@@ -602,7 +602,7 @@ void gray2rgbx(const Size2D &size,
|
|||||||
for (; sj < roiw16; sj += 16, dj += 64)
|
for (; sj < roiw16; sj += 16, dj += 64)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
"vld1.8 {d0-d1}, [%[in0]] \n\t"
|
||||||
"vmov.8 q1, q0 \n\t"
|
"vmov.8 q1, q0 \n\t"
|
||||||
@@ -628,7 +628,7 @@ void gray2rgbx(const Size2D &size,
|
|||||||
|
|
||||||
if (sj < roiw8)
|
if (sj < roiw8)
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.8 {d5}, [%[in]] \n\t"
|
"vld1.8 {d5}, [%[in]] \n\t"
|
||||||
"vmov.8 d6, d5 \n\t"
|
"vmov.8 d6, d5 \n\t"
|
||||||
@@ -672,7 +672,7 @@ void rgb2rgbx(const Size2D &size,
|
|||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
|
register uint8x8_t vc255_0 asm ("d3") = vmov_n_u8(255);
|
||||||
#else
|
#else
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
@@ -688,7 +688,7 @@ void rgb2rgbx(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -742,7 +742,7 @@ void rgbx2rgb(const Size2D &size,
|
|||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
#if !defined(__GNUC__) || !defined(__arm__)
|
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
|
union { uint8x16x4_t v4; uint8x16x3_t v3; } v_dst0;
|
||||||
union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
|
union { uint8x8x4_t v4; uint8x8x3_t v3; } v_dst;
|
||||||
@@ -754,7 +754,7 @@ void rgbx2rgb(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -805,7 +805,7 @@ void rgb2bgr(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#if !defined(__GNUC__) || !defined(__arm__)
|
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -817,7 +817,7 @@ void rgb2bgr(const Size2D &size,
|
|||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -874,7 +874,7 @@ void rgbx2bgrx(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#if !defined(__GNUC__) || !defined(__arm__)
|
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -885,7 +885,7 @@ void rgbx2bgrx(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 32, dj += 32, j += 8)
|
for (; j < roiw8; sj += 32, dj += 32, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -943,7 +943,7 @@ void rgbx2bgr(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#if !defined(__GNUC__) || !defined(__arm__)
|
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -954,7 +954,7 @@ void rgbx2bgr(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -1010,7 +1010,7 @@ void rgb2bgrx(const Size2D &size,
|
|||||||
{
|
{
|
||||||
internal::assertSupportedConfiguration();
|
internal::assertSupportedConfiguration();
|
||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
|
register uint8x8_t vc255 asm ("d3") = vmov_n_u8(255);
|
||||||
#else
|
#else
|
||||||
union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
|
union { uint8x16x4_t v4; uint8x16x3_t v3; } vals0;
|
||||||
@@ -1019,7 +1019,7 @@ void rgb2bgrx(const Size2D &size,
|
|||||||
vals8.v4.val[3] = vmov_n_u8(255);
|
vals8.v4.val[3] = vmov_n_u8(255);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__GNUC__) || !defined(__arm__)
|
#if !(!defined(__aarch64__) && defined(__GNUC__) && defined(__arm__))
|
||||||
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
size_t roiw16 = size.width >= 15 ? size.width - 15 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
@@ -1030,7 +1030,7 @@ void rgb2bgrx(const Size2D &size,
|
|||||||
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0u, dj = 0u, j = 0u;
|
size_t sj = 0u, dj = 0u, j = 0u;
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
for (; j < roiw8; sj += 24, dj += 32, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
@@ -1087,12 +1087,12 @@ inline uint8x8x3_t convertToHSV(const uint8x8_t vR, const uint8x8_t vG, const ui
|
|||||||
const s32 hrange )
|
const s32 hrange )
|
||||||
{
|
{
|
||||||
const s32 hsv_shift = 12;
|
const s32 hsv_shift = 12;
|
||||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||||
register const s32 vhrange = hrange;
|
const s32 vhrange = hrange;
|
||||||
register const s32 v0 = s32(0);
|
const s32 v0 = s32(0);
|
||||||
register const s32 vshift = s32(1 << (hsv_shift-1));
|
const s32 vshift = s32(1 << (hsv_shift-1));
|
||||||
register const s32 v6 = s32(6);
|
const s32 v6 = s32(6);
|
||||||
|
|
||||||
uint8x8_t vMin = vmin_u8(vR, vG);
|
uint8x8_t vMin = vmin_u8(vR, vG);
|
||||||
uint8x8_t vMax = vmax_u8(vR, vG);
|
uint8x8_t vMax = vmax_u8(vR, vG);
|
||||||
@@ -1409,7 +1409,7 @@ inline void convertToHSV(const s32 r, const s32 g, const s32 b,
|
|||||||
"d24","d25","d26","d27","d28","d29","d30","d31" \
|
"d24","d25","d26","d27","d28","d29","d30","d31" \
|
||||||
);
|
);
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
|
|
||||||
#define YCRCB_CONSTS \
|
#define YCRCB_CONSTS \
|
||||||
register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
|
register int16x4_t vcYR asm ("d31") = vmov_n_s16(4899); \
|
||||||
@@ -1555,7 +1555,7 @@ inline uint8x8x3_t convertToYCrCb( const int16x8_t& vR, const int16x8_t& vG, con
|
|||||||
#define COEFF_G ( 8663)
|
#define COEFF_G ( 8663)
|
||||||
#define COEFF_B (-17705)
|
#define COEFF_B (-17705)
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
#define YUV420ALPHA3_CONST
|
#define YUV420ALPHA3_CONST
|
||||||
#define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
|
#define YUV420ALPHA4_CONST register uint8x16_t c255 asm ("q13") = vmovq_n_u8(255);
|
||||||
#define YUV420ALPHA3_CONVERT
|
#define YUV420ALPHA3_CONVERT
|
||||||
@@ -1852,7 +1852,7 @@ void rgb2hsv(const Size2D &size,
|
|||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
const s32 hsv_shift = 12;
|
const s32 hsv_shift = 12;
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||||
register const s32 vhrange = hrange;
|
register const s32 vhrange = hrange;
|
||||||
@@ -1871,7 +1871,7 @@ void rgb2hsv(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
|
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d0, d2)
|
||||||
#else
|
#else
|
||||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||||
@@ -1904,7 +1904,7 @@ void rgbx2hsv(const Size2D &size,
|
|||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
const s32 hsv_shift = 12;
|
const s32 hsv_shift = 12;
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||||
register const s32 vhrange = hrange;
|
register const s32 vhrange = hrange;
|
||||||
@@ -1923,7 +1923,7 @@ void rgbx2hsv(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
|
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d0, d2)
|
||||||
#else
|
#else
|
||||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||||
@@ -1956,7 +1956,7 @@ void bgr2hsv(const Size2D &size,
|
|||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
const s32 hsv_shift = 12;
|
const s32 hsv_shift = 12;
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||||
register const s32 vhrange = hrange;
|
register const s32 vhrange = hrange;
|
||||||
@@ -1975,7 +1975,7 @@ void bgr2hsv(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
|
CONVERT_TO_HSV_ASM(vld3.8 {d0-d2}, d2, d0)
|
||||||
#else
|
#else
|
||||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||||
@@ -2008,7 +2008,7 @@ void bgrx2hsv(const Size2D &size,
|
|||||||
#ifdef CAROTENE_NEON
|
#ifdef CAROTENE_NEON
|
||||||
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
size_t roiw8 = size.width >= 7 ? size.width - 7 : 0;
|
||||||
const s32 hsv_shift = 12;
|
const s32 hsv_shift = 12;
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
register const f32 vsdiv_table = f32(255 << hsv_shift);
|
||||||
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
register f32 vhdiv_table = f32(hrange << hsv_shift);
|
||||||
register const s32 vhrange = hrange;
|
register const s32 vhrange = hrange;
|
||||||
@@ -2027,7 +2027,7 @@ void bgrx2hsv(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
|
CONVERT_TO_HSV_ASM(vld4.8 {d0-d3}, d2, d0)
|
||||||
#else
|
#else
|
||||||
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
uint8x8x4_t vRgb = vld4_u8(src + sj);
|
||||||
@@ -2068,7 +2068,7 @@ void rgbx2bgr565(const Size2D &size,
|
|||||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
"vld4.8 {d2, d4, d6, d8}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||||
"vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
"vld4.8 {d3, d5, d7, d9}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||||
@@ -2122,7 +2122,7 @@ void rgb2bgr565(const Size2D &size,
|
|||||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
"vld3.8 {d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 q4 \n\t"
|
||||||
"vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
"vld3.8 {d3, d5, d7}, [%[in1]] @ xxxxxxxx rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||||
@@ -2176,7 +2176,7 @@ void rgbx2rgb565(const Size2D &size,
|
|||||||
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
for (; j < roiw16; sj += 64, dj += 32, j += 16)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
"vld4.8 {d0, d2, d4, d6}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||||
"vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
|
"vld4.8 {d1, d3, d5, d7}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB aaaaAAAA \n\t"
|
||||||
@@ -2230,7 +2230,7 @@ void rgb2rgb565(const Size2D &size,
|
|||||||
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
for (; j < roiw16; sj += 48, dj += 32, j += 16)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
"vld3.8 {d0, d2, d4}, [%[in0]] @ q0 q1 q2 q3 \n\t"
|
||||||
"vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
"vld3.8 {d1, d3, d5}, [%[in1]] @ rrrrRRRR ggggGGGG bbbbBBBB xxxxxxxx \n\t"
|
||||||
@@ -2285,7 +2285,7 @@ void rgb2ycrcb(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
|
CONVERTTOYCRCB(vld3.8 {d0-d2}, d0, d1, d2)
|
||||||
#else
|
#else
|
||||||
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
uint8x8x3_t vRgb = vld3_u8(src + sj);
|
||||||
@@ -2329,7 +2329,7 @@ void rgbx2ycrcb(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
|
CONVERTTOYCRCB(vld4.8 {d0-d3}, d0, d1, d2)
|
||||||
#else
|
#else
|
||||||
uint8x8x4_t vRgba = vld4_u8(src + sj);
|
uint8x8x4_t vRgba = vld4_u8(src + sj);
|
||||||
@@ -2373,7 +2373,7 @@ void bgr2ycrcb(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
for (; j < roiw8; sj += 24, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
|
CONVERTTOYCRCB(vld3.8 {d0-d2}, d2, d1, d0)
|
||||||
#else
|
#else
|
||||||
uint8x8x3_t vBgr = vld3_u8(src + sj);
|
uint8x8x3_t vBgr = vld3_u8(src + sj);
|
||||||
@@ -2417,7 +2417,7 @@ void bgrx2ycrcb(const Size2D &size,
|
|||||||
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
for (; j < roiw8; sj += 32, dj += 24, j += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(src + sj);
|
internal::prefetch(src + sj);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
|
CONVERTTOYCRCB(vld4.8 {d0-d3}, d2, d1, d0)
|
||||||
#else
|
#else
|
||||||
uint8x8x4_t vBgra = vld4_u8(src + sj);
|
uint8x8x4_t vBgra = vld4_u8(src + sj);
|
||||||
@@ -2499,7 +2499,7 @@ void yuv420sp2rgb(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(3, d1, d0, q5, q6)
|
CONVERTYUV420TORGB(3, d1, d0, q5, q6)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2545,7 +2545,7 @@ void yuv420sp2rgbx(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(4, d1, d0, q5, q6)
|
CONVERTYUV420TORGB(4, d1, d0, q5, q6)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2591,7 +2591,7 @@ void yuv420i2rgb(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(3, d0, d1, q5, q6)
|
CONVERTYUV420TORGB(3, d0, d1, q5, q6)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2637,7 +2637,7 @@ void yuv420i2rgbx(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(4, d0, d1, q5, q6)
|
CONVERTYUV420TORGB(4, d0, d1, q5, q6)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2683,7 +2683,7 @@ void yuv420sp2bgr(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(3, d1, d0, q6, q5)
|
CONVERTYUV420TORGB(3, d1, d0, q6, q5)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2729,7 +2729,7 @@ void yuv420sp2bgrx(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(4, d1, d0, q6, q5)
|
CONVERTYUV420TORGB(4, d1, d0, q6, q5)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2775,7 +2775,7 @@ void yuv420i2bgr(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(3, d0, d1, q6, q5)
|
CONVERTYUV420TORGB(3, d0, d1, q6, q5)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
@@ -2821,7 +2821,7 @@ void yuv420i2bgrx(const Size2D &size,
|
|||||||
internal::prefetch(uv + j);
|
internal::prefetch(uv + j);
|
||||||
internal::prefetch(y1 + j);
|
internal::prefetch(y1 + j);
|
||||||
internal::prefetch(y2 + j);
|
internal::prefetch(y2 + j);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CONVERTYUV420TORGB(4, d0, d1, q6, q5)
|
CONVERTYUV420TORGB(4, d0, d1, q6, q5)
|
||||||
#else
|
#else
|
||||||
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
convertYUV420.ToRGB(y1 + j, y2 + j, uv + j, dst1 + dj, dst2 + dj);
|
||||||
|
|||||||
Vendored
+27
-27
@@ -101,7 +101,7 @@ CVT_FUNC(u8, s8, 16,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(u8, u16, 16,
|
CVT_FUNC(u8, u16, 16,
|
||||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ CVT_FUNC(u8, u16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(u8, s32, 16,
|
CVT_FUNC(u8, s32, 16,
|
||||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
|
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);
|
||||||
register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
|
register uint8x16_t zero1 asm ("q2") = vmovq_n_u8(0);
|
||||||
@@ -173,7 +173,7 @@ CVT_FUNC(u8, s32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(u8, f32, 16,
|
CVT_FUNC(u8, f32, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ CVT_FUNC(s8, u8, 16,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(s8, u16, 16,
|
CVT_FUNC(s8, u16, 16,
|
||||||
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
register uint8x16_t zero0 asm ("q1") = vmovq_n_u8(0);,
|
||||||
{
|
{
|
||||||
@@ -284,7 +284,7 @@ CVT_FUNC(s8, u16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s8, s16, 16,
|
CVT_FUNC(s8, s16, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -323,7 +323,7 @@ CVT_FUNC(s8, s16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(s8, s32, 16,
|
CVT_FUNC(s8, s32, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -377,7 +377,7 @@ CVT_FUNC(s8, s32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s8, f32, 16,
|
CVT_FUNC(s8, f32, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -440,7 +440,7 @@ CVT_FUNC(s8, f32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(u16, u8, 16,
|
CVT_FUNC(u16, u8, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -479,7 +479,7 @@ CVT_FUNC(u16, u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(u16, s8, 16,
|
CVT_FUNC(u16, s8, 16,
|
||||||
register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
|
register uint8x16_t v127 asm ("q4") = vmovq_n_u8(127);,
|
||||||
{
|
{
|
||||||
@@ -522,7 +522,7 @@ CVT_FUNC(u16, s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(u16, s16, 8,
|
CVT_FUNC(u16, s16, 8,
|
||||||
register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
|
register uint16x8_t v32767 asm ("q4") = vmovq_n_u16(0x7FFF);,
|
||||||
{
|
{
|
||||||
@@ -555,7 +555,7 @@ CVT_FUNC(u16, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(u16, s32, 8,
|
CVT_FUNC(u16, s32, 8,
|
||||||
register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
|
register uint16x8_t zero0 asm ("q1") = vmovq_n_u16(0);,
|
||||||
{
|
{
|
||||||
@@ -589,7 +589,7 @@ CVT_FUNC(u16, s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(u16, f32, 8,
|
CVT_FUNC(u16, f32, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -633,7 +633,7 @@ CVT_FUNC(u16, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s16, u8, 16,
|
CVT_FUNC(s16, u8, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -672,7 +672,7 @@ CVT_FUNC(s16, u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s16, s8, 16,
|
CVT_FUNC(s16, s8, 16,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -711,7 +711,7 @@ CVT_FUNC(s16, s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVT_FUNC(s16, u16, 8,
|
CVT_FUNC(s16, u16, 8,
|
||||||
register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
|
register int16x8_t vZero asm ("q4") = vmovq_n_s16(0);,
|
||||||
{
|
{
|
||||||
@@ -747,7 +747,7 @@ CVT_FUNC(s16, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s16, s32, 8,
|
CVT_FUNC(s16, s32, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -786,7 +786,7 @@ CVT_FUNC(s16, s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s16, f32, 8,
|
CVT_FUNC(s16, f32, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -829,7 +829,7 @@ CVT_FUNC(s16, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s32, u8, 8,
|
CVT_FUNC(s32, u8, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -870,7 +870,7 @@ CVT_FUNC(s32, u8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s32, s8, 8,
|
CVT_FUNC(s32, s8, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -911,7 +911,7 @@ CVT_FUNC(s32, s8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s32, u16, 8,
|
CVT_FUNC(s32, u16, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -950,7 +950,7 @@ CVT_FUNC(s32, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s32, s16, 8,
|
CVT_FUNC(s32, s16, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -989,7 +989,7 @@ CVT_FUNC(s32, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(s32, f32, 8,
|
CVT_FUNC(s32, f32, 8,
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
@@ -1034,7 +1034,7 @@ CVT_FUNC(s32, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(f32, u8, 8,
|
CVT_FUNC(f32, u8, 8,
|
||||||
register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
|
register float32x4_t vmult asm ("q0") = vdupq_n_f32((float)(1 << 16));
|
||||||
register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
|
register uint32x4_t vmask asm ("q1") = vdupq_n_u32(1<<16);,
|
||||||
@@ -1101,7 +1101,7 @@ CVT_FUNC(f32, u8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(f32, s8, 8,
|
CVT_FUNC(f32, s8, 8,
|
||||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||||
{
|
{
|
||||||
@@ -1153,7 +1153,7 @@ CVT_FUNC(f32, s8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(f32, u16, 8,
|
CVT_FUNC(f32, u16, 8,
|
||||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||||
{
|
{
|
||||||
@@ -1212,7 +1212,7 @@ CVT_FUNC(f32, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(f32, s16, 8,
|
CVT_FUNC(f32, s16, 8,
|
||||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||||
{
|
{
|
||||||
@@ -1271,7 +1271,7 @@ CVT_FUNC(f32, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
CVT_FUNC(f32, s32, 8,
|
CVT_FUNC(f32, s32, 8,
|
||||||
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
register float32x4_t vhalf asm ("q0") = vdupq_n_f32(0.5f);,
|
||||||
{
|
{
|
||||||
|
|||||||
+36
-36
@@ -135,7 +135,7 @@ namespace CAROTENE_NS {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC1(u8, 16,
|
CVTS_FUNC1(u8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -220,7 +220,7 @@ CVTS_FUNC1(u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(u8, s8, 16,
|
CVTS_FUNC(u8, s8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -305,7 +305,7 @@ CVTS_FUNC(u8, s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(u8, u16, 16,
|
CVTS_FUNC(u8, u16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -389,7 +389,7 @@ CVTS_FUNC(u8, u16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(u8, s16, 16,
|
CVTS_FUNC(u8, s16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -473,7 +473,7 @@ CVTS_FUNC(u8, s16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u8, s32, 16,
|
CVTS_FUNC(u8, s32, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -562,7 +562,7 @@ CVTS_FUNC(u8, s32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u8, f32, 16,
|
CVTS_FUNC(u8, f32, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
@@ -643,7 +643,7 @@ CVTS_FUNC(u8, f32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(s8, u8, 16,
|
CVTS_FUNC(s8, u8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -728,7 +728,7 @@ CVTS_FUNC(s8, u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC1(s8, 16,
|
CVTS_FUNC1(s8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -813,7 +813,7 @@ CVTS_FUNC1(s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(s8, u16, 16,
|
CVTS_FUNC(s8, u16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -899,7 +899,7 @@ CVTS_FUNC(s8, u16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
CVTS_FUNC(s8, s16, 16,
|
CVTS_FUNC(s8, s16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -985,7 +985,7 @@ CVTS_FUNC(s8, s16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s8, s32, 16,
|
CVTS_FUNC(s8, s32, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1074,7 +1074,7 @@ CVTS_FUNC(s8, s32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s8, f32, 16,
|
CVTS_FUNC(s8, f32, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
@@ -1155,7 +1155,7 @@ CVTS_FUNC(s8, f32, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u16, u8, 16,
|
CVTS_FUNC(u16, u8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1214,7 +1214,7 @@ CVTS_FUNC(u16, u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u16, s8, 16,
|
CVTS_FUNC(u16, s8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1273,7 +1273,7 @@ CVTS_FUNC(u16, s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC1(u16, 16,
|
CVTS_FUNC1(u16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1330,7 +1330,7 @@ CVTS_FUNC1(u16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u16, s16, 8,
|
CVTS_FUNC(u16, s16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1387,7 +1387,7 @@ CVTS_FUNC(u16, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u16, s32, 8,
|
CVTS_FUNC(u16, s32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1443,7 +1443,7 @@ CVTS_FUNC(u16, s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(u16, f32, 8,
|
CVTS_FUNC(u16, f32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
@@ -1495,7 +1495,7 @@ CVTS_FUNC(u16, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s16, u8, 16,
|
CVTS_FUNC(s16, u8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1554,7 +1554,7 @@ CVTS_FUNC(s16, u8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s16, s8, 16,
|
CVTS_FUNC(s16, s8, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1613,7 +1613,7 @@ CVTS_FUNC(s16, s8, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s16, u16, 8,
|
CVTS_FUNC(s16, u16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1670,7 +1670,7 @@ CVTS_FUNC(s16, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC1(s16, 16,
|
CVTS_FUNC1(s16, 16,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1727,7 +1727,7 @@ CVTS_FUNC1(s16, 16,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s16, s32, 8,
|
CVTS_FUNC(s16, s32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1783,7 +1783,7 @@ CVTS_FUNC(s16, s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s16, f32, 8,
|
CVTS_FUNC(s16, f32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
@@ -1835,7 +1835,7 @@ CVTS_FUNC(s16, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s32, u8, 8,
|
CVTS_FUNC(s32, u8, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1893,7 +1893,7 @@ CVTS_FUNC(s32, u8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s32, s8, 8,
|
CVTS_FUNC(s32, s8, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -1951,7 +1951,7 @@ CVTS_FUNC(s32, s8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s32, u16, 8,
|
CVTS_FUNC(s32, u16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2007,7 +2007,7 @@ CVTS_FUNC(s32, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s32, s16, 8,
|
CVTS_FUNC(s32, s16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2063,7 +2063,7 @@ CVTS_FUNC(s32, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC1(s32, 8,
|
CVTS_FUNC1(s32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2118,7 +2118,7 @@ CVTS_FUNC1(s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(s32, f32, 8,
|
CVTS_FUNC(s32, f32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
@@ -2169,7 +2169,7 @@ CVTS_FUNC(s32, f32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(f32, u8, 8,
|
CVTS_FUNC(f32, u8, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)((1 << 16)*alpha));
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)((1 << 16)*beta));
|
||||||
@@ -2239,7 +2239,7 @@ CVTS_FUNC(f32, u8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(f32, s8, 8,
|
CVTS_FUNC(f32, s8, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2293,7 +2293,7 @@ CVTS_FUNC(f32, s8, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(f32, u16, 8,
|
CVTS_FUNC(f32, u16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2345,7 +2345,7 @@ CVTS_FUNC(f32, u16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(f32, s16, 8,
|
CVTS_FUNC(f32, s16, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2397,7 +2397,7 @@ CVTS_FUNC(f32, s16, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC(f32, s32, 8,
|
CVTS_FUNC(f32, s32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta + 0.5f);,
|
||||||
@@ -2448,7 +2448,7 @@ CVTS_FUNC(f32, s32, 8,
|
|||||||
})
|
})
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
CVTS_FUNC1(f32, 8,
|
CVTS_FUNC1(f32, 8,
|
||||||
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
register float32x4_t vscale asm ("q0") = vdupq_n_f32((f32)alpha);
|
||||||
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
register float32x4_t vshift asm ("q1") = vdupq_n_f32((f32)beta);,
|
||||||
|
|||||||
Vendored
+4
-4
@@ -105,12 +105,12 @@ void flip3(const Size2D & size,
|
|||||||
{
|
{
|
||||||
using namespace internal;
|
using namespace internal;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
typedef typename VecTraits<T, 3>::vec128 vec128;
|
typedef typename VecTraits<T, 3>::vec128 vec128;
|
||||||
#endif
|
#endif
|
||||||
typedef typename VecTraits<T, 3>::vec64 vec64;
|
typedef typename VecTraits<T, 3>::vec64 vec64;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
|
u32 step_base = 16 / sizeof(T), step_base3 = step_base * 3;
|
||||||
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
|
size_t roiw_base = size.width >= (step_base - 1) ? size.width - step_base + 1 : 0;
|
||||||
#endif
|
#endif
|
||||||
@@ -123,7 +123,7 @@ void flip3(const Size2D & size,
|
|||||||
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
|
T * dst = getRowPtr((T *)dstBase, dstStride, (flipMode & FLIP_VERTICAL_MODE) != 0 ? size.height - i - 1 : i);
|
||||||
size_t j = 0, js = 0, jd = size.width * 3;
|
size_t j = 0, js = 0, jd = size.width * 3;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
|
for (; j < roiw_base; j += step_base, js += step_base3, jd -= step_base3)
|
||||||
{
|
{
|
||||||
prefetch(src + js);
|
prefetch(src + js);
|
||||||
@@ -139,7 +139,7 @@ void flip3(const Size2D & size,
|
|||||||
|
|
||||||
vst3q(dst + jd - step_base3, v_dst);
|
vst3q(dst + jd - step_base3, v_dst);
|
||||||
}
|
}
|
||||||
#endif // ANDROID
|
#endif // __ANDROID__
|
||||||
|
|
||||||
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
|
for (; j < roiw_tail; j += step_tail, js += step_tail3, jd -= step_tail3)
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -327,7 +327,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
|||||||
u16* lidx1 = lane + x - 1*2;
|
u16* lidx1 = lane + x - 1*2;
|
||||||
u16* lidx3 = lane + x + 1*2;
|
u16* lidx3 = lane + x + 1*2;
|
||||||
u16* lidx4 = lane + x + 2*2;
|
u16* lidx4 = lane + x + 2*2;
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"vld2.16 {d0, d2}, [%[in0]]! \n\t"
|
"vld2.16 {d0, d2}, [%[in0]]! \n\t"
|
||||||
"vld2.16 {d1, d3}, [%[in0]] \n\t"
|
"vld2.16 {d1, d3}, [%[in0]] \n\t"
|
||||||
@@ -398,7 +398,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
|||||||
u16* lidx1 = lane + x - 1*3;
|
u16* lidx1 = lane + x - 1*3;
|
||||||
u16* lidx3 = lane + x + 1*3;
|
u16* lidx3 = lane + x + 1*3;
|
||||||
u16* lidx4 = lane + x + 2*3;
|
u16* lidx4 = lane + x + 2*3;
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
|
"vld3.16 {d0, d2, d4}, [%[in0]]! \n\t"
|
||||||
"vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
|
"vld3.16 {d1, d3, d5}, [%[in0]] \n\t"
|
||||||
@@ -482,7 +482,7 @@ void gaussianBlur5x5(const Size2D &size, s32 cn,
|
|||||||
u16* lidx1 = lane + x - 1*4;
|
u16* lidx1 = lane + x - 1*4;
|
||||||
u16* lidx3 = lane + x + 1*4;
|
u16* lidx3 = lane + x + 1*4;
|
||||||
u16* lidx4 = lane + x + 2*4;
|
u16* lidx4 = lane + x + 2*4;
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
|
"vld4.16 {d0, d2, d4, d6}, [%[in0]]! \n\t"
|
||||||
"vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
|
"vld4.16 {d1, d3, d5, d7}, [%[in0]] \n\t"
|
||||||
|
|||||||
Vendored
+15
-15
@@ -331,7 +331,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
|||||||
for (; x < roiw8; x += 8)
|
for (; x < roiw8; x += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + 2 * x);
|
internal::prefetch(lane + 2 * x);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld2.16 {d0-d3}, [%[in0]] \n\t"
|
"vld2.16 {d0-d3}, [%[in0]] \n\t"
|
||||||
"vld2.16 {d4-d7}, [%[in4]] \n\t"
|
"vld2.16 {d4-d7}, [%[in4]] \n\t"
|
||||||
@@ -538,7 +538,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
|||||||
for (; x < roiw4; x += 4)
|
for (; x < roiw4; x += 4)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + 2 * x);
|
internal::prefetch(lane + 2 * x);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||||
"vld2.32 {d4-d7}, [%[in4]] \n\t"
|
"vld2.32 {d4-d7}, [%[in4]] \n\t"
|
||||||
@@ -672,7 +672,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
|||||||
std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
|
std::vector<f32> _buf(cn*(srcSize.width + 4) + 32/sizeof(f32));
|
||||||
f32* lane = internal::alignPtr(&_buf[2*cn], 32);
|
f32* lane = internal::alignPtr(&_buf[2*cn], 32);
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
|
register float32x4_t vc6d4f32 asm ("q11") = vmovq_n_f32(1.5f); // 6/4
|
||||||
register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
|
register float32x4_t vc1d4f32 asm ("q12") = vmovq_n_f32(0.25f); // 1/4
|
||||||
|
|
||||||
@@ -680,12 +680,12 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
|||||||
register float32x4_t vc4d64f32 asm ("q14") = vmovq_n_f32(0.0625f); //4/4/16
|
register float32x4_t vc4d64f32 asm ("q14") = vmovq_n_f32(0.0625f); //4/4/16
|
||||||
register float32x4_t vc6d64f32 asm ("q15") = vmovq_n_f32(0.09375f); //6/4/16
|
register float32x4_t vc6d64f32 asm ("q15") = vmovq_n_f32(0.09375f); //6/4/16
|
||||||
#else
|
#else
|
||||||
register float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
float32x4_t vc6d4f32 = vmovq_n_f32(1.5f); // 6/4
|
||||||
register float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
float32x4_t vc1d4f32 = vmovq_n_f32(0.25f); // 1/4
|
||||||
|
|
||||||
register float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
float32x4_t vc1d64f32 = vmovq_n_f32(0.015625f); //1/4/16
|
||||||
register float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
float32x4_t vc4d64f32 = vmovq_n_f32(0.0625f); //4/4/16
|
||||||
register float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
float32x4_t vc6d64f32 = vmovq_n_f32(0.09375f); //6/4/16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (size_t i = 0; i < dstSize.height; ++i)
|
for (size_t i = 0; i < dstSize.height; ++i)
|
||||||
@@ -739,7 +739,7 @@ void gaussianPyramidDown(const Size2D &srcSize,
|
|||||||
for (; x < roiw4; x += 4)
|
for (; x < roiw4; x += 4)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + 2 * x);
|
internal::prefetch(lane + 2 * x);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
"vld2.32 {d0-d3}, [%[in0]] \n\t"
|
||||||
"vld2.32 {d8-d11}, [%[in4]] \n\t"
|
"vld2.32 {d8-d11}, [%[in4]] \n\t"
|
||||||
@@ -932,7 +932,7 @@ pyrUp8uHorizontalConvolution:
|
|||||||
for (; x < lim; x += 8)
|
for (; x < lim; x += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x);
|
internal::prefetch(lane + x);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||||
@@ -973,7 +973,7 @@ pyrUp8uHorizontalConvolution:
|
|||||||
for (; x < lim; x += 24)
|
for (; x < lim; x += 24)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x);
|
internal::prefetch(lane + x);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vmov.u16 q9, #6 \n\t"
|
"vmov.u16 q9, #6 \n\t"
|
||||||
"vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
"vld3.16 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||||
@@ -1064,7 +1064,7 @@ pyrUp8uHorizontalConvolution:
|
|||||||
for (; x < lim; x += 8)
|
for (; x < lim; x += 8)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x);
|
internal::prefetch(lane + x);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
"vld1.16 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||||
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
"vld1.16 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||||
@@ -1210,7 +1210,7 @@ pyrUp16sHorizontalConvolution:
|
|||||||
for (; x < lim; x += 4)
|
for (; x < lim; x += 4)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x);
|
internal::prefetch(lane + x);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||||
@@ -1251,7 +1251,7 @@ pyrUp16sHorizontalConvolution:
|
|||||||
for (; x < lim; x += 12)
|
for (; x < lim; x += 12)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x + 3);
|
internal::prefetch(lane + x + 3);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vmov.s32 q9, #6 \n\t"
|
"vmov.s32 q9, #6 \n\t"
|
||||||
"vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
"vld3.32 {d0, d2, d4}, [%[in0]] /*v0*/ \n\t"
|
||||||
@@ -1343,7 +1343,7 @@ pyrUp16sHorizontalConvolution:
|
|||||||
for (; x < lim; x += 4)
|
for (; x < lim; x += 4)
|
||||||
{
|
{
|
||||||
internal::prefetch(lane + x);
|
internal::prefetch(lane + x);
|
||||||
#if defined(__GNUC__) && defined(__arm__)
|
#if !defined(__aarch64__) && defined(__GNUC__) && defined(__arm__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
"vld1.32 {d0-d1}, [%[in0]] /*q0 = v0*/ \n\t"
|
||||||
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
"vld1.32 {d2-d3}, [%[in2]] /*q1 = v2*/ \n\t"
|
||||||
|
|||||||
Vendored
+14
-13
@@ -106,7 +106,8 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
|
|||||||
&& !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF)// Restrict image size since internal index evaluation
|
&& !(ssize.width > 0xffffFFFF || ssize.height > 0xffffFFFF)// Restrict image size since internal index evaluation
|
||||||
// is performed with u32
|
// is performed with u32
|
||||||
#endif
|
#endif
|
||||||
&& dsize.width >= 2 && dsize.height >= 8)
|
&& dsize.width >= 2 && dsize.height >= 8
|
||||||
|
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
|
||||||
return isSupportedConfiguration();
|
return isSupportedConfiguration();
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -359,7 +360,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
}
|
}
|
||||||
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
|
else //if ((wr == 4.0f) && (hr == 4.0f)) //the only scale that lasts after isSupported check
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
|
size_t roiw16 = dsize.width >= 15 ? dsize.width - 15 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
|
size_t roiw8 = dsize.width >= 7 ? dsize.width - 7 : 0;
|
||||||
@@ -373,7 +374,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw16; dj += 16, sj += 64)
|
for ( ; dj < roiw16; dj += 16, sj += 64)
|
||||||
{
|
{
|
||||||
internal::prefetch(src0_row + sj);
|
internal::prefetch(src0_row + sj);
|
||||||
@@ -450,7 +451,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
{
|
{
|
||||||
if ((wr == 2.0f) && (hr == 2.0f))
|
if ((wr == 2.0f) && (hr == 2.0f))
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
|
size_t roiw4 = dsize.width >= 3 ? (dsize.width - 3) << 2 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
|
size_t roiw2 = dsize.width >= 1 ? (dsize.width - 1) << 2 : 0;
|
||||||
@@ -462,7 +463,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw4; dj += 16, sj += 32)
|
for ( ; dj < roiw4; dj += 16, sj += 32)
|
||||||
{
|
{
|
||||||
internal::prefetch(src0_row + sj);
|
internal::prefetch(src0_row + sj);
|
||||||
@@ -537,7 +538,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
}
|
}
|
||||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
|
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) << 2 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
|
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) << 2 : 0;
|
||||||
@@ -549,7 +550,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw32; dj += 128, sj += 64)
|
for ( ; dj < roiw32; dj += 128, sj += 64)
|
||||||
{
|
{
|
||||||
internal::prefetch(src_row + sj);
|
internal::prefetch(src_row + sj);
|
||||||
@@ -758,7 +759,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
{
|
{
|
||||||
if ((wr == 2.0f) && (wr == 2.0f))
|
if ((wr == 2.0f) && (wr == 2.0f))
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||||
@@ -770,7 +771,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw16; dj += 48, sj += 96)
|
for ( ; dj < roiw16; dj += 48, sj += 96)
|
||||||
{
|
{
|
||||||
internal::prefetch(src0_row + sj);
|
internal::prefetch(src0_row + sj);
|
||||||
@@ -856,7 +857,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
}
|
}
|
||||||
else if ((wr == 0.5f) && (hr == 0.5f))
|
else if ((wr == 0.5f) && (hr == 0.5f))
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
|
size_t roiw32 = dsize.width >= 31 ? (dsize.width - 31) * 3 : 0;
|
||||||
#endif
|
#endif
|
||||||
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
size_t roiw16 = dsize.width >= 15 ? (dsize.width - 15) * 3 : 0;
|
||||||
@@ -868,7 +869,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
u8 * dst1_row = internal::getRowPtr(dstBase, dstStride, std::min(i + 1, dsize.height - 1));
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw32; dj += 96, sj += 48)
|
for ( ; dj < roiw32; dj += 96, sj += 48)
|
||||||
{
|
{
|
||||||
internal::prefetch(src_row + sj);
|
internal::prefetch(src_row + sj);
|
||||||
@@ -928,7 +929,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
}
|
}
|
||||||
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
|
else //if ((hr == 4.0f) && (wr == 4.0f)) //the only scale that lasts after isSupported check
|
||||||
{
|
{
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
size_t roiw8 = dsize.width >= 7 ? (dsize.width - 7) * 3 : 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -941,7 +942,7 @@ inline void resizeAreaRounding(const Size2D &ssize, const Size2D &dsize,
|
|||||||
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
u8 * dst_row = internal::getRowPtr(dstBase, dstStride, i);
|
||||||
size_t sj = 0, dj = 0;
|
size_t sj = 0, dj = 0;
|
||||||
|
|
||||||
#ifndef ANDROID
|
#ifndef __ANDROID__
|
||||||
for ( ; dj < roiw8; dj += 24, sj += 96)
|
for ( ; dj < roiw8; dj += 24, sj += 96)
|
||||||
{
|
{
|
||||||
internal::prefetch(src0_row + sj);
|
internal::prefetch(src0_row + sj);
|
||||||
|
|||||||
+2
-2
@@ -72,11 +72,11 @@ __declspec(naked) static void vcvtr_s32_f64_imp(f64 d)
|
|||||||
|
|
||||||
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
|
# if defined(__VFP_FP__) && !defined(__SOFTFP__) && !(defined _DEBUG || defined DEBUG) && !defined(__CUDACC__)
|
||||||
# define CAROTENE_ROUND_FLT(value) { \
|
# define CAROTENE_ROUND_FLT(value) { \
|
||||||
register union { f32 f; s32 i; } result; \
|
union { f32 f; s32 i; } result; \
|
||||||
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
|
asm ("ftosis %0, %1 \n" : "=w" (result.f) : "w" (value) ); \
|
||||||
return result.i; }
|
return result.i; }
|
||||||
# define CAROTENE_ROUND_DBL(value) { \
|
# define CAROTENE_ROUND_DBL(value) { \
|
||||||
register union {f32 f; s32 i;} __tegra_result; \
|
union {f32 f; s32 i;} __tegra_result; \
|
||||||
asm ( \
|
asm ( \
|
||||||
"ftosid %0, %P1\n" \
|
"ftosid %0, %P1\n" \
|
||||||
: "=w" (__tegra_result.f) \
|
: "=w" (__tegra_result.f) \
|
||||||
|
|||||||
Vendored
+2
-2
@@ -109,7 +109,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
|||||||
internal::prefetch(srow0 + x);
|
internal::prefetch(srow0 + x);
|
||||||
internal::prefetch(srow1 + x);
|
internal::prefetch(srow1 + x);
|
||||||
internal::prefetch(srow2 + x);
|
internal::prefetch(srow2 + x);
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.8 {d0}, [%[src0]] \n\t"
|
"vld1.8 {d0}, [%[src0]] \n\t"
|
||||||
"vld1.8 {d2}, [%[src2]] \n\t"
|
"vld1.8 {d2}, [%[src2]] \n\t"
|
||||||
@@ -161,7 +161,7 @@ void ScharrDeriv(const Size2D &size, s32 cn,
|
|||||||
x = 0;
|
x = 0;
|
||||||
for( ; x < roiw8; x += 8 )
|
for( ; x < roiw8; x += 8 )
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6
|
#if !defined(__aarch64__) && defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__clang__)
|
||||||
__asm__ (
|
__asm__ (
|
||||||
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
|
"vld1.16 {d4-d5}, [%[s2ptr]] \n\t"
|
||||||
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
|
"vld1.16 {d8-d9}, [%[s4ptr]] \n\t"
|
||||||
|
|||||||
Vendored
+7
-5
@@ -2,19 +2,21 @@ if(NOT ANDROID)
|
|||||||
message("cpufeatures is ANDROID project")
|
message("cpufeatures is ANDROID project")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
ocv_update(OPENCV_CPUFEATURES_TARGET_NAME libcpufeatures)
|
||||||
|
|
||||||
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
|
set(CPUFEATURES_ROOT "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH "Android cpufeatures project sources (for example, <android-ndk>/sources/android/cpufeatures)")
|
||||||
|
|
||||||
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
|
set(CPUFEATURES_INCLUDE_DIRS ${CPUFEATURES_ROOT} CACHE INTERNAL "")
|
||||||
set(CPUFEATURES_LIBRARIES cpufeatures CACHE INTERNAL "")
|
set(CPUFEATURES_LIBRARIES "${OPENCV_CPUFEATURES_TARGET_NAME}" CACHE INTERNAL "")
|
||||||
|
|
||||||
if(NOT DEFINED CPUFEATURES_SOURCES)
|
if(NOT DEFINED CPUFEATURES_SOURCES)
|
||||||
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
|
set(CPUFEATURES_SOURCES ${CPUFEATURES_ROOT}/cpu-features.c ${CPUFEATURES_ROOT}/cpu-features.h)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
include_directories(${CPUFEATURES_INCLUDE_DIRS})
|
||||||
add_library(cpufeatures STATIC ${CPUFEATURES_SOURCES})
|
add_library(${OPENCV_CPUFEATURES_TARGET_NAME} STATIC ${CPUFEATURES_SOURCES})
|
||||||
|
|
||||||
set_target_properties(cpufeatures
|
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME}
|
||||||
PROPERTIES OUTPUT_NAME cpufeatures
|
PROPERTIES OUTPUT_NAME cpufeatures
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
COMPILE_PDB_NAME cpufeatures
|
COMPILE_PDB_NAME cpufeatures
|
||||||
@@ -23,9 +25,9 @@ set_target_properties(cpufeatures
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(ENABLE_SOLUTION_FOLDERS)
|
if(ENABLE_SOLUTION_FOLDERS)
|
||||||
set_target_properties(cpufeatures PROPERTIES FOLDER "3rdparty")
|
set_target_properties(${OPENCV_CPUFEATURES_TARGET_NAME} PROPERTIES FOLDER "3rdparty")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_SHARED_LIBS)
|
if(NOT BUILD_SHARED_LIBS)
|
||||||
ocv_install_target(cpufeatures EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
ocv_install_target(${OPENCV_CPUFEATURES_TARGET_NAME} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+6
-6
@@ -1,9 +1,9 @@
|
|||||||
# Binary branch name: ffmpeg/master_20170418
|
# Binary branch name: ffmpeg/master_20171009
|
||||||
# Binaries were created for OpenCV: b993b9b7c7f6f5f37d10acacb2962812228410ba
|
# Binaries were created for OpenCV: 8ac2c5d620b467d3f22802e96c88ddde6da707af
|
||||||
set(FFMPEG_BINARIES_COMMIT "86c4a841055f2612774e85b4292bb20e5fe8a783")
|
set(FFMPEG_BINARIES_COMMIT "66b1fed06cf3510235f367f96aa26da5cb234a15")
|
||||||
set(FFMPEG_FILE_HASH_BIN32 "3dea5f7f009b44601fe95728328e0f9e")
|
set(FFMPEG_FILE_HASH_BIN32 "3ae76b105113d944984b2351c61e21c6")
|
||||||
set(FFMPEG_FILE_HASH_BIN64 "9debe701975ef074bd6661981f3f0716")
|
set(FFMPEG_FILE_HASH_BIN64 "cf3bb5bc9d393b022ea7a42eb63e794d")
|
||||||
set(FFMPEG_FILE_HASH_CMAKE "208c00f03d2f6f39fa6262649e0bfc8d")
|
set(FFMPEG_FILE_HASH_CMAKE "ec59008da403fb18ab3c1ed66aed583b")
|
||||||
|
|
||||||
function(download_win_ffmpeg script_var)
|
function(download_win_ffmpeg script_var)
|
||||||
set(${script_var} "" PARENT_SCOPE)
|
set(${script_var} "" PARENT_SCOPE)
|
||||||
|
|||||||
Vendored
+4
-5
@@ -16,19 +16,18 @@
|
|||||||
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
The binaries are opencv_ffmpeg.dll (version for 32-bit Windows) and
|
||||||
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
opencv_ffmpeg_64.dll (version for 64-bit Windows).
|
||||||
|
|
||||||
See build_win32.txt for the build instructions, if you want to rebuild opencv_ffmpeg*.dll from scratch.
|
|
||||||
|
|
||||||
The pre-built opencv_ffmpeg*.dll is:
|
The pre-built opencv_ffmpeg*.dll is:
|
||||||
* LGPL library, not BSD libraries.
|
* LGPL library, not BSD libraries.
|
||||||
* Loaded at runtime by opencv_videoio module.
|
* Loaded at runtime by opencv_videoio module.
|
||||||
If it succeeds, ffmpeg can be used to decode/encode videos;
|
If it succeeds, ffmpeg can be used to decode/encode videos;
|
||||||
otherwise, other API is used.
|
otherwise, other API is used.
|
||||||
|
|
||||||
FFMPEG build contains H264 encoder based on the OpenH264 library, that should be installed separatelly.
|
FFMPEG build includes support for H264 encoder based on the OpenH264 library.
|
||||||
OpenH264 Video Codec provided by Cisco Systems, Inc.
|
OpenH264 Video Codec provided by Cisco Systems, Inc.
|
||||||
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
|
See https://github.com/cisco/openh264/releases for details and OpenH264 license.
|
||||||
Downloaded binary file can be placed into global system path (System32 or SysWOW64) or near application binaries.
|
OpenH264 library should be installed separatelly. Downloaded binary file can be placed into global system path
|
||||||
You can also specify location of binary file via OPENH264_LIBRARY_PATH environment variable.
|
(System32 or SysWOW64) or near application binaries (check documentation of "LoadLibrary" Win32 function from MSDN).
|
||||||
|
Or you can specify location of binary file via OPENH264_LIBRARY environment variable.
|
||||||
|
|
||||||
If LGPL/GPL software can not be supplied with your OpenCV-based product, simply exclude
|
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_ffmpeg*.dll from your distribution; OpenCV will stay fully functional except for the ability to
|
||||||
|
|||||||
-110
@@ -1,110 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file has no copyright assigned and is placed in the Public Domain.
|
|
||||||
* This file is part of the w64 mingw-runtime package.
|
|
||||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
|
||||||
#define NONAMELESSUNION 1
|
|
||||||
#endif
|
|
||||||
#if defined(NONAMELESSSTRUCT) && \
|
|
||||||
!defined(NONAMELESSUNION)
|
|
||||||
#define NONAMELESSUNION 1
|
|
||||||
#endif
|
|
||||||
#if defined(NONAMELESSUNION) && \
|
|
||||||
!defined(NONAMELESSSTRUCT)
|
|
||||||
#define NONAMELESSSTRUCT 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __ANONYMOUS_DEFINED
|
|
||||||
#define __ANONYMOUS_DEFINED
|
|
||||||
#if defined(__GNUC__) || defined(__GNUG__)
|
|
||||||
#define _ANONYMOUS_UNION __extension__
|
|
||||||
#define _ANONYMOUS_STRUCT __extension__
|
|
||||||
#else
|
|
||||||
#define _ANONYMOUS_UNION
|
|
||||||
#define _ANONYMOUS_STRUCT
|
|
||||||
#endif
|
|
||||||
#ifndef NONAMELESSUNION
|
|
||||||
#define _UNION_NAME(x)
|
|
||||||
#define _STRUCT_NAME(x)
|
|
||||||
#else /* NONAMELESSUNION */
|
|
||||||
#define _UNION_NAME(x) x
|
|
||||||
#define _STRUCT_NAME(x) x
|
|
||||||
#endif
|
|
||||||
#endif /* __ANONYMOUS_DEFINED */
|
|
||||||
|
|
||||||
#ifndef DUMMYUNIONNAME
|
|
||||||
# ifdef NONAMELESSUNION
|
|
||||||
# define DUMMYUNIONNAME u
|
|
||||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
|
||||||
# define DUMMYUNIONNAME2 u2
|
|
||||||
# define DUMMYUNIONNAME3 u3
|
|
||||||
# define DUMMYUNIONNAME4 u4
|
|
||||||
# define DUMMYUNIONNAME5 u5
|
|
||||||
# define DUMMYUNIONNAME6 u6
|
|
||||||
# define DUMMYUNIONNAME7 u7
|
|
||||||
# define DUMMYUNIONNAME8 u8
|
|
||||||
# define DUMMYUNIONNAME9 u9
|
|
||||||
# else /* NONAMELESSUNION */
|
|
||||||
# define DUMMYUNIONNAME
|
|
||||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
|
||||||
# define DUMMYUNIONNAME2
|
|
||||||
# define DUMMYUNIONNAME3
|
|
||||||
# define DUMMYUNIONNAME4
|
|
||||||
# define DUMMYUNIONNAME5
|
|
||||||
# define DUMMYUNIONNAME6
|
|
||||||
# define DUMMYUNIONNAME7
|
|
||||||
# define DUMMYUNIONNAME8
|
|
||||||
# define DUMMYUNIONNAME9
|
|
||||||
# endif
|
|
||||||
#endif /* DUMMYUNIONNAME */
|
|
||||||
|
|
||||||
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
|
|
||||||
# ifdef NONAMELESSUNION
|
|
||||||
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
|
||||||
# else
|
|
||||||
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
|
||||||
# endif
|
|
||||||
#endif /* DUMMYUNIONNAME1 */
|
|
||||||
|
|
||||||
#ifndef DUMMYSTRUCTNAME
|
|
||||||
# ifdef NONAMELESSUNION
|
|
||||||
# define DUMMYSTRUCTNAME s
|
|
||||||
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
|
|
||||||
# define DUMMYSTRUCTNAME2 s2
|
|
||||||
# define DUMMYSTRUCTNAME3 s3
|
|
||||||
# define DUMMYSTRUCTNAME4 s4
|
|
||||||
# define DUMMYSTRUCTNAME5 s5
|
|
||||||
# else
|
|
||||||
# define DUMMYSTRUCTNAME
|
|
||||||
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
|
|
||||||
# define DUMMYSTRUCTNAME2
|
|
||||||
# define DUMMYSTRUCTNAME3
|
|
||||||
# define DUMMYSTRUCTNAME4
|
|
||||||
# define DUMMYSTRUCTNAME5
|
|
||||||
# endif
|
|
||||||
#endif /* DUMMYSTRUCTNAME */
|
|
||||||
|
|
||||||
/* These are for compatibility with the Wine source tree */
|
|
||||||
|
|
||||||
#ifndef WINELIB_NAME_AW
|
|
||||||
# ifdef __MINGW_NAME_AW
|
|
||||||
# define WINELIB_NAME_AW __MINGW_NAME_AW
|
|
||||||
# else
|
|
||||||
# ifdef UNICODE
|
|
||||||
# define WINELIB_NAME_AW(func) func##W
|
|
||||||
# else
|
|
||||||
# define WINELIB_NAME_AW(func) func##A
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif /* WINELIB_NAME_AW */
|
|
||||||
|
|
||||||
#ifndef DECL_WINELIB_TYPE_AW
|
|
||||||
# ifdef __MINGW_TYPEDEF_AW
|
|
||||||
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
|
|
||||||
# else
|
|
||||||
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
|
||||||
# endif
|
|
||||||
#endif /* DECL_WINELIB_TYPE_AW */
|
|
||||||
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file has no copyright assigned and is placed in the Public Domain.
|
|
||||||
* This file is part of the w64 mingw-runtime package.
|
|
||||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined(_INC_CRT_UNICODE_MACROS)
|
|
||||||
/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
|
|
||||||
|
|
||||||
#if defined(UNICODE)
|
|
||||||
# define _INC_CRT_UNICODE_MACROS 1
|
|
||||||
# define __MINGW_NAME_AW(func) func##W
|
|
||||||
# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
|
|
||||||
# define __MINGW_NAME_UAW(func) func##_W
|
|
||||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
|
|
||||||
# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
|
|
||||||
# define __MINGW_PROCNAMEEXT_AW "W"
|
|
||||||
#else
|
|
||||||
# define _INC_CRT_UNICODE_MACROS 2
|
|
||||||
# define __MINGW_NAME_AW(func) func##A
|
|
||||||
# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
|
|
||||||
# define __MINGW_NAME_UAW(func) func##_A
|
|
||||||
# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
|
|
||||||
# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
|
|
||||||
# define __MINGW_PROCNAMEEXT_AW "A"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define __MINGW_TYPEDEF_AW(type) \
|
|
||||||
typedef __MINGW_NAME_AW(type) type;
|
|
||||||
#define __MINGW_TYPEDEF_UAW(type) \
|
|
||||||
typedef __MINGW_NAME_UAW(type) type;
|
|
||||||
|
|
||||||
#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
|
|
||||||
Vendored
-1290
File diff suppressed because it is too large
Load Diff
Vendored
-31
@@ -1,31 +0,0 @@
|
|||||||
#ifndef _AUDEVCOD_H
|
|
||||||
#define _AUDEVCOD_H
|
|
||||||
#if __GNUC__ >=3
|
|
||||||
#pragma GCC system_header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum _tagSND_DEVICE_ERROR {
|
|
||||||
SNDDEV_ERROR_Open = 1,
|
|
||||||
SNDDEV_ERROR_Close = 2,
|
|
||||||
SNDDEV_ERROR_GetCaps = 3,
|
|
||||||
SNDDEV_ERROR_PrepareHeader = 4,
|
|
||||||
SNDDEV_ERROR_UnprepareHeader = 5,
|
|
||||||
SNDDEV_ERROR_Reset = 6,
|
|
||||||
SNDDEV_ERROR_Restart = 7,
|
|
||||||
SNDDEV_ERROR_GetPosition = 8,
|
|
||||||
SNDDEV_ERROR_Write = 9,
|
|
||||||
SNDDEV_ERROR_Pause = 10,
|
|
||||||
SNDDEV_ERROR_Stop = 11,
|
|
||||||
SNDDEV_ERROR_Start = 12,
|
|
||||||
SNDDEV_ERROR_AddBuffer = 13,
|
|
||||||
SNDDEV_ERROR_Query = 14
|
|
||||||
} SNDDEV_ERR;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
Vendored
-32
@@ -1,32 +0,0 @@
|
|||||||
#ifndef _BDATYPES_H
|
|
||||||
#define _BDATYPES_H
|
|
||||||
#if __GNUC__ >= 3
|
|
||||||
#pragma GCC system_header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--- DirectShow Reference - DirectShow Enumerated Types */
|
|
||||||
typedef enum {
|
|
||||||
MEDIA_TRANSPORT_PACKET,
|
|
||||||
MEDIA_ELEMENTARY_STREAM,
|
|
||||||
MEDIA_MPEG2_PSI,
|
|
||||||
MEDIA_TRANSPORT_PAYLOAD
|
|
||||||
} MEDIA_SAMPLE_CONTENT;
|
|
||||||
/*--- DirectShow Reference - DirectShow Structures */
|
|
||||||
typedef struct {
|
|
||||||
DWORD dwOffset;
|
|
||||||
DWORD dwPacketLength;
|
|
||||||
DWORD dwStride;
|
|
||||||
} MPEG2_TRANSPORT_STRIDE;
|
|
||||||
typedef struct {
|
|
||||||
ULONG ulPID;
|
|
||||||
MEDIA_SAMPLE_CONTENT MediaSampleContent ;
|
|
||||||
} PID_MAP;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
Vendored
-1467
File diff suppressed because it is too large
Load Diff
Vendored
-2712
File diff suppressed because it is too large
Load Diff
Vendored
-61
@@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2002 Alexandre Julliard
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DSHOW_INCLUDED__
|
|
||||||
#define __DSHOW_INCLUDED__
|
|
||||||
|
|
||||||
#define AM_NOVTABLE
|
|
||||||
|
|
||||||
#ifndef __WINESRC__
|
|
||||||
# include <windows.h>
|
|
||||||
# include <windowsx.h>
|
|
||||||
#else
|
|
||||||
# include <windef.h>
|
|
||||||
# include <wingdi.h>
|
|
||||||
# include <objbase.h>
|
|
||||||
#endif
|
|
||||||
#include <olectl.h>
|
|
||||||
#include <dshow/ddraw.h>
|
|
||||||
#include <mmsystem.h>
|
|
||||||
/* FIXME: #include <strsafe.h>*/
|
|
||||||
|
|
||||||
#ifndef NUMELMS
|
|
||||||
#define NUMELMS(array) (sizeof(array)/sizeof((array)[0]))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <dshow/strmif.h>
|
|
||||||
#include <dshow/amvideo.h>
|
|
||||||
#ifdef DSHOW_USE_AMAUDIO
|
|
||||||
/* FIXME: #include <amaudio.h>*/
|
|
||||||
#endif
|
|
||||||
#include <dshow/control.h>
|
|
||||||
#include <dshow/evcode.h>
|
|
||||||
#include <dshow/uuids.h>
|
|
||||||
#include <dshow/errors.h>
|
|
||||||
/* FIXME: #include <edevdefs.h> */
|
|
||||||
#include <dshow/audevcod.h>
|
|
||||||
/* FIXME: #include <dvdevcod.h> */
|
|
||||||
|
|
||||||
#ifndef OATRUE
|
|
||||||
#define OATRUE (-1)
|
|
||||||
#endif
|
|
||||||
#ifndef OAFALSE
|
|
||||||
#define OAFALSE (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* __DSHOW_INCLUDED__ */
|
|
||||||
Vendored
-1199
File diff suppressed because it is too large
Load Diff
Vendored
-75
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2008 Maarten Lankhorst
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __DVDMEDIA_H__
|
|
||||||
#define __DVDMEDIA_H__
|
|
||||||
|
|
||||||
#define AMCONTROL_USED 0x00000001
|
|
||||||
#define AMCONTROL_PAD_TO_4x3 0x00000002
|
|
||||||
#define AMCONTROL_PAD_TO_16x9 0x00000004
|
|
||||||
|
|
||||||
enum AM_MPEG2Level {
|
|
||||||
AM_MPEG2Level_Low = 1,
|
|
||||||
AM_MPEG2Level_Main,
|
|
||||||
AM_MPEG2Level_High1440,
|
|
||||||
AM_MPEG2Level_High
|
|
||||||
};
|
|
||||||
enum AM_MPEG2Profile {
|
|
||||||
AM_MPEG2Profile_Simple = 1,
|
|
||||||
AM_MPEG2Profile_Main,
|
|
||||||
AM_MPEG2Profile_SNRScalable,
|
|
||||||
AM_MPEG2Profile_SpatiallyScalable,
|
|
||||||
AM_MPEG2Profile_High
|
|
||||||
};
|
|
||||||
typedef enum {
|
|
||||||
AM_RATE_ChangeRate = 1,
|
|
||||||
AM_RATE_FullDataRateMax = 2,
|
|
||||||
AM_RATE_ReverseDecode = 3,
|
|
||||||
AM_RATE_DecoderPosition = 4,
|
|
||||||
AM_RATE_DecoderVersion = 5
|
|
||||||
} AM_PROPERTY_DVD_RATE_CHANGE;
|
|
||||||
|
|
||||||
typedef struct tagVIDEOINFOHEADER2 {
|
|
||||||
RECT rcSource;
|
|
||||||
RECT rcTarget;
|
|
||||||
DWORD dwBitRate;
|
|
||||||
DWORD dwBitErrorRate;
|
|
||||||
REFERENCE_TIME AvgTimePerFrame;
|
|
||||||
DWORD dwInterlaceFlags;
|
|
||||||
DWORD dwCopyProtectFlags;
|
|
||||||
DWORD dwPictAspectRatioX;
|
|
||||||
DWORD dwPictAspectRatioY;
|
|
||||||
union {
|
|
||||||
DWORD dwControlFlags;
|
|
||||||
DWORD dwReserved1;
|
|
||||||
} DUMMYUNIONNAME;
|
|
||||||
DWORD dwReserved2;
|
|
||||||
BITMAPINFOHEADER bmiHeader;
|
|
||||||
} VIDEOINFOHEADER2;
|
|
||||||
|
|
||||||
typedef struct tagMPEG2VIDEOINFO {
|
|
||||||
VIDEOINFOHEADER2 hdr;
|
|
||||||
DWORD dwStartTimeCode;
|
|
||||||
DWORD cbSequenceHeader;
|
|
||||||
DWORD dwProfile;
|
|
||||||
DWORD dwLevel;
|
|
||||||
DWORD dwFlags;
|
|
||||||
DWORD dwSequenceHeader[1];
|
|
||||||
} MPEG2VIDEOINFO;
|
|
||||||
|
|
||||||
#endif /* __DVDMEDIA_H__ */
|
|
||||||
Vendored
-169
@@ -1,169 +0,0 @@
|
|||||||
#ifndef _ERRORS_H
|
|
||||||
#define _ERRORS_H
|
|
||||||
#if __GNUC__ >=3
|
|
||||||
#pragma GCC system_header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--- DirectShow Reference - Constants and GUIDs - Error and Success Codes */
|
|
||||||
#define VFW_S_NO_MORE_ITEMS 0x00040103
|
|
||||||
#define VFW_S_DUPLICATE_NAME 0x0004022D
|
|
||||||
#define VFW_S_STATE_INTERMEDIATE 0x00040237
|
|
||||||
#define VFW_S_PARTIAL_RENDER 0x00040242
|
|
||||||
#define VFW_S_SOME_DATA_IGNORED 0x00040245
|
|
||||||
#define VFW_S_CONNECTIONS_DEFERRED 0x00040246
|
|
||||||
#define VFW_S_RESOURCE_NOT_NEEDED 0x00040250
|
|
||||||
#define VFW_S_MEDIA_TYPE_IGNORED 0x00040254
|
|
||||||
#define VFW_S_VIDEO_NOT_RENDERED 0x00040257
|
|
||||||
#define VFW_S_AUDIO_NOT_RENDERED 0x00040258
|
|
||||||
#define VFW_S_RPZA 0x0004025A
|
|
||||||
#define VFW_S_ESTIMATED 0x00040260
|
|
||||||
#define VFW_S_RESERVED 0x00040263
|
|
||||||
#define VFW_S_STREAM_OFF 0x00040267
|
|
||||||
#define VFW_S_CANT_CUE 0x00040268
|
|
||||||
#define VFW_S_NOPREVIEWPIN 0x0004027E
|
|
||||||
#define VFW_S_DVD_NON_ONE_SEQUENTIAL 0x00040280
|
|
||||||
#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE 0x0004028C
|
|
||||||
#define VFW_S_DVD_NOT_ACCURATE 0x0004028D
|
|
||||||
#define VFW_E_INVALIDMEDIATYPE 0x80040200
|
|
||||||
#define VFW_E_INVALIDSUBTYPE 0x80040201
|
|
||||||
#define VFW_E_NEED_OWNER 0x80040202
|
|
||||||
#define VFW_E_ENUM_OUT_OF_SYNC 0x80040203
|
|
||||||
#define VFW_E_ALREADY_CONNECTED 0x80040204
|
|
||||||
#define VFW_E_FILTER_ACTIVE 0x80040205
|
|
||||||
#define VFW_E_NO_TYPES 0x80040206
|
|
||||||
#define VFW_E_NO_ACCEPTABLE_TYPES 0x80040207
|
|
||||||
#define VFW_E_INVALID_DIRECTION 0x80040208
|
|
||||||
#define VFW_E_NOT_CONNECTED 0x80040209
|
|
||||||
#define VFW_E_NO_ALLOCATOR 0x8004020A
|
|
||||||
#define VFW_E_RUNTIME_ERROR 0x8004020B
|
|
||||||
#define VFW_E_BUFFER_NOTSET 0x8004020C
|
|
||||||
#define VFW_E_BUFFER_OVERFLOW 0x8004020D
|
|
||||||
#define VFW_E_BADALIGN 0x8004020E
|
|
||||||
#define VFW_E_ALREADY_COMMITTED 0x8004020F
|
|
||||||
#define VFW_E_BUFFERS_OUTSTANDING 0x80040210
|
|
||||||
#define VFW_E_NOT_COMMITTED 0x80040211
|
|
||||||
#define VFW_E_SIZENOTSET 0x80040212
|
|
||||||
#define VFW_E_NO_CLOCK 0x80040213
|
|
||||||
#define VFW_E_NO_SINK 0x80040214
|
|
||||||
#define VFW_E_NO_INTERFACE 0x80040215
|
|
||||||
#define VFW_E_NOT_FOUND 0x80040216
|
|
||||||
#define VFW_E_CANNOT_CONNECT 0x80040217
|
|
||||||
#define VFW_E_CANNOT_RENDER 0x80040218
|
|
||||||
#define VFW_E_CHANGING_FORMAT 0x80040219
|
|
||||||
#define VFW_E_NO_COLOR_KEY_SET 0x8004021A
|
|
||||||
#define VFW_E_NOT_OVERLAY_CONNECTION 0x8004021B
|
|
||||||
#define VFW_E_NOT_SAMPLE_CONNECTION 0x8004021C
|
|
||||||
#define VFW_E_PALETTE_SET 0x8004021D
|
|
||||||
#define VFW_E_COLOR_KEY_SET 0x8004021E
|
|
||||||
#define VFW_E_NO_COLOR_KEY_FOUND 0x8004021F
|
|
||||||
#define VFW_E_NO_PALETTE_AVAILABLE 0x80040220
|
|
||||||
#define VFW_E_NO_DISPLAY_PALETTE 0x80040221
|
|
||||||
#define VFW_E_TOO_MANY_COLORS 0x80040222
|
|
||||||
#define VFW_E_STATE_CHANGED 0x80040223
|
|
||||||
#define VFW_E_NOT_STOPPED 0x80040224
|
|
||||||
#define VFW_E_NOT_PAUSED 0x80040225
|
|
||||||
#define VFW_E_NOT_RUNNING 0x80040226
|
|
||||||
#define VFW_E_WRONG_STATE 0x80040227
|
|
||||||
#define VFW_E_START_TIME_AFTER_END 0x80040228
|
|
||||||
#define VFW_E_INVALID_RECT 0x80040229
|
|
||||||
#define VFW_E_TYPE_NOT_ACCEPTED 0x8004022A
|
|
||||||
#define VFW_E_SAMPLE_REJECTED 0x8004022B
|
|
||||||
#define VFW_E_SAMPLE_REJECTED_EOS 0x8004022C
|
|
||||||
#define VFW_E_DUPLICATE_NAME 0x8004022D
|
|
||||||
#define VFW_E_TIMEOUT 0x8004022E
|
|
||||||
#define VFW_E_INVALID_FILE_FORMAT 0x8004022F
|
|
||||||
#define VFW_E_ENUM_OUT_OF_RANGE 0x80040230
|
|
||||||
#define VFW_E_CIRCULAR_GRAPH 0x80040231
|
|
||||||
#define VFW_E_NOT_ALLOWED_TO_SAVE 0x80040232
|
|
||||||
#define VFW_E_TIME_ALREADY_PASSED 0x80040233
|
|
||||||
#define VFW_E_ALREADY_CANCELLED 0x80040234
|
|
||||||
#define VFW_E_CORRUPT_GRAPH_FILE 0x80040235
|
|
||||||
#define VFW_E_ADVISE_ALREADY_SET 0x80040236
|
|
||||||
#define VFW_E_NO_MODEX_AVAILABLE 0x80040238
|
|
||||||
#define VFW_E_NO_ADVISE_SET 0x80040239
|
|
||||||
#define VFW_E_NO_FULLSCREEN 0x8004023A
|
|
||||||
#define VFW_E_IN_FULLSCREEN_MODE 0x8004023B
|
|
||||||
#define VFW_E_UNKNOWN_FILE_TYPE 0x80040240
|
|
||||||
#define VFW_E_CANNOT_LOAD_SOURCE_FILTER 0x80040241
|
|
||||||
#define VFW_E_FILE_TOO_SHORT 0x80040243
|
|
||||||
#define VFW_E_INVALID_FILE_VERSION 0x80040244
|
|
||||||
#define VFW_E_INVALID_CLSID 0x80040247
|
|
||||||
#define VFW_E_INVALID_MEDIA_TYPE 0x80040248
|
|
||||||
#define VFW_E_SAMPLE_TIME_NOT_SET 0x80040249
|
|
||||||
#define VFW_E_MEDIA_TIME_NOT_SET 0x80040251
|
|
||||||
#define VFW_E_NO_TIME_FORMAT_SET 0x80040252
|
|
||||||
#define VFW_E_MONO_AUDIO_HW 0x80040253
|
|
||||||
#define VFW_E_NO_DECOMPRESSOR 0x80040255
|
|
||||||
#define VFW_E_NO_AUDIO_HARDWARE 0x80040256
|
|
||||||
#define VFW_E_RPZA 0x80040259
|
|
||||||
#define VFW_E_PROCESSOR_NOT_SUITABLE 0x8004025B
|
|
||||||
#define VFW_E_UNSUPPORTED_AUDIO 0x8004025C
|
|
||||||
#define VFW_E_UNSUPPORTED_VIDEO 0x8004025D
|
|
||||||
#define VFW_E_MPEG_NOT_CONSTRAINED 0x8004025E
|
|
||||||
#define VFW_E_NOT_IN_GRAPH 0x8004025F
|
|
||||||
#define VFW_E_NO_TIME_FORMAT 0x80040261
|
|
||||||
#define VFW_E_READ_ONLY 0x80040262
|
|
||||||
#define VFW_E_BUFFER_UNDERFLOW 0x80040264
|
|
||||||
#define VFW_E_UNSUPPORTED_STREAM 0x80040265
|
|
||||||
#define VFW_E_NO_TRANSPORT 0x80040266
|
|
||||||
#define VFW_E_BAD_VIDEOCD 0x80040269
|
|
||||||
#define VFW_S_NO_STOP_TIME 0x80040270
|
|
||||||
#define VFW_E_OUT_OF_VIDEO_MEMORY 0x80040271
|
|
||||||
#define VFW_E_VP_NEGOTIATION_FAILED 0x80040272
|
|
||||||
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE 0x80040273
|
|
||||||
#define VFW_E_NO_VP_HARDWARE 0x80040274
|
|
||||||
#define VFW_E_NO_CAPTURE_HARDWARE 0x80040275
|
|
||||||
#define VFW_E_DVD_OPERATION_INHIBITED 0x80040276
|
|
||||||
#define VFW_E_DVD_INVALIDDOMAIN 0x80040277
|
|
||||||
#define VFW_E_DVD_NO_BUTTON 0x80040278
|
|
||||||
#define VFW_E_DVD_GRAPHNOTREADY 0x80040279
|
|
||||||
#define VFW_E_DVD_RENDERFAIL 0x8004027A
|
|
||||||
#define VFW_E_DVD_DECNOTENOUGH 0x8004027B
|
|
||||||
#define VFW_E_DDRAW_VERSION_NOT_SUITABLE 0x8004027C
|
|
||||||
#define VFW_E_COPYPROT_FAILED 0x8004027D
|
|
||||||
#define VFW_E_TIME_EXPIRED 0x8004027F
|
|
||||||
#define VFW_E_DVD_WRONG_SPEED 0x80040281
|
|
||||||
#define VFW_E_DVD_MENU_DOES_NOT_EXIST 0x80040282
|
|
||||||
#define VFW_E_DVD_CMD_CANCELLED 0x80040283
|
|
||||||
#define VFW_E_DVD_STATE_WRONG_VERSION 0x80040284
|
|
||||||
#define VFW_E_DVD_STATE_CORRUPT 0x80040285
|
|
||||||
#define VFW_E_DVD_STATE_WRONG_DISC 0x80040286
|
|
||||||
#define VFW_E_DVD_INCOMPATIBLE_REGION 0x80040287
|
|
||||||
#define VFW_E_DVD_NO_ATTRIBUTES 0x80040288
|
|
||||||
#define VFW_E_DVD_NO_GOUP_PGC 0x80040289
|
|
||||||
#define VFW_E_DVD_LOW_PARENTAL_LEVEL 0x8004028A
|
|
||||||
#define VFW_E_DVD_NOT_IN_KARAOKE_MODE 0x8004028B
|
|
||||||
#define VFW_E_FRAME_STEP_UNSUPPORTED 0x8004028E
|
|
||||||
#define VFW_E_DVD_STREAM_DISABLED 0x8004028F
|
|
||||||
#define VFW_E_DVD_TITLE_UNKNOWN 0x80040290
|
|
||||||
#define VFW_E_DVD_INVALID_DISC 0x80040291
|
|
||||||
#define VFW_E_DVD_NO_RESUME_INFORMATION 0x80040292
|
|
||||||
#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD 0x80040293
|
|
||||||
#define VFW_E_PIN_ALREADY_BLOCKED 0x80040294
|
|
||||||
#define VFW_E_CERTIFICATION_FAILURE 0x80040295
|
|
||||||
#define VFW_E_VMR_NOT_IN_MIXER_MODE 0x80040296
|
|
||||||
#define VFW_E_VMR_NO_AP_SUPPLIED 0x80040297
|
|
||||||
#define VFW_E_VMR_NO_DEINTERLACE_HW 0x80040298
|
|
||||||
#define VFW_E_VMR_NO_PROCAMP_HW 0x80040299
|
|
||||||
#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC 0x8004029A
|
|
||||||
#define VFW_E_NO_COPP_HW 0x8004029B
|
|
||||||
#define VFW_E_BAD_KEY 0x800403F2
|
|
||||||
/*--- DirectShow Reference - Functions */
|
|
||||||
#define MAX_ERROR_TEXT_LEN 160
|
|
||||||
/*--- DirectShow Reference - Functions */
|
|
||||||
DWORD WINAPI AMGetErrorTextA(HRESULT,CHAR*,DWORD);
|
|
||||||
DWORD WINAPI AMGetErrorTextW(HRESULT,WCHAR*,DWORD);
|
|
||||||
#ifdef UNICODE
|
|
||||||
#define AMGetErrorText AMGetErrorTextW
|
|
||||||
#else
|
|
||||||
#define AMGetErrorText AMGetErrorTextA
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
Vendored
-68
@@ -1,68 +0,0 @@
|
|||||||
#ifndef _EVCODE_H
|
|
||||||
#define _EVCODE_H
|
|
||||||
#if __GNUC__ >=3
|
|
||||||
#pragma GCC system_header
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--- DirectShow Reference - Constants and GUIDs - Event Notification Codes */
|
|
||||||
#define EC_ACTIVATE 0x0013
|
|
||||||
#define EC_BUFFERING_DATA 0x0011
|
|
||||||
#define EC_BUILT 0x0300
|
|
||||||
#define EC_CLOCK_CHANGED 0x000D
|
|
||||||
#define EC_CLOCK_UNSET 0x0051
|
|
||||||
#define EC_CODECAPI_EVENT 0x0057
|
|
||||||
#define EC_COMPLETE 0x0001
|
|
||||||
#define EC_DEVICE_LOST 0x001F
|
|
||||||
#define EC_DISPLAY_CHANGED 0x0016
|
|
||||||
#define EC_END_OF_SEGMENT 0x001C
|
|
||||||
#define EC_ERROR_STILLPLAYING 0x0008
|
|
||||||
#define EC_ERRORABORT 0x0003
|
|
||||||
#define EC_EXTDEVICE_MODE_CHANGE 0x0031
|
|
||||||
#define EC_FULLSCREEN_LOST 0x0012
|
|
||||||
#define EC_GRAPH_CHANGED 0x0050
|
|
||||||
#define EC_LENGTH_CHANGED 0x001E
|
|
||||||
#define EC_NEED_RESTART 0x0014
|
|
||||||
#define EC_NOTIFY_WINDOW 0x0019
|
|
||||||
#define EC_OLE_EVENT 0x0018
|
|
||||||
#define EC_OPENING_FILE 0x0010
|
|
||||||
#define EC_PALETTE_CHANGED 0x0009
|
|
||||||
#define EC_PAUSED 0x000E
|
|
||||||
#define EC_PREPROCESS_COMPLETE 0x0056
|
|
||||||
#define EC_QUALITY_CHANGE 0x000B
|
|
||||||
#define EC_REPAINT 0x0005
|
|
||||||
#define EC_SEGMENT_STARTED 0x001D
|
|
||||||
#define EC_SHUTTING_DOWN 0x000C
|
|
||||||
#define EC_SNDDEV_IN_ERROR 0x0200
|
|
||||||
#define EC_SNDDEV_OUT_ERROR 0x0201
|
|
||||||
#define EC_STARVATION 0x0017
|
|
||||||
#define EC_STATE_CHANGE 0x0032
|
|
||||||
#define EC_STEP_COMPLETE 0x0024
|
|
||||||
#define EC_STREAM_CONTROL_STARTED 0x001B
|
|
||||||
#define EC_STREAM_CONTROL_STOPPED 0x001A
|
|
||||||
#define EC_STREAM_ERROR_STILLPLAYING 0x0007
|
|
||||||
#define EC_STREAM_ERROR_STOPPED 0x0006
|
|
||||||
#define EC_TIMECODE_AVAILABLE 0x0030
|
|
||||||
#define EC_UNBUILT 0x0301
|
|
||||||
#define EC_USERABORT 0x0002
|
|
||||||
#define EC_VIDEO_SIZE_CHANGED 0x000A
|
|
||||||
#define EC_VMR_RENDERDEVICE_SET 0x0053
|
|
||||||
#define EC_VMR_SURFACE_FLIPPED 0x0054
|
|
||||||
#define EC_VMR_RECONNECTION_FAILED 0x0055
|
|
||||||
#define EC_WINDOW_DESTROYED 0x0015
|
|
||||||
#define EC_WMT_EVENT 0x0252
|
|
||||||
#define EC_WMT_INDEX_EVENT 0x0251
|
|
||||||
#define EC_USER 0x8000
|
|
||||||
/*--- DirectShow Reference - DirectShow Structures */
|
|
||||||
typedef struct {
|
|
||||||
HRESULT hrStatus;
|
|
||||||
void *pData;
|
|
||||||
} AM_WMT_EVENT_DATA;
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
Vendored
-191
@@ -1,191 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file has no copyright assigned and is placed in the Public Domain.
|
|
||||||
* This file is part of the w64 mingw-runtime package.
|
|
||||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
||||||
*/
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PACK,
|
|
||||||
0x36523B13,0x8EE5,0x11d1,0x8C,0xA3,0x00,0x60,0xB0,0x57,0x66,0x4A)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_PES,
|
|
||||||
0xe06d8020,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_WMDRM_TRANSPORT,
|
|
||||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VIDEO,
|
|
||||||
0xe06d8026,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_MPEG2_VIDEO,
|
|
||||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x5f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_VIDEOINFO2,
|
|
||||||
0xf72a76A0L,0xeb0a,0x11d0,0xac,0xe4,0x0,0x0,0xc0,0xcc,0x16,0xba)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PROGRAM,
|
|
||||||
0xe06d8022,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT,
|
|
||||||
0xe06d8023,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_AUDIO,
|
|
||||||
0xe06d802b,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3,
|
|
||||||
0xe06d802c,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_SUBPICTURE,
|
|
||||||
0xe06d802d,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_LPCM_AUDIO,
|
|
||||||
0xe06d8032,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_ENCRYPTED_PACK,
|
|
||||||
0xed0b916a,0x044d,0x11d1,0xaa,0x78,0x00,0xc0,0x04f,0xc3,0x1d,0x60)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_DVD_NAVIGATION,
|
|
||||||
0xe06d802e,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PCI,
|
|
||||||
0xe06d802f,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_DSI,
|
|
||||||
0xe06d8030,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVD_NAVIGATION_PROVIDER,
|
|
||||||
0xe06d8031,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_MPEG2Video,
|
|
||||||
0xe06d80e3,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_DolbyAC3,
|
|
||||||
0xe06d80e4,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_MPEG2Audio,
|
|
||||||
0xe06d80e5,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(FORMAT_DVD_LPCMAudio,
|
|
||||||
0xe06d80e6,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_AC3,
|
|
||||||
0xBFABE720,0x6E1F,0x11D0,0xBC,0xF2,0x44,0x45,0x53,0x54,0x00,0x00)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdSubPic,
|
|
||||||
0xac390460,0x43af,0x11d0,0xbd,0x6a,0x00,0x35,0x05,0xc1,0x03,0xa9)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_CopyProt,
|
|
||||||
0x0E8A0A40,0x6AEF,0x11D0,0x9E,0xD0,0x00,0xA0,0x24,0xCA,0x19,0xB3)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_TSRateChange,
|
|
||||||
0xa503c5c0,0x1d1d,0x11d1,0xad,0x80,0x44,0x45,0x53,0x54,0x0,0x0)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_MPEG4_MediaType_Attributes,
|
|
||||||
0xff6c4bfa,0x7a9,0x4c7b,0xa2,0x37,0x67,0x2f,0x9d,0x68,0x6,0x5f)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CAPTURE,
|
|
||||||
0x65E8773DL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_RENDER,
|
|
||||||
0x65E8773EL,0x8F56,0x11D0,0xA3,0xB9,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_DATACOMPRESSOR,
|
|
||||||
0x1E84C900L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_AUDIO,
|
|
||||||
0x6994AD04L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VIDEO,
|
|
||||||
0x6994AD05L,0x93EF,0x11D0,0xA3,0xCC,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVTUNER,
|
|
||||||
0xa799a800L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_CROSSBAR,
|
|
||||||
0xa799a801L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_TVAUDIO,
|
|
||||||
0xa799a802L,0xa46d,0x11d0,0xa1,0x8c,0x00,0xa0,0x24,0x01,0xdc,0xd4)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC,
|
|
||||||
0x07dad660L,0x22f1,0x11d1,0xa9,0xf4,0x00,0xc0,0x4f,0xbb,0xde,0x8f)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_SPLITTER,
|
|
||||||
0x0A4252A0L,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(IID_IKsInterfaceHandler,
|
|
||||||
0xD3ABC7E0L,0x9A61,0x11D0,0xA4,0x0D,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(IID_IKsDataTypeHandler,
|
|
||||||
0x5FFBAA02L,0x49A3,0x11D0,0x9F,0x36,0x00,0xAA,0x00,0xA2,0x16,0xA1)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(IID_IKsPin,
|
|
||||||
0xb61178d1L,0xa2d9,0x11cf,0x9e,0x53,0x00,0xaa,0x00,0xa2,0x16,0xa1)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(IID_IKsControl,
|
|
||||||
0x28F54685L,0x06FD,0x11D2,0xB2,0x7A,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(IID_IKsPinFactory,
|
|
||||||
0xCD5EBE6BL,0x8B6E,0x11D1,0x8A,0xE0,0x00,0xA0,0xC9,0x22,0x31,0x96)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_INTERFACESETID_Standard,
|
|
||||||
0x1A8766A0L,0x62CE,0x11CF,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
|
||||||
|
|
||||||
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG2_SECTIONS,
|
|
||||||
0x455f176c,0x4b06,0x47ce,0x9a,0xef,0x8c,0xae,0xf7,0x3d,0xf7,0xb5)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_VERSIONED_TABLES,
|
|
||||||
0x1ed988b0,0x3ffc,0x4523,0x87,0x25,0x34,0x7b,0xee,0xc1,0xa8,0xa0)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ATSC_SI,
|
|
||||||
0xb3c7397c,0xd303,0x414d,0xb3,0x3c,0x4e,0xd2,0xc9,0xd2,0x97,0x33)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVB_SI,
|
|
||||||
0xe9dd31a3,0x221d,0x4adb,0x85,0x32,0x9a,0xf3,0x9,0xc1,0xa4,0x8)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ISDB_SI,
|
|
||||||
0xe89ad298,0x3601,0x4b06,0xaa,0xec,0x9d,0xde,0xed,0xcc,0x5b,0xd0)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TIF_SI,
|
|
||||||
0xec232eb2,0xcb96,0x4191,0xb2,0x26,0xe,0xa1,0x29,0xf3,0x82,0x50)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2DATA,
|
|
||||||
0xc892e55b,0x252d,0x42b5,0xa3,0x16,0xd9,0x97,0xe7,0xa5,0xd9,0x95)
|
|
||||||
#endif
|
|
||||||
/* ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) ||
|
|
||||||
(NTDDI_VERSION >= NTDDI_WS03SP1) */
|
|
||||||
|
|
||||||
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_TRANSPORT_STRIDE,
|
|
||||||
0x138aa9a4,0x1ee2,0x4c5b,0x98,0x8e,0x19,0xab,0xfd,0xbc,0x8a,0x11)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_UDCR_TRANSPORT,
|
|
||||||
0x18BEC4EA,0x4676,0x450e,0xB4,0x78,0x0C,0xD8,0x4C,0x54,0xB3,0x27)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_RAW,
|
|
||||||
0x0d7aed42,0xcb9a,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG2_PBDA_TRANSPORT_PROCESSED,
|
|
||||||
0xaf748dd4,0xd80,0x11db,0x97,0x5,0x0,0x50,0x56,0xc0,0x0,0x8)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DTS,
|
|
||||||
0xe06d8033,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SDDS,
|
|
||||||
0xe06d8034,0xdb46,0x11cf,0xb4,0xd1,0x00,0x80,0x05f,0x6c,0xbb,0xea)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DVD_RateChange,
|
|
||||||
0x3577eb09,0x9582,0x477f,0xb2,0x9c,0xb0,0xc4,0x52,0xa4,0xff,0x9a)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_DvdKaraoke,
|
|
||||||
0xae4720ae,0xaa71,0x42d8,0xb8,0x2a,0xff,0xfd,0xf5,0x8b,0x76,0xfd)
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(AM_KSPROPSETID_FrameStep,
|
|
||||||
0xc830acbd,0xab07,0x492f,0x88,0x52,0x45,0xb6,0x98,0x7c,0x29,0x79)
|
|
||||||
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
|
|
||||||
|
|
||||||
#if (NTDDI_VERSION >= NTDDI_WS03SP1)
|
|
||||||
OUR_GUID_ENTRY(AM_KSCATEGORY_VBICODEC_MI,
|
|
||||||
0x9c24a977,0x951,0x451a,0x80,0x6,0xe,0x49,0xbd,0x28,0xcd,0x5f)
|
|
||||||
#endif /* NTDDI_VERSION >= NTDDI_WS03SP1 */
|
|
||||||
|
|
||||||
Vendored
-9392
File diff suppressed because it is too large
Load Diff
Vendored
-368
@@ -1,368 +0,0 @@
|
|||||||
/**
|
|
||||||
* This file has no copyright assigned and is placed in the Public Domain.
|
|
||||||
* This file is part of the w64 mingw-runtime package.
|
|
||||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
|
||||||
*/
|
|
||||||
#ifndef OUR_GUID_ENTRY
|
|
||||||
#define OUR_GUID_ENTRY(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MEDIATYPE_NULL GUID_NULL
|
|
||||||
#define MEDIASUBTYPE_NULL GUID_NULL
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_None,0xe436eb8e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Video,0x73646976,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Audio,0x73647561,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Text,0x73747874,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Midi,0x7364696D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Stream,0xe436eb83,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Interleaved,0x73766169,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_File,0x656c6966,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_ScriptCommand,0x73636d64,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_AUXLine21Data,0x670aea80,0x3a82,0x11d0,0xb7,0x9b,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_VBI,0xf72a76e1,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_Timecode,0x482dee3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_LMRT,0x74726c6d,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_URL_STREAM,0x736c7275,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLPL,0x4C504C43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUYV,0x56595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IYUV,0x56555949,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVU9,0x39555659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y411,0x31313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y41P,0x50313459,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YUY2,0x32595559,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YVYU,0x55595659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_UYVY,0x59565955,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Y211,0x31313259,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CLJR,0x524a4c43,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IF09,0x39304649,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CPLA,0x414c5043,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MJPG,0x47504A4D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TVMJ,0x4A4D5654,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAKE,0x454B4157,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_CFCC,0x43434643,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IJPG,0x47504A49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Plum,0x6D756C50,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVCS,0x53435644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DVSD,0x44535644,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MDVF,0x4656444D,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB1,0xe436eb78,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB4,0xe436eb79,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB8,0xe436eb7a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB565,0xe436eb7b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB555,0xe436eb7c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32,0xe436eb7e,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555,0x297c55af,0xe209,0x4cb3,0xb7,0x57,0xc7,0x6d,0x6b,0x9c,0x88,0xa8)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444,0x6e6415e6,0x5c24,0x425f,0x93,0xcd,0x80,0x10,0x2b,0x3d,0x1c,0xca)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32,0x773c9ac0,0x3274,0x11d0,0xb7,0x24,0x0,0xaa,0x0,0x6c,0x1a,0x1)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2R10G10B10,0x2f8bb76d,0xb644,0x4550,0xac,0xf3,0xd3,0x0c,0xaa,0x65,0xd5,0xc5)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_A2B10G10R10,0x576f7893,0xbdf6,0x48c4,0x87,0x5f,0xae,0x7b,0x81,0x83,0x45,0x67)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AYUV,0x56555941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AI44,0x34344941,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IA44,0x34344149,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX7_RT,0x32335237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX7_RT,0x36315237,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX7_RT,0x38384137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX7_RT,0x34344137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX7_RT,0x35314137,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB32_D3D_DX9_RT,0x32335239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RGB16_D3D_DX9_RT,0x36315239,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB32_D3D_DX9_RT,0x38384139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB4444_D3D_DX9_RT,0x34344139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_ARGB1555_D3D_DX9_RT,0x35314139,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
|
|
||||||
#define MEDIASUBTYPE_HASALPHA(mt) (((mt).subtype==MEDIASUBTYPE_ARGB4444) || ((mt).subtype==MEDIASUBTYPE_ARGB32) || ((mt).subtype==MEDIASUBTYPE_AYUV) || ((mt).subtype==MEDIASUBTYPE_AI44) || ((mt).subtype==MEDIASUBTYPE_IA44) || ((mt).subtype==MEDIASUBTYPE_ARGB1555) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
|
||||||
#define MEDIASUBTYPE_HASALPHA7(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT))
|
|
||||||
#define MEDIASUBTYPE_D3D_DX7_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX7_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX7_RT))
|
|
||||||
#define MEDIASUBTYPE_HASALPHA9(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT))
|
|
||||||
#define MEDIASUBTYPE_D3D_DX9_RT(mt) (((mt).subtype==MEDIASUBTYPE_ARGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB4444_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_ARGB1555_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB32_D3D_DX9_RT) || ((mt).subtype==MEDIASUBTYPE_RGB16_D3D_DX9_RT))
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_YV12,0x32315659,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_NV12,0x3231564E,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC1,0x31434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC2,0x32434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC3,0x33434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IMC4,0x34434D49,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S340,0x30343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_S342,0x32343353,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Overlay,0xe436eb7f,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Packet,0xe436eb80,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Payload,0xe436eb81,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1AudioPayload,0x00000050,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_MPEG1SystemStream,0xe436eb82,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1System,0xe436eb84,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1VideoCD,0xe436eb85,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Video,0xe436eb86,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_MPEG1Audio,0xe436eb87,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Avi,0xe436eb88,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Asf,0x3db80f90,0x9412,0x11d1,0xad,0xed,0x0,0x0,0xf8,0x75,0x4b,0x99)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTMovie,0xe436eb89,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRpza,0x617a7072,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTSmc,0x20636d73,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTRle,0x20656c72,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_QTJpeg,0x6765706a,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCMAudio_Obsolete,0xe436eb8a,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_PCM,0x00000001,0x0000,0x0010,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WAVE,0xe436eb8b,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AU,0xe436eb8c,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AIFF,0xe436eb8d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsd,0x64737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvhd,0x64687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvsl,0x6c737664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv25,0x35327664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dv50,0x30357664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_dvh1,0x31687664,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_BytePair,0x6e8d4a22,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_GOPPacket,0x6e8d4a23,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_Line21_VBIRawData,0x6e8d4a24,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_TELETEXT,0xf72a76e3,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_WSS,0x2791D576,0x8E7A,0x466F,0x9E,0x90,0x5D,0x3F,0x30,0x83,0x73,0x8B)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPS,0xa1b3f620,0x9792,0x4d8d,0x81,0xa4,0x86,0xaf,0x25,0x77,0x20,0x90)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DRM_Audio,0x00000009,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_IEEE_FLOAT,0x00000003,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DOLBY_AC3_SPDIF,0x00000092,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_RAW_SPORT,0x00000240,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_SPDIF_TAG_241h,0x00000241,0x0000,0x0010,0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssVideo,0xa0af4f81,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_DssAudio,0xa0af4f82,0xe163,0x11d0,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVideo,0x5a9b6a40,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_VPVBI,0x5a9b6a41,0x1a22,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder,0xBF87B6E0,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CaptureGraphBuilder2,0xBF87B6E1,0x8C27,0x11d0,0xB3,0xF0,0x0,0xAA,0x00,0x37,0x61,0xC5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ProtoFilterGraph,0xe436ebb0,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_SystemClock,0xe436ebb1,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FilterMapper,0xe436ebb2,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FilterGraph,0xe436ebb3,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FilterGraphNoThread,0xe436ebb8,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MPEG1Doc,0xe4bbd160,0x4269,0x11ce,0x83,0x8d,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FileSource,0x701722e0,0x8ae3,0x11ce,0xa8,0x5c,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MPEG1PacketPlayer,0x26c25940,0x4ca9,0x11ce,0xa8,0x28,0x0,0xaa,0x0,0x2f,0xea,0xb5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MPEG1Splitter,0x336475d0,0x942a,0x11ce,0xa8,0x70,0x00,0xaa,0x00,0x2f,0xea,0xb5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CMpegVideoCodec,0xfeb50740,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CMpegAudioCodec,0x4a2286e0,0x7bef,0x11ce,0x9b,0xd9,0x0,0x0,0xe2,0x2,0x59,0x9c)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TextRender,0xe30629d3,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
|
||||||
OUR_GUID_ENTRY(CLSID_InfTee,0xf8388a40,0xd5bb,0x11d0,0xbe,0x5a,0x0,0x80,0xc7,0x6,0x56,0x8e)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AviSplitter,0x1b544c20,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AviReader,0x1b544c21,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VfwCapture,0x1b544c22,0xfd0b,0x11ce,0x8c,0x63,0x0,0xaa,0x00,0x44,0xb5,0x1e)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CaptureProperties,0x1B544c22,0xFD0B,0x11ce,0x8C,0x63,0x00,0xAA,0x00,0x44,0xB5,0x1F)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FGControl,0xe436ebb4,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MOVReader,0x44584800,0xf8ee,0x11ce,0xb2,0xd4,0x00,0xdd,0x1,0x10,0x1b,0x85)
|
|
||||||
OUR_GUID_ENTRY(CLSID_QuickTimeParser,0xd51bd5a0,0x7548,0x11cf,0xa5,0x20,0x0,0x80,0xc7,0x7e,0xf5,0x8a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_QTDec,0xfdfe9681,0x74a3,0x11d0,0xaf,0xa7,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AVIDoc,0xd3588ab0,0x0781,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0xb,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoRenderer,0x70e102b0,0x5556,0x11ce,0x97,0xc0,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_Colour,0x1643e180,0x90f5,0x11ce,0x97,0xd5,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_Dither,0x1da08500,0x9edc,0x11cf,0xbc,0x10,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ModexRenderer,0x7167665,0x5011,0x11cf,0xbf,0x33,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioRender,0xe30629d1,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioProperties,0x05589faf,0xc356,0x11ce,0xbf,0x01,0x0,0xaa,0x0,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DSoundRender,0x79376820,0x07D0,0x11CF,0xA2,0x4D,0x0,0x20,0xAF,0xD7,0x97,0x67)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioRecord,0xe30629d2,0x27e5,0x11ce,0x87,0x5d,0x0,0x60,0x8c,0xb7,0x80,0x66)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioInputMixerProperties,0x2ca8ca52,0x3c3f,0x11d2,0xb7,0x3d,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AVIDec,0xcf49d4e0,0x1115,0x11ce,0xb0,0x3a,0x0,0x20,0xaf,0xb,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AVIDraw,0xa888df60,0x1e90,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ACMWrapper,0x6a08cf80,0x0e18,0x11cf,0xa2,0x4d,0x0,0x20,0xaf,0xd7,0x97,0x67)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AsyncReader,0xe436ebb5,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_URLReader,0xe436ebb6,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_PersistMonikerPID,0xe436ebb7,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf,0x0b,0xa7,0x70)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AVICo,0xd76e2820,0x1563,0x11cf,0xac,0x98,0x0,0xaa,0x0,0x4c,0xf,0xa9)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FileWriter,0x8596e5f0,0xda5,0x11d0,0xbd,0x21,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AviDest,0xe2510970,0xf137,0x11ce,0x8b,0x67,0x0,0xaa,0x0,0xa3,0xf1,0xa6)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage,0xc647b5c0,0x157c,0x11d0,0xbd,0x23,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AviMuxProptyPage1,0xa9ae910,0x85c0,0x11d0,0xbd,0x42,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AVIMIDIRender,0x07b65360,0xc445,0x11ce,0xaf,0xde,0x00,0xaa,0x00,0x6c,0x14,0xf4)
|
|
||||||
OUR_GUID_ENTRY(CLSID_WMAsfReader,0x187463a0,0x5bb7,0x11d3,0xac,0xbe,0x0,0x80,0xc7,0x5e,0x24,0x6e)
|
|
||||||
OUR_GUID_ENTRY(CLSID_WMAsfWriter,0x7c23220e,0x55bb,0x11d3,0x8b,0x16,0x0,0xc0,0x4f,0xb6,0xbd,0x3d)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MPEG2Demultiplexer,0xafb6c280,0x2c41,0x11d3,0x8a,0x60,0x00,0x00,0xf8,0x1e,0x0e,0x4a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MMSPLITTER,0x3ae86b20,0x7be8,0x11d1,0xab,0xe6,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
|
||||||
OUR_GUID_ENTRY(CLSID_StreamBufferSink,0x2db47ae5,0xcf39,0x43c2,0xb4,0xd6,0xc,0xd8,0xd9,0x9,0x46,0xf4)
|
|
||||||
OUR_GUID_ENTRY(CLSID_StreamBufferSource,0xc9f5fe02,0xf851,0x4eb5,0x99,0xee,0xad,0x60,0x2a,0xf1,0xe6,0x19)
|
|
||||||
OUR_GUID_ENTRY(CLSID_StreamBufferConfig,0xfa8a68b2,0xc864,0x4ba2,0xad,0x53,0xd3,0x87,0x6a,0x87,0x49,0x4b)
|
|
||||||
OUR_GUID_ENTRY(CLSID_Mpeg2VideoStreamAnalyzer,0x6cfad761,0x735d,0x4aa5,0x8a,0xfc,0xaf,0x91,0xa7,0xd6,0x1e,0xba)
|
|
||||||
OUR_GUID_ENTRY(CLSID_StreamBufferRecordingAttributes,0xccaa63ac,0x1057,0x4778,0xae,0x92,0x12,0x6,0xab,0x9a,0xce,0xe6)
|
|
||||||
OUR_GUID_ENTRY(CLSID_StreamBufferComposeRecording,0xd682c4ba,0xa90a,0x42fe,0xb9,0xe1,0x3,0x10,0x98,0x49,0xc4,0x23)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVVideoCodec,0xb1b77c00,0xc3e4,0x11cf,0xaf,0x79,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVVideoEnc,0x13aa3650,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVSplitter,0x4eb31670,0x9fc6,0x11cf,0xaf,0x6e,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVMux,0x129d7e40,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_SeekingPassThru,0x60af76c,0x68dd,0x11d0,0x8f,0xc1,0x0,0xc0,0x4f,0xd9,0x18,0x9d)
|
|
||||||
OUR_GUID_ENTRY(CLSID_Line21Decoder,0x6e8d4a20,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(CLSID_Line21Decoder2,0xe4206432,0x01a1,0x4bee,0xb3,0xe1,0x37,0x02,0xc8,0xed,0xc5,0x74)
|
|
||||||
OUR_GUID_ENTRY(CLSID_OverlayMixer,0xcd8743a1,0x3736,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VBISurfaces,0x814b9800,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_WSTDecoder,0x70bc06e0,0x5666,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MjpegDec,0x301056d0,0x6dff,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MJPGEnc,0xb80ab0a0,0x7416,0x11d2,0x9e,0xeb,0x0,0x60,0x8,0x3,0x9e,0x37)
|
|
||||||
OUR_GUID_ENTRY(CLSID_SystemDeviceEnum,0x62BE5D10,0x60EB,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CDeviceMoniker,0x4315D437,0x5B8C,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoInputDeviceCategory,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CVidCapClassManager,0x860BB310,0x5D01,0x11d0,0xBD,0x3B,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_LegacyAmFilterCategory,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CQzFilterClassManager,0x083863F1,0x70DE,0x11d0,0xBD,0x40,0x00,0xA0,0xC9,0x11,0xCE,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoCompressorCategory,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CIcmCoClassManager,0x33d9a760,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioCompressorCategory,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CAcmCoClassManager,0x33d9a761,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioInputDeviceCategory,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CWaveinClassManager,0x33d9a762,0x90c8,0x11d0,0xbd,0x43,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioRendererCategory,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CWaveOutClassManager,0xe0f158e1,0xcb04,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MidiRendererCategory,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CMidiOutClassManager,0x4EfE2452,0x168A,0x11d1,0xBC,0x76,0x0,0xc0,0x4F,0xB9,0x45,0x3B)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TransmitCategory,0xcc7bfb41,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DeviceControlCategory,0xcc7bfb46,0xf175,0x11d1,0xa3,0x92,0x0,0xe0,0x29,0x1f,0x39,0x59)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ActiveMovieCategories,0xda4e3da0,0xd07d,0x11d0,0xbd,0x50,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVDHWDecodersCategory,0x2721AE20,0x7E70,0x11D0,0xA5,0xD6,0x28,0xDB,0x04,0xC1,0x00,0x00)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MediaEncoderCategory,0x7D22E920,0x5CA9,0x4787,0x8C,0x2B,0xA6,0x77,0x9B,0xD1,0x17,0x81)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MediaMultiplexerCategory,0x236C9559,0xADCE,0x4736,0xBF,0x72,0xBA,0xB3,0x4E,0x39,0x21,0x96)
|
|
||||||
OUR_GUID_ENTRY(CLSID_FilterMapper2,0xcda42200,0xbd88,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MemoryAllocator,0x1e651cc0,0xb199,0x11d0,0x82,0x12,0x00,0xc0,0x4f,0xc3,0x2c,0x45)
|
|
||||||
OUR_GUID_ENTRY(CLSID_MediaPropertyBag,0xcdbd8d00,0xc193,0x11d0,0xbd,0x4e,0x0,0xa0,0xc9,0x11,0xce,0x86)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DvdGraphBuilder,0xFCC152B7,0xF372,0x11d0,0x8E,0x00,0x00,0xC0,0x4F,0xD7,0xC0,0x8B)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVDNavigator,0x9b8c4620,0x2c1a,0x11d0,0x84,0x93,0x0,0xa0,0x24,0x38,0xad,0x48)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVDState,0xf963c5cf,0xa659,0x4a93,0x96,0x38,0xca,0xf3,0xcd,0x27,0x7d,0x13)
|
|
||||||
OUR_GUID_ENTRY(CLSID_SmartTee,0xcc58e280,0x8aa1,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_None,0x0F6417D6,0xc318,0x11d0,0xa4,0x3f,0x00,0xa0,0xc9,0x22,0x31,0x96)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_VideoInfo,0x05589f80,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_VideoInfo2,0xf72a76A0,0xeb0a,0x11d0,0xac,0xe4,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_WaveFormatEx,0x05589f81,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_MPEGVideo,0x05589f82,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_MPEGStreams,0x05589f83,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_DvInfo,0x05589f84,0xc356,0x11ce,0xbf,0x01,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DirectDrawProperties,0x944d4c00,0xdd52,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_PerformanceProperties,0x59ce6880,0xacf8,0x11cf,0xb5,0x6e,0x00,0x80,0xc7,0xc4,0xb6,0x8a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_QualityProperties,0x418afb70,0xf8b8,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
|
||||||
OUR_GUID_ENTRY(IID_IBaseVideoMixer,0x61ded640,0xe912,0x11ce,0xa0,0x99,0x00,0xaa,0x00,0x47,0x9a,0x58)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawVideo,0x36d39eb0,0xdd75,0x11ce,0xbf,0x0e,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(IID_IQualProp,0x1bd0ecb0,0xf8e2,0x11ce,0xaa,0xc6,0x00,0x20,0xaf,0x0b,0x99,0xa3)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VPObject,0xce292861,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPObject,0xce292862,0xfc88,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPControl,0x25df12c1,0x3de0,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VPVBIObject,0x814b9801,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPVBIObject,0x814b9802,0x1c88,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPConfig,0xbc29a660,0x30e3,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPNotify,0xc76794a1,0xd6c5,0x11d0,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPNotify2,0xebf47183,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPVBIConfig,0xec529b00,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(IID_IVPVBINotify,0xec529b01,0x1a1f,0x11d1,0xba,0xd9,0x0,0x60,0x97,0x44,0x11,0x1a)
|
|
||||||
OUR_GUID_ENTRY(IID_IMixerPinConfig,0x593cdde1,0x759,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IMixerPinConfig2,0xebf47182,0x8764,0x11d1,0x9e,0x69,0x0,0xc0,0x4f,0xd7,0xc1,0x5b)
|
|
||||||
#ifndef __DDRAW_INCLUDED__
|
|
||||||
OUR_GUID_ENTRY(CLSID_DirectDraw,0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DirectDrawClipper,0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDraw,0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDraw2,0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface,0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface2,0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface3,0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface4,0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurface7,0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawPalette,0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawClipper,0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
|
||||||
#endif
|
|
||||||
#ifndef __DVP_INCLUDED__
|
|
||||||
OUR_GUID_ENTRY(IID_IDDVideoPortContainer,0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60)
|
|
||||||
#endif
|
|
||||||
#ifndef __DDKM_INCLUDED__
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawKernel,0x8D56C120,0x6A08,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
|
||||||
OUR_GUID_ENTRY(IID_IDirectDrawSurfaceKernel,0x60755DA0,0x6A40,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8)
|
|
||||||
#endif
|
|
||||||
OUR_GUID_ENTRY(CLSID_ModexProperties,0x0618aa30,0x6bc4,0x11cf,0xbf,0x36,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(IID_IFullScreenVideo,0xdd1d7110,0x7836,0x11cf,0xbf,0x47,0x00,0xaa,0x00,0x55,0x59,0x5a)
|
|
||||||
OUR_GUID_ENTRY(IID_IFullScreenVideoEx,0x53479470,0xf1dd,0x11cf,0xbc,0x42,0x00,0xaa,0x00,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVDecPropertiesPage,0x101193c0,0xbfe,0x11d0,0xaf,0x91,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVEncPropertiesPage,0x4150f050,0xbb6f,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVMuxPropertyPage,0x4db880e0,0xc10d,0x11d0,0xaf,0xb9,0x0,0xaa,0x0,0xb6,0x7a,0x42)
|
|
||||||
OUR_GUID_ENTRY(IID_IAMDirectSound,0x546f4260,0xd53e,0x11cf,0xb3,0xf0,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
|
||||||
OUR_GUID_ENTRY(IID_IMpegAudioDecoder,0xb45dd570,0x3c77,0x11d1,0xab,0xe1,0x00,0xa0,0xc9,0x05,0xf3,0x75)
|
|
||||||
OUR_GUID_ENTRY(IID_IAMLine21Decoder,0x6e8d4a21,0x310c,0x11d0,0xb7,0x9a,0x0,0xaa,0x0,0x37,0x67,0xa7)
|
|
||||||
OUR_GUID_ENTRY(IID_IAMWstDecoder,0xc056de21,0x75c2,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
|
||||||
OUR_GUID_ENTRY(CLSID_WstDecoderPropertyPage,0x4e27f80,0x91e4,0x11d3,0xa1,0x84,0x0,0x10,0x5a,0xef,0x9f,0x33)
|
|
||||||
OUR_GUID_ENTRY(FORMAT_AnalogVideo,0x482dde0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogVideo,0x482dde1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_NTSC_M,0x482dde2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_B,0x482dde5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_D,0x482dde6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_G,0x482dde7,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_H,0x482dde8,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_I,0x482dde9,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_M,0x482ddea,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N,0x482ddeb,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_PAL_N_COMBO,0x482ddec,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_B,0x482ddf0,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_D,0x482ddf1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_G,0x482ddf2,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_H,0x482ddf3,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K,0x482ddf4,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_K1,0x482ddf5,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIASUBTYPE_AnalogVideo_SECAM_L,0x482ddf6,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(MEDIATYPE_AnalogAudio,0x482dee1,0x7817,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
|
|
||||||
#include "dshow/ksuuids.h"
|
|
||||||
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_NONE,0L,0,0,0,0,0,0,0,0,0,0)
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_FRAME,0x7b785570,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_BYTE,0x7b785571,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_SAMPLE,0x7b785572,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_FIELD,0x7b785573,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(TIME_FORMAT_MEDIA_TIME,0x7b785574,0x8c82,0x11cf,0xbc,0xc,0x0,0xaa,0x0,0xac,0x74,0xf6)
|
|
||||||
OUR_GUID_ENTRY(AMPROPSETID_Pin,0x9b00f101,0x1567,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_CAPTURE,0xfb6c4281,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_PREVIEW,0xfb6c4282,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_ANALOGVIDEOIN,0xfb6c4283,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_VBI,0xfb6c4284,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT,0xfb6c4285,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_NABTS,0xfb6c4286,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_EDS,0xfb6c4287,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_TELETEXT,0xfb6c4288,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_CC,0xfb6c4289,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_STILL,0xfb6c428a,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_TIMECODE,0xfb6c428b,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(PIN_CATEGORY_VIDEOPORT_VBI,0xfb6c428c,0x0353,0x11d1,0x90,0x5f,0x00,0x00,0xc0,0xcc,0x16,0xba)
|
|
||||||
OUR_GUID_ENTRY(LOOK_UPSTREAM_ONLY,0xac798be0,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
|
||||||
OUR_GUID_ENTRY(LOOK_DOWNSTREAM_ONLY,0xac798be1,0x98e3,0x11d1,0xb3,0xf1,0x0,0xaa,0x0,0x37,0x61,0xc5)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TVTunerFilterPropertyPage,0x266eee41,0x6c63,0x11cf,0x8a,0x3,0x0,0xaa,0x0,0x6e,0xcb,0x65)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage,0x71f96461,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage,0x71f96463,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage,0x71f96464,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage,0x71f96465,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage,0x71f96466,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage,0x71f96467,0x78f3,0x11d0,0xa1,0x8c,0x0,0xa0,0xc9,0x11,0x89,0x56)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AudioRendererAdvancedProperties,0x37e92a92,0xd9aa,0x11d2,0xbf,0x84,0x8e,0xf2,0xb1,0x55,0x5a,0xed)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer,0xB87BEB7B,0x8D29,0x423f,0xAE,0x4D,0x65,0x82,0xC1,0x01,0x75,0xAC)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoRendererDefault,0x6BC1CFFA,0x8FC1,0x4261,0xAC,0x22,0xCF,0xB4,0xCC,0x38,0xDB,0x50)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AllocPresenter,0x99d54f63,0x1a69,0x41ae,0xaa,0x4d,0xc9,0x76,0xeb,0x3f,0x07,0x13)
|
|
||||||
OUR_GUID_ENTRY(CLSID_AllocPresenterDDXclMode,0x4444ac9e,0x242e,0x471b,0xa3,0xc7,0x45,0xdc,0xd4,0x63,0x52,0xbc)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoPortManager,0x6f26a6cd,0x967b,0x47fd,0x87,0x4a,0x7a,0xed,0x2c,0x9d,0x25,0xa2)
|
|
||||||
OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9,0x51b4abf3,0x748f,0x4e3b,0xa2,0x76,0xc8,0x28,0x33,0x0e,0x92,0x6a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkProvider,0x0dad2fdd,0x5fd7,0x11d3,0x8f,0x50,0x00,0xc0,0x4f,0x79,0x71,0xe2)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ATSCNetworkPropertyPage,0xe3444d16,0x5ac4,0x4386,0x88,0xdf,0x13,0xfd,0x23,0x0e,0x1d,0xda)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVBSNetworkProvider,0xfa4b375a,0x45b4,0x4d45,0x84,0x40,0x26,0x39,0x57,0xb1,0x16,0x23)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVBTNetworkProvider,0x216c62df,0x6d7f,0x4e9a,0x85,0x71,0x5,0xf1,0x4e,0xdb,0x76,0x6a)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DVBCNetworkProvider,0xdc0c0fe7,0x485,0x4266,0xb9,0x3f,0x68,0xfb,0xf8,0xe,0xd8,0x34)
|
|
||||||
OUR_GUID_ENTRY(CLSID_DShowTVEFilter,0x05500280,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TVEFilterTuneProperties,0x05500281,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TVEFilterCCProperties,0x05500282,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
|
||||||
OUR_GUID_ENTRY(CLSID_TVEFilterStatsProperties,0x05500283,0xFAA5,0x4DF9,0x82,0x46,0xBF,0xC2,0x3A,0xC5,0xCE,0xA8)
|
|
||||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderProxy,0xb43c4eec,0x8c32,0x4791,0x91,0x2,0x50,0x8a,0xda,0x5e,0xe8,0xe7)
|
|
||||||
OUR_GUID_ENTRY(CLSID_ICodecAPIProxy,0x7ff0997a,0x1999,0x4286,0xa7,0x3c,0x62,0x2b,0x88,0x14,0xe7,0xeb)
|
|
||||||
OUR_GUID_ENTRY(CLSID_IVideoEncoderCodecAPIProxy,0xb05dabd9,0x56e5,0x4fdc,0xaf,0xa4,0x8a,0x47,0xe9,0x1f,0x1c,0x9c)
|
|
||||||
|
|
||||||
#ifndef __ENCODER_API_GUIDS__
|
|
||||||
#define __ENCODER_API_GUIDS__
|
|
||||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE,0x49cc4c43,0xca83,0x4ad4,0xa9,0xaf,0xf3,0x69,0x6a,0xf6,0x66,0xdf)
|
|
||||||
OUR_GUID_ENTRY(ENCAPIPARAM_PEAK_BITRATE,0x703f16a9,0x3d48,0x44a1,0xb0,0x77,0x1,0x8d,0xff,0x91,0x5d,0x19)
|
|
||||||
OUR_GUID_ENTRY(ENCAPIPARAM_BITRATE_MODE,0xee5fb25c,0xc713,0x40d1,0x9d,0x58,0xc0,0xd7,0x24,0x1e,0x25,0xf)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_CHANGELISTS,0x62b12acf,0xf6b0,0x47d9,0x94,0x56,0x96,0xf2,0x2c,0x4e,0x0b,0x9d)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_VIDEO_ENCODER,0x7112e8e1,0x3d03,0x47ef,0x8e,0x60,0x03,0xf1,0xcf,0x53,0x73,0x01)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_AUDIO_ENCODER,0xb9d19a3e,0xf897,0x429c,0xbc,0x46,0x81,0x38,0xb7,0x27,0x2b,0x2d)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_SETALLDEFAULTS,0x6c5e6a7c,0xacf8,0x4f55,0xa9,0x99,0x1a,0x62,0x81,0x09,0x05,0x1b)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_ALLSETTINGS,0x6a577e92,0x83e1,0x4113,0xad,0xc2,0x4f,0xce,0xc3,0x2f,0x83,0xa1)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_SUPPORTSEVENTS,0x0581af97,0x7693,0x4dbd,0x9d,0xca,0x3f,0x9e,0xbd,0x65,0x85,0xa1)
|
|
||||||
OUR_GUID_ENTRY(CODECAPI_CURRENTCHANGELIST,0x1cb14e83,0x7d72,0x4657,0x83,0xfd,0x47,0xa2,0xc5,0xb9,0xd1,0x3d)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef OUR_GUID_ENTRY
|
|
||||||
Vendored
-301
@@ -1,301 +0,0 @@
|
|||||||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
|
||||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
|
||||||
//
|
|
||||||
// Copyright (c) 2006 Alexander Chemeris
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
// this list of conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer in the
|
|
||||||
// documentation and/or other materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// 3. The name of the author may be used to endorse or promote products
|
|
||||||
// derived from this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef _MSC_VER // [
|
|
||||||
#error "Use this header only with Microsoft Visual C++ compilers!"
|
|
||||||
#endif // _MSC_VER ]
|
|
||||||
|
|
||||||
#ifndef _MSC_INTTYPES_H_ // [
|
|
||||||
#define _MSC_INTTYPES_H_
|
|
||||||
|
|
||||||
#if _MSC_VER > 1000
|
|
||||||
#pragma once
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <msc_stdint.h>
|
|
||||||
|
|
||||||
// 7.8 Format conversion of integer types
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
intmax_t quot;
|
|
||||||
intmax_t rem;
|
|
||||||
} imaxdiv_t;
|
|
||||||
|
|
||||||
// 7.8.1 Macros for format specifiers
|
|
||||||
|
|
||||||
// The fprintf macros for signed integers are:
|
|
||||||
#define PRId8 "d"
|
|
||||||
#define PRIi8 "i"
|
|
||||||
#define PRIdLEAST8 "d"
|
|
||||||
#define PRIiLEAST8 "i"
|
|
||||||
#define PRIdFAST8 "d"
|
|
||||||
#define PRIiFAST8 "i"
|
|
||||||
|
|
||||||
#define PRId16 "hd"
|
|
||||||
#define PRIi16 "hi"
|
|
||||||
#define PRIdLEAST16 "hd"
|
|
||||||
#define PRIiLEAST16 "hi"
|
|
||||||
#define PRIdFAST16 "hd"
|
|
||||||
#define PRIiFAST16 "hi"
|
|
||||||
|
|
||||||
#define PRId32 "I32d"
|
|
||||||
#define PRIi32 "I32i"
|
|
||||||
#define PRIdLEAST32 "I32d"
|
|
||||||
#define PRIiLEAST32 "I32i"
|
|
||||||
#define PRIdFAST32 "I32d"
|
|
||||||
#define PRIiFAST32 "I32i"
|
|
||||||
|
|
||||||
#define PRId64 "I64d"
|
|
||||||
#define PRIi64 "I64i"
|
|
||||||
#define PRIdLEAST64 "I64d"
|
|
||||||
#define PRIiLEAST64 "I64i"
|
|
||||||
#define PRIdFAST64 "I64d"
|
|
||||||
#define PRIiFAST64 "I64i"
|
|
||||||
|
|
||||||
#define PRIdMAX "I64d"
|
|
||||||
#define PRIiMAX "I64i"
|
|
||||||
|
|
||||||
#define PRIdPTR "Id"
|
|
||||||
#define PRIiPTR "Ii"
|
|
||||||
|
|
||||||
// The fprintf macros for unsigned integers are:
|
|
||||||
#define PRIo8 "o"
|
|
||||||
#define PRIu8 "u"
|
|
||||||
#define PRIx8 "x"
|
|
||||||
#define PRIX8 "X"
|
|
||||||
#define PRIoLEAST8 "o"
|
|
||||||
#define PRIuLEAST8 "u"
|
|
||||||
#define PRIxLEAST8 "x"
|
|
||||||
#define PRIXLEAST8 "X"
|
|
||||||
#define PRIoFAST8 "o"
|
|
||||||
#define PRIuFAST8 "u"
|
|
||||||
#define PRIxFAST8 "x"
|
|
||||||
#define PRIXFAST8 "X"
|
|
||||||
|
|
||||||
#define PRIo16 "ho"
|
|
||||||
#define PRIu16 "hu"
|
|
||||||
#define PRIx16 "hx"
|
|
||||||
#define PRIX16 "hX"
|
|
||||||
#define PRIoLEAST16 "ho"
|
|
||||||
#define PRIuLEAST16 "hu"
|
|
||||||
#define PRIxLEAST16 "hx"
|
|
||||||
#define PRIXLEAST16 "hX"
|
|
||||||
#define PRIoFAST16 "ho"
|
|
||||||
#define PRIuFAST16 "hu"
|
|
||||||
#define PRIxFAST16 "hx"
|
|
||||||
#define PRIXFAST16 "hX"
|
|
||||||
|
|
||||||
#define PRIo32 "I32o"
|
|
||||||
#define PRIu32 "I32u"
|
|
||||||
#define PRIx32 "I32x"
|
|
||||||
#define PRIX32 "I32X"
|
|
||||||
#define PRIoLEAST32 "I32o"
|
|
||||||
#define PRIuLEAST32 "I32u"
|
|
||||||
#define PRIxLEAST32 "I32x"
|
|
||||||
#define PRIXLEAST32 "I32X"
|
|
||||||
#define PRIoFAST32 "I32o"
|
|
||||||
#define PRIuFAST32 "I32u"
|
|
||||||
#define PRIxFAST32 "I32x"
|
|
||||||
#define PRIXFAST32 "I32X"
|
|
||||||
|
|
||||||
#define PRIo64 "I64o"
|
|
||||||
#define PRIu64 "I64u"
|
|
||||||
#define PRIx64 "I64x"
|
|
||||||
#define PRIX64 "I64X"
|
|
||||||
#define PRIoLEAST64 "I64o"
|
|
||||||
#define PRIuLEAST64 "I64u"
|
|
||||||
#define PRIxLEAST64 "I64x"
|
|
||||||
#define PRIXLEAST64 "I64X"
|
|
||||||
#define PRIoFAST64 "I64o"
|
|
||||||
#define PRIuFAST64 "I64u"
|
|
||||||
#define PRIxFAST64 "I64x"
|
|
||||||
#define PRIXFAST64 "I64X"
|
|
||||||
|
|
||||||
#define PRIoMAX "I64o"
|
|
||||||
#define PRIuMAX "I64u"
|
|
||||||
#define PRIxMAX "I64x"
|
|
||||||
#define PRIXMAX "I64X"
|
|
||||||
|
|
||||||
#define PRIoPTR "Io"
|
|
||||||
#define PRIuPTR "Iu"
|
|
||||||
#define PRIxPTR "Ix"
|
|
||||||
#define PRIXPTR "IX"
|
|
||||||
|
|
||||||
// The fscanf macros for signed integers are:
|
|
||||||
#define SCNd8 "d"
|
|
||||||
#define SCNi8 "i"
|
|
||||||
#define SCNdLEAST8 "d"
|
|
||||||
#define SCNiLEAST8 "i"
|
|
||||||
#define SCNdFAST8 "d"
|
|
||||||
#define SCNiFAST8 "i"
|
|
||||||
|
|
||||||
#define SCNd16 "hd"
|
|
||||||
#define SCNi16 "hi"
|
|
||||||
#define SCNdLEAST16 "hd"
|
|
||||||
#define SCNiLEAST16 "hi"
|
|
||||||
#define SCNdFAST16 "hd"
|
|
||||||
#define SCNiFAST16 "hi"
|
|
||||||
|
|
||||||
#define SCNd32 "ld"
|
|
||||||
#define SCNi32 "li"
|
|
||||||
#define SCNdLEAST32 "ld"
|
|
||||||
#define SCNiLEAST32 "li"
|
|
||||||
#define SCNdFAST32 "ld"
|
|
||||||
#define SCNiFAST32 "li"
|
|
||||||
|
|
||||||
#define SCNd64 "I64d"
|
|
||||||
#define SCNi64 "I64i"
|
|
||||||
#define SCNdLEAST64 "I64d"
|
|
||||||
#define SCNiLEAST64 "I64i"
|
|
||||||
#define SCNdFAST64 "I64d"
|
|
||||||
#define SCNiFAST64 "I64i"
|
|
||||||
|
|
||||||
#define SCNdMAX "I64d"
|
|
||||||
#define SCNiMAX "I64i"
|
|
||||||
|
|
||||||
#ifdef _WIN64 // [
|
|
||||||
# define SCNdPTR "I64d"
|
|
||||||
# define SCNiPTR "I64i"
|
|
||||||
#else // _WIN64 ][
|
|
||||||
# define SCNdPTR "ld"
|
|
||||||
# define SCNiPTR "li"
|
|
||||||
#endif // _WIN64 ]
|
|
||||||
|
|
||||||
// The fscanf macros for unsigned integers are:
|
|
||||||
#define SCNo8 "o"
|
|
||||||
#define SCNu8 "u"
|
|
||||||
#define SCNx8 "x"
|
|
||||||
#define SCNX8 "X"
|
|
||||||
#define SCNoLEAST8 "o"
|
|
||||||
#define SCNuLEAST8 "u"
|
|
||||||
#define SCNxLEAST8 "x"
|
|
||||||
#define SCNXLEAST8 "X"
|
|
||||||
#define SCNoFAST8 "o"
|
|
||||||
#define SCNuFAST8 "u"
|
|
||||||
#define SCNxFAST8 "x"
|
|
||||||
#define SCNXFAST8 "X"
|
|
||||||
|
|
||||||
#define SCNo16 "ho"
|
|
||||||
#define SCNu16 "hu"
|
|
||||||
#define SCNx16 "hx"
|
|
||||||
#define SCNX16 "hX"
|
|
||||||
#define SCNoLEAST16 "ho"
|
|
||||||
#define SCNuLEAST16 "hu"
|
|
||||||
#define SCNxLEAST16 "hx"
|
|
||||||
#define SCNXLEAST16 "hX"
|
|
||||||
#define SCNoFAST16 "ho"
|
|
||||||
#define SCNuFAST16 "hu"
|
|
||||||
#define SCNxFAST16 "hx"
|
|
||||||
#define SCNXFAST16 "hX"
|
|
||||||
|
|
||||||
#define SCNo32 "lo"
|
|
||||||
#define SCNu32 "lu"
|
|
||||||
#define SCNx32 "lx"
|
|
||||||
#define SCNX32 "lX"
|
|
||||||
#define SCNoLEAST32 "lo"
|
|
||||||
#define SCNuLEAST32 "lu"
|
|
||||||
#define SCNxLEAST32 "lx"
|
|
||||||
#define SCNXLEAST32 "lX"
|
|
||||||
#define SCNoFAST32 "lo"
|
|
||||||
#define SCNuFAST32 "lu"
|
|
||||||
#define SCNxFAST32 "lx"
|
|
||||||
#define SCNXFAST32 "lX"
|
|
||||||
|
|
||||||
#define SCNo64 "I64o"
|
|
||||||
#define SCNu64 "I64u"
|
|
||||||
#define SCNx64 "I64x"
|
|
||||||
#define SCNX64 "I64X"
|
|
||||||
#define SCNoLEAST64 "I64o"
|
|
||||||
#define SCNuLEAST64 "I64u"
|
|
||||||
#define SCNxLEAST64 "I64x"
|
|
||||||
#define SCNXLEAST64 "I64X"
|
|
||||||
#define SCNoFAST64 "I64o"
|
|
||||||
#define SCNuFAST64 "I64u"
|
|
||||||
#define SCNxFAST64 "I64x"
|
|
||||||
#define SCNXFAST64 "I64X"
|
|
||||||
|
|
||||||
#define SCNoMAX "I64o"
|
|
||||||
#define SCNuMAX "I64u"
|
|
||||||
#define SCNxMAX "I64x"
|
|
||||||
#define SCNXMAX "I64X"
|
|
||||||
|
|
||||||
#ifdef _WIN64 // [
|
|
||||||
# define SCNoPTR "I64o"
|
|
||||||
# define SCNuPTR "I64u"
|
|
||||||
# define SCNxPTR "I64x"
|
|
||||||
# define SCNXPTR "I64X"
|
|
||||||
#else // _WIN64 ][
|
|
||||||
# define SCNoPTR "lo"
|
|
||||||
# define SCNuPTR "lu"
|
|
||||||
# define SCNxPTR "lx"
|
|
||||||
# define SCNXPTR "lX"
|
|
||||||
#endif // _WIN64 ]
|
|
||||||
|
|
||||||
// 7.8.2 Functions for greatest-width integer types
|
|
||||||
|
|
||||||
// 7.8.2.1 The imaxabs function
|
|
||||||
#define imaxabs _abs64
|
|
||||||
|
|
||||||
// 7.8.2.2 The imaxdiv function
|
|
||||||
|
|
||||||
// This is modified version of div() function from Microsoft's div.c found
|
|
||||||
// in %MSVC.NET%\crt\src\div.c
|
|
||||||
#ifdef STATIC_IMAXDIV // [
|
|
||||||
static
|
|
||||||
#else // STATIC_IMAXDIV ][
|
|
||||||
_inline
|
|
||||||
#endif // STATIC_IMAXDIV ]
|
|
||||||
imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
|
|
||||||
{
|
|
||||||
imaxdiv_t result;
|
|
||||||
|
|
||||||
result.quot = numer / denom;
|
|
||||||
result.rem = numer % denom;
|
|
||||||
|
|
||||||
if (numer < 0 && result.rem > 0) {
|
|
||||||
// did division wrong; must fix up
|
|
||||||
++result.quot;
|
|
||||||
result.rem -= denom;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 7.8.2.3 The strtoimax and strtoumax functions
|
|
||||||
#define strtoimax _strtoi64
|
|
||||||
#define strtoumax _strtoui64
|
|
||||||
|
|
||||||
// 7.8.2.4 The wcstoimax and wcstoumax functions
|
|
||||||
#define wcstoimax _wcstoi64
|
|
||||||
#define wcstoumax _wcstoui64
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _MSC_INTTYPES_H_ ]
|
|
||||||
Vendored
-219
@@ -1,219 +0,0 @@
|
|||||||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
|
||||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
|
||||||
//
|
|
||||||
// Copyright (c) 2006 Alexander Chemeris
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// 1. Redistributions of source code must retain the above copyright notice,
|
|
||||||
// this list of conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer in the
|
|
||||||
// documentation and/or other materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// 3. The name of the author may be used to endorse or promote products
|
|
||||||
// derived from this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
#ifndef _MSC_STDINT_H_ // [
|
|
||||||
#define _MSC_STDINT_H_
|
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
|
|
||||||
// or compiler give many errors like this:
|
|
||||||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
|
||||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
|
||||||
extern "C++" {
|
|
||||||
#endif
|
|
||||||
# include <wchar.h>
|
|
||||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined __GNUC__ || _MSC_VER >= 1600
|
|
||||||
#include "stdint.h"
|
|
||||||
#else
|
|
||||||
|
|
||||||
// 7.18.1 Integer types
|
|
||||||
|
|
||||||
// 7.18.1.1 Exact-width integer types
|
|
||||||
typedef __int8 int8_t;
|
|
||||||
typedef __int16 int16_t;
|
|
||||||
typedef __int32 int32_t;
|
|
||||||
typedef __int64 int64_t;
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
|
|
||||||
// 7.18.1.2 Minimum-width integer types
|
|
||||||
typedef int8_t int_least8_t;
|
|
||||||
typedef int16_t int_least16_t;
|
|
||||||
typedef int32_t int_least32_t;
|
|
||||||
typedef int64_t int_least64_t;
|
|
||||||
typedef uint8_t uint_least8_t;
|
|
||||||
typedef uint16_t uint_least16_t;
|
|
||||||
typedef uint32_t uint_least32_t;
|
|
||||||
typedef uint64_t uint_least64_t;
|
|
||||||
|
|
||||||
// 7.18.1.3 Fastest minimum-width integer types
|
|
||||||
typedef int8_t int_fast8_t;
|
|
||||||
typedef int16_t int_fast16_t;
|
|
||||||
typedef int32_t int_fast32_t;
|
|
||||||
typedef int64_t int_fast64_t;
|
|
||||||
typedef uint8_t uint_fast8_t;
|
|
||||||
typedef uint16_t uint_fast16_t;
|
|
||||||
typedef uint32_t uint_fast32_t;
|
|
||||||
typedef uint64_t uint_fast64_t;
|
|
||||||
|
|
||||||
// 7.18.1.4 Integer types capable of holding object pointers
|
|
||||||
#ifdef _WIN64 // [
|
|
||||||
typedef __int64 intptr_t;
|
|
||||||
typedef unsigned __int64 uintptr_t;
|
|
||||||
#else // _WIN64 ][
|
|
||||||
typedef int intptr_t;
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif // _WIN64 ]
|
|
||||||
|
|
||||||
// 7.18.1.5 Greatest-width integer types
|
|
||||||
typedef int64_t intmax_t;
|
|
||||||
typedef uint64_t uintmax_t;
|
|
||||||
|
|
||||||
|
|
||||||
// 7.18.2 Limits of specified-width integer types
|
|
||||||
|
|
||||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
|
||||||
|
|
||||||
// 7.18.2.1 Limits of exact-width integer types
|
|
||||||
#define INT8_MIN _I8_MIN
|
|
||||||
#define INT8_MAX _I8_MAX
|
|
||||||
#define INT16_MIN _I16_MIN
|
|
||||||
#define INT16_MAX _I16_MAX
|
|
||||||
#define INT32_MIN _I32_MIN
|
|
||||||
#define INT32_MAX _I32_MAX
|
|
||||||
#define INT64_MIN _I64_MIN
|
|
||||||
#define INT64_MAX _I64_MAX
|
|
||||||
#define UINT8_MAX _UI8_MAX
|
|
||||||
#define UINT16_MAX _UI16_MAX
|
|
||||||
#define UINT32_MAX _UI32_MAX
|
|
||||||
#define UINT64_MAX _UI64_MAX
|
|
||||||
|
|
||||||
// 7.18.2.2 Limits of minimum-width integer types
|
|
||||||
#define INT_LEAST8_MIN INT8_MIN
|
|
||||||
#define INT_LEAST8_MAX INT8_MAX
|
|
||||||
#define INT_LEAST16_MIN INT16_MIN
|
|
||||||
#define INT_LEAST16_MAX INT16_MAX
|
|
||||||
#define INT_LEAST32_MIN INT32_MIN
|
|
||||||
#define INT_LEAST32_MAX INT32_MAX
|
|
||||||
#define INT_LEAST64_MIN INT64_MIN
|
|
||||||
#define INT_LEAST64_MAX INT64_MAX
|
|
||||||
#define UINT_LEAST8_MAX UINT8_MAX
|
|
||||||
#define UINT_LEAST16_MAX UINT16_MAX
|
|
||||||
#define UINT_LEAST32_MAX UINT32_MAX
|
|
||||||
#define UINT_LEAST64_MAX UINT64_MAX
|
|
||||||
|
|
||||||
// 7.18.2.3 Limits of fastest minimum-width integer types
|
|
||||||
#define INT_FAST8_MIN INT8_MIN
|
|
||||||
#define INT_FAST8_MAX INT8_MAX
|
|
||||||
#define INT_FAST16_MIN INT16_MIN
|
|
||||||
#define INT_FAST16_MAX INT16_MAX
|
|
||||||
#define INT_FAST32_MIN INT32_MIN
|
|
||||||
#define INT_FAST32_MAX INT32_MAX
|
|
||||||
#define INT_FAST64_MIN INT64_MIN
|
|
||||||
#define INT_FAST64_MAX INT64_MAX
|
|
||||||
#define UINT_FAST8_MAX UINT8_MAX
|
|
||||||
#define UINT_FAST16_MAX UINT16_MAX
|
|
||||||
#define UINT_FAST32_MAX UINT32_MAX
|
|
||||||
#define UINT_FAST64_MAX UINT64_MAX
|
|
||||||
|
|
||||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
|
||||||
#ifdef _WIN64 // [
|
|
||||||
# define INTPTR_MIN INT64_MIN
|
|
||||||
# define INTPTR_MAX INT64_MAX
|
|
||||||
# define UINTPTR_MAX UINT64_MAX
|
|
||||||
#else // _WIN64 ][
|
|
||||||
# define INTPTR_MIN INT32_MIN
|
|
||||||
# define INTPTR_MAX INT32_MAX
|
|
||||||
# define UINTPTR_MAX UINT32_MAX
|
|
||||||
#endif // _WIN64 ]
|
|
||||||
|
|
||||||
// 7.18.2.5 Limits of greatest-width integer types
|
|
||||||
#define INTMAX_MIN INT64_MIN
|
|
||||||
#define INTMAX_MAX INT64_MAX
|
|
||||||
#define UINTMAX_MAX UINT64_MAX
|
|
||||||
|
|
||||||
// 7.18.3 Limits of other integer types
|
|
||||||
|
|
||||||
#ifdef _WIN64 // [
|
|
||||||
# define PTRDIFF_MIN _I64_MIN
|
|
||||||
# define PTRDIFF_MAX _I64_MAX
|
|
||||||
#else // _WIN64 ][
|
|
||||||
# define PTRDIFF_MIN _I32_MIN
|
|
||||||
# define PTRDIFF_MAX _I32_MAX
|
|
||||||
#endif // _WIN64 ]
|
|
||||||
|
|
||||||
#define SIG_ATOMIC_MIN INT_MIN
|
|
||||||
#define SIG_ATOMIC_MAX INT_MAX
|
|
||||||
|
|
||||||
#ifndef SIZE_MAX // [
|
|
||||||
# ifdef _WIN64 // [
|
|
||||||
# define SIZE_MAX _UI64_MAX
|
|
||||||
# else // _WIN64 ][
|
|
||||||
# define SIZE_MAX _UI32_MAX
|
|
||||||
# endif // _WIN64 ]
|
|
||||||
#endif // SIZE_MAX ]
|
|
||||||
|
|
||||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
|
||||||
#ifndef WCHAR_MIN // [
|
|
||||||
# define WCHAR_MIN 0
|
|
||||||
#endif // WCHAR_MIN ]
|
|
||||||
#ifndef WCHAR_MAX // [
|
|
||||||
# define WCHAR_MAX _UI16_MAX
|
|
||||||
#endif // WCHAR_MAX ]
|
|
||||||
|
|
||||||
#define WINT_MIN 0
|
|
||||||
#define WINT_MAX _UI16_MAX
|
|
||||||
|
|
||||||
#endif // __STDC_LIMIT_MACROS ]
|
|
||||||
|
|
||||||
|
|
||||||
// 7.18.4 Limits of other integer types
|
|
||||||
|
|
||||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
|
||||||
|
|
||||||
// 7.18.4.1 Macros for minimum-width integer constants
|
|
||||||
|
|
||||||
#define INT8_C(val) val
|
|
||||||
#define INT16_C(val) val
|
|
||||||
#define INT32_C(val) val##L
|
|
||||||
#define INT64_C(val) val##i64
|
|
||||||
|
|
||||||
#define UINT8_C(val) val
|
|
||||||
#define UINT16_C(val) val
|
|
||||||
#define UINT32_C(val) val##UL
|
|
||||||
#define UINT64_C(val) val##Ui64
|
|
||||||
|
|
||||||
// 7.18.4.2 Macros for greatest-width integer constants
|
|
||||||
#define INTMAX_C INT64_C
|
|
||||||
#define UINTMAX_C UINT64_C
|
|
||||||
|
|
||||||
#endif // __STDC_CONSTANT_MACROS ]
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // _MSC_STDINT_H_ ]
|
|
||||||
Vendored
+5
-2
@@ -6,7 +6,7 @@ project(${IPP_IW_LIBRARY})
|
|||||||
|
|
||||||
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
|
ocv_include_directories(${IPP_INCLUDE_DIRS} ${IPP_IW_PATH}/include)
|
||||||
add_definitions(-DIW_BUILD)
|
add_definitions(-DIW_BUILD)
|
||||||
if(HAVE_IPP_ICV_ONLY)
|
if(HAVE_IPP_ICV)
|
||||||
add_definitions(-DICV_BASE)
|
add_definitions(-DICV_BASE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -21,7 +21,10 @@ add_library(${IPP_IW_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
|||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-unused-function")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
|
||||||
|
endif()
|
||||||
|
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Vendored
+13
-13
@@ -2,37 +2,37 @@ function(download_ippicv root_var)
|
|||||||
set(${root_var} "" PARENT_SCOPE)
|
set(${root_var} "" PARENT_SCOPE)
|
||||||
|
|
||||||
# Commit SHA in the opencv_3rdparty repo
|
# Commit SHA in the opencv_3rdparty repo
|
||||||
set(IPPICV_COMMIT "a62e20676a60ee0ad6581e217fe7e4bada3b95db")
|
set(IPPICV_COMMIT "dfe3162c237af211e98b8960018b564bc209261d")
|
||||||
# Define actual ICV versions
|
# Define actual ICV versions
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(OPENCV_ICV_PLATFORM "macosx")
|
set(OPENCV_ICV_PLATFORM "macosx")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_intel64_20170418.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_mac_intel64_general_20170822.tgz")
|
||||||
set(OPENCV_ICV_HASH "0c25953c99dbb499ff502485a9356d8d")
|
set(OPENCV_ICV_HASH "c1ebb5dfa5b7f54b0c44e1917805a463")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_mac_ia32_20170418.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_mac_ia32_general_20170822.tgz")
|
||||||
set(OPENCV_ICV_HASH "5f225948f3f64067c681293c098d50d8")
|
set(OPENCV_ICV_HASH "49b05a669042753ae75895a445ebd612")
|
||||||
endif()
|
endif()
|
||||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||||
set(OPENCV_ICV_PLATFORM "linux")
|
set(OPENCV_ICV_PLATFORM "linux")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_intel64_20170418.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_lnx_intel64_general_20170822.tgz")
|
||||||
set(OPENCV_ICV_HASH "87cbdeb627415d8e4bc811156289fa3a")
|
set(OPENCV_ICV_HASH "4e0352ce96473837b1d671ce87f17359")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_lnx_ia32_20170418.tgz")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_lnx_ia32_general_20170822.tgz")
|
||||||
set(OPENCV_ICV_HASH "f2cece00d802d4dea86df52ed095257e")
|
set(OPENCV_ICV_HASH "dcdb0ba4b123f240596db1840cd59a76")
|
||||||
endif()
|
endif()
|
||||||
elseif(WIN32 AND NOT ARM)
|
elseif(WIN32 AND NOT ARM)
|
||||||
set(OPENCV_ICV_PLATFORM "windows")
|
set(OPENCV_ICV_PLATFORM "windows")
|
||||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||||
if(X86_64)
|
if(X86_64)
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_win_intel64_20170418.zip")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_win_intel64_general_20170822.zip")
|
||||||
set(OPENCV_ICV_HASH "75060a0c662c0800f48995b7e9b085f6")
|
set(OPENCV_ICV_HASH "0421e642bc7ad741a2236d3ec4190bdd")
|
||||||
else()
|
else()
|
||||||
set(OPENCV_ICV_NAME "ippicv_2017u2_win_ia32_20170418.zip")
|
set(OPENCV_ICV_NAME "ippicv_2017u3_win_ia32_general_20170822.zip")
|
||||||
set(OPENCV_ICV_HASH "60fcf3ccd9a2ebc9e432ffb5cb91638b")
|
set(OPENCV_ICV_HASH "8a7680ae352c192de2e2e34936164bd0")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
return()
|
return()
|
||||||
|
|||||||
Vendored
-6
@@ -43,12 +43,6 @@ if(NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(${ITT_LIBRARY} PROPERTIES
|
set_target_properties(${ITT_LIBRARY} PROPERTIES
|
||||||
OUTPUT_NAME ${ITT_LIBRARY}
|
OUTPUT_NAME ${ITT_LIBRARY}
|
||||||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
|
||||||
|
|||||||
Vendored
+4
-8
@@ -25,16 +25,12 @@ endif(WIN32 AND NOT MINGW)
|
|||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes
|
||||||
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
-Wno-unused-but-set-parameter -Wmissing-declarations -Wunused -Wshadow
|
||||||
-Wsign-compare -Wstrict-overflow)
|
-Wsign-compare -Wstrict-overflow -Wpointer-compare
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
-Wabsolute-value # clang on Linux
|
||||||
|
)
|
||||||
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wstrict-prototypes) # clang
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4018 /wd4101 /wd4244 /wd4267 /wd4715) # vs2005
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set_target_properties(${JASPER_LIBRARY}
|
set_target_properties(${JASPER_LIBRARY}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
OUTPUT_NAME ${JASPER_LIBRARY}
|
OUTPUT_NAME ${JASPER_LIBRARY}
|
||||||
|
|||||||
Vendored
+1
-7
@@ -28,17 +28,11 @@ endif()
|
|||||||
|
|
||||||
add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
add_library(${JPEG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
|
set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused -Wshift-negative-value)
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter) # clang
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4244 /wd4267) # vs2005
|
ocv_warnings_disable(CMAKE_C_FLAGS /wd4013 /wd4244 /wd4267) # vs2005
|
||||||
|
|
||||||
|
|||||||
Vendored
+66
-41
@@ -1,8 +1,8 @@
|
|||||||
The Independent JPEG Group's JPEG software
|
The Independent JPEG Group's JPEG software
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
README for release 9 of 13-Jan-2013
|
README for release 9b of 17-Jan-2016
|
||||||
===================================
|
====================================
|
||||||
|
|
||||||
This distribution contains the ninth public release of the Independent JPEG
|
This distribution contains the ninth public release of the Independent JPEG
|
||||||
Group's free JPEG software. You are welcome to redistribute this software and
|
Group's free JPEG software. You are welcome to redistribute this software and
|
||||||
@@ -14,7 +14,7 @@ Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
|
|||||||
and other members of the Independent JPEG Group.
|
and other members of the Independent JPEG Group.
|
||||||
|
|
||||||
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
IJG is not affiliated with the ISO/IEC JTC1/SC29/WG1 standards committee
|
||||||
(also known as JPEG, together with ITU-T SG16).
|
(previously known as JPEG, together with ITU-T SG16).
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION ROADMAP
|
DOCUMENTATION ROADMAP
|
||||||
@@ -60,7 +60,7 @@ OVERVIEW
|
|||||||
|
|
||||||
This package contains C software to implement JPEG image encoding, decoding,
|
This package contains C software to implement JPEG image encoding, decoding,
|
||||||
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
|
||||||
method for full-color and gray-scale images.
|
method for full-color and grayscale images.
|
||||||
|
|
||||||
This software implements JPEG baseline, extended-sequential, and progressive
|
This software implements JPEG baseline, extended-sequential, and progressive
|
||||||
compression processes. Provision is made for supporting all variants of these
|
compression processes. Provision is made for supporting all variants of these
|
||||||
@@ -115,7 +115,7 @@ with respect to this software, its quality, accuracy, merchantability, or
|
|||||||
fitness for a particular purpose. This software is provided "AS IS", and you,
|
fitness for a particular purpose. This software is provided "AS IS", and you,
|
||||||
its user, assume the entire risk as to its quality and accuracy.
|
its user, assume the entire risk as to its quality and accuracy.
|
||||||
|
|
||||||
This software is copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.
|
This software is copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||||
All Rights Reserved except as specified below.
|
All Rights Reserved except as specified below.
|
||||||
|
|
||||||
Permission is hereby granted to use, copy, modify, and distribute this
|
Permission is hereby granted to use, copy, modify, and distribute this
|
||||||
@@ -153,16 +153,11 @@ ltmain.sh). Another support script, install-sh, is copyright by X Consortium
|
|||||||
but is also freely distributable.
|
but is also freely distributable.
|
||||||
|
|
||||||
The IJG distribution formerly included code to read and write GIF files.
|
The IJG distribution formerly included code to read and write GIF files.
|
||||||
To avoid entanglement with the Unisys LZW patent, GIF reading support has
|
To avoid entanglement with the Unisys LZW patent (now expired), GIF reading
|
||||||
been removed altogether, and the GIF writer has been simplified to produce
|
support has been removed altogether, and the GIF writer has been simplified
|
||||||
"uncompressed GIFs". This technique does not use the LZW algorithm; the
|
to produce "uncompressed GIFs". This technique does not use the LZW
|
||||||
resulting GIF files are larger than usual, but are readable by all standard
|
algorithm; the resulting GIF files are larger than usual, but are readable
|
||||||
GIF decoders.
|
by all standard GIF decoders.
|
||||||
|
|
||||||
We are required to state that
|
|
||||||
"The Graphics Interchange Format(c) is the Copyright property of
|
|
||||||
CompuServe Incorporated. GIF(sm) is a Service Mark property of
|
|
||||||
CompuServe Incorporated."
|
|
||||||
|
|
||||||
|
|
||||||
REFERENCES
|
REFERENCES
|
||||||
@@ -176,8 +171,8 @@ The best short technical introduction to the JPEG compression algorithm is
|
|||||||
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
Communications of the ACM, April 1991 (vol. 34 no. 4), pp. 30-44.
|
||||||
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
(Adjacent articles in that issue discuss MPEG motion picture compression,
|
||||||
applications of JPEG, and related topics.) If you don't have the CACM issue
|
applications of JPEG, and related topics.) If you don't have the CACM issue
|
||||||
handy, a PostScript file containing a revised version of Wallace's article is
|
handy, a PDF file containing a revised version of Wallace's article is
|
||||||
available at http://www.ijg.org/files/wallace.ps.gz. The file (actually
|
available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
|
||||||
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
|
||||||
omits the sample images that appeared in CACM, but it includes corrections
|
omits the sample images that appeared in CACM, but it includes corrections
|
||||||
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
and some added material. Note: the Wallace article is copyright ACM and IEEE,
|
||||||
@@ -225,14 +220,13 @@ WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris,
|
|||||||
France.
|
France.
|
||||||
|
|
||||||
The JPEG standard does not specify all details of an interchangeable file
|
The JPEG standard does not specify all details of an interchangeable file
|
||||||
format. For the omitted details we follow the "JFIF" conventions, revision
|
format. For the omitted details we follow the "JFIF" conventions, version 2.
|
||||||
1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
|
JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) :
|
||||||
and thus received a formal publication status. It is available as a free
|
Information technology - Digital compression and coding of continuous-tone
|
||||||
download in PDF format from
|
still images: JPEG File Interchange Format (JFIF). It is available as a
|
||||||
http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
|
free download in PDF file format from http://www.itu.int/rec/T-REC-T.871.
|
||||||
A PostScript version of the JFIF document is available at
|
A PDF file of the older JFIF document is available at
|
||||||
http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
|
http://www.w3.org/Graphics/JPEG/jfif3.pdf.
|
||||||
http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
|
|
||||||
|
|
||||||
The TIFF 6.0 file format specification can be obtained by FTP from
|
The TIFF 6.0 file format specification can be obtained by FTP from
|
||||||
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
|
||||||
@@ -252,8 +246,8 @@ ARCHIVE LOCATIONS
|
|||||||
The "official" archive site for this software is www.ijg.org.
|
The "official" archive site for this software is www.ijg.org.
|
||||||
The most recent released version can always be found there in
|
The most recent released version can always be found there in
|
||||||
directory "files". This particular version will be archived as
|
directory "files". This particular version will be archived as
|
||||||
http://www.ijg.org/files/jpegsrc.v9.tar.gz, and in Windows-compatible
|
http://www.ijg.org/files/jpegsrc.v9b.tar.gz, and in Windows-compatible
|
||||||
"zip" archive format as http://www.ijg.org/files/jpegsr9.zip.
|
"zip" archive format as http://www.ijg.org/files/jpegsr9b.zip.
|
||||||
|
|
||||||
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
The JPEG FAQ (Frequently Asked Questions) article is a source of some
|
||||||
general information about JPEG.
|
general information about JPEG.
|
||||||
@@ -280,7 +274,7 @@ Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
|
|||||||
Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
|
Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
|
||||||
|
|
||||||
Thank to Thomas Richter and Daniel Lee for inviting me to the
|
Thank to Thomas Richter and Daniel Lee for inviting me to the
|
||||||
ISO/IEC JTC1/SC29/WG1 (also known as JPEG, together with ITU-T SG16)
|
ISO/IEC JTC1/SC29/WG1 (previously known as JPEG, together with ITU-T SG16)
|
||||||
meeting in Berlin, Germany.
|
meeting in Berlin, Germany.
|
||||||
|
|
||||||
Thank to John Korejwa and Massimo Ballerini for inviting me to
|
Thank to John Korejwa and Massimo Ballerini for inviting me to
|
||||||
@@ -306,10 +300,10 @@ design and development of this singular software package.
|
|||||||
FILE FORMAT WARS
|
FILE FORMAT WARS
|
||||||
================
|
================
|
||||||
|
|
||||||
The ISO/IEC JTC1/SC29/WG1 standards committee (also known as JPEG, together
|
The ISO/IEC JTC1/SC29/WG1 standards committee (previously known as JPEG,
|
||||||
with ITU-T SG16) currently promotes different formats containing the name
|
together with ITU-T SG16) currently promotes different formats containing
|
||||||
"JPEG" which is misleading because these formats are incompatible with
|
the name "JPEG" which is misleading because these formats are incompatible
|
||||||
original DCT-based JPEG and are based on faulty technologies.
|
with original DCT-based JPEG and are based on faulty technologies.
|
||||||
IJG therefore does not and will not support such momentary mistakes
|
IJG therefore does not and will not support such momentary mistakes
|
||||||
(see REFERENCES).
|
(see REFERENCES).
|
||||||
There exist also distributions under the name "OpenJPEG" promoting such
|
There exist also distributions under the name "OpenJPEG" promoting such
|
||||||
@@ -322,9 +316,13 @@ Don't use an incompatible file format!
|
|||||||
(In any case, our decoder will remain capable of reading existing JPEG
|
(In any case, our decoder will remain capable of reading existing JPEG
|
||||||
image files indefinitely.)
|
image files indefinitely.)
|
||||||
|
|
||||||
Furthermore, the ISO committee pretends to be "responsible for the popular
|
The ISO committee pretends to be "responsible for the popular JPEG" in their
|
||||||
JPEG" in their public reports which is not true because they don't respond to
|
public reports which is not true because they don't respond to actual
|
||||||
actual requirements for the maintenance of the original JPEG specification.
|
requirements for the maintenance of the original JPEG specification.
|
||||||
|
Furthermore, the ISO committee pretends to "ensure interoperability" with
|
||||||
|
their standards which is not true because their "standards" support only
|
||||||
|
application-specific and proprietary use cases and contain mathematically
|
||||||
|
incorrect code.
|
||||||
|
|
||||||
There are currently different distributions in circulation containing the
|
There are currently different distributions in circulation containing the
|
||||||
name "libjpeg" which is misleading because they don't have the features and
|
name "libjpeg" which is misleading because they don't have the features and
|
||||||
@@ -332,19 +330,46 @@ are incompatible with formats supported by actual IJG libjpeg distributions.
|
|||||||
One of those fakes is released by members of the ISO committee and just uses
|
One of those fakes is released by members of the ISO committee and just uses
|
||||||
the name of libjpeg for misdirection of people, similar to the abuse of the
|
the name of libjpeg for misdirection of people, similar to the abuse of the
|
||||||
name JPEG as described above, while having nothing in common with actual IJG
|
name JPEG as described above, while having nothing in common with actual IJG
|
||||||
libjpeg distributions.
|
libjpeg distributions and containing mathematically incorrect code.
|
||||||
The other one claims to be a "derivative" or "fork" of the original libjpeg
|
The other one claims to be a "derivative" or "fork" of the original libjpeg,
|
||||||
and violates the license conditions as described under LEGAL ISSUES above.
|
but violates the license conditions as described under LEGAL ISSUES above
|
||||||
We have no sympathy for the release of misleading and illegal distributions
|
and violates basic C programming properties.
|
||||||
derived from obsolete code bases.
|
We have no sympathy for the release of misleading, incorrect and illegal
|
||||||
|
distributions derived from obsolete code bases.
|
||||||
Don't use an obsolete code base!
|
Don't use an obsolete code base!
|
||||||
|
|
||||||
|
According to the UCC (Uniform Commercial Code) law, IJG has the lawful and
|
||||||
|
legal right to foreclose on certain standardization bodies and other
|
||||||
|
institutions or corporations that knowingly perform substantial and
|
||||||
|
systematic deceptive acts and practices, fraud, theft, and damaging of the
|
||||||
|
value of the people of this planet without their knowing, willing and
|
||||||
|
intentional consent.
|
||||||
|
The titles, ownership, and rights of these institutions and all their assets
|
||||||
|
are now duly secured and held in trust for the free people of this planet.
|
||||||
|
People of the planet, on every country, may have a financial interest in
|
||||||
|
the assets of these former principals, agents, and beneficiaries of the
|
||||||
|
foreclosed institutions and corporations.
|
||||||
|
IJG asserts what is: that each man, woman, and child has unalienable value
|
||||||
|
and rights granted and deposited in them by the Creator and not any one of
|
||||||
|
the people is subordinate to any artificial principality, corporate fiction
|
||||||
|
or the special interest of another without their appropriate knowing,
|
||||||
|
willing and intentional consent made by contract or accommodation agreement.
|
||||||
|
IJG expresses that which already was.
|
||||||
|
The people have already determined and demanded that public administration
|
||||||
|
entities, national governments, and their supporting judicial systems must
|
||||||
|
be fully transparent, accountable, and liable.
|
||||||
|
IJG has secured the value for all concerned free people of the planet.
|
||||||
|
|
||||||
|
A partial list of foreclosed institutions and corporations ("Hall of Shame")
|
||||||
|
is currently prepared and will be published later.
|
||||||
|
|
||||||
|
|
||||||
TO DO
|
TO DO
|
||||||
=====
|
=====
|
||||||
|
|
||||||
Version 9 is the second release of a new generation JPEG standard
|
Version 9 is the second release of a new generation JPEG standard
|
||||||
to overcome the limitations of the original JPEG specification.
|
to overcome the limitations of the original JPEG specification,
|
||||||
|
and is the first true source reference JPEG codec.
|
||||||
More features are being prepared for coming releases...
|
More features are being prepared for coming releases...
|
||||||
|
|
||||||
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
Please send bug reports, offers of help, etc. to jpeg-info@jpegclub.org.
|
||||||
|
|||||||
Vendored
+50
@@ -1,6 +1,56 @@
|
|||||||
CHANGE LOG for Independent JPEG Group's JPEG software
|
CHANGE LOG for Independent JPEG Group's JPEG software
|
||||||
|
|
||||||
|
|
||||||
|
Version 9b 17-Jan-2016
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Improvements and optimizations in DCT and color calculations.
|
||||||
|
Normalize range limit array composition and access pattern.
|
||||||
|
Thank to Sia Furler and Maddie Ziegler for inspiration.
|
||||||
|
|
||||||
|
Use merged upsample with scaled DCT sizes larger than 8.
|
||||||
|
Thank to Taylor Hatala for inspiration.
|
||||||
|
|
||||||
|
Check for excessive comment lengths in argument parsing in wrjpgcom.c.
|
||||||
|
Thank to Julian Cohen for hint.
|
||||||
|
|
||||||
|
Add makefile.b32 for use with Borland C++ 32-bit (bcc32).
|
||||||
|
Thank to Joe Slater for contribution.
|
||||||
|
|
||||||
|
Document 'f' specifier for jpegtran -crop specification.
|
||||||
|
Thank to Michele Martone for suggestion.
|
||||||
|
|
||||||
|
Use defined value from header instead of hardwired number in rdswitch.c.
|
||||||
|
Thank to Robert Sprowson for hint.
|
||||||
|
|
||||||
|
|
||||||
|
Version 9a 19-Jan-2014
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Add support for wide gamut color spaces (JFIF version 2).
|
||||||
|
Improve clarity and accuracy in color conversion modules.
|
||||||
|
Note: Requires rebuild of test images.
|
||||||
|
|
||||||
|
Extend the bit depth support to all values from 8 to 12
|
||||||
|
(BITS_IN_JSAMPLE configuration option in jmorecfg.h).
|
||||||
|
jpegtran now supports N bits sample data precision with all N from 8 to 12
|
||||||
|
in a single instance. Thank to Roland Fassauer for inspiration.
|
||||||
|
|
||||||
|
Try to resolve issues with new boolean type definition.
|
||||||
|
Thank also to v4hn for suggestion.
|
||||||
|
|
||||||
|
Enable option to use default Huffman tables for lossless compression
|
||||||
|
(for hardware solution), and in this case improve lossless RGB compression
|
||||||
|
with reversible color transform. Thank to Benny Alexandar for hint.
|
||||||
|
|
||||||
|
Extend the entropy decoding structure, so that extraneous bytes between
|
||||||
|
compressed scan data and following marker can be reported correctly.
|
||||||
|
Thank to Nigel Tao for hint.
|
||||||
|
|
||||||
|
Add jpegtran -wipe option and extension for -crop.
|
||||||
|
Thank to Andrew Senior, David Clunie, and Josef Schmid for suggestion.
|
||||||
|
|
||||||
|
|
||||||
Version 9 13-Jan-2013
|
Version 9 13-Jan-2013
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
|||||||
Vendored
+2
-1
@@ -2,6 +2,7 @@
|
|||||||
* jcapistd.c
|
* jcapistd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
|
* Modified 2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -145,7 +146,7 @@ jpeg_write_raw_data (j_compress_ptr cinfo, JSAMPIMAGE data,
|
|||||||
(*cinfo->master->pass_startup) (cinfo);
|
(*cinfo->master->pass_startup) (cinfo);
|
||||||
|
|
||||||
/* Verify that at least one iMCU row has been passed. */
|
/* Verify that at least one iMCU row has been passed. */
|
||||||
lines_per_iMCU_row = cinfo->max_v_samp_factor * DCTSIZE;
|
lines_per_iMCU_row = cinfo->max_v_samp_factor * cinfo->min_DCT_v_scaled_size;
|
||||||
if (num_lines < lines_per_iMCU_row)
|
if (num_lines < lines_per_iMCU_row)
|
||||||
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
ERREXIT(cinfo, JERR_BUFFER_SIZE);
|
||||||
|
|
||||||
|
|||||||
Vendored
+10
-9
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jcarith.c
|
* jcarith.c
|
||||||
*
|
*
|
||||||
* Developed 1997-2012 by Guido Vollbeding.
|
* Developed 1997-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -362,7 +362,6 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||||
JBLOCKROW block;
|
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int blkn, ci, tbl;
|
int blkn, ci, tbl;
|
||||||
int v, v2, m;
|
int v, v2, m;
|
||||||
@@ -381,14 +380,13 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/* Encode the MCU data blocks */
|
/* Encode the MCU data blocks */
|
||||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||||
block = MCU_data[blkn];
|
|
||||||
ci = cinfo->MCU_membership[blkn];
|
ci = cinfo->MCU_membership[blkn];
|
||||||
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
|
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
|
||||||
|
|
||||||
/* Compute the DC value after the required point transform by Al.
|
/* Compute the DC value after the required point transform by Al.
|
||||||
* This is simply an arithmetic right shift.
|
* This is simply an arithmetic right shift.
|
||||||
*/
|
*/
|
||||||
m = IRIGHT_SHIFT((int) ((*block)[0]), cinfo->Al);
|
m = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al);
|
||||||
|
|
||||||
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
|
/* Sections F.1.4.1 & F.1.4.4.1: Encoding of DC coefficients */
|
||||||
|
|
||||||
@@ -453,11 +451,11 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||||
|
const int * natural_order;
|
||||||
JBLOCKROW block;
|
JBLOCKROW block;
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int tbl, k, ke;
|
int tbl, k, ke;
|
||||||
int v, v2, m;
|
int v, v2, m;
|
||||||
const int * natural_order;
|
|
||||||
|
|
||||||
/* Emit restart marker if needed */
|
/* Emit restart marker if needed */
|
||||||
if (cinfo->restart_interval) {
|
if (cinfo->restart_interval) {
|
||||||
@@ -552,6 +550,8 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU encoding for DC successive approximation refinement scan.
|
* MCU encoding for DC successive approximation refinement scan.
|
||||||
|
* Note: we assume such scans can be multi-component,
|
||||||
|
* although the spec is not very clear on the point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
@@ -593,11 +593,11 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||||
|
const int * natural_order;
|
||||||
JBLOCKROW block;
|
JBLOCKROW block;
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int tbl, k, ke, kex;
|
int tbl, k, ke, kex;
|
||||||
int v;
|
int v;
|
||||||
const int * natural_order;
|
|
||||||
|
|
||||||
/* Emit restart marker if needed */
|
/* Emit restart marker if needed */
|
||||||
if (cinfo->restart_interval) {
|
if (cinfo->restart_interval) {
|
||||||
@@ -692,12 +692,13 @@ METHODDEF(boolean)
|
|||||||
encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
|
||||||
jpeg_component_info * compptr;
|
const int * natural_order;
|
||||||
JBLOCKROW block;
|
JBLOCKROW block;
|
||||||
unsigned char *st;
|
unsigned char *st;
|
||||||
int blkn, ci, tbl, k, ke;
|
int tbl, k, ke;
|
||||||
int v, v2, m;
|
int v, v2, m;
|
||||||
const int * natural_order;
|
int blkn, ci;
|
||||||
|
jpeg_component_info * compptr;
|
||||||
|
|
||||||
/* Emit restart marker if needed */
|
/* Emit restart marker if needed */
|
||||||
if (cinfo->restart_interval) {
|
if (cinfo->restart_interval) {
|
||||||
|
|||||||
Vendored
+98
-35
@@ -2,7 +2,7 @@
|
|||||||
* jccolor.c
|
* jccolor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* Modified 2011-2012 by Guido Vollbeding.
|
* Modified 2011-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -29,13 +29,25 @@ typedef my_color_converter * my_cconvert_ptr;
|
|||||||
/**************** RGB -> YCbCr conversion: most common case **************/
|
/**************** RGB -> YCbCr conversion: most common case **************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
|
* YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011),
|
||||||
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
* previously known as Recommendation CCIR 601-1, except that Cb and Cr
|
||||||
* The conversion equations to be implemented are therefore
|
* are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
||||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
* sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999.
|
||||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + CENTERJSAMPLE
|
* sYCC (standard luma-chroma-chroma color space with extended gamut)
|
||||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + CENTERJSAMPLE
|
* is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F.
|
||||||
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
|
* bg-sRGB and bg-sYCC (big gamut standard color spaces)
|
||||||
|
* are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G.
|
||||||
|
* Note that the derived conversion coefficients given in some of these
|
||||||
|
* documents are imprecise. The general conversion equations are
|
||||||
|
* Y = Kr * R + (1 - Kr - Kb) * G + Kb * B
|
||||||
|
* Cb = 0.5 * (B - Y) / (1 - Kb)
|
||||||
|
* Cr = 0.5 * (R - Y) / (1 - Kr)
|
||||||
|
* With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993
|
||||||
|
* from the 1953 FCC NTSC primaries and CIE Illuminant C),
|
||||||
|
* the conversion equations to be implemented are therefore
|
||||||
|
* Y = 0.299 * R + 0.587 * G + 0.114 * B
|
||||||
|
* Cb = -0.168735892 * R - 0.331264108 * G + 0.5 * B + CENTERJSAMPLE
|
||||||
|
* Cr = 0.5 * R - 0.418687589 * G - 0.081312411 * B + CENTERJSAMPLE
|
||||||
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
|
* Note: older versions of the IJG code used a zero offset of MAXJSAMPLE/2,
|
||||||
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
|
* rather than CENTERJSAMPLE, for Cb and Cr. This gave equal positive and
|
||||||
* negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
|
* negative swings for Cb/Cr, but meant that grayscale values (Cb=Cr=0)
|
||||||
@@ -49,9 +61,9 @@ typedef my_color_converter * my_cconvert_ptr;
|
|||||||
* For even more speed, we avoid doing any multiplications in the inner loop
|
* For even more speed, we avoid doing any multiplications in the inner loop
|
||||||
* by precalculating the constants times R,G,B for all possible values.
|
* by precalculating the constants times R,G,B for all possible values.
|
||||||
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
||||||
* for 12-bit samples it is still acceptable. It's not very reasonable for
|
* for 9-bit to 12-bit samples it is still acceptable. It's not very
|
||||||
* 16-bit samples, but if you want lossless storage you shouldn't be changing
|
* reasonable for 16-bit samples, but if you want lossless storage you
|
||||||
* colorspace anyway.
|
* shouldn't be changing colorspace anyway.
|
||||||
* The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
|
* The CENTERJSAMPLE offsets and the rounding fudge-factor of 0.5 are included
|
||||||
* in the tables to save adding them separately in the inner loop.
|
* in the tables to save adding them separately in the inner loop.
|
||||||
*/
|
*/
|
||||||
@@ -96,21 +108,21 @@ rgb_ycc_start (j_compress_ptr cinfo)
|
|||||||
(TABLE_SIZE * SIZEOF(INT32)));
|
(TABLE_SIZE * SIZEOF(INT32)));
|
||||||
|
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||||
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i;
|
rgb_ycc_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
||||||
rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i;
|
rgb_ycc_tab[i+G_Y_OFF] = FIX(0.587) * i;
|
||||||
rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
|
rgb_ycc_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF;
|
||||||
rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i;
|
rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.168735892)) * i;
|
||||||
rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i;
|
rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.331264108)) * i;
|
||||||
/* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
|
/* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr.
|
||||||
* This ensures that the maximum output will round to MAXJSAMPLE
|
* This ensures that the maximum output will round to MAXJSAMPLE
|
||||||
* not MAXJSAMPLE+1, and thus that we don't have to range-limit.
|
* not MAXJSAMPLE+1, and thus that we don't have to range-limit.
|
||||||
*/
|
*/
|
||||||
rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
|
rgb_ycc_tab[i+B_CB_OFF] = FIX(0.5) * i + CBCR_OFFSET + ONE_HALF-1;
|
||||||
/* B=>Cb and R=>Cr tables are the same
|
/* B=>Cb and R=>Cr tables are the same
|
||||||
rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1;
|
rgb_ycc_tab[i+R_CR_OFF] = FIX(0.5) * i + CBCR_OFFSET + ONE_HALF-1;
|
||||||
*/
|
*/
|
||||||
rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i;
|
rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.418687589)) * i;
|
||||||
rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i;
|
rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.081312411)) * i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,6 +286,9 @@ cmyk_ycck_convert (j_compress_ptr cinfo,
|
|||||||
* Convert some rows of samples to the JPEG colorspace.
|
* Convert some rows of samples to the JPEG colorspace.
|
||||||
* [R,G,B] to [R-G,G,B-G] conversion with modulo calculation
|
* [R,G,B] to [R-G,G,B-G] conversion with modulo calculation
|
||||||
* (forward reversible color transform).
|
* (forward reversible color transform).
|
||||||
|
* This can be seen as an adaption of the general RGB->YCbCr
|
||||||
|
* conversion equation with Kr = Kb = 0, while replacing the
|
||||||
|
* normalization by modulo calculation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
@@ -312,7 +327,7 @@ rgb_rgb1_convert (j_compress_ptr cinfo,
|
|||||||
/*
|
/*
|
||||||
* Convert some rows of samples to the JPEG colorspace.
|
* Convert some rows of samples to the JPEG colorspace.
|
||||||
* This version handles grayscale output with no conversion.
|
* This version handles grayscale output with no conversion.
|
||||||
* The source can be either plain grayscale or YCbCr (since Y == gray).
|
* The source can be either plain grayscale or YCC (since Y == gray).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
@@ -439,11 +454,13 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
|
case JCS_BG_RGB:
|
||||||
if (cinfo->input_components != RGB_PIXELSIZE)
|
if (cinfo->input_components != RGB_PIXELSIZE)
|
||||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
|
case JCS_BG_YCC:
|
||||||
if (cinfo->input_components != 3)
|
if (cinfo->input_components != 3)
|
||||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||||
break;
|
break;
|
||||||
@@ -460,8 +477,10 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Support color transform only for RGB colorspace */
|
/* Support color transform only for RGB colorspaces */
|
||||||
if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB)
|
if (cinfo->color_transform &&
|
||||||
|
cinfo->jpeg_color_space != JCS_RGB &&
|
||||||
|
cinfo->jpeg_color_space != JCS_BG_RGB)
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
|
||||||
/* Check num_components, set conversion method based on requested space */
|
/* Check num_components, set conversion method based on requested space */
|
||||||
@@ -469,20 +488,26 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
case JCS_GRAYSCALE:
|
case JCS_GRAYSCALE:
|
||||||
if (cinfo->num_components != 1)
|
if (cinfo->num_components != 1)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == JCS_GRAYSCALE ||
|
switch (cinfo->in_color_space) {
|
||||||
cinfo->in_color_space == JCS_YCbCr)
|
case JCS_GRAYSCALE:
|
||||||
|
case JCS_YCbCr:
|
||||||
|
case JCS_BG_YCC:
|
||||||
cconvert->pub.color_convert = grayscale_convert;
|
cconvert->pub.color_convert = grayscale_convert;
|
||||||
else if (cinfo->in_color_space == JCS_RGB) {
|
break;
|
||||||
|
case JCS_RGB:
|
||||||
cconvert->pub.start_pass = rgb_ycc_start;
|
cconvert->pub.start_pass = rgb_ycc_start;
|
||||||
cconvert->pub.color_convert = rgb_gray_convert;
|
cconvert->pub.color_convert = rgb_gray_convert;
|
||||||
} else
|
break;
|
||||||
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
|
case JCS_BG_RGB:
|
||||||
if (cinfo->num_components != 3)
|
if (cinfo->num_components != 3)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == JCS_RGB) {
|
if (cinfo->in_color_space == cinfo->jpeg_color_space) {
|
||||||
switch (cinfo->color_transform) {
|
switch (cinfo->color_transform) {
|
||||||
case JCT_NONE:
|
case JCT_NONE:
|
||||||
cconvert->pub.color_convert = rgb_convert;
|
cconvert->pub.color_convert = rgb_convert;
|
||||||
@@ -492,7 +517,6 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
@@ -501,13 +525,48 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
if (cinfo->num_components != 3)
|
if (cinfo->num_components != 3)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == JCS_RGB) {
|
switch (cinfo->in_color_space) {
|
||||||
|
case JCS_RGB:
|
||||||
cconvert->pub.start_pass = rgb_ycc_start;
|
cconvert->pub.start_pass = rgb_ycc_start;
|
||||||
cconvert->pub.color_convert = rgb_ycc_convert;
|
cconvert->pub.color_convert = rgb_ycc_convert;
|
||||||
} else if (cinfo->in_color_space == JCS_YCbCr)
|
break;
|
||||||
|
case JCS_YCbCr:
|
||||||
cconvert->pub.color_convert = null_convert;
|
cconvert->pub.color_convert = null_convert;
|
||||||
else
|
break;
|
||||||
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JCS_BG_YCC:
|
||||||
|
if (cinfo->num_components != 3)
|
||||||
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
|
switch (cinfo->in_color_space) {
|
||||||
|
case JCS_RGB:
|
||||||
|
/* For conversion from normal RGB input to BG_YCC representation,
|
||||||
|
* the Cb/Cr values are first computed as usual, and then
|
||||||
|
* quantized further after DCT processing by a factor of
|
||||||
|
* 2 in reference to the nominal quantization factor.
|
||||||
|
*/
|
||||||
|
/* need quantization scale by factor of 2 after DCT */
|
||||||
|
cinfo->comp_info[1].component_needed = TRUE;
|
||||||
|
cinfo->comp_info[2].component_needed = TRUE;
|
||||||
|
/* compute normal YCC first */
|
||||||
|
cconvert->pub.start_pass = rgb_ycc_start;
|
||||||
|
cconvert->pub.color_convert = rgb_ycc_convert;
|
||||||
|
break;
|
||||||
|
case JCS_YCbCr:
|
||||||
|
/* need quantization scale by factor of 2 after DCT */
|
||||||
|
cinfo->comp_info[1].component_needed = TRUE;
|
||||||
|
cinfo->comp_info[2].component_needed = TRUE;
|
||||||
|
/*FALLTHROUGH*/
|
||||||
|
case JCS_BG_YCC:
|
||||||
|
/* Pass through for BG_YCC input */
|
||||||
|
cconvert->pub.color_convert = null_convert;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
@@ -522,13 +581,17 @@ jinit_color_converter (j_compress_ptr cinfo)
|
|||||||
case JCS_YCCK:
|
case JCS_YCCK:
|
||||||
if (cinfo->num_components != 4)
|
if (cinfo->num_components != 4)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
if (cinfo->in_color_space == JCS_CMYK) {
|
switch (cinfo->in_color_space) {
|
||||||
|
case JCS_CMYK:
|
||||||
cconvert->pub.start_pass = rgb_ycc_start;
|
cconvert->pub.start_pass = rgb_ycc_start;
|
||||||
cconvert->pub.color_convert = cmyk_ycck_convert;
|
cconvert->pub.color_convert = cmyk_ycck_convert;
|
||||||
} else if (cinfo->in_color_space == JCS_YCCK)
|
break;
|
||||||
|
case JCS_YCCK:
|
||||||
cconvert->pub.color_convert = null_convert;
|
cconvert->pub.color_convert = null_convert;
|
||||||
else
|
break;
|
||||||
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: /* allow null conversion of JCS_UNKNOWN */
|
default: /* allow null conversion of JCS_UNKNOWN */
|
||||||
|
|||||||
Vendored
+37
-42
@@ -2,6 +2,7 @@
|
|||||||
* jcdctmgr.c
|
* jcdctmgr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
|
* Modified 2003-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -25,22 +26,30 @@ typedef struct {
|
|||||||
/* Pointer to the DCT routine actually in use */
|
/* Pointer to the DCT routine actually in use */
|
||||||
forward_DCT_method_ptr do_dct[MAX_COMPONENTS];
|
forward_DCT_method_ptr do_dct[MAX_COMPONENTS];
|
||||||
|
|
||||||
/* The actual post-DCT divisors --- not identical to the quant table
|
|
||||||
* entries, because of scaling (especially for an unnormalized DCT).
|
|
||||||
* Each table is given in normal array order.
|
|
||||||
*/
|
|
||||||
DCTELEM * divisors[NUM_QUANT_TBLS];
|
|
||||||
|
|
||||||
#ifdef DCT_FLOAT_SUPPORTED
|
#ifdef DCT_FLOAT_SUPPORTED
|
||||||
/* Same as above for the floating-point case. */
|
/* Same as above for the floating-point case. */
|
||||||
float_DCT_method_ptr do_float_dct[MAX_COMPONENTS];
|
float_DCT_method_ptr do_float_dct[MAX_COMPONENTS];
|
||||||
FAST_FLOAT * float_divisors[NUM_QUANT_TBLS];
|
|
||||||
#endif
|
#endif
|
||||||
} my_fdct_controller;
|
} my_fdct_controller;
|
||||||
|
|
||||||
typedef my_fdct_controller * my_fdct_ptr;
|
typedef my_fdct_controller * my_fdct_ptr;
|
||||||
|
|
||||||
|
|
||||||
|
/* The allocated post-DCT divisor tables -- big enough for any
|
||||||
|
* supported variant and not identical to the quant table entries,
|
||||||
|
* because of scaling (especially for an unnormalized DCT) --
|
||||||
|
* are pointed to by dct_table in the per-component comp_info
|
||||||
|
* structures. Each table is given in normal array order.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef union {
|
||||||
|
DCTELEM int_array[DCTSIZE2];
|
||||||
|
#ifdef DCT_FLOAT_SUPPORTED
|
||||||
|
FAST_FLOAT float_array[DCTSIZE2];
|
||||||
|
#endif
|
||||||
|
} divisor_table;
|
||||||
|
|
||||||
|
|
||||||
/* The current scaled-DCT routines require ISLOW-style divisor tables,
|
/* The current scaled-DCT routines require ISLOW-style divisor tables,
|
||||||
* so be sure to compile that code if either ISLOW or SCALING is requested.
|
* so be sure to compile that code if either ISLOW or SCALING is requested.
|
||||||
*/
|
*/
|
||||||
@@ -71,7 +80,7 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||||
forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index];
|
forward_DCT_method_ptr do_dct = fdct->do_dct[compptr->component_index];
|
||||||
DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no];
|
DCTELEM * divisors = (DCTELEM *) compptr->dct_table;
|
||||||
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
||||||
JDIMENSION bi;
|
JDIMENSION bi;
|
||||||
|
|
||||||
@@ -134,7 +143,7 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
/* This routine is heavily used, so it's worth coding it tightly. */
|
/* This routine is heavily used, so it's worth coding it tightly. */
|
||||||
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
my_fdct_ptr fdct = (my_fdct_ptr) cinfo->fdct;
|
||||||
float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index];
|
float_DCT_method_ptr do_dct = fdct->do_float_dct[compptr->component_index];
|
||||||
FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no];
|
FAST_FLOAT * divisors = (FAST_FLOAT *) compptr->dct_table;
|
||||||
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
|
||||||
JDIMENSION bi;
|
JDIMENSION bi;
|
||||||
|
|
||||||
@@ -352,22 +361,17 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
|||||||
cinfo->quant_tbl_ptrs[qtblno] == NULL)
|
cinfo->quant_tbl_ptrs[qtblno] == NULL)
|
||||||
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
|
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
|
||||||
qtbl = cinfo->quant_tbl_ptrs[qtblno];
|
qtbl = cinfo->quant_tbl_ptrs[qtblno];
|
||||||
/* Compute divisors for this quant table */
|
/* Create divisor table from quant table */
|
||||||
/* We may do this more than once for same table, but it's not a big deal */
|
|
||||||
switch (method) {
|
switch (method) {
|
||||||
#ifdef PROVIDE_ISLOW_TABLES
|
#ifdef PROVIDE_ISLOW_TABLES
|
||||||
case JDCT_ISLOW:
|
case JDCT_ISLOW:
|
||||||
/* For LL&M IDCT method, divisors are equal to raw quantization
|
/* For LL&M IDCT method, divisors are equal to raw quantization
|
||||||
* coefficients multiplied by 8 (to counteract scaling).
|
* coefficients multiplied by 8 (to counteract scaling).
|
||||||
*/
|
*/
|
||||||
if (fdct->divisors[qtblno] == NULL) {
|
dtbl = (DCTELEM *) compptr->dct_table;
|
||||||
fdct->divisors[qtblno] = (DCTELEM *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
DCTSIZE2 * SIZEOF(DCTELEM));
|
|
||||||
}
|
|
||||||
dtbl = fdct->divisors[qtblno];
|
|
||||||
for (i = 0; i < DCTSIZE2; i++) {
|
for (i = 0; i < DCTSIZE2; i++) {
|
||||||
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
|
dtbl[i] =
|
||||||
|
((DCTELEM) qtbl->quantval[i]) << (compptr->component_needed ? 4 : 3);
|
||||||
}
|
}
|
||||||
fdct->pub.forward_DCT[ci] = forward_DCT;
|
fdct->pub.forward_DCT[ci] = forward_DCT;
|
||||||
break;
|
break;
|
||||||
@@ -395,17 +399,12 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
|||||||
};
|
};
|
||||||
SHIFT_TEMPS
|
SHIFT_TEMPS
|
||||||
|
|
||||||
if (fdct->divisors[qtblno] == NULL) {
|
dtbl = (DCTELEM *) compptr->dct_table;
|
||||||
fdct->divisors[qtblno] = (DCTELEM *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
DCTSIZE2 * SIZEOF(DCTELEM));
|
|
||||||
}
|
|
||||||
dtbl = fdct->divisors[qtblno];
|
|
||||||
for (i = 0; i < DCTSIZE2; i++) {
|
for (i = 0; i < DCTSIZE2; i++) {
|
||||||
dtbl[i] = (DCTELEM)
|
dtbl[i] = (DCTELEM)
|
||||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||||
(INT32) aanscales[i]),
|
(INT32) aanscales[i]),
|
||||||
CONST_BITS-3);
|
compptr->component_needed ? CONST_BITS-4 : CONST_BITS-3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fdct->pub.forward_DCT[ci] = forward_DCT;
|
fdct->pub.forward_DCT[ci] = forward_DCT;
|
||||||
@@ -422,25 +421,20 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
|||||||
* What's actually stored is 1/divisor so that the inner loop can
|
* What's actually stored is 1/divisor so that the inner loop can
|
||||||
* use a multiplication rather than a division.
|
* use a multiplication rather than a division.
|
||||||
*/
|
*/
|
||||||
FAST_FLOAT * fdtbl;
|
FAST_FLOAT * fdtbl = (FAST_FLOAT *) compptr->dct_table;
|
||||||
int row, col;
|
int row, col;
|
||||||
static const double aanscalefactor[DCTSIZE] = {
|
static const double aanscalefactor[DCTSIZE] = {
|
||||||
1.0, 1.387039845, 1.306562965, 1.175875602,
|
1.0, 1.387039845, 1.306562965, 1.175875602,
|
||||||
1.0, 0.785694958, 0.541196100, 0.275899379
|
1.0, 0.785694958, 0.541196100, 0.275899379
|
||||||
};
|
};
|
||||||
|
|
||||||
if (fdct->float_divisors[qtblno] == NULL) {
|
|
||||||
fdct->float_divisors[qtblno] = (FAST_FLOAT *)
|
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
|
||||||
DCTSIZE2 * SIZEOF(FAST_FLOAT));
|
|
||||||
}
|
|
||||||
fdtbl = fdct->float_divisors[qtblno];
|
|
||||||
i = 0;
|
i = 0;
|
||||||
for (row = 0; row < DCTSIZE; row++) {
|
for (row = 0; row < DCTSIZE; row++) {
|
||||||
for (col = 0; col < DCTSIZE; col++) {
|
for (col = 0; col < DCTSIZE; col++) {
|
||||||
fdtbl[i] = (FAST_FLOAT)
|
fdtbl[i] = (FAST_FLOAT)
|
||||||
(1.0 / (((double) qtbl->quantval[i] *
|
(1.0 / ((double) qtbl->quantval[i] *
|
||||||
aanscalefactor[row] * aanscalefactor[col] * 8.0)));
|
aanscalefactor[row] * aanscalefactor[col] *
|
||||||
|
(compptr->component_needed ? 16.0 : 8.0)));
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -464,19 +458,20 @@ GLOBAL(void)
|
|||||||
jinit_forward_dct (j_compress_ptr cinfo)
|
jinit_forward_dct (j_compress_ptr cinfo)
|
||||||
{
|
{
|
||||||
my_fdct_ptr fdct;
|
my_fdct_ptr fdct;
|
||||||
int i;
|
int ci;
|
||||||
|
jpeg_component_info *compptr;
|
||||||
|
|
||||||
fdct = (my_fdct_ptr)
|
fdct = (my_fdct_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_fdct_controller));
|
SIZEOF(my_fdct_controller));
|
||||||
cinfo->fdct = (struct jpeg_forward_dct *) fdct;
|
cinfo->fdct = &fdct->pub;
|
||||||
fdct->pub.start_pass = start_pass_fdctmgr;
|
fdct->pub.start_pass = start_pass_fdctmgr;
|
||||||
|
|
||||||
/* Mark divisor tables unallocated */
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
for (i = 0; i < NUM_QUANT_TBLS; i++) {
|
ci++, compptr++) {
|
||||||
fdct->divisors[i] = NULL;
|
/* Allocate a divisor table for each component */
|
||||||
#ifdef DCT_FLOAT_SUPPORTED
|
compptr->dct_table =
|
||||||
fdct->float_divisors[i] = NULL;
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
#endif
|
SIZEOF(divisor_table));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+40
-43
@@ -2,7 +2,7 @@
|
|||||||
* jchuff.c
|
* jchuff.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2006-2009 by Guido Vollbeding.
|
* Modified 2006-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -308,20 +308,23 @@ emit_bits_s (working_state * state, unsigned int code, int size)
|
|||||||
/* Emit some bits; return TRUE if successful, FALSE if must suspend */
|
/* Emit some bits; return TRUE if successful, FALSE if must suspend */
|
||||||
{
|
{
|
||||||
/* This routine is heavily used, so it's worth coding tightly. */
|
/* This routine is heavily used, so it's worth coding tightly. */
|
||||||
register INT32 put_buffer = (INT32) code;
|
register INT32 put_buffer;
|
||||||
register int put_bits = state->cur.put_bits;
|
register int put_bits;
|
||||||
|
|
||||||
/* if size is 0, caller used an invalid Huffman table entry */
|
/* if size is 0, caller used an invalid Huffman table entry */
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
|
ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
|
||||||
|
|
||||||
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
|
/* mask off any extra bits in code */
|
||||||
|
put_buffer = ((INT32) code) & ((((INT32) 1) << size) - 1);
|
||||||
|
|
||||||
put_bits += size; /* new number of bits in buffer */
|
/* new number of bits in buffer */
|
||||||
|
put_bits = size + state->cur.put_bits;
|
||||||
|
|
||||||
put_buffer <<= 24 - put_bits; /* align incoming bits */
|
put_buffer <<= 24 - put_bits; /* align incoming bits */
|
||||||
|
|
||||||
put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
|
/* and merge with old buffer contents */
|
||||||
|
put_buffer |= state->cur.put_buffer;
|
||||||
|
|
||||||
while (put_bits >= 8) {
|
while (put_bits >= 8) {
|
||||||
int c = (int) ((put_buffer >> 16) & 0xFF);
|
int c = (int) ((put_buffer >> 16) & 0xFF);
|
||||||
@@ -347,8 +350,8 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size)
|
|||||||
/* Emit some bits, unless we are in gather mode */
|
/* Emit some bits, unless we are in gather mode */
|
||||||
{
|
{
|
||||||
/* This routine is heavily used, so it's worth coding tightly. */
|
/* This routine is heavily used, so it's worth coding tightly. */
|
||||||
register INT32 put_buffer = (INT32) code;
|
register INT32 put_buffer;
|
||||||
register int put_bits = entropy->saved.put_bits;
|
register int put_bits;
|
||||||
|
|
||||||
/* if size is 0, caller used an invalid Huffman table entry */
|
/* if size is 0, caller used an invalid Huffman table entry */
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
@@ -357,9 +360,11 @@ emit_bits_e (huff_entropy_ptr entropy, unsigned int code, int size)
|
|||||||
if (entropy->gather_statistics)
|
if (entropy->gather_statistics)
|
||||||
return; /* do nothing if we're only getting stats */
|
return; /* do nothing if we're only getting stats */
|
||||||
|
|
||||||
put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
|
/* mask off any extra bits in code */
|
||||||
|
put_buffer = ((INT32) code) & ((((INT32) 1) << size) - 1);
|
||||||
|
|
||||||
put_bits += size; /* new number of bits in buffer */
|
/* new number of bits in buffer */
|
||||||
|
put_bits = size + entropy->saved.put_bits;
|
||||||
|
|
||||||
put_buffer <<= 24 - put_bits; /* align incoming bits */
|
put_buffer <<= 24 - put_bits; /* align incoming bits */
|
||||||
|
|
||||||
@@ -543,10 +548,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
register int temp, temp2;
|
register int temp, temp2;
|
||||||
register int nbits;
|
register int nbits;
|
||||||
int blkn, ci;
|
int blkn, ci, tbl;
|
||||||
int Al = cinfo->Al;
|
|
||||||
JBLOCKROW block;
|
|
||||||
jpeg_component_info * compptr;
|
|
||||||
ISHIFT_TEMPS
|
ISHIFT_TEMPS
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
@@ -559,21 +561,20 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/* Encode the MCU data blocks */
|
/* Encode the MCU data blocks */
|
||||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||||
block = MCU_data[blkn];
|
|
||||||
ci = cinfo->MCU_membership[blkn];
|
ci = cinfo->MCU_membership[blkn];
|
||||||
compptr = cinfo->cur_comp_info[ci];
|
tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
|
||||||
|
|
||||||
/* Compute the DC value after the required point transform by Al.
|
/* Compute the DC value after the required point transform by Al.
|
||||||
* This is simply an arithmetic right shift.
|
* This is simply an arithmetic right shift.
|
||||||
*/
|
*/
|
||||||
temp2 = IRIGHT_SHIFT((int) ((*block)[0]), Al);
|
temp = IRIGHT_SHIFT((int) (MCU_data[blkn][0][0]), cinfo->Al);
|
||||||
|
|
||||||
/* DC differences are figured on the point-transformed values. */
|
/* DC differences are figured on the point-transformed values. */
|
||||||
temp = temp2 - entropy->saved.last_dc_val[ci];
|
temp2 = temp - entropy->saved.last_dc_val[ci];
|
||||||
entropy->saved.last_dc_val[ci] = temp2;
|
entropy->saved.last_dc_val[ci] = temp;
|
||||||
|
|
||||||
/* Encode the DC coefficient difference per section G.1.2.1 */
|
/* Encode the DC coefficient difference per section G.1.2.1 */
|
||||||
temp2 = temp;
|
temp = temp2;
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
temp = -temp; /* temp is abs value of input */
|
temp = -temp; /* temp is abs value of input */
|
||||||
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
/* For a negative input, want temp2 = bitwise complement of abs(input) */
|
||||||
@@ -594,7 +595,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
ERREXIT(cinfo, JERR_BAD_DCT_COEF);
|
||||||
|
|
||||||
/* Count/emit the Huffman-coded symbol for the number of bits */
|
/* Count/emit the Huffman-coded symbol for the number of bits */
|
||||||
emit_dc_symbol(entropy, compptr->dc_tbl_no, nbits);
|
emit_dc_symbol(entropy, tbl, nbits);
|
||||||
|
|
||||||
/* Emit that number of bits of the value, if positive, */
|
/* Emit that number of bits of the value, if positive, */
|
||||||
/* or the complement of its magnitude, if negative. */
|
/* or the complement of its magnitude, if negative. */
|
||||||
@@ -628,12 +629,12 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
|
const int * natural_order;
|
||||||
|
JBLOCKROW block;
|
||||||
register int temp, temp2;
|
register int temp, temp2;
|
||||||
register int nbits;
|
register int nbits;
|
||||||
register int r, k;
|
register int r, k;
|
||||||
int Se, Al;
|
int Se, Al;
|
||||||
const int * natural_order;
|
|
||||||
JBLOCKROW block;
|
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
||||||
@@ -731,18 +732,15 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU encoding for DC successive approximation refinement scan.
|
* MCU encoding for DC successive approximation refinement scan.
|
||||||
* Note: we assume such scans can be multi-component, although the spec
|
* Note: we assume such scans can be multi-component,
|
||||||
* is not very clear on the point.
|
* although the spec is not very clear on the point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
register int temp;
|
int Al, blkn;
|
||||||
int blkn;
|
|
||||||
int Al = cinfo->Al;
|
|
||||||
JBLOCKROW block;
|
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
entropy->free_in_buffer = cinfo->dest->free_in_buffer;
|
||||||
@@ -752,13 +750,12 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
if (entropy->restarts_to_go == 0)
|
if (entropy->restarts_to_go == 0)
|
||||||
emit_restart_e(entropy, entropy->next_restart_num);
|
emit_restart_e(entropy, entropy->next_restart_num);
|
||||||
|
|
||||||
|
Al = cinfo->Al;
|
||||||
|
|
||||||
/* Encode the MCU data blocks */
|
/* Encode the MCU data blocks */
|
||||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||||
block = MCU_data[blkn];
|
|
||||||
|
|
||||||
/* We simply emit the Al'th bit of the DC coefficient value. */
|
/* We simply emit the Al'th bit of the DC coefficient value. */
|
||||||
temp = (*block)[0];
|
emit_bits_e(entropy, (unsigned int) (MCU_data[blkn][0][0] >> Al), 1);
|
||||||
emit_bits_e(entropy, (unsigned int) (temp >> Al), 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cinfo->dest->next_output_byte = entropy->next_output_byte;
|
cinfo->dest->next_output_byte = entropy->next_output_byte;
|
||||||
@@ -786,14 +783,14 @@ METHODDEF(boolean)
|
|||||||
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
|
const int * natural_order;
|
||||||
|
JBLOCKROW block;
|
||||||
register int temp;
|
register int temp;
|
||||||
register int r, k;
|
register int r, k;
|
||||||
|
int Se, Al;
|
||||||
int EOB;
|
int EOB;
|
||||||
char *BR_buffer;
|
char *BR_buffer;
|
||||||
unsigned int BR;
|
unsigned int BR;
|
||||||
int Se, Al;
|
|
||||||
const int * natural_order;
|
|
||||||
JBLOCKROW block;
|
|
||||||
int absvalues[DCTSIZE2];
|
int absvalues[DCTSIZE2];
|
||||||
|
|
||||||
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
entropy->next_output_byte = cinfo->dest->next_output_byte;
|
||||||
@@ -918,7 +915,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
|||||||
{
|
{
|
||||||
register int temp, temp2;
|
register int temp, temp2;
|
||||||
register int nbits;
|
register int nbits;
|
||||||
register int k, r, i;
|
register int r, k;
|
||||||
int Se = state->cinfo->lim_Se;
|
int Se = state->cinfo->lim_Se;
|
||||||
const int * natural_order = state->cinfo->natural_order;
|
const int * natural_order = state->cinfo->natural_order;
|
||||||
|
|
||||||
@@ -960,7 +957,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
|||||||
r = 0; /* r = run length of zeros */
|
r = 0; /* r = run length of zeros */
|
||||||
|
|
||||||
for (k = 1; k <= Se; k++) {
|
for (k = 1; k <= Se; k++) {
|
||||||
if ((temp = block[natural_order[k]]) == 0) {
|
if ((temp2 = block[natural_order[k]]) == 0) {
|
||||||
r++;
|
r++;
|
||||||
} else {
|
} else {
|
||||||
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
|
/* if run length > 15, must emit special run-length-16 codes (0xF0) */
|
||||||
@@ -970,7 +967,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
|||||||
r -= 16;
|
r -= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp2 = temp;
|
temp = temp2;
|
||||||
if (temp < 0) {
|
if (temp < 0) {
|
||||||
temp = -temp; /* temp is abs value of input */
|
temp = -temp; /* temp is abs value of input */
|
||||||
/* This code assumes we are on a two's complement machine */
|
/* This code assumes we are on a two's complement machine */
|
||||||
@@ -986,8 +983,8 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
|
|||||||
ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
|
ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
|
||||||
|
|
||||||
/* Emit Huffman symbol for run length / number of bits */
|
/* Emit Huffman symbol for run length / number of bits */
|
||||||
i = (r << 4) + nbits;
|
temp = (r << 4) + nbits;
|
||||||
if (! emit_bits_s(state, actbl->ehufco[i], actbl->ehufsi[i]))
|
if (! emit_bits_s(state, actbl->ehufco[temp], actbl->ehufsi[temp]))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Emit that number of bits of the value, if positive, */
|
/* Emit that number of bits of the value, if positive, */
|
||||||
@@ -1124,7 +1121,7 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
|
|||||||
{
|
{
|
||||||
register int temp;
|
register int temp;
|
||||||
register int nbits;
|
register int nbits;
|
||||||
register int k, r;
|
register int r, k;
|
||||||
int Se = cinfo->lim_Se;
|
int Se = cinfo->lim_Se;
|
||||||
const int * natural_order = cinfo->natural_order;
|
const int * natural_order = cinfo->natural_order;
|
||||||
|
|
||||||
@@ -1562,7 +1559,7 @@ jinit_huff_encoder (j_compress_ptr cinfo)
|
|||||||
entropy = (huff_entropy_ptr)
|
entropy = (huff_entropy_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(huff_entropy_encoder));
|
SIZEOF(huff_entropy_encoder));
|
||||||
cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass_huff;
|
entropy->pub.start_pass = start_pass_huff;
|
||||||
|
|
||||||
/* Mark tables unallocated */
|
/* Mark tables unallocated */
|
||||||
|
|||||||
Vendored
+19
@@ -2,6 +2,7 @@
|
|||||||
* jcinit.c
|
* jcinit.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
|
* Modified 2003-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -29,6 +30,24 @@
|
|||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jinit_compress_master (j_compress_ptr cinfo)
|
jinit_compress_master (j_compress_ptr cinfo)
|
||||||
{
|
{
|
||||||
|
long samplesperrow;
|
||||||
|
JDIMENSION jd_samplesperrow;
|
||||||
|
|
||||||
|
/* For now, precision must match compiled-in value... */
|
||||||
|
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||||
|
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||||
|
|
||||||
|
/* Sanity check on image dimensions */
|
||||||
|
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
||||||
|
cinfo->input_components <= 0)
|
||||||
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
|
/* Width of an input scanline must be representable as JDIMENSION. */
|
||||||
|
samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
|
||||||
|
jd_samplesperrow = (JDIMENSION) samplesperrow;
|
||||||
|
if ((long) jd_samplesperrow != samplesperrow)
|
||||||
|
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
||||||
|
|
||||||
/* Initialize master control (includes parameter checking/processing) */
|
/* Initialize master control (includes parameter checking/processing) */
|
||||||
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
jinit_c_master_control(cinfo, FALSE /* full compression */);
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jcmarker.c
|
* jcmarker.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2003-2012 by Guido Vollbeding.
|
* Modified 2003-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -508,8 +508,8 @@ write_marker_byte (j_compress_ptr cinfo, int val)
|
|||||||
* Write datastream header.
|
* Write datastream header.
|
||||||
* This consists of an SOI and optional APPn markers.
|
* This consists of an SOI and optional APPn markers.
|
||||||
* We recommend use of the JFIF marker, but not the Adobe marker,
|
* We recommend use of the JFIF marker, but not the Adobe marker,
|
||||||
* when using YCbCr or grayscale data. The JFIF marker should NOT
|
* when using YCbCr or grayscale data. The JFIF marker is also used
|
||||||
* be used for any other JPEG colorspace. The Adobe marker is helpful
|
* for other standard JPEG colorspaces. The Adobe marker is helpful
|
||||||
* to distinguish RGB, CMYK, and YCCK colorspaces.
|
* to distinguish RGB, CMYK, and YCCK colorspaces.
|
||||||
* Note that an application can write additional header markers after
|
* Note that an application can write additional header markers after
|
||||||
* jpeg_start_compress returns.
|
* jpeg_start_compress returns.
|
||||||
|
|||||||
Vendored
+17
-19
@@ -2,7 +2,7 @@
|
|||||||
* jcmaster.c
|
* jcmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2003-2011 by Guido Vollbeding.
|
* Modified 2003-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -222,8 +222,6 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
{
|
{
|
||||||
int ci, ssize;
|
int ci, ssize;
|
||||||
jpeg_component_info *compptr;
|
jpeg_component_info *compptr;
|
||||||
long samplesperrow;
|
|
||||||
JDIMENSION jd_samplesperrow;
|
|
||||||
|
|
||||||
if (transcode_only)
|
if (transcode_only)
|
||||||
jpeg_calc_trans_dimensions(cinfo);
|
jpeg_calc_trans_dimensions(cinfo);
|
||||||
@@ -251,7 +249,7 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
|
|
||||||
/* Sanity check on image dimensions */
|
/* Sanity check on image dimensions */
|
||||||
if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||
|
if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||
|
||||||
cinfo->num_components <= 0 || cinfo->input_components <= 0)
|
cinfo->num_components <= 0)
|
||||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
/* Make sure image isn't bigger than I can handle */
|
/* Make sure image isn't bigger than I can handle */
|
||||||
@@ -259,14 +257,8 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
(long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION)
|
(long) cinfo->jpeg_width > (long) JPEG_MAX_DIMENSION)
|
||||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
||||||
|
|
||||||
/* Width of an input scanline must be representable as JDIMENSION. */
|
/* Only 8 to 12 bits data precision are supported for DCT based JPEG */
|
||||||
samplesperrow = (long) cinfo->image_width * (long) cinfo->input_components;
|
if (cinfo->data_precision < 8 || cinfo->data_precision > 12)
|
||||||
jd_samplesperrow = (JDIMENSION) samplesperrow;
|
|
||||||
if ((long) jd_samplesperrow != samplesperrow)
|
|
||||||
ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
|
|
||||||
|
|
||||||
/* For now, precision must match compiled-in value... */
|
|
||||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
|
||||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||||
|
|
||||||
/* Check that number of components won't exceed internal array sizes */
|
/* Check that number of components won't exceed internal array sizes */
|
||||||
@@ -339,8 +331,10 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
jdiv_round_up((long) cinfo->jpeg_height *
|
jdiv_round_up((long) cinfo->jpeg_height *
|
||||||
(long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),
|
(long) (compptr->v_samp_factor * compptr->DCT_v_scaled_size),
|
||||||
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
|
(long) (cinfo->max_v_samp_factor * cinfo->block_size));
|
||||||
/* Mark component needed (this flag isn't actually used for compression) */
|
/* Don't need quantization scale after DCT,
|
||||||
compptr->component_needed = TRUE;
|
* until color conversion says otherwise.
|
||||||
|
*/
|
||||||
|
compptr->component_needed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Compute number of fully interleaved MCU rows (number of times that
|
/* Compute number of fully interleaved MCU rows (number of times that
|
||||||
@@ -811,7 +805,7 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
master = (my_master_ptr)
|
master = (my_master_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_comp_master));
|
SIZEOF(my_comp_master));
|
||||||
cinfo->master = (struct jpeg_comp_master *) master;
|
cinfo->master = &master->pub;
|
||||||
master->pub.prepare_for_pass = prepare_for_pass;
|
master->pub.prepare_for_pass = prepare_for_pass;
|
||||||
master->pub.pass_startup = pass_startup;
|
master->pub.pass_startup = pass_startup;
|
||||||
master->pub.finish_pass = finish_pass_master;
|
master->pub.finish_pass = finish_pass_master;
|
||||||
@@ -833,10 +827,14 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
|||||||
cinfo->num_scans = 1;
|
cinfo->num_scans = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cinfo->progressive_mode || cinfo->block_size < DCTSIZE) &&
|
if (cinfo->optimize_coding)
|
||||||
!cinfo->arith_code) /* TEMPORARY HACK ??? */
|
cinfo->arith_code = FALSE; /* disable arithmetic coding */
|
||||||
/* assume default tables no good for progressive or downscale mode */
|
else if (! cinfo->arith_code &&
|
||||||
cinfo->optimize_coding = TRUE;
|
(cinfo->progressive_mode ||
|
||||||
|
(cinfo->block_size > 1 && cinfo->block_size < DCTSIZE)))
|
||||||
|
/* TEMPORARY HACK ??? */
|
||||||
|
/* assume default tables no good for progressive or reduced AC mode */
|
||||||
|
cinfo->optimize_coding = TRUE; /* force Huffman optimization */
|
||||||
|
|
||||||
/* Initialize my private state */
|
/* Initialize my private state */
|
||||||
if (transcode_only) {
|
if (transcode_only) {
|
||||||
|
|||||||
Vendored
+15
-99
@@ -1,136 +1,52 @@
|
|||||||
|
/* jconfig.vc --- jconfig.h for Microsoft Visual C++ on Windows 9x or NT. */
|
||||||
|
/* This file also works for Borland C++ 32-bit (bcc32) on Windows 9x or NT. */
|
||||||
|
/* see jconfig.txt for explanations */
|
||||||
|
|
||||||
#define HAVE_PROTOTYPES
|
#define HAVE_PROTOTYPES
|
||||||
#define HAVE_UNSIGNED_CHAR
|
#define HAVE_UNSIGNED_CHAR
|
||||||
#define HAVE_UNSIGNED_SHORT
|
#define HAVE_UNSIGNED_SHORT
|
||||||
|
/* #define void char */
|
||||||
/* Define this if an ordinary "char" type is unsigned.
|
/* #define const */
|
||||||
* If you're not sure, leaving it undefined will work at some cost in speed.
|
|
||||||
* If you defined HAVE_UNSIGNED_CHAR then the speed difference is minimal.
|
|
||||||
*/
|
|
||||||
#undef CHAR_IS_UNSIGNED
|
#undef CHAR_IS_UNSIGNED
|
||||||
|
|
||||||
#if defined __MINGW__ || defined __MINGW32__ || (!defined WIN32 && !defined _WIN32)
|
|
||||||
/* Define this if your system has an ANSI-conforming <stddef.h> file.
|
|
||||||
*/
|
|
||||||
#define HAVE_STDDEF_H
|
#define HAVE_STDDEF_H
|
||||||
|
|
||||||
/* Define this if your system has an ANSI-conforming <stdlib.h> file.
|
|
||||||
*/
|
|
||||||
#define HAVE_STDLIB_H
|
#define HAVE_STDLIB_H
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define this if your system does not have an ANSI/SysV <string.h>,
|
|
||||||
* but does have a BSD-style <strings.h>.
|
|
||||||
*/
|
|
||||||
#undef NEED_BSD_STRINGS
|
#undef NEED_BSD_STRINGS
|
||||||
|
|
||||||
/* Define this if your system does not provide typedef size_t in any of the
|
|
||||||
* ANSI-standard places (stddef.h, stdlib.h, or stdio.h), but places it in
|
|
||||||
* <sys/types.h> instead.
|
|
||||||
*/
|
|
||||||
#undef NEED_SYS_TYPES_H
|
#undef NEED_SYS_TYPES_H
|
||||||
|
#undef NEED_FAR_POINTERS /* we presume a 32-bit flat memory model */
|
||||||
/* For 80x86 machines, you need to define NEED_FAR_POINTERS,
|
|
||||||
* unless you are using a large-data memory model or 80386 flat-memory mode.
|
|
||||||
* On less brain-damaged CPUs this symbol must not be defined.
|
|
||||||
* (Defining this symbol causes large data structures to be referenced through
|
|
||||||
* "far" pointers and to be allocated with a special version of malloc.)
|
|
||||||
*/
|
|
||||||
#undef NEED_FAR_POINTERS
|
|
||||||
|
|
||||||
/* Define this if your linker needs global names to be unique in less
|
|
||||||
* than the first 15 characters.
|
|
||||||
*/
|
|
||||||
#undef NEED_SHORT_EXTERNAL_NAMES
|
#undef NEED_SHORT_EXTERNAL_NAMES
|
||||||
|
|
||||||
/* Although a real ANSI C compiler can deal perfectly well with pointers to
|
|
||||||
* unspecified structures (see "incomplete types" in the spec), a few pre-ANSI
|
|
||||||
* and pseudo-ANSI compilers get confused. To keep one of these bozos happy,
|
|
||||||
* define INCOMPLETE_TYPES_BROKEN. This is not recommended unless you
|
|
||||||
* actually get "missing structure definition" warnings or errors while
|
|
||||||
* compiling the JPEG code.
|
|
||||||
*/
|
|
||||||
#undef INCOMPLETE_TYPES_BROKEN
|
#undef INCOMPLETE_TYPES_BROKEN
|
||||||
|
|
||||||
/* Define "boolean" as unsigned char, not int, on Windows systems.
|
/* Define "boolean" as unsigned char, not enum, per Windows custom */
|
||||||
*/
|
|
||||||
#ifdef _WIN32
|
|
||||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||||
typedef unsigned char boolean;
|
typedef unsigned char boolean;
|
||||||
#endif
|
#endif
|
||||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
#ifndef FALSE /* in case these macros already exist */
|
||||||
|
#define FALSE 0 /* values of boolean */
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif
|
||||||
|
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The following options affect code selection within the JPEG library,
|
|
||||||
* but they don't need to be visible to applications using the library.
|
|
||||||
* To minimize application namespace pollution, the symbols won't be
|
|
||||||
* defined unless JPEG_INTERNALS has been defined.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef JPEG_INTERNALS
|
#ifdef JPEG_INTERNALS
|
||||||
|
|
||||||
/* Define this if your compiler implements ">>" on signed values as a logical
|
|
||||||
* (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift,
|
|
||||||
* which is the normal and rational definition.
|
|
||||||
*/
|
|
||||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||||
|
|
||||||
/* These are for configuring the JPEG memory manager. */
|
|
||||||
#define DEFAULT_MAX_MEM 1073741824 /*1Gb*/
|
|
||||||
|
|
||||||
#if !defined WIN32 && !defined _WIN32
|
|
||||||
#define INLINE __inline__
|
|
||||||
#undef NO_MKTEMP
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* JPEG_INTERNALS */
|
#endif /* JPEG_INTERNALS */
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The remaining options do not affect the JPEG library proper,
|
|
||||||
* but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c).
|
|
||||||
* Other applications can ignore these.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef JPEG_CJPEG_DJPEG
|
#ifdef JPEG_CJPEG_DJPEG
|
||||||
|
|
||||||
/* These defines indicate which image (non-JPEG) file formats are allowed. */
|
|
||||||
|
|
||||||
#define BMP_SUPPORTED /* BMP image file format */
|
#define BMP_SUPPORTED /* BMP image file format */
|
||||||
#define GIF_SUPPORTED /* GIF image file format */
|
#define GIF_SUPPORTED /* GIF image file format */
|
||||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||||
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
#undef RLE_SUPPORTED /* Utah RLE image file format */
|
||||||
#define TARGA_SUPPORTED /* Targa image file format */
|
#define TARGA_SUPPORTED /* Targa image file format */
|
||||||
|
|
||||||
/* Define this if you want to name both input and output files on the command
|
|
||||||
* line, rather than using stdout and optionally stdin. You MUST do this if
|
|
||||||
* your system can't cope with binary I/O to stdin/stdout. See comments at
|
|
||||||
* head of cjpeg.c or djpeg.c.
|
|
||||||
*/
|
|
||||||
#if defined WIN32 || defined _WIN32
|
|
||||||
#define TWO_FILE_COMMANDLINE /* optional */
|
#define TWO_FILE_COMMANDLINE /* optional */
|
||||||
#define USE_SETMODE /* Microsoft has setmode() */
|
#define USE_SETMODE /* Microsoft has setmode() */
|
||||||
#else
|
|
||||||
#undef TWO_FILE_COMMANDLINE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define this if your system needs explicit cleanup of temporary files.
|
|
||||||
* This is crucial under MS-DOS, where the temporary "files" may be areas
|
|
||||||
* of extended memory; on most other systems it's not as important.
|
|
||||||
*/
|
|
||||||
#undef NEED_SIGNAL_CATCHER
|
#undef NEED_SIGNAL_CATCHER
|
||||||
|
|
||||||
/* By default, we open image files with fopen(...,"rb") or fopen(...,"wb").
|
|
||||||
* This is necessary on systems that distinguish text files from binary files,
|
|
||||||
* and is harmless on most systems that don't. If you have one of the rare
|
|
||||||
* systems that complains about the "b" spec, define this symbol.
|
|
||||||
*/
|
|
||||||
#undef DONT_USE_B_MODE
|
#undef DONT_USE_B_MODE
|
||||||
|
#undef PROGRESS_REPORT /* optional */
|
||||||
/* Define this if you want percent-done progress reports from cjpeg/djpeg.
|
|
||||||
*/
|
|
||||||
#undef PROGRESS_REPORT
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* JPEG_CJPEG_DJPEG */
|
#endif /* JPEG_CJPEG_DJPEG */
|
||||||
|
|||||||
Vendored
+74
-36
@@ -2,7 +2,7 @@
|
|||||||
* jcparam.c
|
* jcparam.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2003-2012 by Guido Vollbeding.
|
* Modified 2003-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -323,18 +323,17 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
|||||||
/* Expect normal source image, not raw downsampled data */
|
/* Expect normal source image, not raw downsampled data */
|
||||||
cinfo->raw_data_in = FALSE;
|
cinfo->raw_data_in = FALSE;
|
||||||
|
|
||||||
/* Use Huffman coding, not arithmetic coding, by default */
|
/* The standard Huffman tables are only valid for 8-bit data precision.
|
||||||
cinfo->arith_code = FALSE;
|
* If the precision is higher, use arithmetic coding.
|
||||||
|
* (Alternatively, using Huffman coding would be possible with forcing
|
||||||
|
* optimization on so that usable tables will be computed, or by
|
||||||
|
* supplying default tables that are valid for the desired precision.)
|
||||||
|
* Otherwise, use Huffman coding by default.
|
||||||
|
*/
|
||||||
|
cinfo->arith_code = cinfo->data_precision > 8 ? TRUE : FALSE;
|
||||||
|
|
||||||
/* By default, don't do extra passes to optimize entropy coding */
|
/* By default, don't do extra passes to optimize entropy coding */
|
||||||
cinfo->optimize_coding = FALSE;
|
cinfo->optimize_coding = FALSE;
|
||||||
/* The standard Huffman tables are only valid for 8-bit data precision.
|
|
||||||
* If the precision is higher, force optimization on so that usable
|
|
||||||
* tables will be computed. This test can be removed if default tables
|
|
||||||
* are supplied that are valid for the desired precision.
|
|
||||||
*/
|
|
||||||
if (cinfo->data_precision > 8)
|
|
||||||
cinfo->optimize_coding = TRUE;
|
|
||||||
|
|
||||||
/* By default, use the simpler non-cosited sampling alignment */
|
/* By default, use the simpler non-cosited sampling alignment */
|
||||||
cinfo->CCIR601_sampling = FALSE;
|
cinfo->CCIR601_sampling = FALSE;
|
||||||
@@ -360,6 +359,9 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
|||||||
* JFIF_minor_version to 2. We could probably get away with just defaulting
|
* JFIF_minor_version to 2. We could probably get away with just defaulting
|
||||||
* to 1.02, but there may still be some decoders in use that will complain
|
* to 1.02, but there may still be some decoders in use that will complain
|
||||||
* about that; saying 1.01 should minimize compatibility problems.
|
* about that; saying 1.01 should minimize compatibility problems.
|
||||||
|
*
|
||||||
|
* For wide gamut colorspaces (BG_RGB and BG_YCC), the major version will be
|
||||||
|
* overridden by jpeg_set_colorspace and set to 2.
|
||||||
*/
|
*/
|
||||||
cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
|
cinfo->JFIF_major_version = 1; /* Default JFIF version = 1.01 */
|
||||||
cinfo->JFIF_minor_version = 1;
|
cinfo->JFIF_minor_version = 1;
|
||||||
@@ -384,6 +386,9 @@ GLOBAL(void)
|
|||||||
jpeg_default_colorspace (j_compress_ptr cinfo)
|
jpeg_default_colorspace (j_compress_ptr cinfo)
|
||||||
{
|
{
|
||||||
switch (cinfo->in_color_space) {
|
switch (cinfo->in_color_space) {
|
||||||
|
case JCS_UNKNOWN:
|
||||||
|
jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
|
||||||
|
break;
|
||||||
case JCS_GRAYSCALE:
|
case JCS_GRAYSCALE:
|
||||||
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
|
jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
|
||||||
break;
|
break;
|
||||||
@@ -399,8 +404,12 @@ jpeg_default_colorspace (j_compress_ptr cinfo)
|
|||||||
case JCS_YCCK:
|
case JCS_YCCK:
|
||||||
jpeg_set_colorspace(cinfo, JCS_YCCK);
|
jpeg_set_colorspace(cinfo, JCS_YCCK);
|
||||||
break;
|
break;
|
||||||
case JCS_UNKNOWN:
|
case JCS_BG_RGB:
|
||||||
jpeg_set_colorspace(cinfo, JCS_UNKNOWN);
|
/* No translation for now -- conversion to BG_YCC not yet supportet */
|
||||||
|
jpeg_set_colorspace(cinfo, JCS_BG_RGB);
|
||||||
|
break;
|
||||||
|
case JCS_BG_YCC:
|
||||||
|
jpeg_set_colorspace(cinfo, JCS_BG_YCC);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
|
||||||
@@ -441,29 +450,40 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
|||||||
cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
|
cinfo->write_Adobe_marker = FALSE; /* write no Adobe marker by default */
|
||||||
|
|
||||||
switch (colorspace) {
|
switch (colorspace) {
|
||||||
|
case JCS_UNKNOWN:
|
||||||
|
cinfo->num_components = cinfo->input_components;
|
||||||
|
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
|
||||||
|
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
||||||
|
MAX_COMPONENTS);
|
||||||
|
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||||
|
SET_COMP(ci, ci, 1,1, 0, 0,0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case JCS_GRAYSCALE:
|
case JCS_GRAYSCALE:
|
||||||
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||||
cinfo->num_components = 1;
|
cinfo->num_components = 1;
|
||||||
/* JFIF specifies component ID 1 */
|
/* JFIF specifies component ID 1 */
|
||||||
SET_COMP(0, 1, 1,1, 0, 0,0);
|
SET_COMP(0, 0x01, 1,1, 0, 0,0);
|
||||||
break;
|
break;
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
|
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
|
||||||
cinfo->num_components = 3;
|
cinfo->num_components = 3;
|
||||||
SET_COMP(0, 0x52 /* 'R' */, 1,1, 0, 0,0);
|
SET_COMP(0, 0x52 /* 'R' */, 1,1, 0,
|
||||||
SET_COMP(1, 0x47 /* 'G' */, 1,1, 0,
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
|
||||||
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
|
||||||
|
SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
|
||||||
|
SET_COMP(2, 0x42 /* 'B' */, 1,1, 0,
|
||||||
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
|
||||||
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
|
||||||
SET_COMP(2, 0x42 /* 'B' */, 1,1, 0, 0,0);
|
|
||||||
break;
|
break;
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||||
cinfo->num_components = 3;
|
cinfo->num_components = 3;
|
||||||
/* JFIF specifies component IDs 1,2,3 */
|
/* JFIF specifies component IDs 1,2,3 */
|
||||||
/* We default to 2x2 subsamples of chrominance */
|
/* We default to 2x2 subsamples of chrominance */
|
||||||
SET_COMP(0, 1, 2,2, 0, 0,0);
|
SET_COMP(0, 0x01, 2,2, 0, 0,0);
|
||||||
SET_COMP(1, 2, 1,1, 1, 1,1);
|
SET_COMP(1, 0x02, 1,1, 1, 1,1);
|
||||||
SET_COMP(2, 3, 1,1, 1, 1,1);
|
SET_COMP(2, 0x03, 1,1, 1, 1,1);
|
||||||
break;
|
break;
|
||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
|
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag CMYK */
|
||||||
@@ -476,19 +496,33 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
|
|||||||
case JCS_YCCK:
|
case JCS_YCCK:
|
||||||
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
|
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag YCCK */
|
||||||
cinfo->num_components = 4;
|
cinfo->num_components = 4;
|
||||||
SET_COMP(0, 1, 2,2, 0, 0,0);
|
SET_COMP(0, 0x01, 2,2, 0, 0,0);
|
||||||
SET_COMP(1, 2, 1,1, 1, 1,1);
|
SET_COMP(1, 0x02, 1,1, 1, 1,1);
|
||||||
SET_COMP(2, 3, 1,1, 1, 1,1);
|
SET_COMP(2, 0x03, 1,1, 1, 1,1);
|
||||||
SET_COMP(3, 4, 2,2, 0, 0,0);
|
SET_COMP(3, 0x04, 2,2, 0, 0,0);
|
||||||
break;
|
break;
|
||||||
case JCS_UNKNOWN:
|
case JCS_BG_RGB:
|
||||||
cinfo->num_components = cinfo->input_components;
|
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||||
if (cinfo->num_components < 1 || cinfo->num_components > MAX_COMPONENTS)
|
cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */
|
||||||
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
|
cinfo->num_components = 3;
|
||||||
MAX_COMPONENTS);
|
/* Add offset 0x20 to the normal R/G/B component IDs */
|
||||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
SET_COMP(0, 0x72 /* 'r' */, 1,1, 0,
|
||||||
SET_COMP(ci, ci, 1,1, 0, 0,0);
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
|
||||||
}
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
|
||||||
|
SET_COMP(1, 0x67 /* 'g' */, 1,1, 0, 0,0);
|
||||||
|
SET_COMP(2, 0x62 /* 'b' */, 1,1, 0,
|
||||||
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
|
||||||
|
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
|
||||||
|
break;
|
||||||
|
case JCS_BG_YCC:
|
||||||
|
cinfo->write_JFIF_header = TRUE; /* Write a JFIF marker */
|
||||||
|
cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */
|
||||||
|
cinfo->num_components = 3;
|
||||||
|
/* Add offset 0x20 to the normal Cb/Cr component IDs */
|
||||||
|
/* We default to 2x2 subsamples of chrominance */
|
||||||
|
SET_COMP(0, 0x01, 2,2, 0, 0,0);
|
||||||
|
SET_COMP(1, 0x22, 1,1, 1, 1,1);
|
||||||
|
SET_COMP(2, 0x23, 1,1, 1, 1,1);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
@@ -572,8 +606,10 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
|||||||
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
|
||||||
|
|
||||||
/* Figure space needed for script. Calculation must match code below! */
|
/* Figure space needed for script. Calculation must match code below! */
|
||||||
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
|
if (ncomps == 3 &&
|
||||||
/* Custom script for YCbCr color images. */
|
(cinfo->jpeg_color_space == JCS_YCbCr ||
|
||||||
|
cinfo->jpeg_color_space == JCS_BG_YCC)) {
|
||||||
|
/* Custom script for YCC color images. */
|
||||||
nscans = 10;
|
nscans = 10;
|
||||||
} else {
|
} else {
|
||||||
/* All-purpose script for other color spaces. */
|
/* All-purpose script for other color spaces. */
|
||||||
@@ -588,7 +624,7 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
|||||||
* multiple compressions without changing the settings. To avoid a memory
|
* multiple compressions without changing the settings. To avoid a memory
|
||||||
* leak if jpeg_simple_progression is called repeatedly for the same JPEG
|
* leak if jpeg_simple_progression is called repeatedly for the same JPEG
|
||||||
* object, we try to re-use previously allocated space, and we allocate
|
* object, we try to re-use previously allocated space, and we allocate
|
||||||
* enough space to handle YCbCr even if initially asked for grayscale.
|
* enough space to handle YCC even if initially asked for grayscale.
|
||||||
*/
|
*/
|
||||||
if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
|
if (cinfo->script_space == NULL || cinfo->script_space_size < nscans) {
|
||||||
cinfo->script_space_size = MAX(nscans, 10);
|
cinfo->script_space_size = MAX(nscans, 10);
|
||||||
@@ -600,8 +636,10 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
|||||||
cinfo->scan_info = scanptr;
|
cinfo->scan_info = scanptr;
|
||||||
cinfo->num_scans = nscans;
|
cinfo->num_scans = nscans;
|
||||||
|
|
||||||
if (ncomps == 3 && cinfo->jpeg_color_space == JCS_YCbCr) {
|
if (ncomps == 3 &&
|
||||||
/* Custom script for YCbCr color images. */
|
(cinfo->jpeg_color_space == JCS_YCbCr ||
|
||||||
|
cinfo->jpeg_color_space == JCS_BG_YCC)) {
|
||||||
|
/* Custom script for YCC color images. */
|
||||||
/* Initial DC scan */
|
/* Initial DC scan */
|
||||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
|
scanptr = fill_dc_scans(scanptr, ncomps, 0, 1);
|
||||||
/* Initial AC scan: get some luma data out in a hurry */
|
/* Initial AC scan: get some luma data out in a hurry */
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jctrans.c
|
* jctrans.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1995-1998, Thomas G. Lane.
|
* Copyright (C) 1995-1998, Thomas G. Lane.
|
||||||
* Modified 2000-2012 by Guido Vollbeding.
|
* Modified 2000-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -143,10 +143,10 @@ jpeg_copy_critical_parameters (j_decompress_ptr srcinfo,
|
|||||||
* if the application chooses to copy JFIF 1.02 extension markers from
|
* if the application chooses to copy JFIF 1.02 extension markers from
|
||||||
* the source file, we need to copy the version to make sure we don't
|
* the source file, we need to copy the version to make sure we don't
|
||||||
* emit a file that has 1.02 extensions but a claimed version of 1.01.
|
* emit a file that has 1.02 extensions but a claimed version of 1.01.
|
||||||
* We will *not*, however, copy version info from mislabeled "2.01" files.
|
|
||||||
*/
|
*/
|
||||||
if (srcinfo->saw_JFIF_marker) {
|
if (srcinfo->saw_JFIF_marker) {
|
||||||
if (srcinfo->JFIF_major_version == 1) {
|
if (srcinfo->JFIF_major_version == 1 ||
|
||||||
|
srcinfo->JFIF_major_version == 2) {
|
||||||
dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
|
dstinfo->JFIF_major_version = srcinfo->JFIF_major_version;
|
||||||
dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
|
dstinfo->JFIF_minor_version = srcinfo->JFIF_minor_version;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+19
-16
@@ -2,7 +2,7 @@
|
|||||||
* jdapimin.c
|
* jdapimin.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
* Modified 2009 by Guido Vollbeding.
|
* Modified 2009-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -114,8 +114,9 @@ jpeg_abort_decompress (j_decompress_ptr cinfo)
|
|||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
default_decompress_parms (j_decompress_ptr cinfo)
|
default_decompress_parms (j_decompress_ptr cinfo)
|
||||||
{
|
{
|
||||||
|
int cid0, cid1, cid2;
|
||||||
|
|
||||||
/* Guess the input colorspace, and set output colorspace accordingly. */
|
/* Guess the input colorspace, and set output colorspace accordingly. */
|
||||||
/* (Wish JPEG committee had provided a real way to specify this...) */
|
|
||||||
/* Note application may override our guesses. */
|
/* Note application may override our guesses. */
|
||||||
switch (cinfo->num_components) {
|
switch (cinfo->num_components) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -124,9 +125,22 @@ default_decompress_parms (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (cinfo->saw_JFIF_marker) {
|
cid0 = cinfo->comp_info[0].component_id;
|
||||||
cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
|
cid1 = cinfo->comp_info[1].component_id;
|
||||||
} else if (cinfo->saw_Adobe_marker) {
|
cid2 = cinfo->comp_info[2].component_id;
|
||||||
|
|
||||||
|
/* First try to guess from the component IDs */
|
||||||
|
if (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03)
|
||||||
|
cinfo->jpeg_color_space = JCS_YCbCr;
|
||||||
|
else if (cid0 == 0x01 && cid1 == 0x22 && cid2 == 0x23)
|
||||||
|
cinfo->jpeg_color_space = JCS_BG_YCC;
|
||||||
|
else if (cid0 == 0x52 && cid1 == 0x47 && cid2 == 0x42)
|
||||||
|
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
|
||||||
|
else if (cid0 == 0x72 && cid1 == 0x67 && cid2 == 0x62)
|
||||||
|
cinfo->jpeg_color_space = JCS_BG_RGB; /* ASCII 'r', 'g', 'b' */
|
||||||
|
else if (cinfo->saw_JFIF_marker)
|
||||||
|
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
|
||||||
|
else if (cinfo->saw_Adobe_marker) {
|
||||||
switch (cinfo->Adobe_transform) {
|
switch (cinfo->Adobe_transform) {
|
||||||
case 0:
|
case 0:
|
||||||
cinfo->jpeg_color_space = JCS_RGB;
|
cinfo->jpeg_color_space = JCS_RGB;
|
||||||
@@ -140,20 +154,9 @@ default_decompress_parms (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Saw no special markers, try to guess from the component IDs */
|
|
||||||
int cid0 = cinfo->comp_info[0].component_id;
|
|
||||||
int cid1 = cinfo->comp_info[1].component_id;
|
|
||||||
int cid2 = cinfo->comp_info[2].component_id;
|
|
||||||
|
|
||||||
if (cid0 == 1 && cid1 == 2 && cid2 == 3)
|
|
||||||
cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
|
|
||||||
else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
|
|
||||||
cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
|
|
||||||
else {
|
|
||||||
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
|
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
|
||||||
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
|
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* Always guess RGB is proper output colorspace. */
|
/* Always guess RGB is proper output colorspace. */
|
||||||
cinfo->out_color_space = JCS_RGB;
|
cinfo->out_color_space = JCS_RGB;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Vendored
+1
@@ -2,6 +2,7 @@
|
|||||||
* jdapistd.c
|
* jdapistd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
|
* Modified 2002-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
|
|||||||
Vendored
+16
-2
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jdarith.c
|
* jdarith.c
|
||||||
*
|
*
|
||||||
* Developed 1997-2012 by Guido Vollbeding.
|
* Developed 1997-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -94,7 +94,7 @@ get_byte (j_decompress_ptr cinfo)
|
|||||||
* (instead of fixed) with the bit shift counter CT.
|
* (instead of fixed) with the bit shift counter CT.
|
||||||
* Thus, we also need only one (variable instead of
|
* Thus, we also need only one (variable instead of
|
||||||
* fixed size) shift for the LPS/MPS decision, and
|
* fixed size) shift for the LPS/MPS decision, and
|
||||||
* we can get away with any renormalization update
|
* we can do away with any renormalization update
|
||||||
* of C (except for new data insertion, of course).
|
* of C (except for new data insertion, of course).
|
||||||
*
|
*
|
||||||
* I've also introduced a new scheme for accessing
|
* I've also introduced a new scheme for accessing
|
||||||
@@ -395,6 +395,8 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU decoding for DC successive approximation refinement scan.
|
* MCU decoding for DC successive approximation refinement scan.
|
||||||
|
* Note: we assume such scans can be multi-component,
|
||||||
|
* although the spec is not very clear on the point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
@@ -743,6 +745,17 @@ start_pass (j_decompress_ptr cinfo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Finish up at the end of an arithmetic-compressed scan.
|
||||||
|
*/
|
||||||
|
|
||||||
|
METHODDEF(void)
|
||||||
|
finish_pass (j_decompress_ptr cinfo)
|
||||||
|
{
|
||||||
|
/* no work necessary here */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Module initialization routine for arithmetic entropy decoding.
|
* Module initialization routine for arithmetic entropy decoding.
|
||||||
*/
|
*/
|
||||||
@@ -758,6 +771,7 @@ jinit_arith_decoder (j_decompress_ptr cinfo)
|
|||||||
SIZEOF(arith_entropy_decoder));
|
SIZEOF(arith_entropy_decoder));
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass;
|
entropy->pub.start_pass = start_pass;
|
||||||
|
entropy->pub.finish_pass = finish_pass;
|
||||||
|
|
||||||
/* Mark tables unallocated */
|
/* Mark tables unallocated */
|
||||||
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
for (i = 0; i < NUM_ARITH_TBLS; i++) {
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jdatasrc.c
|
* jdatasrc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2009-2011 by Guido Vollbeding.
|
* Modified 2009-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -247,7 +247,7 @@ jpeg_stdio_src (j_decompress_ptr cinfo, FILE * infile)
|
|||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
jpeg_mem_src (j_decompress_ptr cinfo,
|
jpeg_mem_src (j_decompress_ptr cinfo,
|
||||||
unsigned char * inbuffer, unsigned long insize)
|
const unsigned char * inbuffer, unsigned long insize)
|
||||||
{
|
{
|
||||||
struct jpeg_source_mgr * src;
|
struct jpeg_source_mgr * src;
|
||||||
|
|
||||||
@@ -271,5 +271,5 @@ jpeg_mem_src (j_decompress_ptr cinfo,
|
|||||||
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
|
||||||
src->term_source = term_source;
|
src->term_source = term_source;
|
||||||
src->bytes_in_buffer = (size_t) insize;
|
src->bytes_in_buffer = (size_t) insize;
|
||||||
src->next_input_byte = (JOCTET *) inbuffer;
|
src->next_input_byte = (const JOCTET *) inbuffer;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+152
-45
@@ -2,7 +2,7 @@
|
|||||||
* jdcolor.c
|
* jdcolor.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2011-2012 by Guido Vollbeding.
|
* Modified 2011-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
struct jpeg_color_deconverter pub; /* public fields */
|
struct jpeg_color_deconverter pub; /* public fields */
|
||||||
|
|
||||||
/* Private state for YCC->RGB conversion */
|
/* Private state for YCbCr->RGB and BG_YCC->RGB conversion */
|
||||||
int * Cr_r_tab; /* => table for Cr to R conversion */
|
int * Cr_r_tab; /* => table for Cr to R conversion */
|
||||||
int * Cb_b_tab; /* => table for Cb to B conversion */
|
int * Cb_b_tab; /* => table for Cb to B conversion */
|
||||||
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
|
INT32 * Cr_g_tab; /* => table for Cr to G conversion */
|
||||||
@@ -32,22 +32,44 @@ typedef struct {
|
|||||||
typedef my_color_deconverter * my_cconvert_ptr;
|
typedef my_color_deconverter * my_cconvert_ptr;
|
||||||
|
|
||||||
|
|
||||||
/**************** YCbCr -> RGB conversion: most common case **************/
|
/*************** YCbCr -> RGB conversion: most common case **************/
|
||||||
/**************** RGB -> Y conversion: less common case **************/
|
/*************** BG_YCC -> RGB conversion: less common case **************/
|
||||||
|
/*************** RGB -> Y conversion: less common case **************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* YCbCr is defined per CCIR 601-1, except that Cb and Cr are
|
* YCbCr is defined per Recommendation ITU-R BT.601-7 (03/2011),
|
||||||
* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
* previously known as Recommendation CCIR 601-1, except that Cb and Cr
|
||||||
* The conversion equations to be implemented are therefore
|
* are normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.
|
||||||
|
* sRGB (standard RGB color space) is defined per IEC 61966-2-1:1999.
|
||||||
|
* sYCC (standard luma-chroma-chroma color space with extended gamut)
|
||||||
|
* is defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex F.
|
||||||
|
* bg-sRGB and bg-sYCC (big gamut standard color spaces)
|
||||||
|
* are defined per IEC 61966-2-1:1999 Amendment A1:2003 Annex G.
|
||||||
|
* Note that the derived conversion coefficients given in some of these
|
||||||
|
* documents are imprecise. The general conversion equations are
|
||||||
*
|
*
|
||||||
* R = Y + 1.40200 * Cr
|
* R = Y + K * (1 - Kr) * Cr
|
||||||
* G = Y - 0.34414 * Cb - 0.71414 * Cr
|
* G = Y - K * (Kb * (1 - Kb) * Cb + Kr * (1 - Kr) * Cr) / (1 - Kr - Kb)
|
||||||
* B = Y + 1.77200 * Cb
|
* B = Y + K * (1 - Kb) * Cb
|
||||||
*
|
*
|
||||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
* Y = Kr * R + (1 - Kr - Kb) * G + Kb * B
|
||||||
|
*
|
||||||
|
* With Kr = 0.299 and Kb = 0.114 (derived according to SMPTE RP 177-1993
|
||||||
|
* from the 1953 FCC NTSC primaries and CIE Illuminant C), K = 2 for sYCC,
|
||||||
|
* the conversion equations to be implemented are therefore
|
||||||
|
*
|
||||||
|
* R = Y + 1.402 * Cr
|
||||||
|
* G = Y - 0.344136286 * Cb - 0.714136286 * Cr
|
||||||
|
* B = Y + 1.772 * Cb
|
||||||
|
*
|
||||||
|
* Y = 0.299 * R + 0.587 * G + 0.114 * B
|
||||||
*
|
*
|
||||||
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
|
* where Cb and Cr represent the incoming values less CENTERJSAMPLE.
|
||||||
* (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.)
|
* For bg-sYCC, with K = 4, the equations are
|
||||||
|
*
|
||||||
|
* R = Y + 2.804 * Cr
|
||||||
|
* G = Y - 0.688272572 * Cb - 1.428272572 * Cr
|
||||||
|
* B = Y + 3.544 * Cb
|
||||||
*
|
*
|
||||||
* To avoid floating-point arithmetic, we represent the fractional constants
|
* To avoid floating-point arithmetic, we represent the fractional constants
|
||||||
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
|
* as integers scaled up by 2^16 (about 4 digits precision); we have to divide
|
||||||
@@ -58,9 +80,9 @@ typedef my_color_deconverter * my_cconvert_ptr;
|
|||||||
* For even more speed, we avoid doing any multiplications in the inner loop
|
* For even more speed, we avoid doing any multiplications in the inner loop
|
||||||
* by precalculating the constants times Cb and Cr for all possible values.
|
* by precalculating the constants times Cb and Cr for all possible values.
|
||||||
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
* For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table);
|
||||||
* for 12-bit samples it is still acceptable. It's not very reasonable for
|
* for 9-bit to 12-bit samples it is still acceptable. It's not very
|
||||||
* 16-bit samples, but if you want lossless storage you shouldn't be changing
|
* reasonable for 16-bit samples, but if you want lossless storage you
|
||||||
* colorspace anyway.
|
* shouldn't be changing colorspace anyway.
|
||||||
* The Cr=>R and Cb=>B values can be rounded to integers in advance; the
|
* The Cr=>R and Cb=>B values can be rounded to integers in advance; the
|
||||||
* values for the G calculation are left scaled up, since we must add them
|
* values for the G calculation are left scaled up, since we must add them
|
||||||
* together before rounding.
|
* together before rounding.
|
||||||
@@ -84,11 +106,12 @@ typedef my_color_deconverter * my_cconvert_ptr;
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize tables for YCC->RGB colorspace conversion.
|
* Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
build_ycc_rgb_table (j_decompress_ptr cinfo)
|
build_ycc_rgb_table (j_decompress_ptr cinfo)
|
||||||
|
/* Normal case, sYCC */
|
||||||
{
|
{
|
||||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||||
int i;
|
int i;
|
||||||
@@ -111,17 +134,57 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 1.40200 * x */
|
/* Cr=>R value is nearest int to 1.402 * x */
|
||||||
cconvert->Cr_r_tab[i] = (int)
|
cconvert->Cr_r_tab[i] = (int)
|
||||||
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
|
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
|
||||||
/* Cb=>B value is nearest int to 1.77200 * x */
|
/* Cb=>B value is nearest int to 1.772 * x */
|
||||||
cconvert->Cb_b_tab[i] = (int)
|
cconvert->Cb_b_tab[i] = (int)
|
||||||
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
|
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
|
||||||
/* Cr=>G value is scaled-up -0.71414 * x */
|
/* Cr=>G value is scaled-up -0.714136286 * x */
|
||||||
cconvert->Cr_g_tab[i] = (- FIX(0.71414)) * x;
|
cconvert->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.34414 * x */
|
/* Cb=>G value is scaled-up -0.344136286 * x */
|
||||||
/* We also add in ONE_HALF so that need not do it in inner loop */
|
/* We also add in ONE_HALF so that need not do it in inner loop */
|
||||||
cconvert->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
|
cconvert->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL(void)
|
||||||
|
build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
|
||||||
|
/* Wide gamut case, bg-sYCC */
|
||||||
|
{
|
||||||
|
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||||
|
int i;
|
||||||
|
INT32 x;
|
||||||
|
SHIFT_TEMPS
|
||||||
|
|
||||||
|
cconvert->Cr_r_tab = (int *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
|
cconvert->Cb_b_tab = (int *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
|
cconvert->Cr_g_tab = (INT32 *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
|
cconvert->Cb_g_tab = (INT32 *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
|
|
||||||
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
|
/* Cr=>R value is nearest int to 2.804 * x */
|
||||||
|
cconvert->Cr_r_tab[i] = (int)
|
||||||
|
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
|
||||||
|
/* Cb=>B value is nearest int to 3.544 * x */
|
||||||
|
cconvert->Cb_b_tab[i] = (int)
|
||||||
|
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
|
||||||
|
/* Cr=>G value is scaled-up -1.428272572 * x */
|
||||||
|
cconvert->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
||||||
|
/* Cb=>G value is scaled-up -0.688272572 * x */
|
||||||
|
/* We also add in ONE_HALF so that need not do it in inner loop */
|
||||||
|
cconvert->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +229,9 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
|
|||||||
y = GETJSAMPLE(inptr0[col]);
|
y = GETJSAMPLE(inptr0[col]);
|
||||||
cb = GETJSAMPLE(inptr1[col]);
|
cb = GETJSAMPLE(inptr1[col]);
|
||||||
cr = GETJSAMPLE(inptr2[col]);
|
cr = GETJSAMPLE(inptr2[col]);
|
||||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
/* Range-limiting is essential due to noise introduced by DCT losses,
|
||||||
|
* for extended gamut (sYCC) and wide gamut (bg-sYCC) encodings.
|
||||||
|
*/
|
||||||
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
|
outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
|
||||||
outptr[RGB_GREEN] = range_limit[y +
|
outptr[RGB_GREEN] = range_limit[y +
|
||||||
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||||
@@ -178,7 +243,7 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**************** Cases other than YCbCr -> RGB **************/
|
/**************** Cases other than YCC -> RGB ****************/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -198,9 +263,9 @@ build_rgb_y_table (j_decompress_ptr cinfo)
|
|||||||
(TABLE_SIZE * SIZEOF(INT32)));
|
(TABLE_SIZE * SIZEOF(INT32)));
|
||||||
|
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++) {
|
for (i = 0; i <= MAXJSAMPLE; i++) {
|
||||||
rgb_y_tab[i+R_Y_OFF] = FIX(0.29900) * i;
|
rgb_y_tab[i+R_Y_OFF] = FIX(0.299) * i;
|
||||||
rgb_y_tab[i+G_Y_OFF] = FIX(0.58700) * i;
|
rgb_y_tab[i+G_Y_OFF] = FIX(0.587) * i;
|
||||||
rgb_y_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
|
rgb_y_tab[i+B_Y_OFF] = FIX(0.114) * i + ONE_HALF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,6 +309,9 @@ rgb_gray_convert (j_decompress_ptr cinfo,
|
|||||||
/*
|
/*
|
||||||
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
|
* [R-G,G,B-G] to [R,G,B] conversion with modulo calculation
|
||||||
* (inverse color transform).
|
* (inverse color transform).
|
||||||
|
* This can be seen as an adaption of the general YCbCr->RGB
|
||||||
|
* conversion equation with Kr = Kb = 0, while replacing the
|
||||||
|
* normalization by modulo calculation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
@@ -387,7 +455,7 @@ null_convert (j_decompress_ptr cinfo,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Color conversion for grayscale: just copy the data.
|
* Color conversion for grayscale: just copy the data.
|
||||||
* This also works for YCbCr -> grayscale conversion, in which
|
* This also works for YCC -> grayscale conversion, in which
|
||||||
* we just copy the Y (luminance) component and ignore chrominance.
|
* we just copy the Y (luminance) component and ignore chrominance.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -466,7 +534,9 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
|
|||||||
y = GETJSAMPLE(inptr0[col]);
|
y = GETJSAMPLE(inptr0[col]);
|
||||||
cb = GETJSAMPLE(inptr1[col]);
|
cb = GETJSAMPLE(inptr1[col]);
|
||||||
cr = GETJSAMPLE(inptr2[col]);
|
cr = GETJSAMPLE(inptr2[col]);
|
||||||
/* Range-limiting is essential due to noise introduced by DCT losses. */
|
/* Range-limiting is essential due to noise introduced by DCT losses,
|
||||||
|
* and for extended gamut encodings (sYCC).
|
||||||
|
*/
|
||||||
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
|
outptr[0] = range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; /* red */
|
||||||
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
|
outptr[1] = range_limit[MAXJSAMPLE - (y + /* green */
|
||||||
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
|
||||||
@@ -516,6 +586,8 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
|
case JCS_BG_RGB:
|
||||||
|
case JCS_BG_YCC:
|
||||||
if (cinfo->num_components != 3)
|
if (cinfo->num_components != 3)
|
||||||
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
|
||||||
break;
|
break;
|
||||||
@@ -532,8 +604,10 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Support color transform only for RGB colorspace */
|
/* Support color transform only for RGB colorspaces */
|
||||||
if (cinfo->color_transform && cinfo->jpeg_color_space != JCS_RGB)
|
if (cinfo->color_transform &&
|
||||||
|
cinfo->jpeg_color_space != JCS_RGB &&
|
||||||
|
cinfo->jpeg_color_space != JCS_BG_RGB)
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
|
||||||
/* Set out_color_components and conversion method based on requested space.
|
/* Set out_color_components and conversion method based on requested space.
|
||||||
@@ -544,13 +618,16 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
switch (cinfo->out_color_space) {
|
switch (cinfo->out_color_space) {
|
||||||
case JCS_GRAYSCALE:
|
case JCS_GRAYSCALE:
|
||||||
cinfo->out_color_components = 1;
|
cinfo->out_color_components = 1;
|
||||||
if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
|
switch (cinfo->jpeg_color_space) {
|
||||||
cinfo->jpeg_color_space == JCS_YCbCr) {
|
case JCS_GRAYSCALE:
|
||||||
|
case JCS_YCbCr:
|
||||||
|
case JCS_BG_YCC:
|
||||||
cconvert->pub.color_convert = grayscale_convert;
|
cconvert->pub.color_convert = grayscale_convert;
|
||||||
/* For color->grayscale conversion, only the Y (0) component is needed */
|
/* For color->grayscale conversion, only the Y (0) component is needed */
|
||||||
for (ci = 1; ci < cinfo->num_components; ci++)
|
for (ci = 1; ci < cinfo->num_components; ci++)
|
||||||
cinfo->comp_info[ci].component_needed = FALSE;
|
cinfo->comp_info[ci].component_needed = FALSE;
|
||||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
break;
|
||||||
|
case JCS_RGB:
|
||||||
switch (cinfo->color_transform) {
|
switch (cinfo->color_transform) {
|
||||||
case JCT_NONE:
|
case JCT_NONE:
|
||||||
cconvert->pub.color_convert = rgb_gray_convert;
|
cconvert->pub.color_convert = rgb_gray_convert;
|
||||||
@@ -560,21 +637,29 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
build_rgb_y_table(cinfo);
|
build_rgb_y_table(cinfo);
|
||||||
} else
|
break;
|
||||||
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
switch (cinfo->jpeg_color_space) {
|
||||||
|
case JCS_GRAYSCALE:
|
||||||
|
cconvert->pub.color_convert = gray_rgb_convert;
|
||||||
|
break;
|
||||||
|
case JCS_YCbCr:
|
||||||
cconvert->pub.color_convert = ycc_rgb_convert;
|
cconvert->pub.color_convert = ycc_rgb_convert;
|
||||||
build_ycc_rgb_table(cinfo);
|
build_ycc_rgb_table(cinfo);
|
||||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
break;
|
||||||
cconvert->pub.color_convert = gray_rgb_convert;
|
case JCS_BG_YCC:
|
||||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
cconvert->pub.color_convert = ycc_rgb_convert;
|
||||||
|
build_bg_ycc_rgb_table(cinfo);
|
||||||
|
break;
|
||||||
|
case JCS_RGB:
|
||||||
switch (cinfo->color_transform) {
|
switch (cinfo->color_transform) {
|
||||||
case JCT_NONE:
|
case JCT_NONE:
|
||||||
cconvert->pub.color_convert = rgb_convert;
|
cconvert->pub.color_convert = rgb_convert;
|
||||||
@@ -584,7 +669,25 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case JCS_BG_RGB:
|
||||||
|
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||||
|
if (cinfo->jpeg_color_space == JCS_BG_RGB) {
|
||||||
|
switch (cinfo->color_transform) {
|
||||||
|
case JCT_NONE:
|
||||||
|
cconvert->pub.color_convert = rgb_convert;
|
||||||
|
break;
|
||||||
|
case JCT_SUBTRACT_GREEN:
|
||||||
|
cconvert->pub.color_convert = rgb1_rgb_convert;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
@@ -592,13 +695,17 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
cinfo->out_color_components = 4;
|
cinfo->out_color_components = 4;
|
||||||
if (cinfo->jpeg_color_space == JCS_YCCK) {
|
switch (cinfo->jpeg_color_space) {
|
||||||
|
case JCS_YCCK:
|
||||||
cconvert->pub.color_convert = ycck_cmyk_convert;
|
cconvert->pub.color_convert = ycck_cmyk_convert;
|
||||||
build_ycc_rgb_table(cinfo);
|
build_ycc_rgb_table(cinfo);
|
||||||
} else if (cinfo->jpeg_color_space == JCS_CMYK) {
|
break;
|
||||||
|
case JCS_CMYK:
|
||||||
cconvert->pub.color_convert = null_convert;
|
cconvert->pub.color_convert = null_convert;
|
||||||
} else
|
break;
|
||||||
|
default:
|
||||||
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Vendored
+28
-4
@@ -2,6 +2,7 @@
|
|||||||
* jdct.h
|
* jdct.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
|
* Modified 2002-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -78,13 +79,16 @@ typedef FAST_FLOAT FLOAT_MULT_TYPE; /* preferred floating type */
|
|||||||
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
* converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could
|
||||||
* be quite far out of range if the input data is corrupt, so a bulletproof
|
* be quite far out of range if the input data is corrupt, so a bulletproof
|
||||||
* range-limiting step is required. We use a mask-and-table-lookup method
|
* range-limiting step is required. We use a mask-and-table-lookup method
|
||||||
* to do the combined operations quickly. See the comments with
|
* to do the combined operations quickly, assuming that MAXJSAMPLE+1
|
||||||
* prepare_range_limit_table (in jdmaster.c) for more info.
|
* is a power of 2. See the comments with prepare_range_limit_table
|
||||||
|
* (in jdmaster.c) for more info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit + CENTERJSAMPLE)
|
|
||||||
|
|
||||||
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
|
#define RANGE_MASK (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
|
||||||
|
#define RANGE_CENTER (MAXJSAMPLE * 2 + 2)
|
||||||
|
#define RANGE_SUBSET (RANGE_CENTER - CENTERJSAMPLE)
|
||||||
|
|
||||||
|
#define IDCT_range_limit(cinfo) ((cinfo)->sample_range_limit - RANGE_SUBSET)
|
||||||
|
|
||||||
|
|
||||||
/* Short forms of external names for systems with brain-damaged linkers. */
|
/* Short forms of external names for systems with brain-damaged linkers. */
|
||||||
@@ -391,3 +395,23 @@ EXTERN(void) jpeg_idct_1x2
|
|||||||
#ifndef MULTIPLY16V16 /* default definition */
|
#ifndef MULTIPLY16V16 /* default definition */
|
||||||
#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
|
#define MULTIPLY16V16(var1,var2) ((var1) * (var2))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Like RIGHT_SHIFT, but applies to a DCTELEM.
|
||||||
|
* We assume that int right shift is unsigned if INT32 right shift is.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef RIGHT_SHIFT_IS_UNSIGNED
|
||||||
|
#define ISHIFT_TEMPS DCTELEM ishift_temp;
|
||||||
|
#if BITS_IN_JSAMPLE == 8
|
||||||
|
#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
|
||||||
|
#else
|
||||||
|
#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
|
||||||
|
#endif
|
||||||
|
#define IRIGHT_SHIFT(x,shft) \
|
||||||
|
((ishift_temp = (x)) < 0 ? \
|
||||||
|
(ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
|
||||||
|
(ishift_temp >> (shft)))
|
||||||
|
#else
|
||||||
|
#define ISHIFT_TEMPS
|
||||||
|
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
|
||||||
|
#endif
|
||||||
|
|||||||
Vendored
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
* jddctmgr.c
|
* jddctmgr.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2002-2010 by Guido Vollbeding.
|
* Modified 2002-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -368,7 +368,7 @@ jinit_inverse_dct (j_decompress_ptr cinfo)
|
|||||||
idct = (my_idct_ptr)
|
idct = (my_idct_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_idct_controller));
|
SIZEOF(my_idct_controller));
|
||||||
cinfo->idct = (struct jpeg_inverse_dct *) idct;
|
cinfo->idct = &idct->pub;
|
||||||
idct->pub.start_pass = start_pass;
|
idct->pub.start_pass = start_pass;
|
||||||
|
|
||||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||||
|
|||||||
Vendored
+25
-13
@@ -2,7 +2,7 @@
|
|||||||
* jdhuff.c
|
* jdhuff.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2006-2012 by Guido Vollbeding.
|
* Modified 2006-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -627,6 +627,22 @@ jpeg_huff_decode (bitread_working_state * state,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Finish up at the end of a Huffman-compressed scan.
|
||||||
|
*/
|
||||||
|
|
||||||
|
METHODDEF(void)
|
||||||
|
finish_pass_huff (j_decompress_ptr cinfo)
|
||||||
|
{
|
||||||
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
|
|
||||||
|
/* Throw away any unused bits remaining in bit buffer; */
|
||||||
|
/* include any full bytes in next_marker's count of discarded bytes */
|
||||||
|
cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
|
||||||
|
entropy->bitstate.bits_left = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for a restart marker & resynchronize decoder.
|
* Check for a restart marker & resynchronize decoder.
|
||||||
* Returns FALSE if must suspend.
|
* Returns FALSE if must suspend.
|
||||||
@@ -638,10 +654,7 @@ process_restart (j_decompress_ptr cinfo)
|
|||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
int ci;
|
int ci;
|
||||||
|
|
||||||
/* Throw away any unused bits remaining in bit buffer; */
|
finish_pass_huff(cinfo);
|
||||||
/* include any full bytes in next_marker's count of discarded bytes */
|
|
||||||
cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
|
|
||||||
entropy->bitstate.bits_left = 0;
|
|
||||||
|
|
||||||
/* Advance past the RSTn marker */
|
/* Advance past the RSTn marker */
|
||||||
if (! (*cinfo->marker->read_restart_marker) (cinfo))
|
if (! (*cinfo->marker->read_restart_marker) (cinfo))
|
||||||
@@ -846,17 +859,15 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* MCU decoding for DC successive approximation refinement scan.
|
* MCU decoding for DC successive approximation refinement scan.
|
||||||
* Note: we assume such scans can be multi-component, although the spec
|
* Note: we assume such scans can be multi-component,
|
||||||
* is not very clear on the point.
|
* although the spec is not very clear on the point.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
METHODDEF(boolean)
|
METHODDEF(boolean)
|
||||||
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
||||||
{
|
{
|
||||||
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
|
||||||
int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
int p1, blkn;
|
||||||
int blkn;
|
|
||||||
JBLOCKROW block;
|
|
||||||
BITREAD_STATE_VARS;
|
BITREAD_STATE_VARS;
|
||||||
|
|
||||||
/* Process restart marker if needed; may have to suspend */
|
/* Process restart marker if needed; may have to suspend */
|
||||||
@@ -873,15 +884,15 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
|
|||||||
/* Load up working state */
|
/* Load up working state */
|
||||||
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
BITREAD_LOAD_STATE(cinfo,entropy->bitstate);
|
||||||
|
|
||||||
|
p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
|
||||||
|
|
||||||
/* Outer loop handles each block in the MCU */
|
/* Outer loop handles each block in the MCU */
|
||||||
|
|
||||||
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
|
||||||
block = MCU_data[blkn];
|
|
||||||
|
|
||||||
/* Encoded data is simply the next bit of the two's-complement DC value */
|
/* Encoded data is simply the next bit of the two's-complement DC value */
|
||||||
CHECK_BIT_BUFFER(br_state, 1, return FALSE);
|
CHECK_BIT_BUFFER(br_state, 1, return FALSE);
|
||||||
if (GET_BITS(1))
|
if (GET_BITS(1))
|
||||||
(*block)[0] |= p1;
|
MCU_data[blkn][0][0] |= p1;
|
||||||
/* Note: since we use |=, repeating the assignment later is safe */
|
/* Note: since we use |=, repeating the assignment later is safe */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1517,6 +1528,7 @@ jinit_huff_decoder (j_decompress_ptr cinfo)
|
|||||||
SIZEOF(huff_entropy_decoder));
|
SIZEOF(huff_entropy_decoder));
|
||||||
cinfo->entropy = &entropy->pub;
|
cinfo->entropy = &entropy->pub;
|
||||||
entropy->pub.start_pass = start_pass_huff_decoder;
|
entropy->pub.start_pass = start_pass_huff_decoder;
|
||||||
|
entropy->pub.finish_pass = finish_pass_huff;
|
||||||
|
|
||||||
if (cinfo->progressive_mode) {
|
if (cinfo->progressive_mode) {
|
||||||
/* Create progression status table */
|
/* Create progression status table */
|
||||||
|
|||||||
Vendored
+6
-5
@@ -2,7 +2,7 @@
|
|||||||
* jdinput.c
|
* jdinput.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2002-2009 by Guido Vollbeding.
|
* Modified 2002-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -196,7 +196,7 @@ jpeg_core_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
/* Hardwire it to "no scaling" */
|
/* Hardwire it to "no scaling" */
|
||||||
cinfo->output_width = cinfo->image_width;
|
cinfo->output_width = cinfo->image_width;
|
||||||
cinfo->output_height = cinfo->image_height;
|
cinfo->output_height = cinfo->image_height;
|
||||||
/* jdinput.c has already initialized DCT_scaled_size,
|
/* initial_setup has already initialized DCT_scaled_size,
|
||||||
* and has computed unscaled downsampled_width and downsampled_height.
|
* and has computed unscaled downsampled_width and downsampled_height.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -216,8 +216,8 @@ initial_setup (j_decompress_ptr cinfo)
|
|||||||
(long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
|
(long) cinfo->image_width > (long) JPEG_MAX_DIMENSION)
|
||||||
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
|
||||||
|
|
||||||
/* For now, precision must match compiled-in value... */
|
/* Only 8 to 12 bits data precision are supported for DCT based JPEG */
|
||||||
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
if (cinfo->data_precision < 8 || cinfo->data_precision > 12)
|
||||||
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||||
|
|
||||||
/* Check that number of components won't exceed internal array sizes */
|
/* Check that number of components won't exceed internal array sizes */
|
||||||
@@ -537,6 +537,7 @@ start_input_pass (j_decompress_ptr cinfo)
|
|||||||
METHODDEF(void)
|
METHODDEF(void)
|
||||||
finish_input_pass (j_decompress_ptr cinfo)
|
finish_input_pass (j_decompress_ptr cinfo)
|
||||||
{
|
{
|
||||||
|
(*cinfo->entropy->finish_pass) (cinfo);
|
||||||
cinfo->inputctl->consume_input = consume_markers;
|
cinfo->inputctl->consume_input = consume_markers;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,7 +647,7 @@ jinit_input_controller (j_decompress_ptr cinfo)
|
|||||||
inputctl = (my_inputctl_ptr)
|
inputctl = (my_inputctl_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
|
||||||
SIZEOF(my_input_controller));
|
SIZEOF(my_input_controller));
|
||||||
cinfo->inputctl = (struct jpeg_input_controller *) inputctl;
|
cinfo->inputctl = &inputctl->pub;
|
||||||
/* Initialize method pointers */
|
/* Initialize method pointers */
|
||||||
inputctl->pub.consume_input = consume_markers;
|
inputctl->pub.consume_input = consume_markers;
|
||||||
inputctl->pub.reset_input_controller = reset_input_controller;
|
inputctl->pub.reset_input_controller = reset_input_controller;
|
||||||
|
|||||||
Vendored
+11
-5
@@ -2,7 +2,7 @@
|
|||||||
* jdmarker.c
|
* jdmarker.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2009-2012 by Guido Vollbeding.
|
* Modified 2009-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -269,8 +269,8 @@ get_sof (j_decompress_ptr cinfo, boolean is_baseline, boolean is_prog,
|
|||||||
/* We don't support files in which the image height is initially specified */
|
/* We don't support files in which the image height is initially specified */
|
||||||
/* as 0 and is later redefined by DNL. As long as we have to check that, */
|
/* as 0 and is later redefined by DNL. As long as we have to check that, */
|
||||||
/* might as well have a general sanity check. */
|
/* might as well have a general sanity check. */
|
||||||
if (cinfo->image_height <= 0 || cinfo->image_width <= 0
|
if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
|
||||||
|| cinfo->num_components <= 0)
|
cinfo->num_components <= 0)
|
||||||
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
if (length != (cinfo->num_components * 3))
|
if (length != (cinfo->num_components * 3))
|
||||||
@@ -350,6 +350,9 @@ get_sos (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
/* Detect the case where component id's are not unique, and, if so, */
|
/* Detect the case where component id's are not unique, and, if so, */
|
||||||
/* create a fake component id using the same logic as in get_sof. */
|
/* create a fake component id using the same logic as in get_sof. */
|
||||||
|
/* Note: This also ensures that all of the SOF components are */
|
||||||
|
/* referenced in the single scan case, which prevents access to */
|
||||||
|
/* uninitialized memory in later decoding stages. */
|
||||||
for (ci = 0; ci < i; ci++) {
|
for (ci = 0; ci < i; ci++) {
|
||||||
if (c == cinfo->cur_comp_info[ci]->component_id) {
|
if (c == cinfo->cur_comp_info[ci]->component_id) {
|
||||||
c = cinfo->cur_comp_info[0]->component_id;
|
c = cinfo->cur_comp_info[0]->component_id;
|
||||||
@@ -493,6 +496,8 @@ get_dht (j_decompress_ptr cinfo)
|
|||||||
if (count > 256 || ((INT32) count) > length)
|
if (count > 256 || ((INT32) count) > length)
|
||||||
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
|
||||||
|
|
||||||
|
MEMZERO(huffval, SIZEOF(huffval)); /* pre-zero array for later copy */
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
INPUT_BYTE(cinfo, huffval[i], return FALSE);
|
INPUT_BYTE(cinfo, huffval[i], return FALSE);
|
||||||
|
|
||||||
@@ -735,12 +740,13 @@ examine_app0 (j_decompress_ptr cinfo, JOCTET FAR * data,
|
|||||||
cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
|
cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
|
||||||
cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
|
cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
|
||||||
/* Check version.
|
/* Check version.
|
||||||
* Major version must be 1, anything else signals an incompatible change.
|
* Major version must be 1 or 2, anything else signals an incompatible
|
||||||
|
* change.
|
||||||
* (We used to treat this as an error, but now it's a nonfatal warning,
|
* (We used to treat this as an error, but now it's a nonfatal warning,
|
||||||
* because some bozo at Hijaak couldn't read the spec.)
|
* because some bozo at Hijaak couldn't read the spec.)
|
||||||
* Minor version should be 0..2, but process anyway if newer.
|
* Minor version should be 0..2, but process anyway if newer.
|
||||||
*/
|
*/
|
||||||
if (cinfo->JFIF_major_version != 1)
|
if (cinfo->JFIF_major_version != 1 && cinfo->JFIF_major_version != 2)
|
||||||
WARNMS2(cinfo, JWRN_JFIF_MAJOR,
|
WARNMS2(cinfo, JWRN_JFIF_MAJOR,
|
||||||
cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
|
cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
|
||||||
/* Generate trace messages */
|
/* Generate trace messages */
|
||||||
|
|||||||
Vendored
+43
-35
@@ -2,7 +2,7 @@
|
|||||||
* jdmaster.c
|
* jdmaster.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 2002-2011 by Guido Vollbeding.
|
* Modified 2002-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -45,13 +45,26 @@ LOCAL(boolean)
|
|||||||
use_merged_upsample (j_decompress_ptr cinfo)
|
use_merged_upsample (j_decompress_ptr cinfo)
|
||||||
{
|
{
|
||||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||||
/* Merging is the equivalent of plain box-filter upsampling */
|
/* Merging is the equivalent of plain box-filter upsampling. */
|
||||||
if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
|
/* The following condition is only needed if fancy shall select
|
||||||
|
* a different upsampling method. In our current implementation
|
||||||
|
* fancy only affects the DCT scaling, thus we can use fancy
|
||||||
|
* upsampling and merged upsample simultaneously, in particular
|
||||||
|
* with scaled DCT sizes larger than the default DCTSIZE.
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
|
if (cinfo->do_fancy_upsampling)
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
|
if (cinfo->CCIR601_sampling)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
/* jdmerge.c only supports YCC=>RGB color conversion */
|
/* jdmerge.c only supports YCC=>RGB color conversion */
|
||||||
if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
|
if ((cinfo->jpeg_color_space != JCS_YCbCr &&
|
||||||
|
cinfo->jpeg_color_space != JCS_BG_YCC) ||
|
||||||
|
cinfo->num_components != 3 ||
|
||||||
cinfo->out_color_space != JCS_RGB ||
|
cinfo->out_color_space != JCS_RGB ||
|
||||||
cinfo->out_color_components != RGB_PIXELSIZE)
|
cinfo->out_color_components != RGB_PIXELSIZE ||
|
||||||
|
cinfo->color_transform)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
/* and it only handles 2h1v or 2h2v sampling ratios */
|
/* and it only handles 2h1v or 2h2v sampling ratios */
|
||||||
if (cinfo->comp_info[0].h_samp_factor != 2 ||
|
if (cinfo->comp_info[0].h_samp_factor != 2 ||
|
||||||
@@ -158,9 +171,11 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
cinfo->out_color_components = 1;
|
cinfo->out_color_components = 1;
|
||||||
break;
|
break;
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
|
case JCS_BG_RGB:
|
||||||
cinfo->out_color_components = RGB_PIXELSIZE;
|
cinfo->out_color_components = RGB_PIXELSIZE;
|
||||||
break;
|
break;
|
||||||
case JCS_YCbCr:
|
case JCS_YCbCr:
|
||||||
|
case JCS_BG_YCC:
|
||||||
cinfo->out_color_components = 3;
|
cinfo->out_color_components = 3;
|
||||||
break;
|
break;
|
||||||
case JCS_CMYK:
|
case JCS_CMYK:
|
||||||
@@ -196,30 +211,20 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
|
|||||||
* These processes all use a common table prepared by the routine below.
|
* These processes all use a common table prepared by the routine below.
|
||||||
*
|
*
|
||||||
* For most steps we can mathematically guarantee that the initial value
|
* For most steps we can mathematically guarantee that the initial value
|
||||||
* of x is within MAXJSAMPLE+1 of the legal range, so a table running from
|
* of x is within 2*(MAXJSAMPLE+1) of the legal range, so a table running
|
||||||
* -(MAXJSAMPLE+1) to 2*MAXJSAMPLE+1 is sufficient. But for the initial
|
* from -2*(MAXJSAMPLE+1) to 3*MAXJSAMPLE+2 is sufficient. But for the
|
||||||
* limiting step (just after the IDCT), a wildly out-of-range value is
|
* initial limiting step (just after the IDCT), a wildly out-of-range value
|
||||||
* possible if the input data is corrupt. To avoid any chance of indexing
|
* is possible if the input data is corrupt. To avoid any chance of indexing
|
||||||
* off the end of memory and getting a bad-pointer trap, we perform the
|
* off the end of memory and getting a bad-pointer trap, we perform the
|
||||||
* post-IDCT limiting thus:
|
* post-IDCT limiting thus:
|
||||||
* x = range_limit[x & MASK];
|
* x = (sample_range_limit - SUBSET)[(x + CENTER) & MASK];
|
||||||
* where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
|
* where MASK is 2 bits wider than legal sample data, ie 10 bits for 8-bit
|
||||||
* samples. Under normal circumstances this is more than enough range and
|
* samples. Under normal circumstances this is more than enough range and
|
||||||
* a correct output will be generated; with bogus input data the mask will
|
* a correct output will be generated; with bogus input data the mask will
|
||||||
* cause wraparound, and we will safely generate a bogus-but-in-range output.
|
* cause wraparound, and we will safely generate a bogus-but-in-range output.
|
||||||
* For the post-IDCT step, we want to convert the data from signed to unsigned
|
* For the post-IDCT step, we want to convert the data from signed to unsigned
|
||||||
* representation by adding CENTERJSAMPLE at the same time that we limit it.
|
* representation by adding CENTERJSAMPLE at the same time that we limit it.
|
||||||
* So the post-IDCT limiting table ends up looking like this:
|
* This is accomplished with SUBSET = CENTER - CENTERJSAMPLE.
|
||||||
* CENTERJSAMPLE,CENTERJSAMPLE+1,...,MAXJSAMPLE,
|
|
||||||
* MAXJSAMPLE (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
|
|
||||||
* 0 (repeat 2*(MAXJSAMPLE+1)-CENTERJSAMPLE times),
|
|
||||||
* 0,1,...,CENTERJSAMPLE-1
|
|
||||||
* Negative inputs select values from the upper half of the table after
|
|
||||||
* masking.
|
|
||||||
*
|
|
||||||
* We can save some space by overlapping the start of the post-IDCT table
|
|
||||||
* with the simpler range limiting table. The post-IDCT table begins at
|
|
||||||
* sample_range_limit + CENTERJSAMPLE.
|
|
||||||
*
|
*
|
||||||
* Note that the table is allocated in near data space on PCs; it's small
|
* Note that the table is allocated in near data space on PCs; it's small
|
||||||
* enough and used often enough to justify this.
|
* enough and used often enough to justify this.
|
||||||
@@ -234,23 +239,17 @@ prepare_range_limit_table (j_decompress_ptr cinfo)
|
|||||||
|
|
||||||
table = (JSAMPLE *)
|
table = (JSAMPLE *)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
(5 * (MAXJSAMPLE+1) + CENTERJSAMPLE) * SIZEOF(JSAMPLE));
|
5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
||||||
table += (MAXJSAMPLE+1); /* allow negative subscripts of simple table */
|
/* 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 */
|
||||||
cinfo->sample_range_limit = table;
|
cinfo->sample_range_limit = table;
|
||||||
/* First segment of "simple" table: limit[x] = 0 for x < 0 */
|
/* Main part of range limit table: limit[x] = x */
|
||||||
MEMZERO(table - (MAXJSAMPLE+1), (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
|
|
||||||
/* Main part of "simple" table: limit[x] = x */
|
|
||||||
for (i = 0; i <= MAXJSAMPLE; i++)
|
for (i = 0; i <= MAXJSAMPLE; i++)
|
||||||
table[i] = (JSAMPLE) i;
|
table[i] = (JSAMPLE) i;
|
||||||
table += CENTERJSAMPLE; /* Point to where post-IDCT table starts */
|
/* End of range limit table: limit[x] = MAXJSAMPLE for x > MAXJSAMPLE */
|
||||||
/* End of simple table, rest of first half of post-IDCT table */
|
for (; i < 3 * (MAXJSAMPLE+1); i++)
|
||||||
for (i = CENTERJSAMPLE; i < 2*(MAXJSAMPLE+1); i++)
|
|
||||||
table[i] = MAXJSAMPLE;
|
table[i] = MAXJSAMPLE;
|
||||||
/* Second half of post-IDCT table */
|
|
||||||
MEMZERO(table + (2 * (MAXJSAMPLE+1)),
|
|
||||||
(2 * (MAXJSAMPLE+1) - CENTERJSAMPLE) * SIZEOF(JSAMPLE));
|
|
||||||
MEMCOPY(table + (4 * (MAXJSAMPLE+1) - CENTERJSAMPLE),
|
|
||||||
cinfo->sample_range_limit, CENTERJSAMPLE * SIZEOF(JSAMPLE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -273,10 +272,19 @@ master_selection (j_decompress_ptr cinfo)
|
|||||||
long samplesperrow;
|
long samplesperrow;
|
||||||
JDIMENSION jd_samplesperrow;
|
JDIMENSION jd_samplesperrow;
|
||||||
|
|
||||||
|
/* For now, precision must match compiled-in value... */
|
||||||
|
if (cinfo->data_precision != BITS_IN_JSAMPLE)
|
||||||
|
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
|
||||||
|
|
||||||
/* Initialize dimensions and other stuff */
|
/* Initialize dimensions and other stuff */
|
||||||
jpeg_calc_output_dimensions(cinfo);
|
jpeg_calc_output_dimensions(cinfo);
|
||||||
prepare_range_limit_table(cinfo);
|
prepare_range_limit_table(cinfo);
|
||||||
|
|
||||||
|
/* Sanity check on image dimensions */
|
||||||
|
if (cinfo->output_height <= 0 || cinfo->output_width <= 0 ||
|
||||||
|
cinfo->out_color_components <= 0)
|
||||||
|
ERREXIT(cinfo, JERR_EMPTY_IMAGE);
|
||||||
|
|
||||||
/* Width of an output scanline must be representable as JDIMENSION. */
|
/* Width of an output scanline must be representable as JDIMENSION. */
|
||||||
samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
|
samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
|
||||||
jd_samplesperrow = (JDIMENSION) samplesperrow;
|
jd_samplesperrow = (JDIMENSION) samplesperrow;
|
||||||
@@ -521,7 +529,7 @@ jinit_master_decompress (j_decompress_ptr cinfo)
|
|||||||
master = (my_master_ptr)
|
master = (my_master_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_decomp_master));
|
SIZEOF(my_decomp_master));
|
||||||
cinfo->master = (struct jpeg_decomp_master *) master;
|
cinfo->master = &master->pub;
|
||||||
master->pub.prepare_for_output_pass = prepare_for_output_pass;
|
master->pub.prepare_for_output_pass = prepare_for_output_pass;
|
||||||
master->pub.finish_output_pass = finish_output_pass;
|
master->pub.finish_output_pass = finish_output_pass;
|
||||||
|
|
||||||
|
|||||||
Vendored
+56
-11
@@ -2,6 +2,7 @@
|
|||||||
* jdmerge.c
|
* jdmerge.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
|
* Modified 2013-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
* multiplications needed for color conversion.
|
* multiplications needed for color conversion.
|
||||||
*
|
*
|
||||||
* This file currently provides implementations for the following cases:
|
* This file currently provides implementations for the following cases:
|
||||||
* YCbCr => RGB color conversion only.
|
* YCC => RGB color conversion only (YCbCr or BG_YCC).
|
||||||
* Sampling ratios of 2h1v or 2h2v.
|
* Sampling ratios of 2h1v or 2h2v.
|
||||||
* No scaling needed at upsample time.
|
* No scaling needed at upsample time.
|
||||||
* Corner-aligned (non-CCIR601) sampling alignment.
|
* Corner-aligned (non-CCIR601) sampling alignment.
|
||||||
@@ -75,12 +76,13 @@ typedef my_upsampler * my_upsample_ptr;
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize tables for YCC->RGB colorspace conversion.
|
* Initialize tables for YCbCr->RGB and BG_YCC->RGB colorspace conversion.
|
||||||
* This is taken directly from jdcolor.c; see that file for more info.
|
* This is taken directly from jdcolor.c; see that file for more info.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LOCAL(void)
|
LOCAL(void)
|
||||||
build_ycc_rgb_table (j_decompress_ptr cinfo)
|
build_ycc_rgb_table (j_decompress_ptr cinfo)
|
||||||
|
/* Normal case, sYCC */
|
||||||
{
|
{
|
||||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||||
int i;
|
int i;
|
||||||
@@ -103,17 +105,57 @@ build_ycc_rgb_table (j_decompress_ptr cinfo)
|
|||||||
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
/* Cr=>R value is nearest int to 1.40200 * x */
|
/* Cr=>R value is nearest int to 1.402 * x */
|
||||||
upsample->Cr_r_tab[i] = (int)
|
upsample->Cr_r_tab[i] = (int)
|
||||||
RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
|
RIGHT_SHIFT(FIX(1.402) * x + ONE_HALF, SCALEBITS);
|
||||||
/* Cb=>B value is nearest int to 1.77200 * x */
|
/* Cb=>B value is nearest int to 1.772 * x */
|
||||||
upsample->Cb_b_tab[i] = (int)
|
upsample->Cb_b_tab[i] = (int)
|
||||||
RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
|
RIGHT_SHIFT(FIX(1.772) * x + ONE_HALF, SCALEBITS);
|
||||||
/* Cr=>G value is scaled-up -0.71414 * x */
|
/* Cr=>G value is scaled-up -0.714136286 * x */
|
||||||
upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x;
|
upsample->Cr_g_tab[i] = (- FIX(0.714136286)) * x;
|
||||||
/* Cb=>G value is scaled-up -0.34414 * x */
|
/* Cb=>G value is scaled-up -0.344136286 * x */
|
||||||
/* We also add in ONE_HALF so that need not do it in inner loop */
|
/* We also add in ONE_HALF so that need not do it in inner loop */
|
||||||
upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF;
|
upsample->Cb_g_tab[i] = (- FIX(0.344136286)) * x + ONE_HALF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL(void)
|
||||||
|
build_bg_ycc_rgb_table (j_decompress_ptr cinfo)
|
||||||
|
/* Wide gamut case, bg-sYCC */
|
||||||
|
{
|
||||||
|
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||||
|
int i;
|
||||||
|
INT32 x;
|
||||||
|
SHIFT_TEMPS
|
||||||
|
|
||||||
|
upsample->Cr_r_tab = (int *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
|
upsample->Cb_b_tab = (int *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(int));
|
||||||
|
upsample->Cr_g_tab = (INT32 *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
|
upsample->Cb_g_tab = (INT32 *)
|
||||||
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
|
(MAXJSAMPLE+1) * SIZEOF(INT32));
|
||||||
|
|
||||||
|
for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
|
||||||
|
/* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
|
||||||
|
/* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
|
||||||
|
/* Cr=>R value is nearest int to 2.804 * x */
|
||||||
|
upsample->Cr_r_tab[i] = (int)
|
||||||
|
RIGHT_SHIFT(FIX(2.804) * x + ONE_HALF, SCALEBITS);
|
||||||
|
/* Cb=>B value is nearest int to 3.544 * x */
|
||||||
|
upsample->Cb_b_tab[i] = (int)
|
||||||
|
RIGHT_SHIFT(FIX(3.544) * x + ONE_HALF, SCALEBITS);
|
||||||
|
/* Cr=>G value is scaled-up -1.428272572 * x */
|
||||||
|
upsample->Cr_g_tab[i] = (- FIX(1.428272572)) * x;
|
||||||
|
/* Cb=>G value is scaled-up -0.688272572 * x */
|
||||||
|
/* We also add in ONE_HALF so that need not do it in inner loop */
|
||||||
|
upsample->Cb_g_tab[i] = (- FIX(0.688272572)) * x + ONE_HALF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,7 +416,7 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
|||||||
upsample = (my_upsample_ptr)
|
upsample = (my_upsample_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_upsampler));
|
SIZEOF(my_upsampler));
|
||||||
cinfo->upsample = (struct jpeg_upsampler *) upsample;
|
cinfo->upsample = &upsample->pub;
|
||||||
upsample->pub.start_pass = start_pass_merged_upsample;
|
upsample->pub.start_pass = start_pass_merged_upsample;
|
||||||
upsample->pub.need_context_rows = FALSE;
|
upsample->pub.need_context_rows = FALSE;
|
||||||
|
|
||||||
@@ -394,6 +436,9 @@ jinit_merged_upsampler (j_decompress_ptr cinfo)
|
|||||||
upsample->spare_row = NULL;
|
upsample->spare_row = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cinfo->jpeg_color_space == JCS_BG_YCC)
|
||||||
|
build_bg_ycc_rgb_table(cinfo);
|
||||||
|
else
|
||||||
build_ycc_rgb_table(cinfo);
|
build_ycc_rgb_table(cinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+8
-11
@@ -2,7 +2,7 @@
|
|||||||
* jdsample.c
|
* jdsample.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||||
* Modified 2002-2008 by Guido Vollbeding.
|
* Modified 2002-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -296,13 +296,12 @@ jinit_upsampler (j_decompress_ptr cinfo)
|
|||||||
my_upsample_ptr upsample;
|
my_upsample_ptr upsample;
|
||||||
int ci;
|
int ci;
|
||||||
jpeg_component_info * compptr;
|
jpeg_component_info * compptr;
|
||||||
boolean need_buffer;
|
|
||||||
int h_in_group, v_in_group, h_out_group, v_out_group;
|
int h_in_group, v_in_group, h_out_group, v_out_group;
|
||||||
|
|
||||||
upsample = (my_upsample_ptr)
|
upsample = (my_upsample_ptr)
|
||||||
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
(*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
SIZEOF(my_upsampler));
|
SIZEOF(my_upsampler));
|
||||||
cinfo->upsample = (struct jpeg_upsampler *) upsample;
|
cinfo->upsample = &upsample->pub;
|
||||||
upsample->pub.start_pass = start_pass_upsample;
|
upsample->pub.start_pass = start_pass_upsample;
|
||||||
upsample->pub.upsample = sep_upsample;
|
upsample->pub.upsample = sep_upsample;
|
||||||
upsample->pub.need_context_rows = FALSE; /* until we find out differently */
|
upsample->pub.need_context_rows = FALSE; /* until we find out differently */
|
||||||
@@ -325,17 +324,17 @@ jinit_upsampler (j_decompress_ptr cinfo)
|
|||||||
h_out_group = cinfo->max_h_samp_factor;
|
h_out_group = cinfo->max_h_samp_factor;
|
||||||
v_out_group = cinfo->max_v_samp_factor;
|
v_out_group = cinfo->max_v_samp_factor;
|
||||||
upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
|
upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
|
||||||
need_buffer = TRUE;
|
|
||||||
if (! compptr->component_needed) {
|
if (! compptr->component_needed) {
|
||||||
/* Don't bother to upsample an uninteresting component. */
|
/* Don't bother to upsample an uninteresting component. */
|
||||||
upsample->methods[ci] = noop_upsample;
|
upsample->methods[ci] = noop_upsample;
|
||||||
need_buffer = FALSE;
|
continue; /* don't need to allocate buffer */
|
||||||
} else if (h_in_group == h_out_group && v_in_group == v_out_group) {
|
}
|
||||||
|
if (h_in_group == h_out_group && v_in_group == v_out_group) {
|
||||||
/* Fullsize components can be processed without any work. */
|
/* Fullsize components can be processed without any work. */
|
||||||
upsample->methods[ci] = fullsize_upsample;
|
upsample->methods[ci] = fullsize_upsample;
|
||||||
need_buffer = FALSE;
|
continue; /* don't need to allocate buffer */
|
||||||
} else if (h_in_group * 2 == h_out_group &&
|
}
|
||||||
v_in_group == v_out_group) {
|
if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) {
|
||||||
/* Special case for 2h1v upsampling */
|
/* Special case for 2h1v upsampling */
|
||||||
upsample->methods[ci] = h2v1_upsample;
|
upsample->methods[ci] = h2v1_upsample;
|
||||||
} else if (h_in_group * 2 == h_out_group &&
|
} else if (h_in_group * 2 == h_out_group &&
|
||||||
@@ -350,12 +349,10 @@ jinit_upsampler (j_decompress_ptr cinfo)
|
|||||||
upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
|
upsample->v_expand[ci] = (UINT8) (v_out_group / v_in_group);
|
||||||
} else
|
} else
|
||||||
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
|
ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
|
||||||
if (need_buffer) {
|
|
||||||
upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
|
upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
|
||||||
((j_common_ptr) cinfo, JPOOL_IMAGE,
|
((j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||||
(JDIMENSION) jround_up((long) cinfo->output_width,
|
(JDIMENSION) jround_up((long) cinfo->output_width,
|
||||||
(long) cinfo->max_h_samp_factor),
|
(long) cinfo->max_h_samp_factor),
|
||||||
(JDIMENSION) cinfo->max_v_samp_factor);
|
(JDIMENSION) cinfo->max_v_samp_factor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+5
-5
@@ -2,7 +2,7 @@
|
|||||||
* jerror.c
|
* jerror.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2012 by Guido Vollbeding.
|
* Modified 2012-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -19,16 +19,16 @@
|
|||||||
* These routines are used by both the compression and decompression code.
|
* These routines are used by both the compression and decompression code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef USE_WINDOWS_MESSAGEBOX
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
/* this is not a core library module, so it doesn't define JPEG_INTERNALS */
|
||||||
#include "jinclude.h"
|
#include "jinclude.h"
|
||||||
#include "jpeglib.h"
|
#include "jpeglib.h"
|
||||||
#include "jversion.h"
|
#include "jversion.h"
|
||||||
#include "jerror.h"
|
#include "jerror.h"
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_MESSAGEBOX
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
#ifndef EXIT_FAILURE /* define exit() codes if not provided */
|
||||||
#define EXIT_FAILURE 1
|
#define EXIT_FAILURE 1
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Vendored
+4
-2
@@ -2,7 +2,7 @@
|
|||||||
* jfdctflt.c
|
* jfdctflt.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2003-2009 by Guido Vollbeding.
|
* Modified 2003-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform the forward DCT on one block of samples.
|
* Perform the forward DCT on one block of samples.
|
||||||
|
*
|
||||||
|
* cK represents cos(K*pi/16).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
@@ -89,7 +91,7 @@ jpeg_fdct_float (FAST_FLOAT * data, JSAMPARRAY sample_data, JDIMENSION start_col
|
|||||||
tmp11 = tmp1 + tmp2;
|
tmp11 = tmp1 + tmp2;
|
||||||
tmp12 = tmp1 - tmp2;
|
tmp12 = tmp1 - tmp2;
|
||||||
|
|
||||||
/* Apply unsigned->signed conversion */
|
/* Apply unsigned->signed conversion. */
|
||||||
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
|
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
|
||||||
dataptr[4] = tmp10 - tmp11;
|
dataptr[4] = tmp10 - tmp11;
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-2
@@ -2,7 +2,7 @@
|
|||||||
* jfdctfst.c
|
* jfdctfst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||||
* Modified 2003-2009 by Guido Vollbeding.
|
* Modified 2003-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -109,6 +109,8 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform the forward DCT on one block of samples.
|
* Perform the forward DCT on one block of samples.
|
||||||
|
*
|
||||||
|
* cK represents cos(K*pi/16).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
@@ -145,7 +147,7 @@ jpeg_fdct_ifast (DCTELEM * data, JSAMPARRAY sample_data, JDIMENSION start_col)
|
|||||||
tmp11 = tmp1 + tmp2;
|
tmp11 = tmp1 + tmp2;
|
||||||
tmp12 = tmp1 - tmp2;
|
tmp12 = tmp1 - tmp2;
|
||||||
|
|
||||||
/* Apply unsigned->signed conversion */
|
/* Apply unsigned->signed conversion. */
|
||||||
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
|
dataptr[0] = tmp10 + tmp11 - 8 * CENTERJSAMPLE; /* phase 3 */
|
||||||
dataptr[4] = tmp10 - tmp11;
|
dataptr[4] = tmp10 - tmp11;
|
||||||
|
|
||||||
|
|||||||
Vendored
+369
-308
File diff suppressed because it is too large
Load Diff
Vendored
+19
-16
@@ -2,7 +2,7 @@
|
|||||||
* jidctflt.c
|
* jidctflt.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
* Modified 2010 by Guido Vollbeding.
|
* Modified 2010-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -63,6 +63,8 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform dequantization and inverse DCT on one block of coefficients.
|
* Perform dequantization and inverse DCT on one block of coefficients.
|
||||||
|
*
|
||||||
|
* cK represents cos(K*pi/16).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
@@ -77,7 +79,7 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
FLOAT_MULT_TYPE * quantptr;
|
FLOAT_MULT_TYPE * quantptr;
|
||||||
FAST_FLOAT * wsptr;
|
FAST_FLOAT * wsptr;
|
||||||
JSAMPROW outptr;
|
JSAMPROW outptr;
|
||||||
JSAMPLE *range_limit = cinfo->sample_range_limit;
|
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
|
||||||
int ctr;
|
int ctr;
|
||||||
FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
|
FAST_FLOAT workspace[DCTSIZE2]; /* buffers data between passes */
|
||||||
|
|
||||||
@@ -186,13 +188,14 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
|
|
||||||
/* Even part */
|
/* Even part */
|
||||||
|
|
||||||
/* Apply signed->unsigned and prepare float->int conversion */
|
/* Prepare range-limit and float->int conversion */
|
||||||
z5 = wsptr[0] + ((FAST_FLOAT) CENTERJSAMPLE + (FAST_FLOAT) 0.5);
|
z5 = wsptr[0] + (((FAST_FLOAT) RANGE_CENTER) + ((FAST_FLOAT) 0.5));
|
||||||
tmp10 = z5 + wsptr[4];
|
tmp10 = z5 + wsptr[4];
|
||||||
tmp11 = z5 - wsptr[4];
|
tmp11 = z5 - wsptr[4];
|
||||||
|
|
||||||
tmp13 = wsptr[2] + wsptr[6];
|
tmp13 = wsptr[2] + wsptr[6];
|
||||||
tmp12 = (wsptr[2] - wsptr[6]) * ((FAST_FLOAT) 1.414213562) - tmp13;
|
tmp12 = (wsptr[2] - wsptr[6]) *
|
||||||
|
((FAST_FLOAT) 1.414213562) - tmp13; /* 2*c4 */
|
||||||
|
|
||||||
tmp0 = tmp10 + tmp13;
|
tmp0 = tmp10 + tmp13;
|
||||||
tmp3 = tmp10 - tmp13;
|
tmp3 = tmp10 - tmp13;
|
||||||
@@ -206,27 +209,27 @@ jpeg_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
z11 = wsptr[1] + wsptr[7];
|
z11 = wsptr[1] + wsptr[7];
|
||||||
z12 = wsptr[1] - wsptr[7];
|
z12 = wsptr[1] - wsptr[7];
|
||||||
|
|
||||||
tmp7 = z11 + z13;
|
tmp7 = z11 + z13; /* phase 5 */
|
||||||
tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562);
|
tmp11 = (z11 - z13) * ((FAST_FLOAT) 1.414213562); /* 2*c4 */
|
||||||
|
|
||||||
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
|
z5 = (z10 + z12) * ((FAST_FLOAT) 1.847759065); /* 2*c2 */
|
||||||
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
|
tmp10 = z5 - z12 * ((FAST_FLOAT) 1.082392200); /* 2*(c2-c6) */
|
||||||
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
|
tmp12 = z5 - z10 * ((FAST_FLOAT) 2.613125930); /* 2*(c2+c6) */
|
||||||
|
|
||||||
tmp6 = tmp12 - tmp7;
|
tmp6 = tmp12 - tmp7; /* phase 2 */
|
||||||
tmp5 = tmp11 - tmp6;
|
tmp5 = tmp11 - tmp6;
|
||||||
tmp4 = tmp10 - tmp5;
|
tmp4 = tmp10 - tmp5;
|
||||||
|
|
||||||
/* Final output stage: float->int conversion and range-limit */
|
/* Final output stage: float->int conversion and range-limit */
|
||||||
|
|
||||||
outptr[0] = range_limit[((int) (tmp0 + tmp7)) & RANGE_MASK];
|
outptr[0] = range_limit[(int) (tmp0 + tmp7) & RANGE_MASK];
|
||||||
outptr[7] = range_limit[((int) (tmp0 - tmp7)) & RANGE_MASK];
|
outptr[7] = range_limit[(int) (tmp0 - tmp7) & RANGE_MASK];
|
||||||
outptr[1] = range_limit[((int) (tmp1 + tmp6)) & RANGE_MASK];
|
outptr[1] = range_limit[(int) (tmp1 + tmp6) & RANGE_MASK];
|
||||||
outptr[6] = range_limit[((int) (tmp1 - tmp6)) & RANGE_MASK];
|
outptr[6] = range_limit[(int) (tmp1 - tmp6) & RANGE_MASK];
|
||||||
outptr[2] = range_limit[((int) (tmp2 + tmp5)) & RANGE_MASK];
|
outptr[2] = range_limit[(int) (tmp2 + tmp5) & RANGE_MASK];
|
||||||
outptr[5] = range_limit[((int) (tmp2 - tmp5)) & RANGE_MASK];
|
outptr[5] = range_limit[(int) (tmp2 - tmp5) & RANGE_MASK];
|
||||||
outptr[3] = range_limit[((int) (tmp3 + tmp4)) & RANGE_MASK];
|
outptr[3] = range_limit[(int) (tmp3 + tmp4) & RANGE_MASK];
|
||||||
outptr[4] = range_limit[((int) (tmp3 - tmp4)) & RANGE_MASK];
|
outptr[4] = range_limit[(int) (tmp3 - tmp4) & RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+36
-53
@@ -2,6 +2,7 @@
|
|||||||
* jidctfst.c
|
* jidctfst.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 1994-1998, Thomas G. Lane.
|
* Copyright (C) 1994-1998, Thomas G. Lane.
|
||||||
|
* Modified 2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -133,35 +134,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Like DESCALE, but applies to a DCTELEM and produces an int.
|
|
||||||
* We assume that int right shift is unsigned if INT32 right shift is.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef RIGHT_SHIFT_IS_UNSIGNED
|
|
||||||
#define ISHIFT_TEMPS DCTELEM ishift_temp;
|
|
||||||
#if BITS_IN_JSAMPLE == 8
|
|
||||||
#define DCTELEMBITS 16 /* DCTELEM may be 16 or 32 bits */
|
|
||||||
#else
|
|
||||||
#define DCTELEMBITS 32 /* DCTELEM must be 32 bits */
|
|
||||||
#endif
|
|
||||||
#define IRIGHT_SHIFT(x,shft) \
|
|
||||||
((ishift_temp = (x)) < 0 ? \
|
|
||||||
(ishift_temp >> (shft)) | ((~((DCTELEM) 0)) << (DCTELEMBITS-(shft))) : \
|
|
||||||
(ishift_temp >> (shft)))
|
|
||||||
#else
|
|
||||||
#define ISHIFT_TEMPS
|
|
||||||
#define IRIGHT_SHIFT(x,shft) ((x) >> (shft))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_ACCURATE_ROUNDING
|
|
||||||
#define IDESCALE(x,n) ((int) IRIGHT_SHIFT((x) + (1 << ((n)-1)), n))
|
|
||||||
#else
|
|
||||||
#define IDESCALE(x,n) ((int) IRIGHT_SHIFT(x, n))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Perform dequantization and inverse DCT on one block of coefficients.
|
* Perform dequantization and inverse DCT on one block of coefficients.
|
||||||
|
*
|
||||||
|
* cK represents cos(K*pi/16).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GLOBAL(void)
|
GLOBAL(void)
|
||||||
@@ -180,7 +156,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
int ctr;
|
int ctr;
|
||||||
int workspace[DCTSIZE2]; /* buffers data between passes */
|
int workspace[DCTSIZE2]; /* buffers data between passes */
|
||||||
SHIFT_TEMPS /* for DESCALE */
|
SHIFT_TEMPS /* for DESCALE */
|
||||||
ISHIFT_TEMPS /* for IDESCALE */
|
ISHIFT_TEMPS /* for IRIGHT_SHIFT */
|
||||||
|
|
||||||
/* Pass 1: process columns from input, store into work array. */
|
/* Pass 1: process columns from input, store into work array. */
|
||||||
|
|
||||||
@@ -253,12 +229,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
|
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
|
||||||
|
|
||||||
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
|
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
|
||||||
tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
|
tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
|
||||||
tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
|
tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
|
||||||
|
|
||||||
tmp6 = tmp12 - tmp7; /* phase 2 */
|
tmp6 = tmp12 - tmp7; /* phase 2 */
|
||||||
tmp5 = tmp11 - tmp6;
|
tmp5 = tmp11 - tmp6;
|
||||||
tmp4 = tmp10 + tmp5;
|
tmp4 = tmp10 - tmp5;
|
||||||
|
|
||||||
wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
|
wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7);
|
||||||
wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
|
wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7);
|
||||||
@@ -266,21 +242,28 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
|
wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6);
|
||||||
wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
|
wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5);
|
||||||
wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
|
wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5);
|
||||||
wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4);
|
wsptr[DCTSIZE*3] = (int) (tmp3 + tmp4);
|
||||||
wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4);
|
wsptr[DCTSIZE*4] = (int) (tmp3 - tmp4);
|
||||||
|
|
||||||
inptr++; /* advance pointers to next column */
|
inptr++; /* advance pointers to next column */
|
||||||
quantptr++;
|
quantptr++;
|
||||||
wsptr++;
|
wsptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pass 2: process rows from work array, store into output array. */
|
/* Pass 2: process rows from work array, store into output array.
|
||||||
/* Note that we must descale the results by a factor of 8 == 2**3, */
|
* Note that we must descale the results by a factor of 8 == 2**3,
|
||||||
/* and also undo the PASS1_BITS scaling. */
|
* and also undo the PASS1_BITS scaling.
|
||||||
|
*/
|
||||||
|
|
||||||
wsptr = workspace;
|
wsptr = workspace;
|
||||||
for (ctr = 0; ctr < DCTSIZE; ctr++) {
|
for (ctr = 0; ctr < DCTSIZE; ctr++) {
|
||||||
outptr = output_buf[ctr] + output_col;
|
outptr = output_buf[ctr] + output_col;
|
||||||
|
|
||||||
|
/* Add range center and fudge factor for final descale and range-limit. */
|
||||||
|
z5 = (DCTELEM) wsptr[0] +
|
||||||
|
((((DCTELEM) RANGE_CENTER) << (PASS1_BITS+3)) +
|
||||||
|
(1 << (PASS1_BITS+2)));
|
||||||
|
|
||||||
/* Rows of zeroes can be exploited in the same way as we did with columns.
|
/* Rows of zeroes can be exploited in the same way as we did with columns.
|
||||||
* However, the column calculation has created many nonzero AC terms, so
|
* However, the column calculation has created many nonzero AC terms, so
|
||||||
* the simplification applies less often (typically 5% to 10% of the time).
|
* the simplification applies less often (typically 5% to 10% of the time).
|
||||||
@@ -293,7 +276,7 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
if (wsptr[1] == 0 && wsptr[2] == 0 && wsptr[3] == 0 && wsptr[4] == 0 &&
|
||||||
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
wsptr[5] == 0 && wsptr[6] == 0 && wsptr[7] == 0) {
|
||||||
/* AC terms all zero */
|
/* AC terms all zero */
|
||||||
JSAMPLE dcval = range_limit[IDESCALE(wsptr[0], PASS1_BITS+3)
|
JSAMPLE dcval = range_limit[(int) IRIGHT_SHIFT(z5, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
|
|
||||||
outptr[0] = dcval;
|
outptr[0] = dcval;
|
||||||
@@ -312,12 +295,12 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
|
|
||||||
/* Even part */
|
/* Even part */
|
||||||
|
|
||||||
tmp10 = ((DCTELEM) wsptr[0] + (DCTELEM) wsptr[4]);
|
tmp10 = z5 + (DCTELEM) wsptr[4];
|
||||||
tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]);
|
tmp11 = z5 - (DCTELEM) wsptr[4];
|
||||||
|
|
||||||
tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]);
|
tmp13 = (DCTELEM) wsptr[2] + (DCTELEM) wsptr[6];
|
||||||
tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6], FIX_1_414213562)
|
tmp12 = MULTIPLY((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6],
|
||||||
- tmp13;
|
FIX_1_414213562) - tmp13; /* 2*c4 */
|
||||||
|
|
||||||
tmp0 = tmp10 + tmp13;
|
tmp0 = tmp10 + tmp13;
|
||||||
tmp3 = tmp10 - tmp13;
|
tmp3 = tmp10 - tmp13;
|
||||||
@@ -335,30 +318,30 @@ jpeg_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
|||||||
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
|
tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); /* 2*c4 */
|
||||||
|
|
||||||
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
|
z5 = MULTIPLY(z10 + z12, FIX_1_847759065); /* 2*c2 */
|
||||||
tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5; /* 2*(c2-c6) */
|
tmp10 = z5 - MULTIPLY(z12, FIX_1_082392200); /* 2*(c2-c6) */
|
||||||
tmp12 = MULTIPLY(z10, - FIX_2_613125930) + z5; /* -2*(c2+c6) */
|
tmp12 = z5 - MULTIPLY(z10, FIX_2_613125930); /* 2*(c2+c6) */
|
||||||
|
|
||||||
tmp6 = tmp12 - tmp7; /* phase 2 */
|
tmp6 = tmp12 - tmp7; /* phase 2 */
|
||||||
tmp5 = tmp11 - tmp6;
|
tmp5 = tmp11 - tmp6;
|
||||||
tmp4 = tmp10 + tmp5;
|
tmp4 = tmp10 - tmp5;
|
||||||
|
|
||||||
/* Final output stage: scale down by a factor of 8 and range-limit */
|
/* Final output stage: scale down by a factor of 8 and range-limit */
|
||||||
|
|
||||||
outptr[0] = range_limit[IDESCALE(tmp0 + tmp7, PASS1_BITS+3)
|
outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp7, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[7] = range_limit[IDESCALE(tmp0 - tmp7, PASS1_BITS+3)
|
outptr[7] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp7, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[1] = range_limit[IDESCALE(tmp1 + tmp6, PASS1_BITS+3)
|
outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp1 + tmp6, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3)
|
outptr[6] = range_limit[(int) IRIGHT_SHIFT(tmp1 - tmp6, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3)
|
outptr[2] = range_limit[(int) IRIGHT_SHIFT(tmp2 + tmp5, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3)
|
outptr[5] = range_limit[(int) IRIGHT_SHIFT(tmp2 - tmp5, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[4] = range_limit[IDESCALE(tmp3 + tmp4, PASS1_BITS+3)
|
outptr[3] = range_limit[(int) IRIGHT_SHIFT(tmp3 + tmp4, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3)
|
outptr[4] = range_limit[(int) IRIGHT_SHIFT(tmp3 - tmp4, PASS1_BITS+3)
|
||||||
& RANGE_MASK];
|
& RANGE_MASK];
|
||||||
|
|
||||||
wsptr += DCTSIZE; /* advance pointer to next row */
|
wsptr += DCTSIZE; /* advance pointer to next row */
|
||||||
|
|||||||
Vendored
+312
-210
File diff suppressed because it is too large
Load Diff
Vendored
+68
-12
@@ -2,7 +2,7 @@
|
|||||||
* jmorecfg.h
|
* jmorecfg.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2012 by Guido Vollbeding.
|
* Modified 1997-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -15,13 +15,22 @@
|
|||||||
/*
|
/*
|
||||||
* Define BITS_IN_JSAMPLE as either
|
* Define BITS_IN_JSAMPLE as either
|
||||||
* 8 for 8-bit sample values (the usual setting)
|
* 8 for 8-bit sample values (the usual setting)
|
||||||
|
* 9 for 9-bit sample values
|
||||||
|
* 10 for 10-bit sample values
|
||||||
|
* 11 for 11-bit sample values
|
||||||
* 12 for 12-bit sample values
|
* 12 for 12-bit sample values
|
||||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
* Only 8, 9, 10, 11, and 12 bits sample data precision are supported for
|
||||||
* JPEG standard, and the IJG code does not support anything else!
|
* full-feature DCT processing. Further depths up to 16-bit may be added
|
||||||
* We do not support run-time selection of data precision, sorry.
|
* later for the lossless modes of operation.
|
||||||
|
* Run-time selection and conversion of data precision will be added later
|
||||||
|
* and are currently not supported, sorry.
|
||||||
|
* Exception: The transcoding part (jpegtran) supports all settings in a
|
||||||
|
* single instance, since it operates on the level of DCT coefficients and
|
||||||
|
* not sample values. The DCT coefficients are of the same type (16 bits)
|
||||||
|
* in all cases (see below).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
#define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -77,6 +86,48 @@ typedef char JSAMPLE;
|
|||||||
#endif /* BITS_IN_JSAMPLE == 8 */
|
#endif /* BITS_IN_JSAMPLE == 8 */
|
||||||
|
|
||||||
|
|
||||||
|
#if BITS_IN_JSAMPLE == 9
|
||||||
|
/* JSAMPLE should be the smallest type that will hold the values 0..511.
|
||||||
|
* On nearly all machines "short" will do nicely.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef short JSAMPLE;
|
||||||
|
#define GETJSAMPLE(value) ((int) (value))
|
||||||
|
|
||||||
|
#define MAXJSAMPLE 511
|
||||||
|
#define CENTERJSAMPLE 256
|
||||||
|
|
||||||
|
#endif /* BITS_IN_JSAMPLE == 9 */
|
||||||
|
|
||||||
|
|
||||||
|
#if BITS_IN_JSAMPLE == 10
|
||||||
|
/* JSAMPLE should be the smallest type that will hold the values 0..1023.
|
||||||
|
* On nearly all machines "short" will do nicely.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef short JSAMPLE;
|
||||||
|
#define GETJSAMPLE(value) ((int) (value))
|
||||||
|
|
||||||
|
#define MAXJSAMPLE 1023
|
||||||
|
#define CENTERJSAMPLE 512
|
||||||
|
|
||||||
|
#endif /* BITS_IN_JSAMPLE == 10 */
|
||||||
|
|
||||||
|
|
||||||
|
#if BITS_IN_JSAMPLE == 11
|
||||||
|
/* JSAMPLE should be the smallest type that will hold the values 0..2047.
|
||||||
|
* On nearly all machines "short" will do nicely.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef short JSAMPLE;
|
||||||
|
#define GETJSAMPLE(value) ((int) (value))
|
||||||
|
|
||||||
|
#define MAXJSAMPLE 2047
|
||||||
|
#define CENTERJSAMPLE 1024
|
||||||
|
|
||||||
|
#endif /* BITS_IN_JSAMPLE == 11 */
|
||||||
|
|
||||||
|
|
||||||
#if BITS_IN_JSAMPLE == 12
|
#if BITS_IN_JSAMPLE == 12
|
||||||
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
|
/* JSAMPLE should be the smallest type that will hold the values 0..4095.
|
||||||
* On nearly all machines "short" will do nicely.
|
* On nearly all machines "short" will do nicely.
|
||||||
@@ -252,7 +303,10 @@ typedef void noreturn_t;
|
|||||||
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
|
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_BOOLEAN
|
#ifndef HAVE_BOOLEAN
|
||||||
|
#if defined FALSE || defined TRUE || defined QGLOBAL_H
|
||||||
|
/* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */
|
||||||
|
typedef int boolean;
|
||||||
#ifndef FALSE /* in case these macros already exist */
|
#ifndef FALSE /* in case these macros already exist */
|
||||||
#define FALSE 0 /* values of boolean */
|
#define FALSE 0 /* values of boolean */
|
||||||
#endif
|
#endif
|
||||||
@@ -262,6 +316,7 @@ typedef void noreturn_t;
|
|||||||
#else
|
#else
|
||||||
typedef enum { FALSE = 0, TRUE = 1 } boolean;
|
typedef enum { FALSE = 0, TRUE = 1 } boolean;
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -299,11 +354,12 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
|
|||||||
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
#define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||||
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
|
#define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/
|
||||||
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
|
#define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */
|
||||||
/* Note: if you selected 12-bit data precision, it is dangerous to turn off
|
/* Note: if you selected more than 8-bit data precision, it is dangerous to
|
||||||
* ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit
|
* turn off ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only
|
||||||
* precision, so jchuff.c normally uses entropy optimization to compute
|
* good for 8-bit precision, so arithmetic coding is recommended for higher
|
||||||
* usable tables for higher precision. If you don't want to do optimization,
|
* precision. The Huffman encoder normally uses entropy optimization to
|
||||||
* you'll have to supply different default Huffman tables.
|
* compute usable tables for higher precision. Otherwise, you'll have to
|
||||||
|
* supply different default Huffman tables.
|
||||||
* The exact same statements apply for progressive JPEG: the default tables
|
* The exact same statements apply for progressive JPEG: the default tables
|
||||||
* don't work for progressive mode. (This may get fixed, however.)
|
* don't work for progressive mode. (This may get fixed, however.)
|
||||||
*/
|
*/
|
||||||
@@ -314,7 +370,7 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean;
|
|||||||
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
#define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */
|
||||||
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
#define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */
|
||||||
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
#define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/
|
||||||
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */
|
#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? (Requires DCT_ISLOW)*/
|
||||||
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
#define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */
|
||||||
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
#define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */
|
||||||
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
|
#undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */
|
||||||
|
|||||||
Vendored
+3
-3
@@ -2,7 +2,7 @@
|
|||||||
* jpegint.h
|
* jpegint.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||||
* Modified 1997-2011 by Guido Vollbeding.
|
* Modified 1997-2013 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -211,8 +211,8 @@ struct jpeg_marker_reader {
|
|||||||
/* Entropy decoding */
|
/* Entropy decoding */
|
||||||
struct jpeg_entropy_decoder {
|
struct jpeg_entropy_decoder {
|
||||||
JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
|
JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
|
||||||
JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
|
JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW *MCU_data));
|
||||||
JBLOCKROW *MCU_data));
|
JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Inverse DCT (also performs dequantization) */
|
/* Inverse DCT (also performs dequantization) */
|
||||||
|
|||||||
Vendored
+20
-13
@@ -2,7 +2,7 @@
|
|||||||
* jpeglib.h
|
* jpeglib.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-1998, Thomas G. Lane.
|
* Copyright (C) 1991-1998, Thomas G. Lane.
|
||||||
* Modified 2002-2012 by Guido Vollbeding.
|
* Modified 2002-2015 by Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -39,12 +39,12 @@ extern "C" {
|
|||||||
|
|
||||||
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
|
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
|
||||||
#define JPEG_LIB_VERSION_MAJOR 9
|
#define JPEG_LIB_VERSION_MAJOR 9
|
||||||
#define JPEG_LIB_VERSION_MINOR 0
|
#define JPEG_LIB_VERSION_MINOR 2
|
||||||
|
|
||||||
|
|
||||||
/* Various constants determining the sizes of things.
|
/* Various constants determining the sizes of things.
|
||||||
* All of these are specified by the JPEG standard, so don't change them
|
* All of these are specified by the JPEG standard,
|
||||||
* if you want to be compatible.
|
* so don't change them if you want to be compatible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */
|
#define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */
|
||||||
@@ -157,16 +157,21 @@ typedef struct {
|
|||||||
/* The downsampled dimensions are the component's actual, unpadded number
|
/* The downsampled dimensions are the component's actual, unpadded number
|
||||||
* of samples at the main buffer (preprocessing/compression interface);
|
* of samples at the main buffer (preprocessing/compression interface);
|
||||||
* DCT scaling is included, so
|
* DCT scaling is included, so
|
||||||
* downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE)
|
* downsampled_width =
|
||||||
|
* ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size)
|
||||||
* and similarly for height.
|
* and similarly for height.
|
||||||
*/
|
*/
|
||||||
JDIMENSION downsampled_width; /* actual width in samples */
|
JDIMENSION downsampled_width; /* actual width in samples */
|
||||||
JDIMENSION downsampled_height; /* actual height in samples */
|
JDIMENSION downsampled_height; /* actual height in samples */
|
||||||
/* This flag is used only for decompression. In cases where some of the
|
/* For decompression, in cases where some of the components will be
|
||||||
* components will be ignored (eg grayscale output from YCbCr image),
|
* ignored (eg grayscale output from YCbCr image), we can skip most
|
||||||
* we can skip most computations for the unused components.
|
* computations for the unused components.
|
||||||
|
* For compression, some of the components will need further quantization
|
||||||
|
* scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input).
|
||||||
|
* The field is first set TRUE for decompression, FALSE for compression
|
||||||
|
* in initial_setup, and then adapted in color conversion setup.
|
||||||
*/
|
*/
|
||||||
boolean component_needed; /* do we need the value of this component? */
|
boolean component_needed;
|
||||||
|
|
||||||
/* These values are computed before starting a scan of the component. */
|
/* These values are computed before starting a scan of the component. */
|
||||||
/* The decompressor output side may not use these variables. */
|
/* The decompressor output side may not use these variables. */
|
||||||
@@ -215,10 +220,12 @@ struct jpeg_marker_struct {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
JCS_UNKNOWN, /* error/unspecified */
|
JCS_UNKNOWN, /* error/unspecified */
|
||||||
JCS_GRAYSCALE, /* monochrome */
|
JCS_GRAYSCALE, /* monochrome */
|
||||||
JCS_RGB, /* red/green/blue */
|
JCS_RGB, /* red/green/blue, standard RGB (sRGB) */
|
||||||
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */
|
JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */
|
||||||
JCS_CMYK, /* C/M/Y/K */
|
JCS_CMYK, /* C/M/Y/K */
|
||||||
JCS_YCCK /* Y/Cb/Cr/K */
|
JCS_YCCK, /* Y/Cb/Cr/K */
|
||||||
|
JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */
|
||||||
|
JCS_BG_YCC /* big gamut Y/Cb/Cr, bg-sYCC */
|
||||||
} J_COLOR_SPACE;
|
} J_COLOR_SPACE;
|
||||||
|
|
||||||
/* Supported color transforms. */
|
/* Supported color transforms. */
|
||||||
@@ -972,7 +979,7 @@ EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
|
|||||||
unsigned char ** outbuffer,
|
unsigned char ** outbuffer,
|
||||||
unsigned long * outsize));
|
unsigned long * outsize));
|
||||||
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
|
EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
|
||||||
unsigned char * inbuffer,
|
const unsigned char * inbuffer,
|
||||||
unsigned long insize));
|
unsigned long insize));
|
||||||
|
|
||||||
/* Default parameter setup for compression */
|
/* Default parameter setup for compression */
|
||||||
|
|||||||
Vendored
+3
-3
@@ -265,9 +265,9 @@ typedef struct {
|
|||||||
INT32 volume;
|
INT32 volume;
|
||||||
/* The number of nonzero histogram cells within this box */
|
/* The number of nonzero histogram cells within this box */
|
||||||
long colorcount;
|
long colorcount;
|
||||||
} _box;
|
} box;
|
||||||
|
|
||||||
typedef _box * boxptr;
|
typedef box * boxptr;
|
||||||
|
|
||||||
|
|
||||||
LOCAL(boxptr)
|
LOCAL(boxptr)
|
||||||
@@ -546,7 +546,7 @@ select_colors (j_decompress_ptr cinfo, int desired_colors)
|
|||||||
|
|
||||||
/* Allocate workspace for box list */
|
/* Allocate workspace for box list */
|
||||||
boxlist = (boxptr) (*cinfo->mem->alloc_small)
|
boxlist = (boxptr) (*cinfo->mem->alloc_small)
|
||||||
((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(_box));
|
((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF(box));
|
||||||
/* Initialize one box containing whole space */
|
/* Initialize one box containing whole space */
|
||||||
numboxes = 1;
|
numboxes = 1;
|
||||||
boxlist[0].c0min = 0;
|
boxlist[0].c0min = 0;
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* jversion.h
|
* jversion.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-2013, Thomas G. Lane, Guido Vollbeding.
|
* Copyright (C) 1991-2016, Thomas G. Lane, Guido Vollbeding.
|
||||||
* This file is part of the Independent JPEG Group's software.
|
* This file is part of the Independent JPEG Group's software.
|
||||||
* For conditions of distribution and use, see the accompanying README file.
|
* For conditions of distribution and use, see the accompanying README file.
|
||||||
*
|
*
|
||||||
@@ -9,6 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define JVERSION "9 13-Jan-2013"
|
#define JVERSION "9b 17-Jan-2016"
|
||||||
|
|
||||||
#define JCOPYRIGHT "Copyright (C) 2013, Thomas G. Lane, Guido Vollbeding"
|
#define JCOPYRIGHT "Copyright (C) 2016, Thomas G. Lane, Guido Vollbeding"
|
||||||
|
|||||||
Vendored
+367
-1
@@ -833,7 +833,7 @@ Version 1.0.7beta11 [May 7, 2000]
|
|||||||
Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
|
Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
|
||||||
which are no longer used.
|
which are no longer used.
|
||||||
Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
|
Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
|
||||||
defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED
|
defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXt_SUPPORTED
|
||||||
is defined.
|
is defined.
|
||||||
Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
|
Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
|
||||||
overrun when old applications fill the info_ptr->text structure directly.
|
overrun when old applications fill the info_ptr->text structure directly.
|
||||||
@@ -5675,6 +5675,372 @@ Version 1.6.24rc03 [August 2, 2016]
|
|||||||
Version 1.6.24[August 4, 2016]
|
Version 1.6.24[August 4, 2016]
|
||||||
No changes.
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.25beta01 [August 12, 2016]
|
||||||
|
Reject oversized iCCP profile immediately.
|
||||||
|
Cleaned up PNG_DEBUG compile of pngtest.c.
|
||||||
|
Conditionally compile png_inflate().
|
||||||
|
|
||||||
|
Version 1.6.25beta02 [August 18, 2016]
|
||||||
|
Don't install pngcp; it conflicts with pngcp in the pngtools package.
|
||||||
|
Minor editing of INSTALL, (whitespace, added copyright line)
|
||||||
|
|
||||||
|
Version 1.6.25rc01 [August 24, 2016]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.25rc02 [August 29, 2016]
|
||||||
|
Added MIPS support (Mandar Sahastrabuddhe <Mandar.Sahastrabuddhe@imgtec.com>).
|
||||||
|
Only the UP filter is currently implemented.
|
||||||
|
|
||||||
|
Version 1.6.25rc03 [August 29, 2016]
|
||||||
|
Rebased contrib/intel/intel_sse.patch after the MIPS implementation.
|
||||||
|
|
||||||
|
Version 1.6.25rc04 [August 30, 2016]
|
||||||
|
Added MIPS support for SUB, AVG, and PAETH filters (Mandar Sahastrabuddhe).
|
||||||
|
|
||||||
|
Version 1.6.25rc05 [August 30, 2016]
|
||||||
|
Rebased contrib/intel/intel_sse.patch after the MIPS implementation update..
|
||||||
|
|
||||||
|
Version 1.6.25 [September 1, 2016]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.26beta01 [September 26, 2016]
|
||||||
|
Fixed handling zero length IDAT in pngfix (bug report by Agostino Sarubbo,
|
||||||
|
bugfix by John Bowler).
|
||||||
|
Do not issue a png_error() on read in png_set_pCAL() because png_handle_pCAL
|
||||||
|
has allocated memory that libpng needs to free.
|
||||||
|
Conditionally compile png_set_benign_errors() in pngread.c and pngtest.c
|
||||||
|
Issue a png_benign_error instead of a png_error on ADLER32 mismatch
|
||||||
|
while decoding compressed data chunks.
|
||||||
|
Changed PNG_ZLIB_VERNUM to ZLIB_VERNUM in pngpriv.h, pngstruct.h, and
|
||||||
|
pngrutil.c.
|
||||||
|
If CRC handling of critical chunks has been set to PNG_CRC_QUIET_USE,
|
||||||
|
ignore the ADLER32 checksum in the IDAT chunk as well as the chunk CRCs.
|
||||||
|
Issue png_benign_error() on ADLER32 checksum mismatch instead of png_error().
|
||||||
|
Add tests/badcrc.png and tests/badadler.png to tests/pngtest.
|
||||||
|
Merged pngtest.c with libpng-1.7.0beta84/pngtest.c
|
||||||
|
|
||||||
|
Version 1.6.26beta02 [October 1, 2016]
|
||||||
|
Updated the documentation about CRC and ADLER32 handling.
|
||||||
|
Quieted 117 warnings from clang-3.8 in pngtrans.c, pngread.c,
|
||||||
|
pngwrite.c, pngunknown.c, and pngvalid.c.
|
||||||
|
Quieted 58 (out of 144) -Wconversion compiler warnings by changing
|
||||||
|
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes
|
||||||
|
in png.c, pngread.c, and pngwutil.c.
|
||||||
|
|
||||||
|
Version 1.6.26beta03 [October 2, 2016]
|
||||||
|
Removed contrib/libtests/*.orig and *.rej that slipped into the tarballs.
|
||||||
|
Quieted the 86 remaining -Wconversion compiler warnings by
|
||||||
|
revising the png_isaligned() macro and trivial changes in png.c,
|
||||||
|
pngerror.c, pngget.c, pngmem.c, pngset.c, pngrtran.c, pngrutil.c,
|
||||||
|
pngwtran.c, pngwrite.c, and pngwutil.c.
|
||||||
|
|
||||||
|
Version 1.6.26beta04 [October 3, 2016]
|
||||||
|
Quieted (bogus?) clang warnings about "absolute value has no effect"
|
||||||
|
when PNG_USE_ABS is defined.
|
||||||
|
Fixed offsets in contrib/intel/intel_sse.patch
|
||||||
|
|
||||||
|
Version 1.6.26beta05 [October 6, 2016]
|
||||||
|
Changed integer constant 4294967294 to unsigned 4294967294U in pngconf.h
|
||||||
|
to avoid a signed/unsigned compare in the preprocessor.
|
||||||
|
|
||||||
|
Version 1.6.26beta06 [October 7, 2016]
|
||||||
|
Use zlib-1.2.8.1 inflateValidate() instead of inflateReset2() to
|
||||||
|
optionally avoid ADLER32 evaluation.
|
||||||
|
|
||||||
|
Version 1.6.26rc01 [October 12, 2016]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.26 [October 20, 2016]
|
||||||
|
Cosmetic change, "ptr != 0" to "ptr != NULL" in png.c and pngrutil.c
|
||||||
|
Despammed email addresses (replaced "@" with " at ").
|
||||||
|
|
||||||
|
Version 1.6.27beta01 [November 2, 2016]
|
||||||
|
Restrict the new ADLER32-skipping to IDAT chunks. It broke iCCP chunk
|
||||||
|
handling: an erroneous iCCP chunk would throw a png_error and reject the
|
||||||
|
entire PNG image instead of rejecting just the iCCP chunk with a warning,
|
||||||
|
if built with zlib-1.2.8.1.
|
||||||
|
|
||||||
|
Version 1.6.27rc01 [December 27, 2016]
|
||||||
|
Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. Fixes
|
||||||
|
an endless loop when handling erroneous ADLER32 checksums; bug
|
||||||
|
introduced in libpng-1.6.26.
|
||||||
|
Removed the use of a macro containing the pre-processor 'defined'
|
||||||
|
operator. It is unclear whether this is valid; a macro that
|
||||||
|
"generates" 'defined' is not permitted, but the use of the word
|
||||||
|
"generates" within the C90 standard seems to imply more than simple
|
||||||
|
substitution of an expression itself containing a well-formed defined
|
||||||
|
operation.
|
||||||
|
Added ARM support to CMakeLists.txt (Andreas Franek).
|
||||||
|
|
||||||
|
Version 1.6.27 [December 29, 2016]
|
||||||
|
Fixed a potential null pointer dereference in png_set_text_2() (bug report
|
||||||
|
and patch by Patrick Keshishian, CVE-2016-10087).
|
||||||
|
|
||||||
|
Version 1.6.28rc01 [January 3, 2017]
|
||||||
|
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
|
||||||
|
Added option to Cmake build allowing a custom location of zlib to be
|
||||||
|
specified in a scenario where libpng is being built as a subproject
|
||||||
|
alongside zlib by another project (Sam Serrels).
|
||||||
|
Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
|
||||||
|
up to 16 options.
|
||||||
|
|
||||||
|
Version 1.6.28rc02 [January 4, 2017]
|
||||||
|
Added "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
|
||||||
|
Moved SSE2 optimization code into the main libpng source directory.
|
||||||
|
Configure libpng with "configure --enable-intel-sse" or compile
|
||||||
|
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
|
||||||
|
|
||||||
|
Version 1.6.28rc03 [January 4, 2017]
|
||||||
|
Backed out the SSE optimization and last CMakeLists.txt to allow time for QA.
|
||||||
|
|
||||||
|
Version 1.6.28 [January 5, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.29beta01 [January 12, 2017]
|
||||||
|
Readded "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
|
||||||
|
Moved SSE2 optimization code into the main libpng source directory.
|
||||||
|
Configure libpng with "configure --enable-intel-sse" or compile
|
||||||
|
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
|
||||||
|
Simplified conditional compilation in pngvalid.c, for AIX (Michael Felt).
|
||||||
|
|
||||||
|
Version 1.6.29beta02 [February 22, 2017]
|
||||||
|
Avoid conditional directives that break statements in pngrutil.c (Romero
|
||||||
|
Malaquias)
|
||||||
|
The contrib/examples/pngtopng.c recovery code was in the wrong "if"
|
||||||
|
branches; the comments were correct.
|
||||||
|
Added code for PowerPC VSX optimisation (Vadim Barkov).
|
||||||
|
|
||||||
|
Version 1.6.29beta03 [March 1, 2017]
|
||||||
|
Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
|
||||||
|
Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c
|
||||||
|
because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1,
|
||||||
|
as suggested in zlib FAQ, item 24.
|
||||||
|
Suppress clang warnings about implicit sign changes in png.c
|
||||||
|
|
||||||
|
Version 1.6.29 [March 16, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.30beta01 [April 1, 2017]
|
||||||
|
Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
|
||||||
|
makefile.linux and makefile.solaris-x86 (Cosmin).
|
||||||
|
Revised documentation of png_get_error_ptr() in the libpng manual.
|
||||||
|
Silence clang -Wcomma and const drop warnings (Viktor Szakats).
|
||||||
|
Update Sourceforge URLs in documentation (https instead of http).
|
||||||
|
|
||||||
|
Version 1.6.30beta02 [April 22, 2017]
|
||||||
|
Document need to check for integer overflow when allocating a pixel
|
||||||
|
buffer for multiple rows in contrib/gregbook, contrib/pngminus,
|
||||||
|
example.c, and in the manual (suggested by Jaeseung Choi). This
|
||||||
|
is similar to the bug reported against pngquant in CVE-2016-5735.
|
||||||
|
Removed reference to the obsolete PNG_SAFE_LIMITS macro in the documentation.
|
||||||
|
|
||||||
|
Version 1.6.30beta03 [May 22, 2017]
|
||||||
|
Check for integer overflow in contrib/visupng and contrib/tools/genpng.
|
||||||
|
Do not double evaluate CMAKE_SYSTEM_PROCESSOR in CMakeLists.txt.
|
||||||
|
Test CMAKE_HOST_WIN32 instead of WIN32 in CMakeLists.txt.
|
||||||
|
Fix some URL in documentation.
|
||||||
|
|
||||||
|
Version 1.6.30beta04 [June 7, 2017]
|
||||||
|
Avoid writing an empty IDAT when the last IDAT exactly fills the
|
||||||
|
compression buffer (bug report by Brian Baird). This bug was
|
||||||
|
introduced in libpng-1.6.0.
|
||||||
|
|
||||||
|
Version 1.6.30rc01 [June 14, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.30rc02 [June 25, 2017]
|
||||||
|
Update copyright year in pnglibconf.h, make ltmain.sh executable.
|
||||||
|
Add a reference to the libpng.download site in README.
|
||||||
|
|
||||||
|
Version 1.6.30 [June 28, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.31beta01 [July 5, 2017]
|
||||||
|
Guard the definition of _POSIX_SOURCE in pngpriv.h (AIX already defines it;
|
||||||
|
bug report by Michael Felt).
|
||||||
|
Revised pngpriv.h to work around failure to compile arm/filter_neon.S
|
||||||
|
("typedef" directive is unrecognized by the assembler). The problem
|
||||||
|
was introduced in libpng-1.6.30beta01.
|
||||||
|
Added "Requires: zlib" to libpng.pc.in (Pieter Neerincx).
|
||||||
|
Added special case for FreeBSD in arm/filter_neon.S (Maya Rashish).
|
||||||
|
|
||||||
|
Version 1.6.31beta02 [July 8, 2017]
|
||||||
|
Added instructions for disabling hardware optimizations in INSTALL.
|
||||||
|
Added "--enable-hardware-optimizations" configuration flag to enable
|
||||||
|
or disable all hardware optimizations with one flag.
|
||||||
|
|
||||||
|
Version 1.6.31beta03 [July 9, 2017]
|
||||||
|
Updated CMakeLists.txt to add INTEL_SSE and MIPS_MSA platforms.
|
||||||
|
Changed "int" to "png_size_t" in intel/filter_sse2.c to prevent
|
||||||
|
possible integer overflow (Bug report by John Bowler).
|
||||||
|
Quieted "declaration after statement" warnings in intel/filter_sse2.c.
|
||||||
|
Added scripts/makefile-linux-opt, which has hardware optimizations enabled.
|
||||||
|
|
||||||
|
Version 1.6.31beta04 [July 11, 2017]
|
||||||
|
Removed one of the GCC-7.1.0 'strict-overflow' warnings that result when
|
||||||
|
integers appear on both sides of a compare. Worked around the others by
|
||||||
|
forcing the strict-overflow setting in the relevant functions to a level
|
||||||
|
where they are not reported (John Bowler).
|
||||||
|
Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
|
||||||
|
the space.
|
||||||
|
Worked around some C-style casts from (void*) because g++ 5.4.0 objects
|
||||||
|
to them.
|
||||||
|
Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
|
||||||
|
overflow' check that is on by default with -Wall -Wextra.
|
||||||
|
|
||||||
|
Version 1.6.31beta05 [July 13, 2017]
|
||||||
|
Added eXIf chunk support.
|
||||||
|
|
||||||
|
Version 1.6.31beta06 [July 17, 2017]
|
||||||
|
Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
|
||||||
|
tags) to pngtest.png.
|
||||||
|
|
||||||
|
Version 1.6.31beta07 [July 18, 2017]
|
||||||
|
Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning.
|
||||||
|
|
||||||
|
Version 1.6.31rc01 [July 19, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.31rc02 [July 25, 2017]
|
||||||
|
Fixed typo in example.c (png_free_image should be png_image_free) (Bug
|
||||||
|
report by John Smith)
|
||||||
|
|
||||||
|
Version 1.6.31 [July 27, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.32beta01 [July 31, 2017]
|
||||||
|
Avoid possible NULL dereference in png_handle_eXIf when benign_errors
|
||||||
|
are allowed. Avoid leaking the input buffer "eXIf_buf".
|
||||||
|
Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
|
||||||
|
to arguments for png_get_eXIf() and png_set_eXIf().
|
||||||
|
Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in
|
||||||
|
pngwrite.c, and made various other fixes to png_write_eXIf().
|
||||||
|
Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1() and
|
||||||
|
png_set_eXIf_1(), respectively, to avoid breaking API compatibility
|
||||||
|
with libpng-1.6.31.
|
||||||
|
|
||||||
|
Version 1.6.32beta02 [August 1, 2017]
|
||||||
|
Updated contrib/libtests/pngunknown.c with eXIf chunk.
|
||||||
|
|
||||||
|
Version 1.6.32beta03 [August 2, 2017]
|
||||||
|
Initialized btoa[] in pngstest.c
|
||||||
|
Stop memory leak when returning from png_handle_eXIf() with an error
|
||||||
|
(Bug report from the OSS-fuzz project).
|
||||||
|
|
||||||
|
Version 1.6.32beta04 [August 2, 2017]
|
||||||
|
Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
|
||||||
|
Update libpng.3 and libpng-manual.txt about eXIf functions.
|
||||||
|
|
||||||
|
Version 1.6.32beta05 [August 2, 2017]
|
||||||
|
Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
|
||||||
|
|
||||||
|
Version 1.6.32beta06 [August 2, 2017]
|
||||||
|
Removed png_get_eXIf_1() and png_set_eXIf_1().
|
||||||
|
|
||||||
|
Version 1.6.32beta07 [August 3, 2017]
|
||||||
|
Check length of all chunks except IDAT against user limit to fix an
|
||||||
|
OSS-fuzz issue (Fixes CVE-2017-12652).
|
||||||
|
|
||||||
|
Version 1.6.32beta08 [August 3, 2017]
|
||||||
|
Check length of IDAT against maximum possible IDAT size, accounting
|
||||||
|
for height, rowbytes, interlacing and zlib/deflate overhead.
|
||||||
|
Restored png_get_eXIf_1() and png_set_eXIf_1(), because strlen(eXIf_buf)
|
||||||
|
does not work (the eXIf chunk data can contain zeroes).
|
||||||
|
|
||||||
|
Version 1.6.32beta09 [August 3, 2017]
|
||||||
|
Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
|
||||||
|
no longer using deprecated cmake LOCATION feature (Clifford Yapp).
|
||||||
|
Fixed five-byte error in the calculation of IDAT maximum possible size.
|
||||||
|
|
||||||
|
Version 1.6.32beta10 [August 5, 2017]
|
||||||
|
Moved chunk-length check into a png_check_chunk_length() private
|
||||||
|
function (Suggested by Max Stepin).
|
||||||
|
Moved bad pngs from tests to contrib/libtests/crashers
|
||||||
|
Moved testing of bad pngs into a separate tests/pngtest-badpngs script
|
||||||
|
Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
|
||||||
|
in the output but PASS for the libpng test.
|
||||||
|
Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp).
|
||||||
|
Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
|
||||||
|
num_exif argument to png_get_eXIf_1() (Github Issue 171).
|
||||||
|
|
||||||
|
Version 1.6.32beta11 [August 7, 2017]
|
||||||
|
Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks().
|
||||||
|
Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers.
|
||||||
|
Make pngtest --strict, --relax, --xfail options imply -m (multiple).
|
||||||
|
Removed unused chunk_name parameter from png_check_chunk_length().
|
||||||
|
Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak.
|
||||||
|
Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue.
|
||||||
|
Initialize png_ptr->row_buf[0] to 255 in png_read_row() to fix OSS-fuzz UMR.
|
||||||
|
Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue.
|
||||||
|
Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(), to account
|
||||||
|
for the minimum 'deflate' stream, and relocate the test to a point
|
||||||
|
after the keyword has been read.
|
||||||
|
Check that the eXIf chunk has at least 2 bytes and begins with "II" or "MM".
|
||||||
|
|
||||||
|
Version 1.6.32rc01 [August 18, 2017]
|
||||||
|
Added a set of "huge_xxxx_chunk.png" files to contrib/testpngs/crashers,
|
||||||
|
one for each known chunk type, with length = 2GB-1.
|
||||||
|
Check for 0 return from png_get_rowbytes() and added some (size_t) typecasts
|
||||||
|
in contrib/pngminus/*.c to stop some Coverity issues (162705, 162706,
|
||||||
|
and 162707).
|
||||||
|
Renamed chunks in contrib/testpngs/crashers to avoid having files whose
|
||||||
|
names differ only in case; this causes problems with some platforms
|
||||||
|
(github issue #172).
|
||||||
|
|
||||||
|
Version 1.6.32rc02 [August 22, 2017]
|
||||||
|
Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
|
||||||
|
project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
|
||||||
|
|
||||||
|
Version 1.6.32 [August 24, 2017]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.33beta01 [August 28, 2017]
|
||||||
|
Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
|
||||||
|
parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
|
||||||
|
Fixed off-by-one error in png_do_check_palette_indexes() (Bug report
|
||||||
|
by Mick P., Source Forge Issue #269).
|
||||||
|
|
||||||
|
Version 1.6.33beta02 [September 3, 2017]
|
||||||
|
Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
|
||||||
|
to fix shortlived oss-fuzz issue 3234.
|
||||||
|
Compute a larger limit on IDAT because some applications write a deflate
|
||||||
|
buffer for each row (Bug report by Andrew Church).
|
||||||
|
Use current date (DATE) instead of release-date (RDATE) in last
|
||||||
|
changed date of contrib/oss-fuzz files.
|
||||||
|
Enabled ARM support in CMakeLists.txt (Bernd Kuhls).
|
||||||
|
|
||||||
|
Version 1.6.33beta03 [September 14, 2017]
|
||||||
|
Fixed incorrect typecast of some arguments to png_malloc() and
|
||||||
|
png_calloc() that were png_uint_32 instead of png_alloc_size_t
|
||||||
|
(Bug report by "irwir" in Github libpng issue #175).
|
||||||
|
Use pnglibconf.h.prebuilt when building for ANDROID with cmake (Github
|
||||||
|
issue 162, by rcdailey).
|
||||||
|
|
||||||
|
Version 1.6.33rc01 [September 20, 2017]
|
||||||
|
Initialize memory allocated by png_inflate to zero, using memset, to
|
||||||
|
stop an oss-fuzz "use of uninitialized value" detection in png_set_text_2()
|
||||||
|
due to truncated iTXt or zTXt chunk.
|
||||||
|
Initialize memory allocated by png_read_buffer to zero, using memset, to
|
||||||
|
stop an oss-fuzz "use of uninitialized value" detection in
|
||||||
|
png_icc_check_tag_table() due to truncated iCCP chunk.
|
||||||
|
Removed a redundant test (suggested by "irwir" in Github issue #180).
|
||||||
|
|
||||||
|
Version 1.6.33rc02 [September 23, 2017]
|
||||||
|
Added an interlaced version of each file in contrib/pngsuite.
|
||||||
|
Relocate new memset() call in pngrutil.c.
|
||||||
|
Removed more redundant tests (suggested by "irwir" in Github issue #180).
|
||||||
|
Add support for loading images with associated alpha in the Simplified
|
||||||
|
API (Samuel Williams).
|
||||||
|
|
||||||
|
Version 1.6.33 [September 28, 2017]
|
||||||
|
Revert contrib/oss-fuzz/libpng_read_fuzzer.cc to libpng-1.6.32 state.
|
||||||
|
Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
|
||||||
|
Add end_info structure and png_read_end() to the libpng fuzzer.
|
||||||
|
|
||||||
|
Version 1.6.34 [September 29, 2017]
|
||||||
|
Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
|
||||||
|
test failures.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||||
|
|||||||
Vendored
+11
-8
@@ -37,12 +37,21 @@ if(ARM OR AARCH64)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_SSE
|
if(";${CPU_BASELINE_FINAL};" MATCHES "SSE2"
|
||||||
AND (NOT MSVC OR (MSVC_VERSION GREATER 1799))) # MSVS2013+ (issue #7232)
|
AND (NOT MSVC OR (MSVC_VERSION GREATER 1799))) # MSVS2013+ (issue #7232)
|
||||||
list(APPEND lib_srcs contrib/intel/intel_init.c contrib/intel/filter_sse2_intrinsics.c)
|
list(APPEND lib_srcs intel/intel_init.c intel/filter_sse2_intrinsics.c)
|
||||||
add_definitions(-DPNG_INTEL_SSE)
|
add_definitions(-DPNG_INTEL_SSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PPC64LE OR PPC64)
|
||||||
|
if(ENABLE_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()
|
||||||
|
add_definitions(-DPNG_POWERPC_VSX_OPT=0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
# Define the library target:
|
# Define the library target:
|
||||||
# ----------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------
|
||||||
@@ -54,12 +63,6 @@ endif(MSVC)
|
|||||||
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
add_library(${PNG_LIBRARY} STATIC ${lib_srcs} ${lib_hdrs})
|
||||||
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
target_link_libraries(${PNG_LIBRARY} ${ZLIB_LIBRARIES})
|
||||||
|
|
||||||
if(UNIX)
|
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align)
|
ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align)
|
||||||
|
|
||||||
set_target_properties(${PNG_LIBRARY}
|
set_target_properties(${PNG_LIBRARY}
|
||||||
|
|||||||
Vendored
+6
-3
@@ -10,8 +10,8 @@ this sentence.
|
|||||||
|
|
||||||
This code is released under the libpng license.
|
This code is released under the libpng license.
|
||||||
|
|
||||||
libpng versions 1.0.7, July 1, 2000 through 1.6.24, August 4, 2016 are
|
libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
|
||||||
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
|
Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
|
||||||
derived from libpng-1.0.6, and are distributed according to the same
|
derived from libpng-1.0.6, and are distributed according to the same
|
||||||
disclaimer and license as libpng-1.0.6 with the following individuals
|
disclaimer and license as libpng-1.0.6 with the following individuals
|
||||||
added to the list of Contributing Authors:
|
added to the list of Contributing Authors:
|
||||||
@@ -22,6 +22,9 @@ added to the list of Contributing Authors:
|
|||||||
Cosmin Truta
|
Cosmin Truta
|
||||||
Gilles Vollant
|
Gilles Vollant
|
||||||
James Yu
|
James Yu
|
||||||
|
Mandar Sahastrabuddhe
|
||||||
|
Google Inc.
|
||||||
|
Vadim Barkov
|
||||||
|
|
||||||
and with the following additions to the disclaimer:
|
and with the following additions to the disclaimer:
|
||||||
|
|
||||||
@@ -127,4 +130,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
August 4, 2016
|
September 29, 2017
|
||||||
|
|||||||
Vendored
+13
-6
@@ -1,4 +1,4 @@
|
|||||||
README for libpng version 1.6.24 - August 4, 2016 (shared library 16.0)
|
README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
@@ -23,7 +23,7 @@ earlier versions if you are using a shared library. The type of the
|
|||||||
png_uint_32, which will affect shared-library applications that use
|
png_uint_32, which will affect shared-library applications that use
|
||||||
this function.
|
this function.
|
||||||
|
|
||||||
To avoid problems with changes to the internals of png info_struct,
|
To avoid problems with changes to the internals of the png info_struct,
|
||||||
new APIs have been made available in 0.95 to avoid direct application
|
new APIs have been made available in 0.95 to avoid direct application
|
||||||
access to info_ptr. These functions are the png_set_<chunk> and
|
access to info_ptr. These functions are the png_set_<chunk> and
|
||||||
png_get_<chunk> functions. These functions should be used when
|
png_get_<chunk> functions. These functions should be used when
|
||||||
@@ -88,11 +88,11 @@ zlib should be available at the same place that libpng is, or at zlib.net.
|
|||||||
|
|
||||||
You may also want a copy of the PNG specification. It is available
|
You may also want a copy of the PNG specification. It is available
|
||||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
||||||
these at http://www.libpng.org/pub/png/documents/
|
these at http://www.libpng.org/pub/png/pngdocs.html .
|
||||||
|
|
||||||
This code is currently being archived at libpng.sf.net in the
|
This code is currently being archived at libpng.sourceforge.io in the
|
||||||
[DOWNLOAD] area, and at ftp://ftp.simplesystems.org. If you can't find it
|
[DOWNLOAD] area, and at http://libpng.download/src . If you
|
||||||
in any of those places, e-mail me, and I'll help you find it.
|
can't find it in any of those places, e-mail me, and I'll help you find it.
|
||||||
|
|
||||||
I am not a lawyer, but I believe that the Export Control Classification
|
I am not a lawyer, but I believe that the Export Control Classification
|
||||||
Number (ECCN) for libpng is EAR99, which means not subject to export
|
Number (ECCN) for libpng is EAR99, which means not subject to export
|
||||||
@@ -179,18 +179,25 @@ Files in this distribution:
|
|||||||
pngwtran.c => Write data transformations
|
pngwtran.c => Write data transformations
|
||||||
pngwutil.c => Write utility functions
|
pngwutil.c => Write utility functions
|
||||||
arm => Contains optimized code for the ARM platform
|
arm => Contains optimized code for the ARM platform
|
||||||
|
powerpc => Contains optimized code for the PowerPC platform
|
||||||
contrib => Contributions
|
contrib => Contributions
|
||||||
|
arm-neon => Optimized code for ARM-NEON platform
|
||||||
|
powerpc-vsx => Optimized code for POWERPC-VSX platform
|
||||||
examples => Example programs
|
examples => Example programs
|
||||||
gregbook => source code for PNG reading and writing, from
|
gregbook => source code for PNG reading and writing, from
|
||||||
Greg Roelofs' "PNG: The Definitive Guide",
|
Greg Roelofs' "PNG: The Definitive Guide",
|
||||||
O'Reilly, 1999
|
O'Reilly, 1999
|
||||||
libtests => Test programs
|
libtests => Test programs
|
||||||
|
mips-msa => Optimized code for MIPS-MSA platform
|
||||||
pngminim => Minimal decoder, encoder, and progressive decoder
|
pngminim => Minimal decoder, encoder, and progressive decoder
|
||||||
programs demonstrating use of pngusr.dfa
|
programs demonstrating use of pngusr.dfa
|
||||||
pngminus => Simple pnm2png and png2pnm programs
|
pngminus => Simple pnm2png and png2pnm programs
|
||||||
pngsuite => Test images
|
pngsuite => Test images
|
||||||
|
testpngs
|
||||||
tools => Various tools
|
tools => Various tools
|
||||||
visupng => Contains a MSVC workspace for VisualPng
|
visupng => Contains a MSVC workspace for VisualPng
|
||||||
|
intel => Optimized code for INTEL-SSE2 platform
|
||||||
|
mips => Optimized code for MIPS platform
|
||||||
projects => Contains project files and workspaces for
|
projects => Contains project files and workspaces for
|
||||||
building a DLL
|
building a DLL
|
||||||
owatcom => Contains a WATCOM project for building libpng
|
owatcom => Contains a WATCOM project for building libpng
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* filter_neon.S - NEON optimised filter functions
|
/* filter_neon.S - NEON optimised filter functions
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014 Glenn Randers-Pehrson
|
* Copyright (c) 2014,2017 Glenn Randers-Pehrson
|
||||||
* Written by Mans Rullgard, 2011.
|
* Written by Mans Rullgard, 2011.
|
||||||
* Last changed in libpng 1.6.16 [December 22, 2014]
|
* Last changed in libpng 1.6.31 [July 27, 2017]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
#define PNG_VERSION_INFO_ONLY
|
#define PNG_VERSION_INFO_ONLY
|
||||||
#include "../pngpriv.h"
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#if defined(__linux__) && defined(__ELF__)
|
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
|
||||||
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
-158
@@ -1,158 +0,0 @@
|
|||||||
Enabling SSE support
|
|
||||||
|
|
||||||
Copyright (c) 2016 Google, Inc.
|
|
||||||
Written by Mike Klein, Matt Sarett
|
|
||||||
|
|
||||||
This INSTALL file written by Glenn Randers-Pehrson, 2016.
|
|
||||||
|
|
||||||
If you have moved intel_init.c and filter_sse2_intrinsics.c to a different
|
|
||||||
directory, be sure to update the '#include "../../pngpriv.h"' line in both
|
|
||||||
files if necessary to point to the correct relative location of pngpriv.h
|
|
||||||
with respect to the new location of those files.
|
|
||||||
|
|
||||||
To enable SSE support in libpng, follow the instructions in I, II, or III,
|
|
||||||
below:
|
|
||||||
|
|
||||||
I. Using patched "configure" scripts:
|
|
||||||
|
|
||||||
First, apply intel_sse.patch in your build directory.
|
|
||||||
|
|
||||||
patch -i contrib/intel/intel_sse.patch -p1
|
|
||||||
|
|
||||||
Then, if you are not building in a new GIT clone, e.g., in a tar
|
|
||||||
distribution, remove any existing pre-built configure scripts:
|
|
||||||
|
|
||||||
./configure --enable-maintainer-mode
|
|
||||||
make maintainer-clean
|
|
||||||
./autogen.sh --maintainer --clean
|
|
||||||
|
|
||||||
Finally, configure libpng with -DPNG_INTEL_SSE in CPPFLAGS:
|
|
||||||
|
|
||||||
./autogen.sh --maintainer
|
|
||||||
CPPFLAGS="-DPNG_INTEL_SSE" ./configure [options]
|
|
||||||
make CPPFLAGS="-DPNG_INTEL_SSE" [options]
|
|
||||||
make
|
|
||||||
|
|
||||||
II. Using a custom makefile:
|
|
||||||
|
|
||||||
If you are using a custom makefile makefile, you will have to update it
|
|
||||||
manually to include contrib/intel/*.o in the dependencies, and to define
|
|
||||||
PNG_INTEL_SSE.
|
|
||||||
|
|
||||||
III. Using manually updated "configure" scripts:
|
|
||||||
|
|
||||||
If you prefer, manually edit pngpriv.h, configure.ac, and Makefile.am,
|
|
||||||
following the instructions below, then follow the instructions in
|
|
||||||
section II of INSTALL in the main libpng directory, then configure libpng
|
|
||||||
with -DPNG_INTEL_SSE in CPPFLAGS.
|
|
||||||
|
|
||||||
1. Add the following code to configure.ac under HOST SPECIFIC OPTIONS
|
|
||||||
directly beneath the section for ARM:
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
# INTEL
|
|
||||||
# =====
|
|
||||||
#
|
|
||||||
# INTEL SSE (SIMD) support.
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([intel-sse],
|
|
||||||
AS_HELP_STRING([[[--enable-intel-sse]]],
|
|
||||||
[Enable Intel SSE optimizations: =no/off, yes/on:]
|
|
||||||
[no/off: disable the optimizations;]
|
|
||||||
[yes/on: enable the optimizations.]
|
|
||||||
[If not specified: determined by the compiler.]),
|
|
||||||
[case "$enableval" in
|
|
||||||
no|off)
|
|
||||||
# disable the default enabling:
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
|
||||||
[Disable Intel SSE optimizations])
|
|
||||||
# Prevent inclusion of the assembler files below:
|
|
||||||
enable_intel_sse=no;;
|
|
||||||
yes|on)
|
|
||||||
AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
|
||||||
[Enable Intel SSE optimizations]);;
|
|
||||||
*)
|
|
||||||
AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
|
|
||||||
esac])
|
|
||||||
|
|
||||||
# Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
|
|
||||||
# or where Intel optimizations were explicitly requested (this allows a
|
|
||||||
# fallback if a future host CPU does not match 'x86*')
|
|
||||||
AM_CONDITIONAL([PNG_INTEL_SSE],
|
|
||||||
[test "$enable_intel_sse" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
i?86|x86_64) :;;
|
|
||||||
*) test "$enable_intel_sse" != '';;
|
|
||||||
esac])
|
|
||||||
-----------------cut----------------
|
|
||||||
|
|
||||||
2. Add the following code to Makefile.am under HOST SPECIFIC OPTIONS
|
|
||||||
directly beneath the "if PNG_ARM_NEON ... endif" statement:
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
if PNG_INTEL_SSE
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\
|
|
||||||
contrib/intel/filter_sse2_intrinsics.c
|
|
||||||
endif
|
|
||||||
-----------------cut----------------
|
|
||||||
|
|
||||||
3. Add the following lines to pngpriv.h, following the PNG_ARM_NEON_OPT
|
|
||||||
code:
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
#ifndef PNG_INTEL_SSE_OPT
|
|
||||||
# ifdef PNG_INTEL_SSE
|
|
||||||
/* Only check for SSE if the build configuration has been modified to
|
|
||||||
* enable SSE optimizations. This means that these optimizations will
|
|
||||||
* be off by default. See contrib/intel for more details.
|
|
||||||
*/
|
|
||||||
# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
|
|
||||||
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
# define PNG_INTEL_SSE_OPT 1
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if PNG_INTEL_SSE_OPT > 0
|
|
||||||
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
|
||||||
# if defined(__SSE4_1__) || defined(__AVX__)
|
|
||||||
/* We are not actually using AVX, but checking for AVX is the best
|
|
||||||
way we can detect SSE4.1 and SSSE3 on MSVC.
|
|
||||||
*/
|
|
||||||
# define PNG_INTEL_SSE_IMPLEMENTATION 3
|
|
||||||
# elif defined(__SSSE3__)
|
|
||||||
# define PNG_INTEL_SSE_IMPLEMENTATION 2
|
|
||||||
# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
# define PNG_INTEL_SSE_IMPLEMENTATION 1
|
|
||||||
# else
|
|
||||||
# define PNG_INTEL_SSE_IMPLEMENTATION 0
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
|
|
||||||
4. Add the following lines to pngpriv.h, following the prototype for
|
|
||||||
png_read_filter_row_paeth4_neon:
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
|
|
||||||
-----------------cut----------------
|
|
||||||
-187
@@ -1,187 +0,0 @@
|
|||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
--- a/configure.ac 2016-05-25 18:59:10.000000000 -0400
|
|
||||||
+++ b/configure.ac 2016-05-25 19:48:10.631751170 -0400
|
|
||||||
@@ -341,16 +341,50 @@ AC_ARG_ENABLE([arm-neon],
|
|
||||||
|
|
||||||
AM_CONDITIONAL([PNG_ARM_NEON],
|
|
||||||
[test "$enable_arm_neon" != 'no' &&
|
|
||||||
case "$host_cpu" in
|
|
||||||
arm*|aarch64*) :;;
|
|
||||||
*) test "$enable_arm_neon" != '';;
|
|
||||||
esac])
|
|
||||||
|
|
||||||
+# INTEL
|
|
||||||
+# =====
|
|
||||||
+#
|
|
||||||
+# INTEL SSE (SIMD) support.
|
|
||||||
+
|
|
||||||
+AC_ARG_ENABLE([intel-sse],
|
|
||||||
+ AS_HELP_STRING([[[--enable-intel-sse]]],
|
|
||||||
+ [Enable Intel SSE optimizations: =no/off, yes/on:]
|
|
||||||
+ [no/off: disable the optimizations;]
|
|
||||||
+ [yes/on: enable the optimizations.]
|
|
||||||
+ [If not specified: determined by the compiler.]),
|
|
||||||
+ [case "$enableval" in
|
|
||||||
+ no|off)
|
|
||||||
+ # disable the default enabling:
|
|
||||||
+ AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
|
|
||||||
+ [Disable Intel SSE optimizations])
|
|
||||||
+ # Prevent inclusion of the assembler files below:
|
|
||||||
+ enable_intel_sse=no;;
|
|
||||||
+ yes|on)
|
|
||||||
+ AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
|
|
||||||
+ [Enable Intel SSE optimizations]);;
|
|
||||||
+ *)
|
|
||||||
+ AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
|
|
||||||
+ esac])
|
|
||||||
+
|
|
||||||
+# Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
|
|
||||||
+# or where Intel optimizations were explicitly requested (this allows a
|
|
||||||
+# fallback if a future host CPU does not match 'x86*')
|
|
||||||
+AM_CONDITIONAL([PNG_INTEL_SSE],
|
|
||||||
+ [test "$enable_intel_sse" != 'no' &&
|
|
||||||
+ case "$host_cpu" in
|
|
||||||
+ i?86|x86_64) :;;
|
|
||||||
+ *) test "$enable_intel_sse" != '';;
|
|
||||||
+ esac])
|
|
||||||
AC_MSG_NOTICE([[Extra options for compiler: $PNG_COPTS]])
|
|
||||||
|
|
||||||
# Config files, substituting as above
|
|
||||||
AC_CONFIG_FILES([Makefile libpng.pc:libpng.pc.in])
|
|
||||||
AC_CONFIG_FILES([libpng-config:libpng-config.in],
|
|
||||||
[chmod +x libpng-config])
|
|
||||||
|
|
||||||
AC_OUTPUT
|
|
||||||
diff --git a/Makefile.am b/Makefile.am
|
|
||||||
--- a/Makefile.am 2016-05-17 18:15:12.000000000 -0400
|
|
||||||
+++ b/Makefile.am 2016-05-25 19:48:10.631751170 -0400
|
|
||||||
@@ -92,16 +92,20 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SO
|
|
||||||
pngset.c pngtrans.c pngwio.c pngwrite.c pngwtran.c pngwutil.c\
|
|
||||||
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
|
|
||||||
|
|
||||||
if PNG_ARM_NEON
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
|
||||||
arm/filter_neon.S arm/filter_neon_intrinsics.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
+if PNG_INTEL_SSE
|
|
||||||
+libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += contrib/intel/intel_init.c\
|
|
||||||
+ contrib/intel/filter_sse2_intrinsics.c
|
|
||||||
+endif
|
|
||||||
nodist_libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = pnglibconf.h
|
|
||||||
|
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LDFLAGS = -no-undefined -export-dynamic \
|
|
||||||
-version-number @PNGLIB_MAJOR@@PNGLIB_MINOR@:@PNGLIB_RELEASE@:0
|
|
||||||
|
|
||||||
if HAVE_LD_VERSION_SCRIPT
|
|
||||||
# Versioned symbols and restricted exports
|
|
||||||
if HAVE_SOLARIS_LD
|
|
||||||
diff --git a/pngpriv.h b/pngpriv.h
|
|
||||||
--- a/pngpriv.h 2016-08-01 18:13:38.770128810 -0500
|
|
||||||
+++ b/pngpriv.h 2016-08-01 18:50:19.130179017 -0500
|
|
||||||
@@ -177,16 +177,52 @@
|
|
||||||
# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
|
|
||||||
|
|
||||||
# ifndef PNG_ARM_NEON_IMPLEMENTATION
|
|
||||||
/* Use the intrinsics code by default. */
|
|
||||||
# define PNG_ARM_NEON_IMPLEMENTATION 1
|
|
||||||
# endif
|
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
|
||||||
|
|
||||||
+#ifndef PNG_INTEL_SSE_OPT
|
|
||||||
+# ifdef PNG_INTEL_SSE
|
|
||||||
+ /* Only check for SSE if the build configuration has been modified to
|
|
||||||
+ * enable SSE optimizations. This means that these optimizations will
|
|
||||||
+ * be off by default. See contrib/intel for more details.
|
|
||||||
+ */
|
|
||||||
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
|
|
||||||
+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
+# define PNG_INTEL_SSE_OPT 1
|
|
||||||
+# endif
|
|
||||||
+# endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if PNG_INTEL_SSE_OPT > 0
|
|
||||||
+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
|
||||||
+# if defined(__SSE4_1__) || defined(__AVX__)
|
|
||||||
+ /* We are not actually using AVX, but checking for AVX is the best
|
|
||||||
+ way we can detect SSE4.1 and SSSE3 on MSVC.
|
|
||||||
+ */
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 3
|
|
||||||
+# elif defined(__SSSE3__)
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 2
|
|
||||||
+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 1
|
|
||||||
+# else
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
|
|
||||||
+# endif
|
|
||||||
+# endif
|
|
||||||
+
|
|
||||||
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
|
|
||||||
+# endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Is this a build of a DLL where compilation of the object modules requires
|
|
||||||
* different preprocessor settings to those required for a simple library? If
|
|
||||||
* so PNG_BUILD_DLL must be set.
|
|
||||||
*
|
|
||||||
* If libpng is used inside a DLL but that DLL does not export the libpng APIs
|
|
||||||
* PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a
|
|
||||||
* static library of libpng then link the DLL against that.
|
|
||||||
*/
|
|
||||||
@@ -1185,16 +1221,31 @@ PNG_INTERNAL_FUNCTION(void,png_read_filt
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
+
|
|
||||||
+#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Choose the best filter to use and filter the row data */
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
|
|
||||||
png_row_infop row_info),PNG_EMPTY);
|
|
||||||
|
|
||||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr,
|
|
||||||
png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY);
|
|
||||||
@@ -1914,16 +1965,20 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_O
|
|
||||||
/* List *all* the possible optimizations here - this branch is required if
|
|
||||||
* the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
|
|
||||||
* CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
|
|
||||||
*/
|
|
||||||
# if PNG_ARM_NEON_OPT > 0
|
|
||||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
|
|
||||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
|
||||||
# endif
|
|
||||||
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
|
||||||
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
|
||||||
+# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
|
|
||||||
png_const_charp key, png_bytep new_key), PNG_EMPTY);
|
|
||||||
|
|
||||||
/* Maintainer: Put new private prototypes here ^ */
|
|
||||||
|
|
||||||
#include "pngdebug.h"
|
|
||||||
+70
-45
@@ -1,19 +1,18 @@
|
|||||||
|
|
||||||
/* filter_sse2_intrinsics.c - SSE2 optimized filter functions
|
/* filter_sse2_intrinsics.c - SSE2 optimized filter functions
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 Google, Inc.
|
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
|
||||||
* Written by Mike Klein and Matt Sarett
|
* Written by Mike Klein and Matt Sarett
|
||||||
* Derived from arm/filter_neon_intrinsics.c, which was
|
* Derived from arm/filter_neon_intrinsics.c
|
||||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.31 [July 27, 2017]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
* and license in png.h
|
* and license in png.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../pngpriv.h"
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
|
|
||||||
@@ -41,7 +40,7 @@ static __m128i load3(const void* p) {
|
|||||||
/* We'll load 2 bytes, then 1 byte,
|
/* We'll load 2 bytes, then 1 byte,
|
||||||
* then mask them together, and finally load into SSE.
|
* then mask them together, and finally load into SSE.
|
||||||
*/
|
*/
|
||||||
const png_uint_16* p01 = p;
|
const png_uint_16* p01 = (png_const_uint_16p)p;
|
||||||
const png_byte* p2 = (const png_byte*)(p01+1);
|
const png_byte* p2 = (const png_byte*)(p01+1);
|
||||||
|
|
||||||
png_uint_32 v012 = (png_uint_32)(*p01)
|
png_uint_32 v012 = (png_uint_32)(*p01)
|
||||||
@@ -54,12 +53,15 @@ static void store3(void* p, __m128i v) {
|
|||||||
* its bottom two bytes, then its third byte.
|
* its bottom two bytes, then its third byte.
|
||||||
*/
|
*/
|
||||||
png_uint_32 v012;
|
png_uint_32 v012;
|
||||||
|
png_uint_16* p01;
|
||||||
|
png_byte* p2;
|
||||||
|
|
||||||
store4(&v012, v);
|
store4(&v012, v);
|
||||||
|
|
||||||
png_uint_16* p01 = p;
|
p01 = (png_uint_16p)p;
|
||||||
png_byte* p2 = (png_byte*)(p01+1);
|
p2 = (png_byte*)(p01+1);
|
||||||
*p01 = v012;
|
*p01 = (png_uint_16)v012;
|
||||||
*p2 = v012 >> 16;
|
*p2 = (png_byte)(v012 >> 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
|
void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
|
||||||
@@ -69,11 +71,13 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* There is no pixel to the left of the first pixel. It's encoded directly.
|
* There is no pixel to the left of the first pixel. It's encoded directly.
|
||||||
* That works with our main loop if we just say that left pixel was zero.
|
* That works with our main loop if we just say that left pixel was zero.
|
||||||
*/
|
*/
|
||||||
(void) prev; //unused parameter
|
png_size_t rb;
|
||||||
png_debug(1, "in png_read_filter_row_sub3_sse2");
|
|
||||||
__m128i a, d = _mm_setzero_si128();
|
__m128i a, d = _mm_setzero_si128();
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_sub3_sse2");
|
||||||
|
|
||||||
|
rb = row_info->rowbytes;
|
||||||
while (rb >= 4) {
|
while (rb >= 4) {
|
||||||
a = d; d = load4(row);
|
a = d; d = load4(row);
|
||||||
d = _mm_add_epi8(d, a);
|
d = _mm_add_epi8(d, a);
|
||||||
@@ -90,6 +94,7 @@ void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
row += 3;
|
row += 3;
|
||||||
rb -= 3;
|
rb -= 3;
|
||||||
}
|
}
|
||||||
|
PNG_UNUSED(prev)
|
||||||
}
|
}
|
||||||
|
|
||||||
void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
|
void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
|
||||||
@@ -99,12 +104,14 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* There is no pixel to the left of the first pixel. It's encoded directly.
|
* There is no pixel to the left of the first pixel. It's encoded directly.
|
||||||
* That works with our main loop if we just say that left pixel was zero.
|
* That works with our main loop if we just say that left pixel was zero.
|
||||||
*/
|
*/
|
||||||
(void) prev; //unused parameter
|
png_size_t rb;
|
||||||
png_debug(1, "in png_read_filter_row_sub4_sse2");
|
|
||||||
__m128i a, d = _mm_setzero_si128();
|
__m128i a, d = _mm_setzero_si128();
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_sub4_sse2");
|
||||||
while (rb > 0) {
|
|
||||||
|
rb = row_info->rowbytes+4;
|
||||||
|
while (rb > 4) {
|
||||||
a = d; d = load4(row);
|
a = d; d = load4(row);
|
||||||
d = _mm_add_epi8(d, a);
|
d = _mm_add_epi8(d, a);
|
||||||
store4(row, d);
|
store4(row, d);
|
||||||
@@ -112,6 +119,7 @@ void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
row += 4;
|
row += 4;
|
||||||
rb -= 4;
|
rb -= 4;
|
||||||
}
|
}
|
||||||
|
PNG_UNUSED(prev)
|
||||||
}
|
}
|
||||||
|
|
||||||
void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
|
void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
|
||||||
@@ -122,18 +130,23 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* predicted to be half of the pixel above it. So again, this works
|
* predicted to be half of the pixel above it. So again, this works
|
||||||
* perfectly with our loop if we make sure a starts at zero.
|
* perfectly with our loop if we make sure a starts at zero.
|
||||||
*/
|
*/
|
||||||
png_debug(1, "in png_read_filter_row_avg3_sse2");
|
|
||||||
|
png_size_t rb;
|
||||||
|
|
||||||
const __m128i zero = _mm_setzero_si128();
|
const __m128i zero = _mm_setzero_si128();
|
||||||
|
|
||||||
__m128i b;
|
__m128i b;
|
||||||
__m128i a, d = zero;
|
__m128i a, d = zero;
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_avg3_sse2");
|
||||||
|
rb = row_info->rowbytes;
|
||||||
while (rb >= 4) {
|
while (rb >= 4) {
|
||||||
|
__m128i avg;
|
||||||
b = load4(prev);
|
b = load4(prev);
|
||||||
a = d; d = load4(row );
|
a = d; d = load4(row );
|
||||||
|
|
||||||
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
||||||
__m128i avg = _mm_avg_epu8(a,b);
|
avg = _mm_avg_epu8(a,b);
|
||||||
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
||||||
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
||||||
_mm_set1_epi8(1)));
|
_mm_set1_epi8(1)));
|
||||||
@@ -145,11 +158,12 @@ void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
rb -= 3;
|
rb -= 3;
|
||||||
}
|
}
|
||||||
if (rb > 0) {
|
if (rb > 0) {
|
||||||
|
__m128i avg;
|
||||||
b = load3(prev);
|
b = load3(prev);
|
||||||
a = d; d = load3(row );
|
a = d; d = load3(row );
|
||||||
|
|
||||||
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
||||||
__m128i avg = _mm_avg_epu8(a,b);
|
avg = _mm_avg_epu8(a,b);
|
||||||
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
||||||
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
||||||
_mm_set1_epi8(1)));
|
_mm_set1_epi8(1)));
|
||||||
@@ -171,18 +185,21 @@ void png_read_filter_row_avg4_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* predicted to be half of the pixel above it. So again, this works
|
* predicted to be half of the pixel above it. So again, this works
|
||||||
* perfectly with our loop if we make sure a starts at zero.
|
* perfectly with our loop if we make sure a starts at zero.
|
||||||
*/
|
*/
|
||||||
png_debug(1, "in png_read_filter_row_avg4_sse2");
|
png_size_t rb;
|
||||||
const __m128i zero = _mm_setzero_si128();
|
const __m128i zero = _mm_setzero_si128();
|
||||||
__m128i b;
|
__m128i b;
|
||||||
__m128i a, d = zero;
|
__m128i a, d = zero;
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_avg4_sse2");
|
||||||
while (rb > 0) {
|
|
||||||
|
rb = row_info->rowbytes+4;
|
||||||
|
while (rb > 4) {
|
||||||
|
__m128i avg;
|
||||||
b = load4(prev);
|
b = load4(prev);
|
||||||
a = d; d = load4(row );
|
a = d; d = load4(row );
|
||||||
|
|
||||||
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
/* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
|
||||||
__m128i avg = _mm_avg_epu8(a,b);
|
avg = _mm_avg_epu8(a,b);
|
||||||
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
/* ...but we can fix it up by subtracting off 1 if it rounded up. */
|
||||||
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
|
||||||
_mm_set1_epi8(1)));
|
_mm_set1_epi8(1)));
|
||||||
@@ -240,36 +257,40 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* Here we zero b and d, which become c and a respectively at the start of
|
* Here we zero b and d, which become c and a respectively at the start of
|
||||||
* the loop.
|
* the loop.
|
||||||
*/
|
*/
|
||||||
png_debug(1, "in png_read_filter_row_paeth3_sse2");
|
png_size_t rb;
|
||||||
const __m128i zero = _mm_setzero_si128();
|
const __m128i zero = _mm_setzero_si128();
|
||||||
__m128i c, b = zero,
|
__m128i c, b = zero,
|
||||||
a, d = zero;
|
a, d = zero;
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_paeth3_sse2");
|
||||||
|
|
||||||
|
rb = row_info->rowbytes;
|
||||||
while (rb >= 4) {
|
while (rb >= 4) {
|
||||||
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
||||||
* intermediates.
|
* intermediates.
|
||||||
*/
|
*/
|
||||||
|
__m128i pa,pb,pc,smallest,nearest;
|
||||||
c = b; b = _mm_unpacklo_epi8(load4(prev), zero);
|
c = b; b = _mm_unpacklo_epi8(load4(prev), zero);
|
||||||
a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
|
a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
|
||||||
|
|
||||||
/* (p-a) == (a+b-c - a) == (b-c) */
|
/* (p-a) == (a+b-c - a) == (b-c) */
|
||||||
__m128i pa = _mm_sub_epi16(b,c);
|
|
||||||
|
pa = _mm_sub_epi16(b,c);
|
||||||
|
|
||||||
/* (p-b) == (a+b-c - b) == (a-c) */
|
/* (p-b) == (a+b-c - b) == (a-c) */
|
||||||
__m128i pb = _mm_sub_epi16(a,c);
|
pb = _mm_sub_epi16(a,c);
|
||||||
|
|
||||||
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
||||||
__m128i pc = _mm_add_epi16(pa,pb);
|
pc = _mm_add_epi16(pa,pb);
|
||||||
|
|
||||||
pa = abs_i16(pa); /* |p-a| */
|
pa = abs_i16(pa); /* |p-a| */
|
||||||
pb = abs_i16(pb); /* |p-b| */
|
pb = abs_i16(pb); /* |p-b| */
|
||||||
pc = abs_i16(pc); /* |p-c| */
|
pc = abs_i16(pc); /* |p-c| */
|
||||||
|
|
||||||
__m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
||||||
|
|
||||||
/* Paeth breaks ties favoring a over b over c. */
|
/* Paeth breaks ties favoring a over b over c. */
|
||||||
__m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
||||||
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
||||||
c));
|
c));
|
||||||
|
|
||||||
@@ -285,26 +306,27 @@ void png_read_filter_row_paeth3_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
||||||
* intermediates.
|
* intermediates.
|
||||||
*/
|
*/
|
||||||
|
__m128i pa,pb,pc,smallest,nearest;
|
||||||
c = b; b = _mm_unpacklo_epi8(load3(prev), zero);
|
c = b; b = _mm_unpacklo_epi8(load3(prev), zero);
|
||||||
a = d; d = _mm_unpacklo_epi8(load3(row ), zero);
|
a = d; d = _mm_unpacklo_epi8(load3(row ), zero);
|
||||||
|
|
||||||
/* (p-a) == (a+b-c - a) == (b-c) */
|
/* (p-a) == (a+b-c - a) == (b-c) */
|
||||||
__m128i pa = _mm_sub_epi16(b,c);
|
pa = _mm_sub_epi16(b,c);
|
||||||
|
|
||||||
/* (p-b) == (a+b-c - b) == (a-c) */
|
/* (p-b) == (a+b-c - b) == (a-c) */
|
||||||
__m128i pb = _mm_sub_epi16(a,c);
|
pb = _mm_sub_epi16(a,c);
|
||||||
|
|
||||||
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
||||||
__m128i pc = _mm_add_epi16(pa,pb);
|
pc = _mm_add_epi16(pa,pb);
|
||||||
|
|
||||||
pa = abs_i16(pa); /* |p-a| */
|
pa = abs_i16(pa); /* |p-a| */
|
||||||
pb = abs_i16(pb); /* |p-b| */
|
pb = abs_i16(pb); /* |p-b| */
|
||||||
pc = abs_i16(pc); /* |p-c| */
|
pc = abs_i16(pc); /* |p-c| */
|
||||||
|
|
||||||
__m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
||||||
|
|
||||||
/* Paeth breaks ties favoring a over b over c. */
|
/* Paeth breaks ties favoring a over b over c. */
|
||||||
__m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
||||||
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
||||||
c));
|
c));
|
||||||
|
|
||||||
@@ -334,13 +356,16 @@ void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
* Here we zero b and d, which become c and a respectively at the start of
|
* Here we zero b and d, which become c and a respectively at the start of
|
||||||
* the loop.
|
* the loop.
|
||||||
*/
|
*/
|
||||||
png_debug(1, "in png_read_filter_row_paeth4_sse2");
|
png_size_t rb;
|
||||||
const __m128i zero = _mm_setzero_si128();
|
const __m128i zero = _mm_setzero_si128();
|
||||||
|
__m128i pa,pb,pc,smallest,nearest;
|
||||||
__m128i c, b = zero,
|
__m128i c, b = zero,
|
||||||
a, d = zero;
|
a, d = zero;
|
||||||
|
|
||||||
png_size_t rb = row_info->rowbytes;
|
png_debug(1, "in png_read_filter_row_paeth4_sse2");
|
||||||
while (rb > 0) {
|
|
||||||
|
rb = row_info->rowbytes+4;
|
||||||
|
while (rb > 4) {
|
||||||
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
/* It's easiest to do this math (particularly, deal with pc) with 16-bit
|
||||||
* intermediates.
|
* intermediates.
|
||||||
*/
|
*/
|
||||||
@@ -348,22 +373,22 @@ void png_read_filter_row_paeth4_sse2(png_row_infop row_info, png_bytep row,
|
|||||||
a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
|
a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
|
||||||
|
|
||||||
/* (p-a) == (a+b-c - a) == (b-c) */
|
/* (p-a) == (a+b-c - a) == (b-c) */
|
||||||
__m128i pa = _mm_sub_epi16(b,c);
|
pa = _mm_sub_epi16(b,c);
|
||||||
|
|
||||||
/* (p-b) == (a+b-c - b) == (a-c) */
|
/* (p-b) == (a+b-c - b) == (a-c) */
|
||||||
__m128i pb = _mm_sub_epi16(a,c);
|
pb = _mm_sub_epi16(a,c);
|
||||||
|
|
||||||
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
/* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
|
||||||
__m128i pc = _mm_add_epi16(pa,pb);
|
pc = _mm_add_epi16(pa,pb);
|
||||||
|
|
||||||
pa = abs_i16(pa); /* |p-a| */
|
pa = abs_i16(pa); /* |p-a| */
|
||||||
pb = abs_i16(pb); /* |p-b| */
|
pb = abs_i16(pb); /* |p-b| */
|
||||||
pc = abs_i16(pc); /* |p-c| */
|
pc = abs_i16(pc); /* |p-c| */
|
||||||
|
|
||||||
__m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
|
||||||
|
|
||||||
/* Paeth breaks ties favoring a over b over c. */
|
/* Paeth breaks ties favoring a over b over c. */
|
||||||
__m128i nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
nearest = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
|
||||||
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
|
||||||
c));
|
c));
|
||||||
|
|
||||||
+5
-6
@@ -1,19 +1,18 @@
|
|||||||
|
|
||||||
/* intel_init.c - SSE2 optimized filter functions
|
/* intel_init.c - SSE2 optimized filter functions
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016 Google, Inc.
|
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
|
||||||
* Written by Mike Klein and Matt Sarett
|
* Written by Mike Klein and Matt Sarett, Google, Inc.
|
||||||
* Derived from arm/arm_init.c, which was
|
* Derived from arm/arm_init.c
|
||||||
* Copyright (c) 2014,2016 Glenn Randers-Pehrson
|
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.22 [May 26, 2016]
|
* Last changed in libpng 1.6.29 [March 16, 2017]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
* and license in png.h
|
* and license in png.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../../pngpriv.h"
|
#include "../pngpriv.h"
|
||||||
|
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifdef PNG_READ_SUPPORTED
|
||||||
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
Vendored
+19
-86
@@ -1,67 +1,15 @@
|
|||||||
diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt
|
|
||||||
index fee9c99..eaf2095 100644
|
|
||||||
--- a/3rdparty/libpng/CMakeLists.txt
|
|
||||||
+++ b/3rdparty/libpng/CMakeLists.txt
|
|
||||||
@@ -33,6 +33,11 @@ if(ENABLE_NEON)
|
|
||||||
add_definitions(-DPNG_ARM_NEON_OPT=2)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
+if(ENABLE_SSE)
|
|
||||||
+ list(APPEND lib_srcs contrib/intel/intel_init.c contrib/intel/filter_sse2_intrinsics.c)
|
|
||||||
+ add_definitions(-DPNG_INTEL_SSE)
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
# ----------------------------------------------------------------------------------
|
|
||||||
# Define the library target:
|
|
||||||
# ----------------------------------------------------------------------------------
|
|
||||||
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
|
|
||||||
index fe3355d..c0aa785 100644
|
|
||||||
--- a/3rdparty/libpng/pngpriv.h
|
--- a/3rdparty/libpng/pngpriv.h
|
||||||
+++ b/3rdparty/libpng/pngpriv.h
|
+++ b/3rdparty/libpng/pngpriv.h
|
||||||
@@ -182,6 +182,42 @@
|
@@ -214,7 +214,7 @@
|
||||||
# endif
|
# endif
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
#endif
|
||||||
|
|
||||||
+#ifndef PNG_INTEL_SSE_OPT
|
-#if PNG_INTEL_SSE_OPT > 0
|
||||||
+# ifdef PNG_INTEL_SSE
|
|
||||||
+ /* Only check for SSE if the build configuration has been modified to
|
|
||||||
+ * enable SSE optimizations. This means that these optimizations will
|
|
||||||
+ * be off by default. See contrib/intel for more details.
|
|
||||||
+ */
|
|
||||||
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
|
|
||||||
+ defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
+# define PNG_INTEL_SSE_OPT 1
|
|
||||||
+# endif
|
|
||||||
+# endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
|
+#if defined(PNG_INTEL_SSE_OPT) && PNG_INTEL_SSE_OPT > 0
|
||||||
+# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
# ifndef PNG_INTEL_SSE_IMPLEMENTATION
|
||||||
+# if defined(__SSE4_1__) || defined(__AVX__)
|
# if defined(__SSE4_1__) || defined(__AVX__)
|
||||||
+ /* We are not actually using AVX, but checking for AVX is the best
|
/* We are not actually using AVX, but checking for AVX is the best
|
||||||
+ way we can detect SSE4.1 and SSSE3 on MSVC.
|
@@ -547,7 +547,7 @@
|
||||||
+ */
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 3
|
|
||||||
+# elif defined(__SSSE3__)
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 2
|
|
||||||
+# elif defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
|
|
||||||
+ (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 1
|
|
||||||
+# else
|
|
||||||
+# define PNG_INTEL_SSE_IMPLEMENTATION 0
|
|
||||||
+# endif
|
|
||||||
+# endif
|
|
||||||
+
|
|
||||||
+# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_sse2
|
|
||||||
+# endif
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Is this a build of a DLL where compilation of the object modules requires
|
|
||||||
* different preprocessor settings to those required for a simple library? If
|
|
||||||
* so PNG_BUILD_DLL must be set.
|
|
||||||
@@ -457,7 +493,7 @@
|
|
||||||
|
|
||||||
/* Memory model/platform independent fns */
|
/* Memory model/platform independent fns */
|
||||||
#ifndef PNG_ABORT
|
#ifndef PNG_ABORT
|
||||||
@@ -70,36 +18,21 @@ index fe3355d..c0aa785 100644
|
|||||||
# define PNG_ABORT() ExitProcess(0)
|
# define PNG_ABORT() ExitProcess(0)
|
||||||
# else
|
# else
|
||||||
# define PNG_ABORT() abort()
|
# define PNG_ABORT() abort()
|
||||||
@@ -1190,6 +1226,21 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
|
@@ -1340,7 +1340,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
|
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
+
|
|
||||||
+#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
|
|
||||||
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Choose the best filter to use and filter the row data */
|
-#if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
|
+#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
@@ -1919,6 +1970,10 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
||||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_sse2,(png_row_infop
|
||||||
|
@@ -2099,7 +2099,7 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
|
||||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||||
# endif
|
|
||||||
+# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
|
||||||
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
|
||||||
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
|
||||||
+# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
|
-# if PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
|
+# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
|
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
||||||
|
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||||
|
# endif
|
||||||
Vendored
+169
-54
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -14,7 +14,27 @@
|
|||||||
#include "pngpriv.h"
|
#include "pngpriv.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef png_libpng_version_1_6_24 Your_png_h_is_not_version_1_6_24;
|
typedef png_libpng_version_1_6_34 Your_png_h_is_not_version_1_6_34;
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
/* The version tests may need to be added to, but the problem warning has
|
||||||
|
* consistently been fixed in GCC versions which obtain wide-spread release.
|
||||||
|
* The problem is that many versions of GCC rearrange comparison expressions in
|
||||||
|
* the optimizer in such a way that the results of the comparison will change
|
||||||
|
* if signed integer overflow occurs. Such comparisons are not permitted in
|
||||||
|
* ANSI C90, however GCC isn't clever enough to work out that that do not occur
|
||||||
|
* below in png_ascii_from_fp and png_muldiv, so it produces a warning with
|
||||||
|
* -Wextra. Unfortunately this is highly dependent on the optimizer and the
|
||||||
|
* machine architecture so the warning comes and goes unpredictably and is
|
||||||
|
* impossible to "fix", even were that a good idea.
|
||||||
|
*/
|
||||||
|
#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
|
||||||
|
#define GCC_STRICT_OVERFLOW 1
|
||||||
|
#endif /* GNU 7.1.x */
|
||||||
|
#endif /* GNU */
|
||||||
|
#ifndef GCC_STRICT_OVERFLOW
|
||||||
|
#define GCC_STRICT_OVERFLOW 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
||||||
* of the PNG file signature. If the PNG data is embedded into another
|
* of the PNG file signature. If the PNG data is embedded into another
|
||||||
@@ -458,7 +478,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
|
|
||||||
#ifdef PNG_TEXT_SUPPORTED
|
#ifdef PNG_TEXT_SUPPORTED
|
||||||
/* Free text item num or (if num == -1) all text items */
|
/* Free text item num or (if num == -1) all text items */
|
||||||
if (info_ptr->text != 0 &&
|
if (info_ptr->text != NULL &&
|
||||||
((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0)
|
((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0)
|
||||||
{
|
{
|
||||||
if (num != -1)
|
if (num != -1)
|
||||||
@@ -477,6 +497,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
png_free(png_ptr, info_ptr->text);
|
png_free(png_ptr, info_ptr->text);
|
||||||
info_ptr->text = NULL;
|
info_ptr->text = NULL;
|
||||||
info_ptr->num_text = 0;
|
info_ptr->num_text = 0;
|
||||||
|
info_ptr->max_text = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -541,7 +562,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
|
|
||||||
#ifdef PNG_sPLT_SUPPORTED
|
#ifdef PNG_sPLT_SUPPORTED
|
||||||
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */
|
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */
|
||||||
if (info_ptr->splt_palettes != 0 &&
|
if (info_ptr->splt_palettes != NULL &&
|
||||||
((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0)
|
((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0)
|
||||||
{
|
{
|
||||||
if (num != -1)
|
if (num != -1)
|
||||||
@@ -571,7 +592,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
|
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
if (info_ptr->unknown_chunks != 0 &&
|
if (info_ptr->unknown_chunks != NULL &&
|
||||||
((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0)
|
((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0)
|
||||||
{
|
{
|
||||||
if (num != -1)
|
if (num != -1)
|
||||||
@@ -594,6 +615,26 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
/* Free any eXIf entry */
|
||||||
|
if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
|
||||||
|
{
|
||||||
|
# ifdef PNG_READ_eXIf_SUPPORTED
|
||||||
|
if (info_ptr->eXIf_buf)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, info_ptr->eXIf_buf);
|
||||||
|
info_ptr->eXIf_buf = NULL;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
if (info_ptr->exif)
|
||||||
|
{
|
||||||
|
png_free(png_ptr, info_ptr->exif);
|
||||||
|
info_ptr->exif = NULL;
|
||||||
|
}
|
||||||
|
info_ptr->valid &= ~PNG_INFO_eXIf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_hIST_SUPPORTED
|
#ifdef PNG_hIST_SUPPORTED
|
||||||
/* Free any hIST entry */
|
/* Free any hIST entry */
|
||||||
if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
|
if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
|
||||||
@@ -617,7 +658,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
|
|||||||
/* Free any image bits attached to the info structure */
|
/* Free any image bits attached to the info structure */
|
||||||
if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0)
|
if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0)
|
||||||
{
|
{
|
||||||
if (info_ptr->row_pointers != 0)
|
if (info_ptr->row_pointers != NULL)
|
||||||
{
|
{
|
||||||
png_uint_32 row;
|
png_uint_32 row;
|
||||||
for (row = 0; row < info_ptr->height; row++)
|
for (row = 0; row < info_ptr->height; row++)
|
||||||
@@ -684,7 +725,7 @@ png_init_io(png_structrp png_ptr, png_FILE_p fp)
|
|||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_save_int_32(png_bytep buf, png_int_32 i)
|
png_save_int_32(png_bytep buf, png_int_32 i)
|
||||||
{
|
{
|
||||||
png_save_uint_32(buf, i);
|
png_save_uint_32(buf, (png_uint_32)i);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -775,15 +816,15 @@ png_get_copyright(png_const_structrp png_ptr)
|
|||||||
#else
|
#else
|
||||||
# ifdef __STDC__
|
# ifdef __STDC__
|
||||||
return PNG_STRING_NEWLINE \
|
return PNG_STRING_NEWLINE \
|
||||||
"libpng version 1.6.24 - August 4, 2016" PNG_STRING_NEWLINE \
|
"libpng version 1.6.34 - September 29, 2017" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \
|
"Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
|
||||||
PNG_STRING_NEWLINE \
|
PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE;
|
PNG_STRING_NEWLINE;
|
||||||
# else
|
# else
|
||||||
return "libpng version 1.6.24 - August 4, 2016\
|
return "libpng version 1.6.34 - September 29, 2017\
|
||||||
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\
|
Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||||
# endif
|
# endif
|
||||||
@@ -1872,12 +1913,12 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
*/
|
*/
|
||||||
if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
|
if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
|
||||||
return png_icc_profile_error(png_ptr, colorspace, "sRGB",
|
return png_icc_profile_error(png_ptr, colorspace, "sRGB",
|
||||||
(unsigned)intent, "invalid sRGB rendering intent");
|
(png_alloc_size_t)intent, "invalid sRGB rendering intent");
|
||||||
|
|
||||||
if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
|
if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
|
||||||
colorspace->rendering_intent != intent)
|
colorspace->rendering_intent != intent)
|
||||||
return png_icc_profile_error(png_ptr, colorspace, "sRGB",
|
return png_icc_profile_error(png_ptr, colorspace, "sRGB",
|
||||||
(unsigned)intent, "inconsistent rendering intents");
|
(png_alloc_size_t)intent, "inconsistent rendering intents");
|
||||||
|
|
||||||
if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
|
if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
|
||||||
{
|
{
|
||||||
@@ -1931,16 +1972,49 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
static const png_byte D50_nCIEXYZ[12] =
|
static const png_byte D50_nCIEXYZ[12] =
|
||||||
{ 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d };
|
{ 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d };
|
||||||
|
|
||||||
int /* PRIVATE */
|
static int /* bool */
|
||||||
png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
||||||
png_const_charp name, png_uint_32 profile_length)
|
png_const_charp name, png_uint_32 profile_length)
|
||||||
{
|
{
|
||||||
if (profile_length < 132)
|
if (profile_length < 132)
|
||||||
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
|
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
|
||||||
"too short");
|
"too short");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||||
|
int /* PRIVATE */
|
||||||
|
png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
||||||
|
png_const_charp name, png_uint_32 profile_length)
|
||||||
|
{
|
||||||
|
if (!icc_check_length(png_ptr, colorspace, name, profile_length))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* This needs to be here because the 'normal' check is in
|
||||||
|
* png_decompress_chunk, yet this happens after the attempt to
|
||||||
|
* png_malloc_base the required data. We only need this on read; on write
|
||||||
|
* the caller supplies the profile buffer so libpng doesn't allocate it. See
|
||||||
|
* the call to icc_check_length below (the write case).
|
||||||
|
*/
|
||||||
|
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
else if (png_ptr->user_chunk_malloc_max > 0 &&
|
||||||
|
png_ptr->user_chunk_malloc_max < profile_length)
|
||||||
|
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
|
||||||
|
"exceeds application limits");
|
||||||
|
# elif PNG_USER_CHUNK_MALLOC_MAX > 0
|
||||||
|
else if (PNG_USER_CHUNK_MALLOC_MAX < profile_length)
|
||||||
|
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
|
||||||
|
"exceeds libpng limits");
|
||||||
|
# else /* !SET_USER_LIMITS */
|
||||||
|
/* This will get compiled out on all 32-bit and better systems. */
|
||||||
|
else if (PNG_SIZE_MAX < profile_length)
|
||||||
|
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
|
||||||
|
"exceeds system limits");
|
||||||
|
# endif /* !SET_USER_LIMITS */
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
#endif /* READ_iCCP */
|
||||||
|
|
||||||
int /* PRIVATE */
|
int /* PRIVATE */
|
||||||
png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
||||||
@@ -2149,15 +2223,6 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
* being in range. All defined tag types have an 8 byte header - a 4 byte
|
* being in range. All defined tag types have an 8 byte header - a 4 byte
|
||||||
* type signature then 0.
|
* type signature then 0.
|
||||||
*/
|
*/
|
||||||
if ((tag_start & 3) != 0)
|
|
||||||
{
|
|
||||||
/* CNHP730S.icc shipped with Microsoft Windows 64 violates this, it is
|
|
||||||
* only a warning here because libpng does not care about the
|
|
||||||
* alignment.
|
|
||||||
*/
|
|
||||||
(void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
|
|
||||||
"ICC profile tag start not a multiple of 4");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is a hard error; potentially it can cause read outside the
|
/* This is a hard error; potentially it can cause read outside the
|
||||||
* profile.
|
* profile.
|
||||||
@@ -2165,6 +2230,16 @@ png_icc_check_tag_table(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
if (tag_start > profile_length || tag_length > profile_length - tag_start)
|
if (tag_start > profile_length || tag_length > profile_length - tag_start)
|
||||||
return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
|
return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
|
||||||
"ICC profile tag outside profile");
|
"ICC profile tag outside profile");
|
||||||
|
|
||||||
|
if ((tag_start & 3) != 0)
|
||||||
|
{
|
||||||
|
/* CNHP730S.icc shipped with Microsoft Windows 64 violates this; it is
|
||||||
|
* only a warning here because libpng does not care about the
|
||||||
|
* alignment.
|
||||||
|
*/
|
||||||
|
(void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
|
||||||
|
"ICC profile tag start not a multiple of 4");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1; /* success, maybe with warnings */
|
return 1; /* success, maybe with warnings */
|
||||||
@@ -2377,7 +2452,7 @@ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
|
if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (png_icc_check_length(png_ptr, colorspace, name, profile_length) != 0 &&
|
if (icc_check_length(png_ptr, colorspace, name, profile_length) != 0 &&
|
||||||
png_icc_check_header(png_ptr, colorspace, name, profile_length, profile,
|
png_icc_check_header(png_ptr, colorspace, name, profile_length, profile,
|
||||||
color_type) != 0 &&
|
color_type) != 0 &&
|
||||||
png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
|
png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
|
||||||
@@ -2495,7 +2570,7 @@ png_check_IHDR(png_const_structrp png_ptr,
|
|||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (png_gt(((width + 7) & (~7)),
|
if (png_gt(((width + 7) & (~7U)),
|
||||||
((PNG_SIZE_MAX
|
((PNG_SIZE_MAX
|
||||||
- 48 /* big_row_buf hack */
|
- 48 /* big_row_buf hack */
|
||||||
- 1) /* filter byte */
|
- 1) /* filter byte */
|
||||||
@@ -2797,7 +2872,7 @@ png_pow10(int power)
|
|||||||
if (power < 0)
|
if (power < 0)
|
||||||
{
|
{
|
||||||
if (power < DBL_MIN_10_EXP) return 0;
|
if (power < DBL_MIN_10_EXP) return 0;
|
||||||
recip = 1, power = -power;
|
recip = 1; power = -power;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (power > 0)
|
if (power > 0)
|
||||||
@@ -2822,6 +2897,14 @@ png_pow10(int power)
|
|||||||
/* Function to format a floating point value in ASCII with a given
|
/* Function to format a floating point value in ASCII with a given
|
||||||
* precision.
|
* precision.
|
||||||
*/
|
*/
|
||||||
|
#if GCC_STRICT_OVERFLOW
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
/* The problem arises below with exp_b10, which can never overflow because it
|
||||||
|
* comes, originally, from frexp and is therefore limited to a range which is
|
||||||
|
* typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
|
||||||
|
*/
|
||||||
|
#pragma GCC diagnostic warning "-Wstrict-overflow=2"
|
||||||
|
#endif /* GCC_STRICT_OVERFLOW */
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
||||||
double fp, unsigned int precision)
|
double fp, unsigned int precision)
|
||||||
@@ -2875,7 +2958,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
double test = png_pow10(exp_b10+1);
|
double test = png_pow10(exp_b10+1);
|
||||||
|
|
||||||
if (test <= DBL_MAX)
|
if (test <= DBL_MAX)
|
||||||
++exp_b10, base = test;
|
{
|
||||||
|
++exp_b10; base = test;
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
@@ -2889,7 +2974,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
* test on DBL_MAX above.
|
* test on DBL_MAX above.
|
||||||
*/
|
*/
|
||||||
fp /= base;
|
fp /= base;
|
||||||
while (fp >= 1) fp /= 10, ++exp_b10;
|
while (fp >= 1)
|
||||||
|
{
|
||||||
|
fp /= 10; ++exp_b10;
|
||||||
|
}
|
||||||
|
|
||||||
/* Because of the code above fp may, at this point, be
|
/* Because of the code above fp may, at this point, be
|
||||||
* less than .1, this is ok because the code below can
|
* less than .1, this is ok because the code below can
|
||||||
@@ -2906,7 +2994,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
*/
|
*/
|
||||||
if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
|
if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
|
||||||
{
|
{
|
||||||
czero = -exp_b10; /* PLUS 2 digits: TOTAL 3 */
|
czero = 0U-exp_b10; /* PLUS 2 digits: TOTAL 3 */
|
||||||
exp_b10 = 0; /* Dot added below before first output. */
|
exp_b10 = 0; /* Dot added below before first output. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2940,7 +3028,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
/* Rounding up to 10, handle that here. */
|
/* Rounding up to 10, handle that here. */
|
||||||
if (czero > 0)
|
if (czero > 0)
|
||||||
{
|
{
|
||||||
--czero, d = 1;
|
--czero; d = 1;
|
||||||
if (cdigits == 0) --clead;
|
if (cdigits == 0) --clead;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2954,7 +3042,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
|
|
||||||
else if (ch == 46)
|
else if (ch == 46)
|
||||||
{
|
{
|
||||||
ch = *--ascii, ++size;
|
ch = *--ascii; ++size;
|
||||||
/* Advance exp_b10 to '1', so that the
|
/* Advance exp_b10 to '1', so that the
|
||||||
* decimal point happens after the
|
* decimal point happens after the
|
||||||
* previous digit.
|
* previous digit.
|
||||||
@@ -2981,7 +3069,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
int ch = *--ascii;
|
int ch = *--ascii;
|
||||||
|
|
||||||
if (ch == 46)
|
if (ch == 46)
|
||||||
++size, exp_b10 = 1;
|
{
|
||||||
|
++size; exp_b10 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Else lost a leading zero, so 'exp_b10' is
|
/* Else lost a leading zero, so 'exp_b10' is
|
||||||
* still ok at (-1)
|
* still ok at (-1)
|
||||||
@@ -3017,21 +3107,26 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
*/
|
*/
|
||||||
if (exp_b10 != (-1))
|
if (exp_b10 != (-1))
|
||||||
{
|
{
|
||||||
if (exp_b10 == 0) *ascii++ = 46, --size;
|
if (exp_b10 == 0)
|
||||||
|
{
|
||||||
|
*ascii++ = 46; --size;
|
||||||
|
}
|
||||||
/* PLUS 1: TOTAL 4 */
|
/* PLUS 1: TOTAL 4 */
|
||||||
--exp_b10;
|
--exp_b10;
|
||||||
}
|
}
|
||||||
*ascii++ = 48, --czero;
|
*ascii++ = 48; --czero;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exp_b10 != (-1))
|
if (exp_b10 != (-1))
|
||||||
{
|
{
|
||||||
if (exp_b10 == 0)
|
if (exp_b10 == 0)
|
||||||
*ascii++ = 46, --size; /* counted above */
|
{
|
||||||
|
*ascii++ = 46; --size; /* counted above */
|
||||||
|
}
|
||||||
|
|
||||||
--exp_b10;
|
--exp_b10;
|
||||||
}
|
}
|
||||||
*ascii++ = (char)(48 + (int)d), ++cdigits;
|
*ascii++ = (char)(48 + (int)d); ++cdigits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (cdigits+czero < precision+clead && fp > DBL_MIN);
|
while (cdigits+czero < precision+clead && fp > DBL_MIN);
|
||||||
@@ -3040,7 +3135,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
|
|
||||||
/* Check for an exponent, if we don't need one we are
|
/* Check for an exponent, if we don't need one we are
|
||||||
* done and just need to terminate the string. At
|
* done and just need to terminate the string. At
|
||||||
* this point exp_b10==(-1) is effectively if flag - it got
|
* this point exp_b10==(-1) is effectively a flag - it got
|
||||||
* to '-1' because of the decrement after outputting
|
* to '-1' because of the decrement after outputting
|
||||||
* the decimal point above (the exponent required is
|
* the decimal point above (the exponent required is
|
||||||
* *not* -1!)
|
* *not* -1!)
|
||||||
@@ -3054,7 +3149,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
* zeros were *not* output, so this doesn't increase
|
* zeros were *not* output, so this doesn't increase
|
||||||
* the output count.
|
* the output count.
|
||||||
*/
|
*/
|
||||||
while (--exp_b10 >= 0) *ascii++ = 48;
|
while (exp_b10-- > 0) *ascii++ = 48;
|
||||||
|
|
||||||
*ascii = 0;
|
*ascii = 0;
|
||||||
|
|
||||||
@@ -3072,7 +3167,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
*/
|
*/
|
||||||
size -= cdigits;
|
size -= cdigits;
|
||||||
|
|
||||||
*ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */
|
*ascii++ = 69; --size; /* 'E': PLUS 1 TOTAL 2+precision */
|
||||||
|
|
||||||
/* The following use of an unsigned temporary avoids ambiguities in
|
/* The following use of an unsigned temporary avoids ambiguities in
|
||||||
* the signed arithmetic on exp_b10 and permits GCC at least to do
|
* the signed arithmetic on exp_b10 and permits GCC at least to do
|
||||||
@@ -3083,12 +3178,12 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
|
|
||||||
if (exp_b10 < 0)
|
if (exp_b10 < 0)
|
||||||
{
|
{
|
||||||
*ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
|
*ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */
|
||||||
uexp_b10 = -exp_b10;
|
uexp_b10 = 0U-exp_b10;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
uexp_b10 = exp_b10;
|
uexp_b10 = 0U+exp_b10;
|
||||||
|
|
||||||
cdigits = 0;
|
cdigits = 0;
|
||||||
|
|
||||||
@@ -3131,6 +3226,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
|
|||||||
/* Here on buffer too small. */
|
/* Here on buffer too small. */
|
||||||
png_error(png_ptr, "ASCII conversion buffer too small");
|
png_error(png_ptr, "ASCII conversion buffer too small");
|
||||||
}
|
}
|
||||||
|
#if GCC_STRICT_OVERFLOW
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif /* GCC_STRICT_OVERFLOW */
|
||||||
|
|
||||||
# endif /* FLOATING_POINT */
|
# endif /* FLOATING_POINT */
|
||||||
|
|
||||||
@@ -3150,9 +3248,11 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
|
|||||||
|
|
||||||
/* Avoid overflow here on the minimum integer. */
|
/* Avoid overflow here on the minimum integer. */
|
||||||
if (fp < 0)
|
if (fp < 0)
|
||||||
*ascii++ = 45, num = -fp;
|
{
|
||||||
|
*ascii++ = 45; num = (png_uint_32)(-fp);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
num = fp;
|
num = (png_uint_32)fp;
|
||||||
|
|
||||||
if (num <= 0x80000000) /* else overflowed */
|
if (num <= 0x80000000) /* else overflowed */
|
||||||
{
|
{
|
||||||
@@ -3188,7 +3288,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
|
|||||||
* then ndigits digits to first:
|
* then ndigits digits to first:
|
||||||
*/
|
*/
|
||||||
i = 5;
|
i = 5;
|
||||||
while (ndigits < i) *ascii++ = 48, --i;
|
while (ndigits < i)
|
||||||
|
{
|
||||||
|
*ascii++ = 48; --i;
|
||||||
|
}
|
||||||
while (ndigits >= first) *ascii++ = digits[--ndigits];
|
while (ndigits >= first) *ascii++ = digits[--ndigits];
|
||||||
/* Don't output the trailing zeros! */
|
/* Don't output the trailing zeros! */
|
||||||
}
|
}
|
||||||
@@ -3239,6 +3342,15 @@ png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
|
|||||||
* the nearest .00001). Overflow and divide by zero are signalled in
|
* the nearest .00001). Overflow and divide by zero are signalled in
|
||||||
* the result, a boolean - true on success, false on overflow.
|
* the result, a boolean - true on success, false on overflow.
|
||||||
*/
|
*/
|
||||||
|
#if GCC_STRICT_OVERFLOW /* from above */
|
||||||
|
/* It is not obvious which comparison below gets optimized in such a way that
|
||||||
|
* signed overflow would change the result; looking through the code does not
|
||||||
|
* reveal any tests which have the form GCC complains about, so presumably the
|
||||||
|
* optimizer is moving an add or subtract into the 'if' somewhere.
|
||||||
|
*/
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic warning "-Wstrict-overflow=2"
|
||||||
|
#endif /* GCC_STRICT_OVERFLOW */
|
||||||
int
|
int
|
||||||
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
|
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
|
||||||
png_int_32 divisor)
|
png_int_32 divisor)
|
||||||
@@ -3353,6 +3465,9 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#if GCC_STRICT_OVERFLOW
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif /* GCC_STRICT_OVERFLOW */
|
||||||
#endif /* READ_GAMMA || INCH_CONVERSIONS */
|
#endif /* READ_GAMMA || INCH_CONVERSIONS */
|
||||||
|
|
||||||
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
|
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
|
||||||
@@ -3646,7 +3761,7 @@ png_log16bit(png_uint_32 x)
|
|||||||
* of getting this accuracy in practice.
|
* of getting this accuracy in practice.
|
||||||
*
|
*
|
||||||
* To deal with this the following exp() function works out the exponent of the
|
* To deal with this the following exp() function works out the exponent of the
|
||||||
* frational part of the logarithm by using an accurate 32-bit value from the
|
* fractional part of the logarithm by using an accurate 32-bit value from the
|
||||||
* top four fractional bits then multiplying in the remaining bits.
|
* top four fractional bits then multiplying in the remaining bits.
|
||||||
*/
|
*/
|
||||||
static const png_uint_32
|
static const png_uint_32
|
||||||
@@ -4225,13 +4340,13 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
|
|||||||
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
|
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
|
||||||
(option & 1) == 0)
|
(option & 1) == 0)
|
||||||
{
|
{
|
||||||
int mask = 3 << option;
|
png_uint_32 mask = 3U << option;
|
||||||
int setting = (2 + (onoff != 0)) << option;
|
png_uint_32 setting = (2U + (onoff != 0)) << option;
|
||||||
int current = png_ptr->options;
|
png_uint_32 current = png_ptr->options;
|
||||||
|
|
||||||
png_ptr->options = (png_byte)(((current & ~mask) | setting) & 0xff);
|
png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
|
||||||
|
|
||||||
return (current & mask) >> option;
|
return (int)(current & mask) >> option;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PNG_OPTION_INVALID;
|
return PNG_OPTION_INVALID;
|
||||||
@@ -4243,7 +4358,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
|
|||||||
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
|
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
|
||||||
/* sRGB conversion tables; these are machine generated with the code in
|
/* sRGB conversion tables; these are machine generated with the code in
|
||||||
* contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the
|
* contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the
|
||||||
* specification (see the article at http://en.wikipedia.org/wiki/SRGB)
|
* specification (see the article at https://en.wikipedia.org/wiki/SRGB)
|
||||||
* is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
|
* is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
|
||||||
* The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
|
* The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
|
||||||
* The inverse (linear to sRGB) table has accuracies as follows:
|
* The inverse (linear to sRGB) table has accuracies as follows:
|
||||||
|
|||||||
Vendored
+48
-32
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.6.24, August 4, 2016
|
* libpng version 1.6.34, September 29, 2017
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* 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.89, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.6.24, August 4, 2016:
|
* libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017:
|
||||||
* Glenn Randers-Pehrson.
|
* Glenn Randers-Pehrson.
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*/
|
*/
|
||||||
@@ -25,12 +25,8 @@
|
|||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
*
|
*
|
||||||
* Some files in the "contrib" directory and some configure-generated
|
* libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
|
||||||
* files that are distributed with libpng have other copyright owners and
|
* Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
|
||||||
* are released under other open source licenses.
|
|
||||||
*
|
|
||||||
* libpng versions 1.0.7, July 1, 2000 through 1.6.24, August 4, 2016 are
|
|
||||||
* Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
|
|
||||||
* derived from libpng-1.0.6, and are distributed according to the same
|
* derived from libpng-1.0.6, and are distributed according to the same
|
||||||
* disclaimer and license as libpng-1.0.6 with the following individuals
|
* disclaimer and license as libpng-1.0.6 with the following individuals
|
||||||
* added to the list of Contributing Authors:
|
* added to the list of Contributing Authors:
|
||||||
@@ -41,6 +37,9 @@
|
|||||||
* Cosmin Truta
|
* Cosmin Truta
|
||||||
* Gilles Vollant
|
* Gilles Vollant
|
||||||
* James Yu
|
* James Yu
|
||||||
|
* Mandar Sahastrabuddhe
|
||||||
|
* Google Inc.
|
||||||
|
* Vadim Barkov
|
||||||
*
|
*
|
||||||
* and with the following additions to the disclaimer:
|
* and with the following additions to the disclaimer:
|
||||||
*
|
*
|
||||||
@@ -51,10 +50,10 @@
|
|||||||
* risk of satisfactory quality, performance, accuracy, and effort is with
|
* risk of satisfactory quality, performance, accuracy, and effort is with
|
||||||
* the user.
|
* the user.
|
||||||
*
|
*
|
||||||
* Some files in the "contrib" directory have other copyright owners and
|
* Some files in the "contrib" directory and some configure-generated
|
||||||
|
* files that are distributed with libpng have other copyright owners and
|
||||||
* are released under other open source licenses.
|
* are released under other open source licenses.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
|
||||||
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
|
||||||
* libpng-0.96, and are distributed according to the same disclaimer and
|
* libpng-0.96, and are distributed according to the same disclaimer and
|
||||||
@@ -65,9 +64,6 @@
|
|||||||
* Glenn Randers-Pehrson
|
* Glenn Randers-Pehrson
|
||||||
* Willem van Schaik
|
* Willem van Schaik
|
||||||
*
|
*
|
||||||
* Some files in the "scripts" directory have different copyright owners
|
|
||||||
* but are also released under this license.
|
|
||||||
*
|
|
||||||
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
* libpng versions 0.89, June 1996, through 0.96, May 1997, are
|
||||||
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
|
||||||
* and are distributed according to the same disclaimer and license as
|
* and are distributed according to the same disclaimer and license as
|
||||||
@@ -213,11 +209,11 @@
|
|||||||
* ...
|
* ...
|
||||||
* 1.0.19 10 10019 10.so.0.19[.0]
|
* 1.0.19 10 10019 10.so.0.19[.0]
|
||||||
* ...
|
* ...
|
||||||
* 1.2.56 13 10256 12.so.0.56[.0]
|
* 1.2.59 13 10257 12.so.0.59[.0]
|
||||||
* ...
|
* ...
|
||||||
* 1.5.27 15 10527 15.so.15.27[.0]
|
* 1.5.30 15 10527 15.so.15.30[.0]
|
||||||
* ...
|
* ...
|
||||||
* 1.6.24 16 10624 16.so.16.24[.0]
|
* 1.6.34 16 10633 16.so.16.34[.0]
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library major
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* and minor numbers; the shared-library major version number will be
|
||||||
@@ -238,20 +234,20 @@
|
|||||||
*
|
*
|
||||||
* See libpng.txt or libpng.3 for more information. The PNG specification
|
* See libpng.txt or libpng.3 for more information. The PNG specification
|
||||||
* is available as a W3C Recommendation and as an ISO Specification,
|
* is available as a W3C Recommendation and as an ISO Specification,
|
||||||
* <http://www.w3.org/TR/2003/REC-PNG-20031110/
|
* <https://www.w3.org/TR/2003/REC-PNG-20031110/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* August 4, 2016
|
* September 29, 2017
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* This is your unofficial assurance that libpng from version 0.71 and
|
||||||
* upward through 1.6.24 are Y2K compliant. It is my belief that
|
* upward through 1.6.34 are Y2K compliant. It is my belief that
|
||||||
* earlier versions were also Y2K compliant.
|
* earlier versions were also Y2K compliant.
|
||||||
*
|
*
|
||||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||||
@@ -313,8 +309,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.6.24"
|
#define PNG_LIBPNG_VER_STRING "1.6.34"
|
||||||
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.24 - August 4, 2016\n"
|
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 16
|
#define PNG_LIBPNG_VER_SONUM 16
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||||
@@ -322,7 +318,7 @@
|
|||||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||||
#define PNG_LIBPNG_VER_MAJOR 1
|
#define PNG_LIBPNG_VER_MAJOR 1
|
||||||
#define PNG_LIBPNG_VER_MINOR 6
|
#define PNG_LIBPNG_VER_MINOR 6
|
||||||
#define PNG_LIBPNG_VER_RELEASE 24
|
#define PNG_LIBPNG_VER_RELEASE 34
|
||||||
|
|
||||||
/* This should match the numeric part of the final component of
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||||
@@ -353,7 +349,7 @@
|
|||||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
||||||
*/
|
*/
|
||||||
#define PNG_LIBPNG_VER 10624 /* 1.6.24 */
|
#define PNG_LIBPNG_VER 10634 /* 1.6.34 */
|
||||||
|
|
||||||
/* Library configuration: these options cannot be changed after
|
/* Library configuration: these options cannot be changed after
|
||||||
* the library has been built.
|
* the library has been built.
|
||||||
@@ -463,7 +459,7 @@ extern "C" {
|
|||||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||||
* do not agree upon the version number.
|
* do not agree upon the version number.
|
||||||
*/
|
*/
|
||||||
typedef char* png_libpng_version_1_6_24;
|
typedef char* png_libpng_version_1_6_34;
|
||||||
|
|
||||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||||
*
|
*
|
||||||
@@ -780,6 +776,7 @@ typedef png_unknown_chunk * * png_unknown_chunkpp;
|
|||||||
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
|
#define PNG_INFO_sPLT 0x2000U /* ESR, 1.0.6 */
|
||||||
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
|
#define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */
|
||||||
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
|
#define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */
|
||||||
|
#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */
|
||||||
|
|
||||||
/* This is used for the transformation routines, as some of them
|
/* This is used for the transformation routines, as some of them
|
||||||
* change these values for the row. It also should enable using
|
* change these values for the row. It also should enable using
|
||||||
@@ -1792,7 +1789,8 @@ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
|
|||||||
#define PNG_FREE_PLTE 0x1000U
|
#define PNG_FREE_PLTE 0x1000U
|
||||||
#define PNG_FREE_TRNS 0x2000U
|
#define PNG_FREE_TRNS 0x2000U
|
||||||
#define PNG_FREE_TEXT 0x4000U
|
#define PNG_FREE_TEXT 0x4000U
|
||||||
#define PNG_FREE_ALL 0x7fffU
|
#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */
|
||||||
|
#define PNG_FREE_ALL 0xffffU
|
||||||
#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
|
#define PNG_FREE_MUL 0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
|
||||||
|
|
||||||
#ifdef PNG_USER_MEM_SUPPORTED
|
#ifdef PNG_USER_MEM_SUPPORTED
|
||||||
@@ -2011,6 +2009,18 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr,
|
|||||||
png_fixed_point int_blue_Z))
|
png_fixed_point int_blue_Z))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
|
||||||
|
png_inforp info_ptr, png_bytep *exif));
|
||||||
|
PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
|
||||||
|
png_inforp info_ptr, const png_bytep exif));
|
||||||
|
|
||||||
|
PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
|
||||||
|
png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
|
||||||
|
PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
|
||||||
|
png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_gAMA_SUPPORTED
|
#ifdef PNG_gAMA_SUPPORTED
|
||||||
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
|
PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
|
||||||
png_const_inforp info_ptr, double *file_gamma))
|
png_const_inforp info_ptr, double *file_gamma))
|
||||||
@@ -2029,9 +2039,6 @@ PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr,
|
|||||||
#ifdef PNG_hIST_SUPPORTED
|
#ifdef PNG_hIST_SUPPORTED
|
||||||
PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
|
PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
|
||||||
png_inforp info_ptr, png_uint_16p *hist));
|
png_inforp info_ptr, png_uint_16p *hist));
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_hIST_SUPPORTED
|
|
||||||
PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
|
PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
|
||||||
png_inforp info_ptr, png_const_uint_16p hist));
|
png_inforp info_ptr, png_const_uint_16p hist));
|
||||||
#endif
|
#endif
|
||||||
@@ -2757,7 +2764,7 @@ typedef struct
|
|||||||
*
|
*
|
||||||
* When the simplified API needs to convert between sRGB and linear colorspaces,
|
* When the simplified API needs to convert between sRGB and linear colorspaces,
|
||||||
* the actual sRGB transfer curve defined in the sRGB specification (see the
|
* the actual sRGB transfer curve defined in the sRGB specification (see the
|
||||||
* article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
|
* article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
|
||||||
* approximation used elsewhere in libpng.
|
* approximation used elsewhere in libpng.
|
||||||
*
|
*
|
||||||
* When an alpha channel is present it is expected to denote pixel coverage
|
* When an alpha channel is present it is expected to denote pixel coverage
|
||||||
@@ -2812,6 +2819,8 @@ typedef struct
|
|||||||
# define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */
|
# define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */
|
||||||
|
|
||||||
/* Commonly used formats have predefined macros.
|
/* Commonly used formats have predefined macros.
|
||||||
*
|
*
|
||||||
* First the single byte (sRGB) formats:
|
* First the single byte (sRGB) formats:
|
||||||
@@ -3226,7 +3235,14 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
|
|||||||
#endif
|
#endif
|
||||||
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
|
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
|
||||||
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
|
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
|
||||||
#define PNG_OPTION_NEXT 6 /* Next option - numbers must be even */
|
#ifdef PNG_MIPS_MSA_API_SUPPORTED
|
||||||
|
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
|
||||||
|
#endif
|
||||||
|
#define PNG_IGNORE_ADLER32 8
|
||||||
|
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
|
||||||
|
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
|
||||||
|
#endif
|
||||||
|
#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
|
||||||
|
|
||||||
/* Return values: NOTE: there are four values and 'off' is *not* zero */
|
/* Return values: NOTE: there are four values and 'off' is *not* zero */
|
||||||
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
|
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
|
||||||
@@ -3250,7 +3266,7 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
|
|||||||
* one to use is one more than this.)
|
* one to use is one more than this.)
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_EXPORT_LAST_ORDINAL
|
#ifdef PNG_EXPORT_LAST_ORDINAL
|
||||||
PNG_EXPORT_LAST_ORDINAL(245);
|
PNG_EXPORT_LAST_ORDINAL(249);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.6.24, August 4, 2016
|
* libpng version 1.6.34, September 29, 2017
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@@ -507,9 +507,9 @@
|
|||||||
# error "libpng requires a signed 32-bit (or more) type"
|
# error "libpng requires a signed 32-bit (or more) type"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if UINT_MAX > 4294967294
|
#if UINT_MAX > 4294967294U
|
||||||
typedef unsigned int png_uint_32;
|
typedef unsigned int png_uint_32;
|
||||||
#elif ULONG_MAX > 4294967294
|
#elif ULONG_MAX > 4294967294U
|
||||||
typedef unsigned long int png_uint_32;
|
typedef unsigned long int png_uint_32;
|
||||||
#else
|
#else
|
||||||
# error "libpng requires an unsigned 32-bit (or more) type"
|
# error "libpng requires an unsigned 32-bit (or more) type"
|
||||||
|
|||||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* pngerror.c - stub functions for i/o and memory allocation
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.31 [July 27, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -163,7 +163,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
|||||||
case PNG_NUMBER_FORMAT_02u:
|
case PNG_NUMBER_FORMAT_02u:
|
||||||
/* Expects at least 2 digits. */
|
/* Expects at least 2 digits. */
|
||||||
mincount = 2;
|
mincount = 2;
|
||||||
/* FALL THROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case PNG_NUMBER_FORMAT_u:
|
case PNG_NUMBER_FORMAT_u:
|
||||||
*--end = digits[number % 10];
|
*--end = digits[number % 10];
|
||||||
@@ -173,7 +173,7 @@ png_format_number(png_const_charp start, png_charp end, int format,
|
|||||||
case PNG_NUMBER_FORMAT_02x:
|
case PNG_NUMBER_FORMAT_02x:
|
||||||
/* This format expects at least two digits */
|
/* This format expects at least two digits */
|
||||||
mincount = 2;
|
mincount = 2;
|
||||||
/* FALL THROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case PNG_NUMBER_FORMAT_x:
|
case PNG_NUMBER_FORMAT_x:
|
||||||
*--end = digits[number & 0xf];
|
*--end = digits[number & 0xf];
|
||||||
@@ -573,7 +573,7 @@ png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
|
|||||||
{
|
{
|
||||||
# define fixed_message "fixed point overflow in "
|
# define fixed_message "fixed point overflow in "
|
||||||
# define fixed_message_ln ((sizeof fixed_message)-1)
|
# define fixed_message_ln ((sizeof fixed_message)-1)
|
||||||
int iin;
|
unsigned int iin;
|
||||||
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
|
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
|
||||||
memcpy(msg, fixed_message, fixed_message_ln);
|
memcpy(msg, fixed_message, fixed_message_ln);
|
||||||
iin = 0;
|
iin = 0;
|
||||||
|
|||||||
Vendored
+32
-3
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -338,7 +338,7 @@ ppi_from_ppm(png_uint_32 ppm)
|
|||||||
png_fixed_point result;
|
png_fixed_point result;
|
||||||
if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127,
|
if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127,
|
||||||
5000) != 0)
|
5000) != 0)
|
||||||
return result;
|
return (png_uint_32)result;
|
||||||
|
|
||||||
/* Overflow. */
|
/* Overflow. */
|
||||||
return 0;
|
return 0;
|
||||||
@@ -773,6 +773,35 @@ png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
png_uint_32 PNGAPI
|
||||||
|
png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||||
|
png_bytep *exif)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "png_get_eXIf does not work; use png_get_eXIf_1");
|
||||||
|
PNG_UNUSED(info_ptr)
|
||||||
|
PNG_UNUSED(exif)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
png_uint_32 PNGAPI
|
||||||
|
png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
|
||||||
|
png_uint_32 *num_exif, png_bytep *exif)
|
||||||
|
{
|
||||||
|
png_debug1(1, "in %s retrieval function", "eXIf");
|
||||||
|
|
||||||
|
if (png_ptr != NULL && info_ptr != NULL &&
|
||||||
|
(info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
|
||||||
|
{
|
||||||
|
*num_exif = info_ptr->num_exif;
|
||||||
|
*exif = info_ptr->exif;
|
||||||
|
return (PNG_INFO_eXIf);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_hIST_SUPPORTED
|
#ifdef PNG_hIST_SUPPORTED
|
||||||
png_uint_32 PNGAPI
|
png_uint_32 PNGAPI
|
||||||
png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
|
png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
|
||||||
|
|||||||
Vendored
+8
@@ -185,6 +185,14 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
|
|||||||
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
|
png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_eXIf_SUPPORTED
|
||||||
|
int num_exif; /* Added at libpng-1.6.31 */
|
||||||
|
png_bytep exif;
|
||||||
|
# ifdef PNG_READ_eXIf_SUPPORTED
|
||||||
|
png_bytep eXIf_buf; /* Added at libpng-1.6.32 */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_hIST_SUPPORTED
|
#ifdef PNG_hIST_SUPPORTED
|
||||||
/* The hIST chunk contains the relative frequency or importance of the
|
/* The hIST chunk contains the relative frequency or importance of the
|
||||||
* various palette entries, so that a viewer can intelligently select a
|
* various palette entries, so that a viewer can intelligently select a
|
||||||
|
|||||||
Vendored
+8
-3
@@ -1,10 +1,10 @@
|
|||||||
/* libpng 1.6.24 STANDARD API DEFINITION */
|
/* libpng 1.6.34 STANDARD API DEFINITION */
|
||||||
|
|
||||||
/* pnglibconf.h - library build configuration */
|
/* pnglibconf.h - library build configuration */
|
||||||
|
|
||||||
/* Libpng version 1.6.24 - August 4, 2016 */
|
/* Libpng version 1.6.34 - September 29, 2017 */
|
||||||
|
|
||||||
/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
|
/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
|
||||||
|
|
||||||
/* This code is released under the libpng license. */
|
/* This code is released under the libpng license. */
|
||||||
/* For conditions of distribution and use, see the disclaimer */
|
/* For conditions of distribution and use, see the disclaimer */
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
#define PNG_ALIGNED_MEMORY_SUPPORTED
|
||||||
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
/*#undef PNG_ARM_NEON_API_SUPPORTED*/
|
||||||
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
|
/*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/
|
||||||
|
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
|
||||||
|
/*#undef PNG_POWERPC_VSX_CHECK_SUPPORTED*/
|
||||||
#define PNG_BENIGN_ERRORS_SUPPORTED
|
#define PNG_BENIGN_ERRORS_SUPPORTED
|
||||||
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
|
#define PNG_BENIGN_READ_ERRORS_SUPPORTED
|
||||||
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
|
/*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/
|
||||||
@@ -82,6 +84,7 @@
|
|||||||
#define PNG_READ_USER_TRANSFORM_SUPPORTED
|
#define PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||||
#define PNG_READ_bKGD_SUPPORTED
|
#define PNG_READ_bKGD_SUPPORTED
|
||||||
#define PNG_READ_cHRM_SUPPORTED
|
#define PNG_READ_cHRM_SUPPORTED
|
||||||
|
#define PNG_READ_eXIf_SUPPORTED
|
||||||
#define PNG_READ_gAMA_SUPPORTED
|
#define PNG_READ_gAMA_SUPPORTED
|
||||||
#define PNG_READ_hIST_SUPPORTED
|
#define PNG_READ_hIST_SUPPORTED
|
||||||
#define PNG_READ_iCCP_SUPPORTED
|
#define PNG_READ_iCCP_SUPPORTED
|
||||||
@@ -151,6 +154,7 @@
|
|||||||
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||||
#define PNG_WRITE_bKGD_SUPPORTED
|
#define PNG_WRITE_bKGD_SUPPORTED
|
||||||
#define PNG_WRITE_cHRM_SUPPORTED
|
#define PNG_WRITE_cHRM_SUPPORTED
|
||||||
|
#define PNG_WRITE_eXIf_SUPPORTED
|
||||||
#define PNG_WRITE_gAMA_SUPPORTED
|
#define PNG_WRITE_gAMA_SUPPORTED
|
||||||
#define PNG_WRITE_hIST_SUPPORTED
|
#define PNG_WRITE_hIST_SUPPORTED
|
||||||
#define PNG_WRITE_iCCP_SUPPORTED
|
#define PNG_WRITE_iCCP_SUPPORTED
|
||||||
@@ -168,6 +172,7 @@
|
|||||||
#define PNG_WRITE_zTXt_SUPPORTED
|
#define PNG_WRITE_zTXt_SUPPORTED
|
||||||
#define PNG_bKGD_SUPPORTED
|
#define PNG_bKGD_SUPPORTED
|
||||||
#define PNG_cHRM_SUPPORTED
|
#define PNG_cHRM_SUPPORTED
|
||||||
|
#define PNG_eXIf_SUPPORTED
|
||||||
#define PNG_gAMA_SUPPORTED
|
#define PNG_gAMA_SUPPORTED
|
||||||
#define PNG_hIST_SUPPORTED
|
#define PNG_hIST_SUPPORTED
|
||||||
#define PNG_iCCP_SUPPORTED
|
#define PNG_iCCP_SUPPORTED
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.26 [October 20, 2016]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -109,7 +109,7 @@ static png_voidp
|
|||||||
png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
|
png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
|
||||||
size_t element_size)
|
size_t element_size)
|
||||||
{
|
{
|
||||||
png_alloc_size_t req = nelements; /* known to be > 0 */
|
png_alloc_size_t req = (png_alloc_size_t)nelements; /* known to be > 0 */
|
||||||
|
|
||||||
if (req <= PNG_SIZE_MAX/element_size)
|
if (req <= PNG_SIZE_MAX/element_size)
|
||||||
return png_malloc_base(png_ptr, req * element_size);
|
return png_malloc_base(png_ptr, req * element_size);
|
||||||
|
|||||||
Vendored
+8
-2
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -189,6 +189,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
|
|||||||
png_crc_read(png_ptr, chunk_tag, 4);
|
png_crc_read(png_ptr, chunk_tag, 4);
|
||||||
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
|
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
|
||||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||||
|
png_check_chunk_length(png_ptr, png_ptr->push_length);
|
||||||
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
|
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,8 +684,13 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
|
|||||||
png_ptr->pass > 6)
|
png_ptr->pass > 6)
|
||||||
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (ret == Z_DATA_ERROR)
|
||||||
|
png_benign_error(png_ptr, "IDAT: ADLER32 checksum mismatch");
|
||||||
else
|
else
|
||||||
png_error(png_ptr, "Decompression error in IDAT");
|
png_error(png_ptr, "Decompression error in IDAT");
|
||||||
|
}
|
||||||
|
|
||||||
/* Skip the check on unprocessed input */
|
/* Skip the check on unprocessed input */
|
||||||
return;
|
return;
|
||||||
|
|||||||
Vendored
+237
-108
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngpriv.h - private declarations for use inside libpng
|
/* pngpriv.h - private declarations for use inside libpng
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.32 [August 24, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -35,7 +35,9 @@
|
|||||||
* Windows/Visual Studio) there is no effect; the OS specific tests below are
|
* Windows/Visual Studio) there is no effect; the OS specific tests below are
|
||||||
* still required (as of 2011-05-02.)
|
* still required (as of 2011-05-02.)
|
||||||
*/
|
*/
|
||||||
#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
|
#ifndef _POSIX_SOURCE
|
||||||
|
# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef PNG_VERSION_INFO_ONLY
|
#ifndef PNG_VERSION_INFO_ONLY
|
||||||
/* Standard library headers not required by png.h: */
|
/* Standard library headers not required by png.h: */
|
||||||
@@ -182,6 +184,22 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* PNG_ARM_NEON_OPT > 0 */
|
#endif /* PNG_ARM_NEON_OPT > 0 */
|
||||||
|
|
||||||
|
#ifndef PNG_MIPS_MSA_OPT
|
||||||
|
# if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
|
||||||
|
# define PNG_MIPS_MSA_OPT 2
|
||||||
|
# else
|
||||||
|
# define PNG_MIPS_MSA_OPT 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef PNG_POWERPC_VSX_OPT
|
||||||
|
# if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
|
||||||
|
# define PNG_POWERPC_VSX_OPT 2
|
||||||
|
# else
|
||||||
|
# define PNG_POWERPC_VSX_OPT 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef PNG_INTEL_SSE_OPT
|
#ifndef PNG_INTEL_SSE_OPT
|
||||||
# ifdef PNG_INTEL_SSE
|
# ifdef PNG_INTEL_SSE
|
||||||
/* Only check for SSE if the build configuration has been modified to
|
/* Only check for SSE if the build configuration has been modified to
|
||||||
@@ -218,6 +236,32 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PNG_MIPS_MSA_OPT > 0
|
||||||
|
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
|
||||||
|
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
|
||||||
|
# if defined(__mips_msa)
|
||||||
|
# if defined(__clang__)
|
||||||
|
# elif defined(__GNUC__)
|
||||||
|
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
|
||||||
|
# define PNG_MIPS_MSA_IMPLEMENTATION 2
|
||||||
|
# endif /* no GNUC support */
|
||||||
|
# endif /* __GNUC__ */
|
||||||
|
# else /* !defined __mips_msa */
|
||||||
|
# define PNG_MIPS_MSA_IMPLEMENTATION 2
|
||||||
|
# endif /* __mips_msa */
|
||||||
|
# endif /* !PNG_MIPS_MSA_IMPLEMENTATION */
|
||||||
|
|
||||||
|
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
|
||||||
|
# define PNG_MIPS_MSA_IMPLEMENTATION 1
|
||||||
|
# endif
|
||||||
|
#endif /* PNG_MIPS_MSA_OPT > 0 */
|
||||||
|
|
||||||
|
#if PNG_POWERPC_VSX_OPT > 0
|
||||||
|
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
|
||||||
|
# define PNG_POWERPC_VSX_IMPLEMENTATION 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Is this a build of a DLL where compilation of the object modules requires
|
/* Is this a build of a DLL where compilation of the object modules requires
|
||||||
* different preprocessor settings to those required for a simple library? If
|
* different preprocessor settings to those required for a simple library? If
|
||||||
* so PNG_BUILD_DLL must be set.
|
* so PNG_BUILD_DLL must be set.
|
||||||
@@ -410,25 +454,6 @@
|
|||||||
# define png_fixed_error(s1,s2) png_err(s1)
|
# define png_fixed_error(s1,s2) png_err(s1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* C allows up-casts from (void*) to any pointer and (const void*) to any
|
|
||||||
* pointer to a const object. C++ regards this as a type error and requires an
|
|
||||||
* explicit, static, cast and provides the static_cast<> rune to ensure that
|
|
||||||
* const is not cast away.
|
|
||||||
*/
|
|
||||||
#ifdef __cplusplus
|
|
||||||
# define png_voidcast(type, value) static_cast<type>(value)
|
|
||||||
# define png_constcast(type, value) const_cast<type>(value)
|
|
||||||
# define png_aligncast(type, value) \
|
|
||||||
static_cast<type>(static_cast<void*>(value))
|
|
||||||
# define png_aligncastconst(type, value) \
|
|
||||||
static_cast<type>(static_cast<const void*>(value))
|
|
||||||
#else
|
|
||||||
# define png_voidcast(type, value) (value)
|
|
||||||
# define png_constcast(type, value) ((type)(value))
|
|
||||||
# define png_aligncast(type, value) ((void*)(value))
|
|
||||||
# define png_aligncastconst(type, value) ((const void*)(value))
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
/* Some fixed point APIs are still required even if not exported because
|
/* Some fixed point APIs are still required even if not exported because
|
||||||
* they get used by the corresponding floating point APIs. This magic
|
* they get used by the corresponding floating point APIs. This magic
|
||||||
* deals with this:
|
* deals with this:
|
||||||
@@ -443,6 +468,35 @@
|
|||||||
/* Other defines specific to compilers can go here. Try to keep
|
/* Other defines specific to compilers can go here. Try to keep
|
||||||
* them inside an appropriate ifdef/endif pair for portability.
|
* them inside an appropriate ifdef/endif pair for portability.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* C allows up-casts from (void*) to any pointer and (const void*) to any
|
||||||
|
* pointer to a const object. C++ regards this as a type error and requires an
|
||||||
|
* explicit, static, cast and provides the static_cast<> rune to ensure that
|
||||||
|
* const is not cast away.
|
||||||
|
*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
# define png_voidcast(type, value) static_cast<type>(value)
|
||||||
|
# define png_constcast(type, value) const_cast<type>(value)
|
||||||
|
# define png_aligncast(type, value) \
|
||||||
|
static_cast<type>(static_cast<void*>(value))
|
||||||
|
# define png_aligncastconst(type, value) \
|
||||||
|
static_cast<type>(static_cast<const void*>(value))
|
||||||
|
#else
|
||||||
|
# define png_voidcast(type, value) (value)
|
||||||
|
# ifdef _WIN64
|
||||||
|
# ifdef __GNUC__
|
||||||
|
typedef unsigned long long png_ptruint;
|
||||||
|
# else
|
||||||
|
typedef unsigned __int64 png_ptruint;
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
typedef unsigned long png_ptruint;
|
||||||
|
# endif
|
||||||
|
# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
|
||||||
|
# define png_aligncast(type, value) ((void*)(value))
|
||||||
|
# define png_aligncastconst(type, value) ((const void*)(value))
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
|
#if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
|
||||||
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
|
defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
|
||||||
/* png.c requires the following ANSI-C constants if the conversion of
|
/* png.c requires the following ANSI-C constants if the conversion of
|
||||||
@@ -540,7 +594,8 @@
|
|||||||
/* This implicitly assumes alignment is always to a power of 2. */
|
/* This implicitly assumes alignment is always to a power of 2. */
|
||||||
#ifdef png_alignof
|
#ifdef png_alignof
|
||||||
# define png_isaligned(ptr, type)\
|
# define png_isaligned(ptr, type)\
|
||||||
((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0)
|
(((type)((const char*)ptr-(const char*)0) & \
|
||||||
|
(type)(png_alignof(type)-1)) == 0)
|
||||||
#else
|
#else
|
||||||
# define png_isaligned(ptr, type) 0
|
# define png_isaligned(ptr, type) 0
|
||||||
#endif
|
#endif
|
||||||
@@ -557,92 +612,92 @@
|
|||||||
* are defined in png.h because they need to be visible to applications
|
* are defined in png.h because they need to be visible to applications
|
||||||
* that call png_set_unknown_chunk().
|
* that call png_set_unknown_chunk().
|
||||||
*/
|
*/
|
||||||
/* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */
|
/* #define PNG_HAVE_IHDR 0x01U (defined in png.h) */
|
||||||
/* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */
|
/* #define PNG_HAVE_PLTE 0x02U (defined in png.h) */
|
||||||
#define PNG_HAVE_IDAT 0x04
|
#define PNG_HAVE_IDAT 0x04U
|
||||||
/* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */
|
/* #define PNG_AFTER_IDAT 0x08U (defined in png.h) */
|
||||||
#define PNG_HAVE_IEND 0x10
|
#define PNG_HAVE_IEND 0x10U
|
||||||
/* 0x20 (unused) */
|
/* 0x20U (unused) */
|
||||||
/* 0x40 (unused) */
|
/* 0x40U (unused) */
|
||||||
/* 0x80 (unused) */
|
/* 0x80U (unused) */
|
||||||
#define PNG_HAVE_CHUNK_HEADER 0x100
|
#define PNG_HAVE_CHUNK_HEADER 0x100U
|
||||||
#define PNG_WROTE_tIME 0x200
|
#define PNG_WROTE_tIME 0x200U
|
||||||
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
|
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400U
|
||||||
#define PNG_BACKGROUND_IS_GRAY 0x800
|
#define PNG_BACKGROUND_IS_GRAY 0x800U
|
||||||
#define PNG_HAVE_PNG_SIGNATURE 0x1000
|
#define PNG_HAVE_PNG_SIGNATURE 0x1000U
|
||||||
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
|
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */
|
||||||
/* 0x4000 (unused) */
|
/* 0x4000U (unused) */
|
||||||
#define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */
|
#define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */
|
||||||
|
|
||||||
/* Flags for the transformations the PNG library does on the image data */
|
/* Flags for the transformations the PNG library does on the image data */
|
||||||
#define PNG_BGR 0x0001
|
#define PNG_BGR 0x0001U
|
||||||
#define PNG_INTERLACE 0x0002
|
#define PNG_INTERLACE 0x0002U
|
||||||
#define PNG_PACK 0x0004
|
#define PNG_PACK 0x0004U
|
||||||
#define PNG_SHIFT 0x0008
|
#define PNG_SHIFT 0x0008U
|
||||||
#define PNG_SWAP_BYTES 0x0010
|
#define PNG_SWAP_BYTES 0x0010U
|
||||||
#define PNG_INVERT_MONO 0x0020
|
#define PNG_INVERT_MONO 0x0020U
|
||||||
#define PNG_QUANTIZE 0x0040
|
#define PNG_QUANTIZE 0x0040U
|
||||||
#define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */
|
#define PNG_COMPOSE 0x0080U /* Was PNG_BACKGROUND */
|
||||||
#define PNG_BACKGROUND_EXPAND 0x0100
|
#define PNG_BACKGROUND_EXPAND 0x0100U
|
||||||
#define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */
|
#define PNG_EXPAND_16 0x0200U /* Added to libpng 1.5.2 */
|
||||||
#define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */
|
#define PNG_16_TO_8 0x0400U /* Becomes 'chop' in 1.5.4 */
|
||||||
#define PNG_RGBA 0x0800
|
#define PNG_RGBA 0x0800U
|
||||||
#define PNG_EXPAND 0x1000
|
#define PNG_EXPAND 0x1000U
|
||||||
#define PNG_GAMMA 0x2000
|
#define PNG_GAMMA 0x2000U
|
||||||
#define PNG_GRAY_TO_RGB 0x4000
|
#define PNG_GRAY_TO_RGB 0x4000U
|
||||||
#define PNG_FILLER 0x8000
|
#define PNG_FILLER 0x8000U
|
||||||
#define PNG_PACKSWAP 0x10000
|
#define PNG_PACKSWAP 0x10000U
|
||||||
#define PNG_SWAP_ALPHA 0x20000
|
#define PNG_SWAP_ALPHA 0x20000U
|
||||||
#define PNG_STRIP_ALPHA 0x40000
|
#define PNG_STRIP_ALPHA 0x40000U
|
||||||
#define PNG_INVERT_ALPHA 0x80000
|
#define PNG_INVERT_ALPHA 0x80000U
|
||||||
#define PNG_USER_TRANSFORM 0x100000
|
#define PNG_USER_TRANSFORM 0x100000U
|
||||||
#define PNG_RGB_TO_GRAY_ERR 0x200000
|
#define PNG_RGB_TO_GRAY_ERR 0x200000U
|
||||||
#define PNG_RGB_TO_GRAY_WARN 0x400000
|
#define PNG_RGB_TO_GRAY_WARN 0x400000U
|
||||||
#define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */
|
#define PNG_RGB_TO_GRAY 0x600000U /* two bits, RGB_TO_GRAY_ERR|WARN */
|
||||||
#define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */
|
#define PNG_ENCODE_ALPHA 0x800000U /* Added to libpng-1.5.4 */
|
||||||
#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */
|
#define PNG_ADD_ALPHA 0x1000000U /* Added to libpng-1.2.7 */
|
||||||
#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */
|
#define PNG_EXPAND_tRNS 0x2000000U /* Added to libpng-1.2.9 */
|
||||||
#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */
|
#define PNG_SCALE_16_TO_8 0x4000000U /* Added to libpng-1.5.4 */
|
||||||
/* 0x8000000 unused */
|
/* 0x8000000U unused */
|
||||||
/* 0x10000000 unused */
|
/* 0x10000000U unused */
|
||||||
/* 0x20000000 unused */
|
/* 0x20000000U unused */
|
||||||
/* 0x40000000 unused */
|
/* 0x40000000U unused */
|
||||||
/* Flags for png_create_struct */
|
/* Flags for png_create_struct */
|
||||||
#define PNG_STRUCT_PNG 0x0001
|
#define PNG_STRUCT_PNG 0x0001U
|
||||||
#define PNG_STRUCT_INFO 0x0002
|
#define PNG_STRUCT_INFO 0x0002U
|
||||||
|
|
||||||
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
|
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
|
||||||
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001
|
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001U
|
||||||
#define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */
|
#define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002U /* Added to libpng-1.6.0 */
|
||||||
/* 0x0004 unused */
|
/* 0x0004U unused */
|
||||||
#define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */
|
#define PNG_FLAG_ZSTREAM_ENDED 0x0008U /* Added to libpng-1.6.0 */
|
||||||
/* 0x0010 unused */
|
/* 0x0010U unused */
|
||||||
/* 0x0020 unused */
|
/* 0x0020U unused */
|
||||||
#define PNG_FLAG_ROW_INIT 0x0040
|
#define PNG_FLAG_ROW_INIT 0x0040U
|
||||||
#define PNG_FLAG_FILLER_AFTER 0x0080
|
#define PNG_FLAG_FILLER_AFTER 0x0080U
|
||||||
#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100
|
#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100U
|
||||||
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200
|
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200U
|
||||||
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400
|
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400U
|
||||||
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800
|
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800U
|
||||||
#define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */
|
#define PNG_FLAG_ASSUME_sRGB 0x1000U /* Added to libpng-1.5.4 */
|
||||||
#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */
|
#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000U /* Added to libpng-1.5.4 */
|
||||||
#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */
|
#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000U /* Added to libpng-1.5.4 */
|
||||||
/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */
|
/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000U */
|
||||||
/* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */
|
/* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000U */
|
||||||
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000
|
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000U
|
||||||
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000
|
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000U
|
||||||
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000
|
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000U
|
||||||
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */
|
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000U /* Added to libpng-1.4.0 */
|
||||||
#define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */
|
#define PNG_FLAG_APP_WARNINGS_WARN 0x200000U /* Added to libpng-1.6.0 */
|
||||||
#define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */
|
#define PNG_FLAG_APP_ERRORS_WARN 0x400000U /* Added to libpng-1.6.0 */
|
||||||
/* 0x800000 unused */
|
/* 0x800000U unused */
|
||||||
/* 0x1000000 unused */
|
/* 0x1000000U unused */
|
||||||
/* 0x2000000 unused */
|
/* 0x2000000U unused */
|
||||||
/* 0x4000000 unused */
|
/* 0x4000000U unused */
|
||||||
/* 0x8000000 unused */
|
/* 0x8000000U unused */
|
||||||
/* 0x10000000 unused */
|
/* 0x10000000U unused */
|
||||||
/* 0x20000000 unused */
|
/* 0x20000000U unused */
|
||||||
/* 0x40000000 unused */
|
/* 0x40000000U unused */
|
||||||
|
|
||||||
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
|
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
|
||||||
PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
||||||
@@ -676,6 +731,24 @@
|
|||||||
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
|
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
|
||||||
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
|
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
|
||||||
|
|
||||||
|
/* This returns the number of trailing bits in the last byte of a row, 0 if the
|
||||||
|
* last byte is completely full of pixels. It is, in principle, (pixel_bits x
|
||||||
|
* width) % 8, but that would overflow for large 'width'. The second macro is
|
||||||
|
* the same except that it returns the number of unused bits in the last byte;
|
||||||
|
* (8-TRAILBITS), but 0 when TRAILBITS is 0.
|
||||||
|
*
|
||||||
|
* NOTE: these macros are intended to be self-evidently correct and never
|
||||||
|
* overflow on the assumption that pixel_bits is in the range 0..255. The
|
||||||
|
* arguments are evaluated only once and they can be signed (e.g. as a result of
|
||||||
|
* the integral promotions). The result of the expression always has type
|
||||||
|
* (png_uint_32), however the compiler always knows it is in the range 0..7.
|
||||||
|
*/
|
||||||
|
#define PNG_TRAILBITS(pixel_bits, width) \
|
||||||
|
(((pixel_bits) * ((width) % (png_uint_32)8)) % 8)
|
||||||
|
|
||||||
|
#define PNG_PADBITS(pixel_bits, width) \
|
||||||
|
((8 - PNG_TRAILBITS(pixel_bits, width)) % 8)
|
||||||
|
|
||||||
/* PNG_OUT_OF_RANGE returns true if value is outside the range
|
/* PNG_OUT_OF_RANGE returns true if value is outside the range
|
||||||
* ideal-delta..ideal+delta. Each argument is evaluated twice.
|
* ideal-delta..ideal+delta. Each argument is evaluated twice.
|
||||||
* "ideal" and "delta" should be constants, normally simple
|
* "ideal" and "delta" should be constants, normally simple
|
||||||
@@ -769,6 +842,7 @@
|
|||||||
#define png_PLTE PNG_U32( 80, 76, 84, 69)
|
#define png_PLTE PNG_U32( 80, 76, 84, 69)
|
||||||
#define png_bKGD PNG_U32( 98, 75, 71, 68)
|
#define png_bKGD PNG_U32( 98, 75, 71, 68)
|
||||||
#define png_cHRM PNG_U32( 99, 72, 82, 77)
|
#define png_cHRM PNG_U32( 99, 72, 82, 77)
|
||||||
|
#define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */
|
||||||
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
|
#define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */
|
||||||
#define png_gAMA PNG_U32(103, 65, 77, 65)
|
#define png_gAMA PNG_U32(103, 65, 77, 65)
|
||||||
#define png_gIFg PNG_U32(103, 73, 70, 103)
|
#define png_gIFg PNG_U32(103, 73, 70, 103)
|
||||||
@@ -1069,6 +1143,11 @@ PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr,
|
|||||||
int intent),PNG_EMPTY);
|
int intent),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_eXIf_SUPPORTED
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_write_eXIf,(png_structrp png_ptr,
|
||||||
|
png_bytep exif, int num_exif),PNG_EMPTY);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_iCCP_SUPPORTED
|
#ifdef PNG_WRITE_iCCP_SUPPORTED
|
||||||
PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
|
||||||
png_const_charp name, png_const_bytep profile), PNG_EMPTY);
|
png_const_charp name, png_const_bytep profile), PNG_EMPTY);
|
||||||
@@ -1227,6 +1306,40 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
|
|||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PNG_MIPS_MSA_OPT > 0
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
|
||||||
|
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if PNG_POWERPC_VSX_OPT > 0
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
|
||||||
|
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_vsx,(png_row_infop
|
||||||
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
#if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_sse2,(png_row_infop
|
||||||
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
|
||||||
@@ -1268,7 +1381,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
|
|||||||
/* Initialize the row buffers, etc. */
|
/* Initialize the row buffers, etc. */
|
||||||
PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
|
PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
|
||||||
|
|
||||||
#if PNG_ZLIB_VERNUM >= 0x1240
|
#if ZLIB_VERNUM >= 0x1240
|
||||||
PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
|
PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
|
||||||
PNG_EMPTY);
|
PNG_EMPTY);
|
||||||
# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
|
# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
|
||||||
@@ -1334,6 +1447,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr,
|
|||||||
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_eXIf_SUPPORTED
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
|
||||||
|
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||||
PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
|
||||||
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
||||||
@@ -1409,8 +1527,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr,
|
|||||||
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
|
||||||
png_uint_32 chunk_name),PNG_EMPTY);
|
const png_uint_32 chunk_name),PNG_EMPTY);
|
||||||
|
|
||||||
|
PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
|
||||||
|
const png_uint_32 chunk_length),PNG_EMPTY);
|
||||||
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
|
||||||
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
|
png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
|
||||||
@@ -1545,9 +1666,11 @@ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
|
|||||||
/* The 'name' is used for information only */
|
/* The 'name' is used for information only */
|
||||||
|
|
||||||
/* Routines for checking parts of an ICC profile. */
|
/* Routines for checking parts of an ICC profile. */
|
||||||
|
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||||
PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
|
||||||
png_colorspacerp colorspace, png_const_charp name,
|
png_colorspacerp colorspace, png_const_charp name,
|
||||||
png_uint_32 profile_length), PNG_EMPTY);
|
png_uint_32 profile_length), PNG_EMPTY);
|
||||||
|
#endif /* READ_iCCP */
|
||||||
PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
|
||||||
png_colorspacerp colorspace, png_const_charp name,
|
png_colorspacerp colorspace, png_const_charp name,
|
||||||
png_uint_32 profile_length,
|
png_uint_32 profile_length,
|
||||||
@@ -1969,7 +2092,13 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr,
|
|||||||
# if PNG_ARM_NEON_OPT > 0
|
# if PNG_ARM_NEON_OPT > 0
|
||||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
|
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
|
||||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||||
# endif
|
#endif
|
||||||
|
|
||||||
|
#if PNG_MIPS_MSA_OPT > 0
|
||||||
|
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
|
||||||
|
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||||
|
#endif
|
||||||
|
|
||||||
# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
# if defined(PNG_INTEL_SSE_IMPLEMENTATION) && PNG_INTEL_SSE_IMPLEMENTATION > 0
|
||||||
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
|
||||||
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
|
||||||
|
|||||||
Vendored
+62
-37
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -175,6 +175,11 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr)
|
|||||||
png_handle_cHRM(png_ptr, info_ptr, length);
|
png_handle_cHRM(png_ptr, info_ptr, length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_eXIf_SUPPORTED
|
||||||
|
else if (chunk_name == png_eXIf)
|
||||||
|
png_handle_eXIf(png_ptr, info_ptr, length);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||||
else if (chunk_name == png_gAMA)
|
else if (chunk_name == png_gAMA)
|
||||||
png_handle_gAMA(png_ptr, info_ptr, length);
|
png_handle_gAMA(png_ptr, info_ptr, length);
|
||||||
@@ -359,9 +364,9 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
|||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||||
{
|
{
|
||||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
png_uint_32 s0 = (png_uint_32)(*(rp ) << 8) | *(rp + 1);
|
||||||
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
png_uint_32 s1 = (png_uint_32)(*(rp + 2) << 8) | *(rp + 3);
|
||||||
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
png_uint_32 s2 = (png_uint_32)(*(rp + 4) << 8) | *(rp + 5);
|
||||||
png_uint_32 red = (s0 + s1 + 65536) & 0xffff;
|
png_uint_32 red = (s0 + s1 + 65536) & 0xffff;
|
||||||
png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
|
png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
|
||||||
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
||||||
@@ -534,6 +539,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
png_error(png_ptr, "Invalid attempt to read row data");
|
png_error(png_ptr, "Invalid attempt to read row data");
|
||||||
|
|
||||||
/* Fill the row with IDAT data: */
|
/* Fill the row with IDAT data: */
|
||||||
|
png_ptr->row_buf[0]=255; /* to force error if no data was found */
|
||||||
png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
|
png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
|
||||||
|
|
||||||
if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
|
if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
|
||||||
@@ -842,6 +848,11 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
|
|||||||
png_handle_cHRM(png_ptr, info_ptr, length);
|
png_handle_cHRM(png_ptr, info_ptr, length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_eXIf_SUPPORTED
|
||||||
|
else if (chunk_name == png_eXIf)
|
||||||
|
png_handle_eXIf(png_ptr, info_ptr, length);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||||
else if (chunk_name == png_gAMA)
|
else if (chunk_name == png_gAMA)
|
||||||
png_handle_gAMA(png_ptr, info_ptr, length);
|
png_handle_gAMA(png_ptr, info_ptr, length);
|
||||||
@@ -1393,7 +1404,9 @@ png_image_read_header(png_voidp argument)
|
|||||||
png_structrp png_ptr = image->opaque->png_ptr;
|
png_structrp png_ptr = image->opaque->png_ptr;
|
||||||
png_inforp info_ptr = image->opaque->info_ptr;
|
png_inforp info_ptr = image->opaque->info_ptr;
|
||||||
|
|
||||||
|
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
|
||||||
png_set_benign_errors(png_ptr, 1/*warn*/);
|
png_set_benign_errors(png_ptr, 1/*warn*/);
|
||||||
|
#endif
|
||||||
png_read_info(png_ptr, info_ptr);
|
png_read_info(png_ptr, info_ptr);
|
||||||
|
|
||||||
/* Do this the fast way; just read directly out of png_struct. */
|
/* Do this the fast way; just read directly out of png_struct. */
|
||||||
@@ -1431,7 +1444,7 @@ png_image_read_header(png_voidp argument)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case PNG_COLOR_TYPE_PALETTE:
|
case PNG_COLOR_TYPE_PALETTE:
|
||||||
cmap_entries = png_ptr->num_palette;
|
cmap_entries = (png_uint_32)png_ptr->num_palette;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1881,7 +1894,7 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
entry[afirst ? 0 : 3] = (png_uint_16)alpha;
|
entry[afirst ? 0 : 3] = (png_uint_16)alpha;
|
||||||
/* FALL THROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
if (alpha < 65535)
|
if (alpha < 65535)
|
||||||
@@ -1903,7 +1916,7 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
entry[1 ^ afirst] = (png_uint_16)alpha;
|
entry[1 ^ afirst] = (png_uint_16)alpha;
|
||||||
/* FALL THROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (alpha < 65535)
|
if (alpha < 65535)
|
||||||
@@ -1932,6 +1945,7 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
entry[afirst ? 0 : 3] = (png_byte)alpha;
|
entry[afirst ? 0 : 3] = (png_byte)alpha;
|
||||||
|
/* FALLTHROUGH */
|
||||||
case 3:
|
case 3:
|
||||||
entry[afirst + (2 ^ bgr)] = (png_byte)blue;
|
entry[afirst + (2 ^ bgr)] = (png_byte)blue;
|
||||||
entry[afirst + 1] = (png_byte)green;
|
entry[afirst + 1] = (png_byte)green;
|
||||||
@@ -1940,6 +1954,7 @@ png_create_colormap_entry(png_image_read_control *display,
|
|||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
entry[1 ^ afirst] = (png_byte)alpha;
|
entry[1 ^ afirst] = (png_byte)alpha;
|
||||||
|
/* FALLTHROUGH */
|
||||||
case 1:
|
case 1:
|
||||||
entry[afirst] = (png_byte)green;
|
entry[afirst] = (png_byte)green;
|
||||||
break;
|
break;
|
||||||
@@ -1966,7 +1981,7 @@ make_gray_file_colormap(png_image_read_control *display)
|
|||||||
for (i=0; i<256; ++i)
|
for (i=0; i<256; ++i)
|
||||||
png_create_colormap_entry(display, i, i, i, i, 255, P_FILE);
|
png_create_colormap_entry(display, i, i, i, i, 255, P_FILE);
|
||||||
|
|
||||||
return i;
|
return (int)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -1977,7 +1992,7 @@ make_gray_colormap(png_image_read_control *display)
|
|||||||
for (i=0; i<256; ++i)
|
for (i=0; i<256; ++i)
|
||||||
png_create_colormap_entry(display, i, i, i, i, 255, P_sRGB);
|
png_create_colormap_entry(display, i, i, i, i, 255, P_sRGB);
|
||||||
|
|
||||||
return i;
|
return (int)i;
|
||||||
}
|
}
|
||||||
#define PNG_GRAY_COLORMAP_ENTRIES 256
|
#define PNG_GRAY_COLORMAP_ENTRIES 256
|
||||||
|
|
||||||
@@ -2031,7 +2046,7 @@ make_ga_colormap(png_image_read_control *display)
|
|||||||
P_sRGB);
|
P_sRGB);
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return (int)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PNG_GA_COLORMAP_ENTRIES 256
|
#define PNG_GA_COLORMAP_ENTRIES 256
|
||||||
@@ -2056,7 +2071,7 @@ make_rgb_colormap(png_image_read_control *display)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return i;
|
return (int)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PNG_RGB_COLORMAP_ENTRIES 216
|
#define PNG_RGB_COLORMAP_ENTRIES 216
|
||||||
@@ -2249,7 +2264,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
|
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
|
||||||
png_error(png_ptr, "gray[16] color-map: too few entries");
|
png_error(png_ptr, "gray[16] color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_gray_colormap(display);
|
cmap_entries = (unsigned int)make_gray_colormap(display);
|
||||||
|
|
||||||
if (png_ptr->num_trans > 0)
|
if (png_ptr->num_trans > 0)
|
||||||
{
|
{
|
||||||
@@ -2347,7 +2362,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
|
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
|
||||||
png_error(png_ptr, "gray+alpha color-map: too few entries");
|
png_error(png_ptr, "gray+alpha color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_ga_colormap(display);
|
cmap_entries = (unsigned int)make_ga_colormap(display);
|
||||||
|
|
||||||
background_index = PNG_CMAP_GA_BACKGROUND;
|
background_index = PNG_CMAP_GA_BACKGROUND;
|
||||||
output_processing = PNG_CMAP_GA;
|
output_processing = PNG_CMAP_GA;
|
||||||
@@ -2381,7 +2396,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
|
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
|
||||||
png_error(png_ptr, "gray-alpha color-map: too few entries");
|
png_error(png_ptr, "gray-alpha color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_gray_colormap(display);
|
cmap_entries = (unsigned int)make_gray_colormap(display);
|
||||||
|
|
||||||
if (output_encoding == P_LINEAR)
|
if (output_encoding == P_LINEAR)
|
||||||
{
|
{
|
||||||
@@ -2520,7 +2535,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
|
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
|
||||||
png_error(png_ptr, "rgb[ga] color-map: too few entries");
|
png_error(png_ptr, "rgb[ga] color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_ga_colormap(display);
|
cmap_entries = (unsigned int)make_ga_colormap(display);
|
||||||
background_index = PNG_CMAP_GA_BACKGROUND;
|
background_index = PNG_CMAP_GA_BACKGROUND;
|
||||||
output_processing = PNG_CMAP_GA;
|
output_processing = PNG_CMAP_GA;
|
||||||
}
|
}
|
||||||
@@ -2546,12 +2561,12 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
png_ptr->num_trans > 0) &&
|
png_ptr->num_trans > 0) &&
|
||||||
png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0)
|
png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0)
|
||||||
{
|
{
|
||||||
cmap_entries = make_gray_file_colormap(display);
|
cmap_entries = (unsigned int)make_gray_file_colormap(display);
|
||||||
data_encoding = P_FILE;
|
data_encoding = P_FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
cmap_entries = make_gray_colormap(display);
|
cmap_entries = (unsigned int)make_gray_colormap(display);
|
||||||
|
|
||||||
/* But if the input has alpha or transparency it must be removed
|
/* But if the input has alpha or transparency it must be removed
|
||||||
*/
|
*/
|
||||||
@@ -2639,7 +2654,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
|
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
|
||||||
png_error(png_ptr, "rgb+alpha color-map: too few entries");
|
png_error(png_ptr, "rgb+alpha color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_rgb_colormap(display);
|
cmap_entries = (unsigned int)make_rgb_colormap(display);
|
||||||
|
|
||||||
/* Add a transparent entry. */
|
/* Add a transparent entry. */
|
||||||
png_create_colormap_entry(display, cmap_entries, 255, 255,
|
png_create_colormap_entry(display, cmap_entries, 255, 255,
|
||||||
@@ -2688,7 +2703,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
|
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
|
||||||
png_error(png_ptr, "rgb-alpha color-map: too few entries");
|
png_error(png_ptr, "rgb-alpha color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_rgb_colormap(display);
|
cmap_entries = (unsigned int)make_rgb_colormap(display);
|
||||||
|
|
||||||
png_create_colormap_entry(display, cmap_entries, back_r,
|
png_create_colormap_entry(display, cmap_entries, back_r,
|
||||||
back_g, back_b, 0/*unused*/, output_encoding);
|
back_g, back_b, 0/*unused*/, output_encoding);
|
||||||
@@ -2773,7 +2788,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries)
|
if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries)
|
||||||
png_error(png_ptr, "rgb color-map: too few entries");
|
png_error(png_ptr, "rgb color-map: too few entries");
|
||||||
|
|
||||||
cmap_entries = make_rgb_colormap(display);
|
cmap_entries = (unsigned int)make_rgb_colormap(display);
|
||||||
output_processing = PNG_CMAP_RGB;
|
output_processing = PNG_CMAP_RGB;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2797,11 +2812,11 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
|
|
||||||
output_processing = PNG_CMAP_NONE;
|
output_processing = PNG_CMAP_NONE;
|
||||||
data_encoding = P_FILE; /* Don't change from color-map indices */
|
data_encoding = P_FILE; /* Don't change from color-map indices */
|
||||||
cmap_entries = png_ptr->num_palette;
|
cmap_entries = (unsigned int)png_ptr->num_palette;
|
||||||
if (cmap_entries > 256)
|
if (cmap_entries > 256)
|
||||||
cmap_entries = 256;
|
cmap_entries = 256;
|
||||||
|
|
||||||
if (cmap_entries > image->colormap_entries)
|
if (cmap_entries > (unsigned int)image->colormap_entries)
|
||||||
png_error(png_ptr, "palette color-map: too few entries");
|
png_error(png_ptr, "palette color-map: too few entries");
|
||||||
|
|
||||||
for (i=0; i < cmap_entries; ++i)
|
for (i=0; i < cmap_entries; ++i)
|
||||||
@@ -2859,7 +2874,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
case P_sRGB:
|
case P_sRGB:
|
||||||
/* Change to 8-bit sRGB */
|
/* Change to 8-bit sRGB */
|
||||||
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
|
png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
|
||||||
/* FALL THROUGH */
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
case P_FILE:
|
case P_FILE:
|
||||||
if (png_ptr->bit_depth > 8)
|
if (png_ptr->bit_depth > 8)
|
||||||
@@ -2913,7 +2928,7 @@ png_image_read_colormap(png_voidp argument)
|
|||||||
png_error(png_ptr, "bad background index (internal error)");
|
png_error(png_ptr, "bad background index (internal error)");
|
||||||
}
|
}
|
||||||
|
|
||||||
display->colormap_processing = output_processing;
|
display->colormap_processing = (int)output_processing;
|
||||||
|
|
||||||
return 1/*ok*/;
|
return 1/*ok*/;
|
||||||
}
|
}
|
||||||
@@ -3177,8 +3192,7 @@ png_image_read_colormapped(png_voidp argument)
|
|||||||
image->colormap_entries == 244 /* 216 + 1 + 27 */)
|
image->colormap_entries == 244 /* 216 + 1 + 27 */)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* goto bad_output; */
|
goto bad_output;
|
||||||
/* FALL THROUGH */
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
bad_output:
|
bad_output:
|
||||||
@@ -3222,14 +3236,14 @@ png_image_read_colormapped(png_voidp argument)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
png_alloc_size_t row_bytes = display->row_bytes;
|
png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
|
||||||
|
|
||||||
while (--passes >= 0)
|
while (--passes >= 0)
|
||||||
{
|
{
|
||||||
png_uint_32 y = image->height;
|
png_uint_32 y = image->height;
|
||||||
png_bytep row = png_voidcast(png_bytep, display->first_row);
|
png_bytep row = png_voidcast(png_bytep, display->first_row);
|
||||||
|
|
||||||
while (y-- > 0)
|
for (; y > 0; --y)
|
||||||
{
|
{
|
||||||
png_read_row(png_ptr, row, NULL);
|
png_read_row(png_ptr, row, NULL);
|
||||||
row += row_bytes;
|
row += row_bytes;
|
||||||
@@ -3557,8 +3571,9 @@ png_image_read_background(png_voidp argument)
|
|||||||
* stride which was multiplied by 2 (below) to get row_bytes.
|
* stride which was multiplied by 2 (below) to get row_bytes.
|
||||||
*/
|
*/
|
||||||
ptrdiff_t step_row = display->row_bytes / 2;
|
ptrdiff_t step_row = display->row_bytes / 2;
|
||||||
int preserve_alpha = (image->format & PNG_FORMAT_FLAG_ALPHA) != 0;
|
unsigned int preserve_alpha = (image->format &
|
||||||
unsigned int outchannels = 1+preserve_alpha;
|
PNG_FORMAT_FLAG_ALPHA) != 0;
|
||||||
|
unsigned int outchannels = 1U+preserve_alpha;
|
||||||
int swap_alpha = 0;
|
int swap_alpha = 0;
|
||||||
|
|
||||||
# ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
|
# ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
|
||||||
@@ -3745,6 +3760,12 @@ png_image_read_direct(png_voidp argument)
|
|||||||
output_gamma = PNG_DEFAULT_sRGB;
|
output_gamma = PNG_DEFAULT_sRGB;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0)
|
||||||
|
{
|
||||||
|
mode = PNG_ALPHA_OPTIMIZED;
|
||||||
|
change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
|
||||||
|
}
|
||||||
|
|
||||||
/* If 'do_local_background' is set check for the presence of gamma
|
/* If 'do_local_background' is set check for the presence of gamma
|
||||||
* correction; this is part of the work-round for the libpng bug
|
* correction; this is part of the work-round for the libpng bug
|
||||||
* described above.
|
* described above.
|
||||||
@@ -3970,6 +3991,10 @@ png_image_read_direct(png_voidp argument)
|
|||||||
else if (do_local_compose != 0) /* internal error */
|
else if (do_local_compose != 0) /* internal error */
|
||||||
png_error(png_ptr, "png_image_read: alpha channel lost");
|
png_error(png_ptr, "png_image_read: alpha channel lost");
|
||||||
|
|
||||||
|
if ((format & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) {
|
||||||
|
info_format |= PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
|
||||||
|
}
|
||||||
|
|
||||||
if (info_ptr->bit_depth == 16)
|
if (info_ptr->bit_depth == 16)
|
||||||
info_format |= PNG_FORMAT_FLAG_LINEAR;
|
info_format |= PNG_FORMAT_FLAG_LINEAR;
|
||||||
|
|
||||||
@@ -4055,14 +4080,14 @@ png_image_read_direct(png_voidp argument)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
png_alloc_size_t row_bytes = display->row_bytes;
|
png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
|
||||||
|
|
||||||
while (--passes >= 0)
|
while (--passes >= 0)
|
||||||
{
|
{
|
||||||
png_uint_32 y = image->height;
|
png_uint_32 y = image->height;
|
||||||
png_bytep row = png_voidcast(png_bytep, display->first_row);
|
png_bytep row = png_voidcast(png_bytep, display->first_row);
|
||||||
|
|
||||||
while (y-- > 0)
|
for (; y > 0; --y)
|
||||||
{
|
{
|
||||||
png_read_row(png_ptr, row, NULL);
|
png_read_row(png_ptr, row, NULL);
|
||||||
row += row_bytes;
|
row += row_bytes;
|
||||||
@@ -4091,7 +4116,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
|||||||
* bits; this is just to verify that the 'row_stride' argument can be
|
* bits; this is just to verify that the 'row_stride' argument can be
|
||||||
* represented.
|
* represented.
|
||||||
*/
|
*/
|
||||||
if (image->width <= 0x7FFFFFFFU/channels) /* no overflow */
|
if (image->width <= 0x7fffffffU/channels) /* no overflow */
|
||||||
{
|
{
|
||||||
png_uint_32 check;
|
png_uint_32 check;
|
||||||
const png_uint_32 png_row_stride = image->width * channels;
|
const png_uint_32 png_row_stride = image->width * channels;
|
||||||
@@ -4100,10 +4125,10 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
|||||||
row_stride = (png_int_32)/*SAFE*/png_row_stride;
|
row_stride = (png_int_32)/*SAFE*/png_row_stride;
|
||||||
|
|
||||||
if (row_stride < 0)
|
if (row_stride < 0)
|
||||||
check = -row_stride;
|
check = (png_uint_32)(-row_stride);
|
||||||
|
|
||||||
else
|
else
|
||||||
check = row_stride;
|
check = (png_uint_32)row_stride;
|
||||||
|
|
||||||
/* This verifies 'check', the absolute value of the actual stride
|
/* This verifies 'check', the absolute value of the actual stride
|
||||||
* passed in and detects overflow in the application calculation (i.e.
|
* passed in and detects overflow in the application calculation (i.e.
|
||||||
@@ -4128,7 +4153,7 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
|||||||
* accomodated on 64-bit systems.
|
* accomodated on 64-bit systems.
|
||||||
*/
|
*/
|
||||||
if (image->height <=
|
if (image->height <=
|
||||||
0xFFFFFFFFU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check)
|
0xffffffffU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check)
|
||||||
{
|
{
|
||||||
if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 ||
|
if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 ||
|
||||||
(image->colormap_entries > 0 && colormap != NULL))
|
(image->colormap_entries > 0 && colormap != NULL))
|
||||||
|
|||||||
Vendored
+37
-27
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.24 [August 4, 2016]
|
* Last changed in libpng 1.6.33 [September 28, 2017]
|
||||||
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -49,6 +49,7 @@ png_set_crc_action(png_structrp png_ptr, int crit_action, int ancil_action)
|
|||||||
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
|
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
|
||||||
png_warning(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Can't discard critical data on CRC error");
|
"Can't discard critical data on CRC error");
|
||||||
|
/* FALLTHROUGH */
|
||||||
case PNG_CRC_ERROR_QUIT: /* Error/quit */
|
case PNG_CRC_ERROR_QUIT: /* Error/quit */
|
||||||
|
|
||||||
case PNG_CRC_DEFAULT:
|
case PNG_CRC_DEFAULT:
|
||||||
@@ -429,7 +430,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * (sizeof (png_byte))));
|
(png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
png_ptr->quantize_index[i] = (png_byte)i;
|
png_ptr->quantize_index[i] = (png_byte)i;
|
||||||
}
|
}
|
||||||
@@ -446,7 +447,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
/* Initialize an array to sort colors */
|
/* Initialize an array to sort colors */
|
||||||
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * (sizeof (png_byte))));
|
(png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
|
||||||
|
|
||||||
/* Initialize the quantize_sort array */
|
/* Initialize the quantize_sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
@@ -580,9 +581,11 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
|
|
||||||
/* Initialize palette index arrays */
|
/* Initialize palette index arrays */
|
||||||
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * (sizeof (png_byte))));
|
(png_alloc_size_t)((png_uint_32)num_palette *
|
||||||
|
(sizeof (png_byte))));
|
||||||
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
|
||||||
(png_uint_32)(num_palette * (sizeof (png_byte))));
|
(png_alloc_size_t)((png_uint_32)num_palette *
|
||||||
|
(sizeof (png_byte))));
|
||||||
|
|
||||||
/* Initialize the sort array */
|
/* Initialize the sort array */
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
@@ -591,7 +594,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
png_ptr->palette_to_index[i] = (png_byte)i;
|
png_ptr->palette_to_index[i] = (png_byte)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 *
|
hash = (png_dsortpp)png_calloc(png_ptr, (png_alloc_size_t)(769 *
|
||||||
(sizeof (png_dsortp))));
|
(sizeof (png_dsortp))));
|
||||||
|
|
||||||
num_new_palette = num_palette;
|
num_new_palette = num_palette;
|
||||||
@@ -622,7 +625,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
{
|
{
|
||||||
|
|
||||||
t = (png_dsortp)png_malloc_warn(png_ptr,
|
t = (png_dsortp)png_malloc_warn(png_ptr,
|
||||||
(png_uint_32)(sizeof (png_dsort)));
|
(png_alloc_size_t)(sizeof (png_dsort)));
|
||||||
|
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
break;
|
break;
|
||||||
@@ -747,9 +750,9 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
|
|||||||
png_size_t num_entries = ((png_size_t)1 << total_bits);
|
png_size_t num_entries = ((png_size_t)1 << total_bits);
|
||||||
|
|
||||||
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
|
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
|
||||||
(png_uint_32)(num_entries * (sizeof (png_byte))));
|
(png_alloc_size_t)(num_entries * (sizeof (png_byte))));
|
||||||
|
|
||||||
distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
|
distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
|
||||||
(sizeof (png_byte))));
|
(sizeof (png_byte))));
|
||||||
|
|
||||||
memset(distance, 0xff, num_entries * (sizeof (png_byte)));
|
memset(distance, 0xff, num_entries * (sizeof (png_byte)));
|
||||||
@@ -1253,7 +1256,7 @@ png_init_rgb_transformations(png_structrp png_ptr)
|
|||||||
default:
|
default:
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
/* FALL THROUGH (Already 8 bits) */
|
/* FALLTHROUGH */ /* (Already 8 bits) */
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
/* Already a full 16 bits */
|
/* Already a full 16 bits */
|
||||||
@@ -2150,7 +2153,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
png_bytep sp = row + (png_size_t)((row_width - 1) >> 3);
|
png_bytep sp = row + (png_size_t)((row_width - 1) >> 3);
|
||||||
png_bytep dp = row + (png_size_t)row_width - 1;
|
png_bytep dp = row + (png_size_t)row_width - 1;
|
||||||
png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07);
|
png_uint_32 shift = 7U - ((row_width + 7U) & 0x07);
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
*dp = (png_byte)((*sp >> shift) & 0x01);
|
*dp = (png_byte)((*sp >> shift) & 0x01);
|
||||||
@@ -2174,7 +2177,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
|||||||
|
|
||||||
png_bytep sp = row + (png_size_t)((row_width - 1) >> 2);
|
png_bytep sp = row + (png_size_t)((row_width - 1) >> 2);
|
||||||
png_bytep dp = row + (png_size_t)row_width - 1;
|
png_bytep dp = row + (png_size_t)row_width - 1;
|
||||||
png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1);
|
png_uint_32 shift = ((3U - ((row_width + 3U) & 0x03)) << 1);
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
*dp = (png_byte)((*sp >> shift) & 0x03);
|
*dp = (png_byte)((*sp >> shift) & 0x03);
|
||||||
@@ -2197,7 +2200,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
|||||||
{
|
{
|
||||||
png_bytep sp = row + (png_size_t)((row_width - 1) >> 1);
|
png_bytep sp = row + (png_size_t)((row_width - 1) >> 1);
|
||||||
png_bytep dp = row + (png_size_t)row_width - 1;
|
png_bytep dp = row + (png_size_t)row_width - 1;
|
||||||
png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2);
|
png_uint_32 shift = ((1U - ((row_width + 1U) & 0x01)) << 2);
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
*dp = (png_byte)((*sp >> shift) & 0x0f);
|
*dp = (png_byte)((*sp >> shift) & 0x0f);
|
||||||
@@ -2934,7 +2937,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
|||||||
* using the equation given in Poynton's ColorFAQ of 1998-01-04 at
|
* using the equation given in Poynton's ColorFAQ of 1998-01-04 at
|
||||||
* <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but
|
* <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but
|
||||||
* versions dated 1998 through November 2002 have been archived at
|
* versions dated 1998 through November 2002 have been archived at
|
||||||
* http://web.archive.org/web/20000816232553/http://www.inforamp.net/
|
* https://web.archive.org/web/20000816232553/www.inforamp.net/
|
||||||
* ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
|
* ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
|
||||||
* Charles Poynton poynton at poynton.com
|
* Charles Poynton poynton at poynton.com
|
||||||
*
|
*
|
||||||
@@ -3223,7 +3226,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
== png_ptr->trans_color.gray)
|
== png_ptr->trans_color.gray)
|
||||||
{
|
{
|
||||||
unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
|
unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
|
||||||
tmp |= png_ptr->background.gray << shift;
|
tmp |=
|
||||||
|
(unsigned int)(png_ptr->background.gray << shift);
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3252,7 +3256,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
== png_ptr->trans_color.gray)
|
== png_ptr->trans_color.gray)
|
||||||
{
|
{
|
||||||
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
||||||
tmp |= png_ptr->background.gray << shift;
|
tmp |=
|
||||||
|
(unsigned int)png_ptr->background.gray << shift;
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3262,7 +3267,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
unsigned int g = (gamma_table [p | (p << 2) |
|
unsigned int g = (gamma_table [p | (p << 2) |
|
||||||
(p << 4) | (p << 6)] >> 6) & 0x03;
|
(p << 4) | (p << 6)] >> 6) & 0x03;
|
||||||
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
||||||
tmp |= g << shift;
|
tmp |= (unsigned int)(g << shift);
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3288,7 +3293,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
== png_ptr->trans_color.gray)
|
== png_ptr->trans_color.gray)
|
||||||
{
|
{
|
||||||
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
|
||||||
tmp |= png_ptr->background.gray << shift;
|
tmp |=
|
||||||
|
(unsigned int)png_ptr->background.gray << shift;
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3318,7 +3324,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
== png_ptr->trans_color.gray)
|
== png_ptr->trans_color.gray)
|
||||||
{
|
{
|
||||||
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
||||||
tmp |= png_ptr->background.gray << shift;
|
tmp |=
|
||||||
|
(unsigned int)(png_ptr->background.gray << shift);
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3328,7 +3335,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
|
unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
|
||||||
0x0f;
|
0x0f;
|
||||||
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
||||||
tmp |= g << shift;
|
tmp |= (unsigned int)(g << shift);
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3354,7 +3361,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
== png_ptr->trans_color.gray)
|
== png_ptr->trans_color.gray)
|
||||||
{
|
{
|
||||||
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
|
||||||
tmp |= png_ptr->background.gray << shift;
|
tmp |=
|
||||||
|
(unsigned int)(png_ptr->background.gray << shift);
|
||||||
*sp = (png_byte)(tmp & 0xff);
|
*sp = (png_byte)(tmp & 0xff);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4297,7 +4305,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
|||||||
if (num_trans > 0)
|
if (num_trans > 0)
|
||||||
{
|
{
|
||||||
sp = row + (png_size_t)row_width - 1;
|
sp = row + (png_size_t)row_width - 1;
|
||||||
dp = row + (png_size_t)(row_width << 2) - 1;
|
dp = row + ((png_size_t)row_width << 2) - 1;
|
||||||
|
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
@@ -4458,7 +4466,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
{
|
{
|
||||||
gray = gray & 0xff;
|
gray = gray & 0xff;
|
||||||
sp = row + (png_size_t)row_width - 1;
|
sp = row + (png_size_t)row_width - 1;
|
||||||
dp = row + (png_size_t)(row_width << 1) - 1;
|
dp = row + ((png_size_t)row_width << 1) - 1;
|
||||||
|
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
@@ -4514,7 +4522,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
png_byte green = (png_byte)(trans_color->green & 0xff);
|
png_byte green = (png_byte)(trans_color->green & 0xff);
|
||||||
png_byte blue = (png_byte)(trans_color->blue & 0xff);
|
png_byte blue = (png_byte)(trans_color->blue & 0xff);
|
||||||
sp = row + (png_size_t)row_info->rowbytes - 1;
|
sp = row + (png_size_t)row_info->rowbytes - 1;
|
||||||
dp = row + (png_size_t)(row_width << 2) - 1;
|
dp = row + ((png_size_t)row_width << 2) - 1;
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
|
if (*(sp - 2) == red && *(sp - 1) == green && *(sp) == blue)
|
||||||
@@ -4537,7 +4545,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
png_byte green_low = (png_byte)(trans_color->green & 0xff);
|
png_byte green_low = (png_byte)(trans_color->green & 0xff);
|
||||||
png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
|
png_byte blue_low = (png_byte)(trans_color->blue & 0xff);
|
||||||
sp = row + row_info->rowbytes - 1;
|
sp = row + row_info->rowbytes - 1;
|
||||||
dp = row + (png_size_t)(row_width << 3) - 1;
|
dp = row + ((png_size_t)row_width << 3) - 1;
|
||||||
for (i = 0; i < row_width; i++)
|
for (i = 0; i < row_width; i++)
|
||||||
{
|
{
|
||||||
if (*(sp - 5) == red_high &&
|
if (*(sp - 5) == red_high &&
|
||||||
@@ -4596,7 +4604,9 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
|
|||||||
png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
|
png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
|
||||||
png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */
|
png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */
|
||||||
while (dp > sp)
|
while (dp > sp)
|
||||||
dp[-2] = dp[-1] = *--sp, dp -= 2;
|
{
|
||||||
|
dp[-2] = dp[-1] = *--sp; dp -= 2;
|
||||||
|
}
|
||||||
|
|
||||||
row_info->rowbytes *= 2;
|
row_info->rowbytes *= 2;
|
||||||
row_info->bit_depth = 16;
|
row_info->bit_depth = 16;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user