mirror of
https://github.com/opencv/opencv.git
synced 2026-07-21 19:33:03 +04:00
Compare commits
4780 Commits
4.5.3-openvino
...
4.12.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 49486f61fb | |||
| 6b55ae0319 | |||
| 7a0d6559c3 | |||
| 66e5fce928 | |||
| 677c4ee42f | |||
| 43112409ef | |||
| 27867cc72c | |||
| 5ee8919139 | |||
| 3ff2ce3291 | |||
| 64ef095314 | |||
| d9e2b4c650 | |||
| 611d69aae1 | |||
| d2d90dd1cd | |||
| f6697558ce | |||
| 856a497209 | |||
| 117801e136 | |||
| 1d45a63598 | |||
| 029030095c | |||
| 2e54a1f14f | |||
| 83309580f4 | |||
| e9f1da7e8e | |||
| c363303d0a | |||
| 42ec439d5a | |||
| 5ee1a53d1e | |||
| 359a005d82 | |||
| 288471f559 | |||
| 91be7d3ce6 | |||
| a55eca9fb5 | |||
| 77d2a5868a | |||
| 0fac0e760f | |||
| e392b3843e | |||
| ba70d1104f | |||
| 7dfd1226ce | |||
| 6ed29bdd39 | |||
| a122f83374 | |||
| c3400603d0 | |||
| 4629299163 | |||
| 54fe519ae0 | |||
| afe5b226b4 | |||
| 1950c4dbb9 | |||
| 2ffca501e7 | |||
| 850b686f8a | |||
| 89289ecaa5 | |||
| 3259863924 | |||
| 7f4c89c7cc | |||
| f24f6b8d4e | |||
| 98ed06c339 | |||
| 23d812187e | |||
| 9bb20c0174 | |||
| a4a253ea2b | |||
| 7cb7a6fd20 | |||
| 972e135479 | |||
| 1c53fd3777 | |||
| 210203090e | |||
| bbaed6f377 | |||
| d1b4b46dc6 | |||
| 0755c512e7 | |||
| 37a3eddd53 | |||
| 30130cdc86 | |||
| f09de671be | |||
| 40e3aee3d6 | |||
| c0fdb1145e | |||
| 664230091e | |||
| 8ffcd60538 | |||
| c5ef3948cf | |||
| 1f674dcdb4 | |||
| 287dad8102 | |||
| d750d43aa2 | |||
| b395a2e307 | |||
| 452882c007 | |||
| fcc76c120f | |||
| 85b45656fa | |||
| bbe2f50b5d | |||
| 6b4f5b48b1 | |||
| 809090f203 | |||
| 4b69cc53e6 | |||
| b13704b583 | |||
| 7ca36d9c50 | |||
| ebfee90c30 | |||
| 62b36495cc | |||
| d6864cdd22 | |||
| b9cab7e4af | |||
| d97e926f70 | |||
| a503070e01 | |||
| beeda17483 | |||
| 987548d041 | |||
| aef6ae4872 | |||
| 9e18169959 | |||
| a2c381a82b | |||
| e258f2595e | |||
| 0ccbd21c0a | |||
| 17d94277f0 | |||
| 5205e26663 | |||
| cd0699a338 | |||
| 4033043488 | |||
| e92cfb35f6 | |||
| a39f61b6e1 | |||
| e1f6e85c88 | |||
| b3cb517cac | |||
| 8a0ea789e7 | |||
| d26aa99a05 | |||
| 9f7793cdae | |||
| 47d0bedeb2 | |||
| 344f8c6400 | |||
| a23baceb06 | |||
| 17f399f475 | |||
| 575e3adc01 | |||
| 7578007d23 | |||
| 0806124ac7 | |||
| b4944c9375 | |||
| 0a5352ee27 | |||
| 374ad41420 | |||
| 023d14ecc4 | |||
| 388b6dd81f | |||
| b8099d3cc2 | |||
| 5a457842f1 | |||
| e6fb6c290c | |||
| 2c4eab0969 | |||
| aee828ac6e | |||
| c37f54aeed | |||
| 7ecb1d8cab | |||
| 0bc95d9256 | |||
| dc610867e1 | |||
| 5177c4a25a | |||
| 4530206445 | |||
| d4c4493413 | |||
| 3ff6c7f9fe | |||
| 166f76d224 | |||
| c3fe92d813 | |||
| d00738d97c | |||
| 79a5e5276a | |||
| 9b08167769 | |||
| 23f8e523a0 | |||
| 7fe8ce19d9 | |||
| 1e3ab44cff | |||
| b3e17ea9d4 | |||
| eae77dae86 | |||
| 9d2d927fa9 | |||
| 84ea77a4be | |||
| a9b298eb47 | |||
| fd5b33bb00 | |||
| 250b5003ee | |||
| 9201ca1af1 | |||
| f3cffcd85d | |||
| 1c421be489 | |||
| 80a8c97dd7 | |||
| 1a624efc0f | |||
| 2af8d0317e | |||
| 7e12c397d0 | |||
| f016c728f5 | |||
| 8ceddbff68 | |||
| 8fae4a65fe | |||
| 5d3a9788eb | |||
| 67ba045e3b | |||
| e1a74e6d1b | |||
| 547cef4e88 | |||
| 838babe351 | |||
| 868fc5c581 | |||
| a39db41390 | |||
| 90e7119ce0 | |||
| d5a5b0e85f | |||
| ce4c3f64e0 | |||
| 2364056aa3 | |||
| 3a69b11b6d | |||
| 8035aade11 | |||
| 59a17bc41a | |||
| 11aefa2338 | |||
| 306204089f | |||
| 9d07c25175 | |||
| 2f97718bc1 | |||
| 9ab3a249c2 | |||
| 8a2903c190 | |||
| 16a3d37dc1 | |||
| 7d66431f8e | |||
| c248d47110 | |||
| 0ea3c156a4 | |||
| 806eb4767c | |||
| 7a9ce585f0 | |||
| 37be2a2a68 | |||
| 4ad4bd5dc0 | |||
| 956f583b69 | |||
| ab5a65b5a2 | |||
| fe5bd15cdd | |||
| c9a73061ca | |||
| 2fb786532a | |||
| c774dd41cf | |||
| 55a063f025 | |||
| 19c4d97638 | |||
| 9533c5633d | |||
| 86a963cec9 | |||
| edccfa7961 | |||
| 485c7d5be7 | |||
| 6f8f846288 | |||
| 829495355d | |||
| 9241e0a9f6 | |||
| 325e59bd4c | |||
| cd5a636459 | |||
| a7749c3813 | |||
| e37819c2ac | |||
| 29ef2a1da3 | |||
| 97f73ba0b5 | |||
| a08b1b6566 | |||
| a8a3b93043 | |||
| 0bea67f57b | |||
| 8eb9d27a31 | |||
| f20facc60a | |||
| 11e46cda86 | |||
| d42b6f438e | |||
| b5d38ea4cb | |||
| 767dd838d3 | |||
| 6ffc515b2a | |||
| 3962803e7a | |||
| 5170f56a1e | |||
| 250ea3d7c6 | |||
| ba6eb8d952 | |||
| 050dfab749 | |||
| 7f7be9bab0 | |||
| 6ef5746391 | |||
| c1d71d5375 | |||
| 70ab545b90 | |||
| fa7a0c1e12 | |||
| 0d092c7b1e | |||
| db9df33d33 | |||
| 78662ac085 | |||
| 09a85e97aa | |||
| e826a41eeb | |||
| e148a2c4aa | |||
| 8f74086d3f | |||
| 91e078be93 | |||
| 1b3db545a3 | |||
| 81859255ca | |||
| 55a4a713fd | |||
| 0b3155980a | |||
| d49dee83bf | |||
| 3f9ed93da2 | |||
| cb8030809e | |||
| c8e88d8984 | |||
| 8b4b382fa4 | |||
| 009fdbbea2 | |||
| 09c71aed14 | |||
| 1f468dd586 | |||
| ec1cbe294a | |||
| 8c7288676e | |||
| 9d34a88597 | |||
| d0c5a04ddb | |||
| 14e1f6ce96 | |||
| 289884adc5 | |||
| afc7c0a89c | |||
| 767407e711 | |||
| 6b4ef1dccd | |||
| 3d5ab56a68 | |||
| 42a132088c | |||
| 8e2826ddd6 | |||
| 9a1f71c14b | |||
| 8948faa394 | |||
| 68a595d88b | |||
| c72c527bfe | |||
| ae443a904b | |||
| fa58c1205b | |||
| 931af518d9 | |||
| a2a2f37ebb | |||
| 7d87f3cda6 | |||
| 4f4767cb9c | |||
| bc5545c3e6 | |||
| d6966f82a3 | |||
| a77623a32b | |||
| 0944f7ad26 | |||
| ef474e06fc | |||
| 5db60e1621 | |||
| 64535757df | |||
| ce1398882d | |||
| 01ef38dcad | |||
| 8566930922 | |||
| 1d9dda3f09 | |||
| afc4a9ac51 | |||
| 46bd22abad | |||
| 4e488a0b16 | |||
| 2e9345570f | |||
| c10b800837 | |||
| 41e3fcc73e | |||
| ec5f7bb9f1 | |||
| 50072f8d4f | |||
| 46fbe1895a | |||
| 67ffb230f1 | |||
| 0ed5556cee | |||
| 259ec3674d | |||
| 3e43d0cfca | |||
| b902a8e792 | |||
| 8207549638 | |||
| 0142231e4d | |||
| 855f20fdfe | |||
| 2090407002 | |||
| b6f213a8c7 | |||
| 0a39f98bee | |||
| 6eaaaa410e | |||
| 2c16f3b7d2 | |||
| 14396b8029 | |||
| 2a8d4b8e43 | |||
| b129abfdaa | |||
| 186537a315 | |||
| fd62bd0991 | |||
| e30697fd42 | |||
| 71fe903121 | |||
| 7481cb50b5 | |||
| bbcdbca872 | |||
| d83df66ff0 | |||
| 0db6a496ba | |||
| 49ab8121b7 | |||
| eefa327f30 | |||
| 2969b67bd7 | |||
| 46dbc57a86 | |||
| 60de3ff24f | |||
| 656038346b | |||
| 1f63b986a1 | |||
| a48e78cdfc | |||
| d9956fc24f | |||
| 2dd72201af | |||
| 6fb082ae7f | |||
| d9ec808b15 | |||
| fa092b4597 | |||
| f833519506 | |||
| 4be88e934f | |||
| e342d2f339 | |||
| 4bb57ceb73 | |||
| 2fbb310265 | |||
| 6004badce2 | |||
| e813326c17 | |||
| 3236436892 | |||
| accebdecf7 | |||
| 316b5d7b08 | |||
| f4a2c35c73 | |||
| 54da5c3e77 | |||
| 830d031213 | |||
| 02253dd76b | |||
| 797068853f | |||
| 6d161c25ef | |||
| 0fed1fa184 | |||
| 524d8ae01c | |||
| e06502a254 | |||
| 40843d06ab | |||
| a2d784b6f5 | |||
| 12d182bf9e | |||
| 648424eaf2 | |||
| a9b2467868 | |||
| fbffaa5276 | |||
| e89e2fd7ea | |||
| 00956d5c15 | |||
| bb525fe91d | |||
| 57a78cb9df | |||
| 83104bed32 | |||
| dbd4e4549d | |||
| d80fd565b4 | |||
| 1aa658fa75 | |||
| 97abffbdac | |||
| cbcfd772ce | |||
| 5c6c6af4ec | |||
| 8a24d41b54 | |||
| 1aa69292b0 | |||
| a62b78d6e3 | |||
| 3f1e7fcb8f | |||
| e39eb949ea | |||
| dbd3ef9a6f | |||
| 87cc1643f4 | |||
| b65fd3b51c | |||
| 3084f950cf | |||
| 0b8cab368b | |||
| 3db1247745 | |||
| 4d6d6fb18f | |||
| 4f6996b5dd | |||
| 76d3bf0a3b | |||
| a63ede6b1d | |||
| d3792dad86 | |||
| 43551b72d7 | |||
| 39bc5df72a | |||
| d869b12e89 | |||
| 33d632f85e | |||
| 314f99f7a0 | |||
| 6c3b195a57 | |||
| 63ad15c243 | |||
| 3c88a001a2 | |||
| 6a6a5a765d | |||
| b5f5540e8a | |||
| a256886838 | |||
| e2803bee5c | |||
| a47f0f00cb | |||
| 364eedb87e | |||
| 7a2b048c92 | |||
| 1f9d6aa6cf | |||
| 58b14294b5 | |||
| a6bfd87943 | |||
| f212c163e3 | |||
| 9ae23a7f51 | |||
| d32d4da9a3 | |||
| bb07ce7454 | |||
| 379b5a2fdb | |||
| 6092499907 | |||
| b5c3b706de | |||
| c759a7cdde | |||
| f570852d20 | |||
| c5ad6d7904 | |||
| 21402668a1 | |||
| 680fd4d975 | |||
| 9a3fb556c4 | |||
| 7ac939c53a | |||
| 18c0368840 | |||
| 8065f10521 | |||
| acc9084044 | |||
| a9cb451199 | |||
| 36a5176a5f | |||
| 1de6e20463 | |||
| ae25c3194f | |||
| a8df0a06ac | |||
| b44b30b730 | |||
| 58e557d059 | |||
| e4b23cf96a | |||
| 5200419ba5 | |||
| def8619648 | |||
| 45aa502549 | |||
| 5921aae2b3 | |||
| 8e65075c1e | |||
| 7aaada4175 | |||
| 62658fba24 | |||
| 076bfa6431 | |||
| d8c2f0bcdf | |||
| 2364f4b0b9 | |||
| 7eaddb8aa4 | |||
| 284660fb6c | |||
| a490623bf0 | |||
| 1e013a07c4 | |||
| ce51023ad4 | |||
| fbd8180cc1 | |||
| 4d23b56d98 | |||
| 0e17a879d7 | |||
| bbca50ecc5 | |||
| 6c2d6bea2f | |||
| b323780460 | |||
| aeac913203 | |||
| 740388b3ce | |||
| 987ba6504b | |||
| 32d3d54ca1 | |||
| 2e909c38dc | |||
| 01e3fe8791 | |||
| 7563cebad5 | |||
| 9a566d772f | |||
| b7663086fb | |||
| e8e49ab7a8 | |||
| 59c3b6c995 | |||
| b310233ea4 | |||
| 0fa61de22a | |||
| 3356b36d72 | |||
| 0e747e592b | |||
| d6dc22d03c | |||
| 4e2f0471bd | |||
| 43cebe52eb | |||
| 0cfc2e8fd8 | |||
| fbd2105067 | |||
| 13b2caffe0 | |||
| c21d0ad9d0 | |||
| 2f58f82e84 | |||
| ea404df069 | |||
| 2a0092cf75 | |||
| f6c9ca5602 | |||
| d5f69305cb | |||
| bb798d15e1 | |||
| 86241653a7 | |||
| 585226a5fd | |||
| 08a24ba2cf | |||
| 0049cde1f7 | |||
| e62ab4ff71 | |||
| c840e24e94 | |||
| ae57c54d83 | |||
| f5c06f8b91 | |||
| 4403e3bad8 | |||
| 33da8763a5 | |||
| c5f6ed6fef | |||
| 9dde7790cf | |||
| df5da4abcd | |||
| 8a8e59c8fd | |||
| 4b2a33a5c6 | |||
| 6bffa64af4 | |||
| c637dd2646 | |||
| d4eed1c5aa | |||
| a2dd4ddbb2 | |||
| 8cb3ef177c | |||
| ca51d55ee3 | |||
| 9bb01e799f | |||
| 3cbb4acd2d | |||
| ab77e1cfc8 | |||
| 9a77bef92b | |||
| a3e95ec6d0 | |||
| 4e4eaea9a3 | |||
| 4a4031dc48 | |||
| c623a5afc1 | |||
| 7728dd3387 | |||
| f6aa472acc | |||
| 055dbbb848 | |||
| 8ab0ad6e1b | |||
| ea023b72ce | |||
| db962ea069 | |||
| 459bb12466 | |||
| fe9405e8c0 | |||
| a2a3f5e86c | |||
| 6f24d755f2 | |||
| 2db6b29a76 | |||
| 5949cb10ee | |||
| 3e1fafefbe | |||
| 133fda3c56 | |||
| 16cbdcf582 | |||
| 918196ec1b | |||
| 500e1ff763 | |||
| 93023e1a68 | |||
| 3effe195cb | |||
| 8482caf348 | |||
| b7e1cba660 | |||
| 63ef786a3a | |||
| eff12685c5 | |||
| 6ba8f4838b | |||
| 1d701d1690 | |||
| e76924ef0d | |||
| 796adf5dc6 | |||
| 1a6ef7e08c | |||
| b62ab874d1 | |||
| 534243647e | |||
| 342ced1e04 | |||
| bfb54aa691 | |||
| 6931a4cc06 | |||
| 08a88816ed | |||
| d6f60d4ab8 | |||
| 052b2c43c3 | |||
| 5b7b887200 | |||
| e29a70c17f | |||
| 2c2866a7a6 | |||
| 1e31f8047d | |||
| bb79493a89 | |||
| ee86f1c969 | |||
| 97f3f39066 | |||
| f00814e38d | |||
| 85f9ac4e23 | |||
| 68187de4ad | |||
| d12fa37eed | |||
| 05bc484eed | |||
| bdb6a968ce | |||
| 0da8c760d3 | |||
| 7e7c75e239 | |||
| 938f89a20e | |||
| d744296bbd | |||
| 31b0eeea0b | |||
| d2704548b4 | |||
| 198f23890e | |||
| 66ffeae4b1 | |||
| 38b86591ba | |||
| cb959b3915 | |||
| e34eff9ab2 | |||
| 0dfd2b3628 | |||
| 4b35101d55 | |||
| d5087a2bd6 | |||
| 0331af01ae | |||
| 0e3d71b0e0 | |||
| 9b85ab0a63 | |||
| d86387347d | |||
| 56dd9d51b1 | |||
| fc994a6ae8 | |||
| 2aee94752a | |||
| 904dbe9555 | |||
| 3d7eb55f75 | |||
| ad36f68500 | |||
| 5000ec50db | |||
| 3e534bb7c8 | |||
| ff18c9cc79 | |||
| a6f72f813d | |||
| f65006eee1 | |||
| b4d0325666 | |||
| 0538e64b13 | |||
| b9505ac861 | |||
| 9e8b9a0ebb | |||
| 845616d82c | |||
| 5e1eed5026 | |||
| ffd0548651 | |||
| 1281317e17 | |||
| 2f0035b23f | |||
| ab0a818c84 | |||
| 12963ea699 | |||
| f2878eb337 | |||
| 4d26e16af8 | |||
| 1db982780f | |||
| c803aa2ddd | |||
| 269ff8cd83 | |||
| d2264d5868 | |||
| f15fa21c6b | |||
| 8bc65a1d13 | |||
| d39aae6bdf | |||
| 9c33baebbd | |||
| 1b48eafe48 | |||
| b31f7694c5 | |||
| 94bccbecc0 | |||
| aeb7a9b383 | |||
| 707ab39454 | |||
| c64fe91ff4 | |||
| 4c7ea70051 | |||
| 09892c9d17 | |||
| e9982e856f | |||
| 745a12c03b | |||
| 96d6395a6d | |||
| fe649f4adb | |||
| f106866d3e | |||
| 0756dbfe3d | |||
| b42075f3e2 | |||
| 1399672a83 | |||
| a2ce9e1bac | |||
| ec2208f5f7 | |||
| 4efd52f676 | |||
| aa52dafc90 | |||
| f1a775825f | |||
| d9a139f9e8 | |||
| 0903061589 | |||
| f3d9d56ebe | |||
| 8ffc4a6bd5 | |||
| b53fa94745 | |||
| 6a0affdbce | |||
| 3073ba28cc | |||
| 5baca5275e | |||
| d037b40faa | |||
| 60d35d1bd5 | |||
| cdad0b7027 | |||
| ebf3c400d2 | |||
| 59f762b2f0 | |||
| 537a2566cf | |||
| 9f64f021de | |||
| e747ed11cb | |||
| 5cd448377a | |||
| 79d019b4f1 | |||
| 428d93114f | |||
| 914a83fa0c | |||
| a628417f2a | |||
| 773bd1a90a | |||
| 3fbaad36d7 | |||
| 7c0c9e1e55 | |||
| 874e57512e | |||
| 1fe9dd0c3b | |||
| d369cf6d50 | |||
| 1c28a98b34 | |||
| 23f6a9ee3e | |||
| 3899a060a3 | |||
| 7ddc02907e | |||
| d77abeddd0 | |||
| 59b9681af6 | |||
| 2e21e11318 | |||
| e0001903ce | |||
| a8f4019932 | |||
| dbb330d7be | |||
| 0ca98d437b | |||
| 51ec7fedaf | |||
| 260f511dfb | |||
| 1a1b1901e8 | |||
| a4c8d318e6 | |||
| 03f90aaf85 | |||
| 71581d9c97 | |||
| 25fe85bbbb | |||
| 42be822c1d | |||
| 1d4110884b | |||
| dc8a9d5d3d | |||
| 5ef062343c | |||
| d85c13bcbb | |||
| 0dfc5d416f | |||
| 4ade7931e1 | |||
| 0a2669daba | |||
| 3a8d7ec75a | |||
| f825b4d1ab | |||
| 1db93911ae | |||
| 1f2e7adb4b | |||
| acdb707ba4 | |||
| 082cd7a74e | |||
| 7fbf3c1fec | |||
| ed9d64c9d3 | |||
| 646e87c728 | |||
| 7edfb57f5a | |||
| 3d91d75f1a | |||
| 23fcea0d33 | |||
| 03cedee0b0 | |||
| 8897002fcc | |||
| 31d04f8fd9 | |||
| c58b6bf11f | |||
| 89c19f1f1a | |||
| f4db63ca71 | |||
| 5f1b05af0e | |||
| 6eaa77461e | |||
| 96dab6ba71 | |||
| e953fcfaa4 | |||
| bef3585245 | |||
| a5f8711ce1 | |||
| a27d749471 | |||
| fb0a40ded4 | |||
| bf914a7681 | |||
| c8c64f69dd | |||
| 68941ef8e7 | |||
| 55b4c2ac59 | |||
| fb422a62d2 | |||
| 82c45dde5b | |||
| 0b01712dd3 | |||
| b385767c1c | |||
| 65d4112fa5 | |||
| 905cc45f85 | |||
| 7095cb6904 | |||
| 5080be6669 | |||
| 1358af180c | |||
| 7be5181bff | |||
| c3ca3f4f00 | |||
| 64d3111377 | |||
| 64273c8a5b | |||
| 1b0d58a554 | |||
| 474028ea87 | |||
| d0c8b36de8 | |||
| 21cb138be8 | |||
| 8c6339c04d | |||
| 4866811933 | |||
| 3dace76c3f | |||
| b7e609d5e8 | |||
| e5a8e2ac79 | |||
| 1ff16cb551 | |||
| e1d66643b3 | |||
| 11a4a06fa4 | |||
| 1a775198ce | |||
| 67f07b16cb | |||
| 8fe70a1877 | |||
| 5f95827a5f | |||
| ff639d11d4 | |||
| 641f43dd48 | |||
| c230841105 | |||
| 37c2af63f0 | |||
| 6f8c3b13d8 | |||
| 3fddea2ade | |||
| 3d89824423 | |||
| 6873bdee70 | |||
| 9d64e2959f | |||
| 5817b562b3 | |||
| c287423b33 | |||
| c3747a6847 | |||
| 9b635da563 | |||
| ee95bfe244 | |||
| ddc03c0769 | |||
| cf87380fad | |||
| 725ce48837 | |||
| 04818d6dd5 | |||
| 265a2c39b2 | |||
| 2756c20e3e | |||
| 7654d06b83 | |||
| 41489f983d | |||
| 0e80a97f87 | |||
| 8791cd147c | |||
| bf7ab8eebd | |||
| dd08328228 | |||
| 24a497acd8 | |||
| 52100328d8 | |||
| d6fe289a79 | |||
| 515b4a2689 | |||
| e4bcd46f64 | |||
| 35571be570 | |||
| 331412dfad | |||
| d193554a5f | |||
| 898a2a3811 | |||
| 9fc7ca8ed1 | |||
| 983086411f | |||
| 57ccbee25d | |||
| 4398e0b62b | |||
| 94d5ad09ff | |||
| e026a5ad8a | |||
| c79b72a838 | |||
| 35dbf32227 | |||
| 888469a842 | |||
| 3919f33e21 | |||
| 489df18a13 | |||
| d20c456ab7 | |||
| 8ba76e65e9 | |||
| 8e5dbc03fe | |||
| 1909ac8650 | |||
| 45b9398d68 | |||
| 08f7f13dfa | |||
| 3edcf410b6 | |||
| 0f234209da | |||
| 4cbb96b396 | |||
| 50f6d54f87 | |||
| 687e37e6a8 | |||
| 2a681bbb6b | |||
| 63b5dee274 | |||
| 8ba7389b21 | |||
| 885bbc643f | |||
| dceeb47cd3 | |||
| 69803e7b99 | |||
| e1b06371ad | |||
| e72efd0d32 | |||
| cefde84a76 | |||
| 7d9014e09e | |||
| 40428d919d | |||
| 28efc21530 | |||
| cda9f4197e | |||
| 73d68f3f49 | |||
| fa6d6520c7 | |||
| e375d5786b | |||
| 3901426d85 | |||
| ae1fb8c033 | |||
| 783fe72756 | |||
| 73b3b24c56 | |||
| 1aa325a460 | |||
| 292ee28913 | |||
| b8eed54ced | |||
| 93a882d2e2 | |||
| 807170d5c9 | |||
| 72023951ea | |||
| 305b57e622 | |||
| 658336b366 | |||
| 086b999013 | |||
| 8a36f119ce | |||
| 679931dcde | |||
| 48a48fe11c | |||
| 450e741f8d | |||
| a6ec12f58b | |||
| 50eebbd21f | |||
| b2e118ea94 | |||
| 6ef357fd54 | |||
| fab419a484 | |||
| f503890c2b | |||
| e043d5d9d6 | |||
| 881440c6c6 | |||
| ee685017c3 | |||
| aa11a898a4 | |||
| e1fec15627 | |||
| 6308739638 | |||
| bf998429f6 | |||
| 9663245459 | |||
| f143f45fa2 | |||
| c8080aa415 | |||
| 4c81e174bf | |||
| 85923c8f30 | |||
| 7de3a8e960 | |||
| fcfdd311ab | |||
| 976fb3e8d6 | |||
| 8725a7e21c | |||
| 209802c9f6 | |||
| 79faf857d9 | |||
| e5790c0241 | |||
| a7d942b681 | |||
| 307dc2a298 | |||
| 6cc166985d | |||
| 7590813b69 | |||
| 2a8d4c6025 | |||
| dbd53fe89a | |||
| b743edd466 | |||
| 06db881ca9 | |||
| c0a0852f05 | |||
| 9ef574a213 | |||
| 76f495dce9 | |||
| 32d3d6fa97 | |||
| 8561f45c2a | |||
| 88f99edc65 | |||
| e9c3e1acb5 | |||
| 3995ad8458 | |||
| e2ba36bf9c | |||
| 960aaa32db | |||
| b72d7e3b05 | |||
| 165bf25c46 | |||
| 4d66541999 | |||
| 5b4d1ce6a0 | |||
| a905526f71 | |||
| 2829a6de85 | |||
| e087cc8fd1 | |||
| f156236d17 | |||
| 61f6b6d773 | |||
| bacefd3b8d | |||
| a17fafc3af | |||
| 766bad0035 | |||
| 18117cf355 | |||
| ea8c9dc2de | |||
| 3803eeecba | |||
| 2d5b0caa77 | |||
| 5638c38d53 | |||
| 9c19a0cdba | |||
| 412c97b411 | |||
| 76bf17a248 | |||
| f4c2e4f872 | |||
| e5b871fa7e | |||
| a3bdbf5553 | |||
| 916724e2a0 | |||
| 6c6d5cd7b2 | |||
| 697512bb9f | |||
| 55d1bf3da9 | |||
| 347d673a87 | |||
| 7cf075c392 | |||
| 7e3b69e02b | |||
| 8715229e49 | |||
| 7fe36a3cb2 | |||
| a087a9c47a | |||
| ec2e2da1fe | |||
| 7d3d2101f9 | |||
| 24fde08712 | |||
| ae4a11b0c0 | |||
| ebe04a5723 | |||
| de89aa379d | |||
| cb72a2131f | |||
| aa133cd899 | |||
| b5b9b3a279 | |||
| 61d719d2aa | |||
| 78630ddc67 | |||
| 0838920371 | |||
| 95070e61ce | |||
| a8a088d28c | |||
| c340b3b466 | |||
| 93e0c7e53f | |||
| 315f85d4f4 | |||
| 2fcea41f86 | |||
| 37c1acbf19 | |||
| da3debda6d | |||
| 6cd730a02c | |||
| c9df679943 | |||
| 67d0338c9c | |||
| 3f92884520 | |||
| 582a7f32d5 | |||
| d8bcc2c85d | |||
| 1acf722e24 | |||
| 9dee2c6e67 | |||
| 49459d46e2 | |||
| 333054e05e | |||
| ea2a3cb264 | |||
| ecbff5a20c | |||
| 75fca7d9d0 | |||
| 6ed603e917 | |||
| ab99f87b6a | |||
| 9de2ebbec1 | |||
| 992dc932ee | |||
| a15cd4b63d | |||
| 796974cccc | |||
| 95041f5e65 | |||
| 340a390ea2 | |||
| 35463e079c | |||
| b79b366859 | |||
| b9b2d551ac | |||
| f67d4852bf | |||
| 2db7f8e827 | |||
| 93745245a3 | |||
| 2a333a6c86 | |||
| 89fff355c8 | |||
| 603344fa54 | |||
| 938b9e4bb7 | |||
| 99672a2691 | |||
| 1ca526dcdb | |||
| 65853aa783 | |||
| be3c519956 | |||
| 5b3f33dd11 | |||
| 0b3dbdd4b3 | |||
| eab21b6106 | |||
| c5de090964 | |||
| 160879c100 | |||
| 14f9d71dd0 | |||
| c16927605d | |||
| e1b57057bf | |||
| 93b607dc72 | |||
| 38cfea981f | |||
| 44c814e334 | |||
| 012d853474 | |||
| c9b57819b1 | |||
| 89dd4ee137 | |||
| db3654ef51 | |||
| 23b244d3a3 | |||
| 26714f9a34 | |||
| b5ea32158a | |||
| 4dd54bbec9 | |||
| a5dacb5bed | |||
| d892c7b142 | |||
| 325da2b2f4 | |||
| 1125755345 | |||
| 32d81a8bae | |||
| 0020831414 | |||
| 0c2da1dc9b | |||
| bcce38c05a | |||
| d1505693dd | |||
| 53a5b85d9f | |||
| 7b176d898b | |||
| 9ebf387850 | |||
| da078c4b75 | |||
| 4842043c6a | |||
| c53c2f6844 | |||
| e90935e81c | |||
| a6b8ea892b | |||
| 04f9e3cd4f | |||
| 81f33103fd | |||
| e906f0f3b3 | |||
| 15783d6598 | |||
| 3ff97c5580 | |||
| 78195bc3df | |||
| c6ace77e21 | |||
| 50f1ea5c9c | |||
| dc2ce2b856 | |||
| a9d8d45df4 | |||
| 63b9cbc2d0 | |||
| 7dcc305301 | |||
| 35ca2f78d6 | |||
| 06b9db6a71 | |||
| 11fde3bb89 | |||
| b964943517 | |||
| 8d935e2184 | |||
| e962395565 | |||
| e3858cc5a3 | |||
| 31b308f882 | |||
| a54de7d55e | |||
| 0b5b40179c | |||
| d7a237aefc | |||
| d30b9450c1 | |||
| cdd8395f68 | |||
| 88b28ee2a0 | |||
| dfbd18e9aa | |||
| 94b7a2d320 | |||
| efbc9f0b66 | |||
| 9f5139b575 | |||
| 20e72b0b30 | |||
| 5510718381 | |||
| e644ab0b40 | |||
| e28c6eb3b6 | |||
| 99c0a96a2f | |||
| 53f51275e4 | |||
| 25fb55601b | |||
| aac8bc877a | |||
| bef6c110a4 | |||
| 934e6899f8 | |||
| a7fd9446cf | |||
| a8d1373919 | |||
| 939cb58cd6 | |||
| 2799c74d50 | |||
| 6e1864e3fc | |||
| 883faf8871 | |||
| 75339a5528 | |||
| 35d9e8ef5c | |||
| fd5efabdd9 | |||
| 3d74d646d8 | |||
| 39a7b3d186 | |||
| 930af15f47 | |||
| 34ed88d7fb | |||
| 25609ef5fd | |||
| 996ed0a2eb | |||
| ce1d840adf | |||
| bbf65a166e | |||
| 1e5407a9ba | |||
| b7c9221b80 | |||
| be00247ca0 | |||
| 855f6cfdd4 | |||
| 310169490a | |||
| aab7239f38 | |||
| 4500eb937f | |||
| 786726719f | |||
| 284a79446a | |||
| ee2b0f9d63 | |||
| 445022682e | |||
| 204d62ae12 | |||
| efa4d9176a | |||
| 2179186a51 | |||
| 76a1d26bcd | |||
| 11c69bb171 | |||
| 8be2056cff | |||
| 2028998e00 | |||
| d8c7debe52 | |||
| 3f13ce797b | |||
| acd16e384f | |||
| 5cfa44d2a2 | |||
| 5dc1b39e4c | |||
| 7ef42d7706 | |||
| 57984e689b | |||
| 0cba7020a1 | |||
| a102b24285 | |||
| e7108f48ab | |||
| d1b643a05a | |||
| 766f3f5fc4 | |||
| 553c111c5a | |||
| e3884a9ea8 | |||
| 0fac5d52bc | |||
| 60819979d4 | |||
| b9d2ecb72f | |||
| 860b688cdd | |||
| 24907f35a3 | |||
| 4bf95ac2df | |||
| 0a12c7d9de | |||
| 7ff531b8ab | |||
| 88c6c7d9f7 | |||
| a03b813167 | |||
| 8e9307074c | |||
| 2629688d11 | |||
| 3ea7ed9ebf | |||
| 6623c62f56 | |||
| e1dba2c6d2 | |||
| bdf986ee51 | |||
| cc6f85e1ba | |||
| 3282954c2e | |||
| 3700f9e1e9 | |||
| ef3303716e | |||
| bef5a87680 | |||
| adcb070396 | |||
| cbc08514fd | |||
| cbf3b1187d | |||
| 0d1ed49d2a | |||
| a5d9c29b12 | |||
| 5dd7b5f0e5 | |||
| 99f32f17b4 | |||
| b77c74b6fc | |||
| 9c05b27ba0 | |||
| 92b588f30b | |||
| 2bb8b2b173 | |||
| d8f0838fa3 | |||
| 3f26664e8d | |||
| 337c183b9d | |||
| 71d3237a09 | |||
| a7e53aa184 | |||
| 1bd5ca1ebe | |||
| 1db6a8a1f3 | |||
| 98b8825031 | |||
| 29f91a08d5 | |||
| 08107957d8 | |||
| ca035e6dae | |||
| 472eba324a | |||
| dcce2b8b24 | |||
| d7f04a9d33 | |||
| f4ebf7c0a6 | |||
| 9ed1d6730f | |||
| 7e9ef4db86 | |||
| 3e3ee106fb | |||
| 2624929ec6 | |||
| 79af357cf4 | |||
| 8709115d9a | |||
| e7bf07786d | |||
| d9421ac148 | |||
| 1668203a1c | |||
| 05e48605a0 | |||
| b6593517c4 | |||
| c5976f7865 | |||
| f1890e384b | |||
| 8955a27577 | |||
| 1fa96b161f | |||
| d97df262f6 | |||
| 7b31cc7314 | |||
| cc49aee04e | |||
| b267f1791c | |||
| f17b122512 | |||
| 8b2783e9ff | |||
| 7e3f6875c1 | |||
| ba28b7d6df | |||
| f85818ba6f | |||
| 28c3000f62 | |||
| 6bee2facf3 | |||
| f1aef892bf | |||
| f5793d26b7 | |||
| de3eb0ec5f | |||
| 4824354e46 | |||
| 6fb3f63331 | |||
| 16b5096ed0 | |||
| 9f1559595b | |||
| f8ad6eb71b | |||
| 500207785a | |||
| f85014534f | |||
| f2c48e5e97 | |||
| e765c9f9c8 | |||
| 28d029c158 | |||
| 5696413bbc | |||
| 8393885a39 | |||
| 49f80cb3c4 | |||
| e52540162f | |||
| 0b39a51be8 | |||
| c71d495273 | |||
| 40faced6c1 | |||
| 23ba63b0be | |||
| d95ff3ac04 | |||
| 69af621ef6 | |||
| 83e32c4d37 | |||
| e05ad56f6e | |||
| 6350bfbf79 | |||
| 8aa129dce1 | |||
| 5f509e2ec1 | |||
| 5e7887897a | |||
| bc0618b688 | |||
| 0044047782 | |||
| 41f08988b4 | |||
| f2d6527a4b | |||
| d29ad2fb71 | |||
| 5f3a505a2d | |||
| 78ed6de518 | |||
| 7d6b6161cc | |||
| 7713c84465 | |||
| 5009109167 | |||
| 76d9f7aaeb | |||
| 68581e7b4a | |||
| c034c46e69 | |||
| 4d4def2d36 | |||
| 2e07ec1f87 | |||
| 47a6ffb73c | |||
| 03507e06b4 | |||
| 7fc8a490f8 | |||
| f4e5438401 | |||
| 02ad8c284f | |||
| 58e007e183 | |||
| 1614b8df4e | |||
| 3c7e94b275 | |||
| 023d805492 | |||
| 8dc9ff5624 | |||
| 78c9793d5b | |||
| 1d9a4120fa | |||
| 55eebe81c3 | |||
| 1f1ba7e402 | |||
| 5bd64e09a3 | |||
| faa259ab34 | |||
| a9e489f149 | |||
| 392fd4edd1 | |||
| ba65d2eb0d | |||
| 8bc90a4bff | |||
| 7127161426 | |||
| 26a5730f0d | |||
| a4486c0e20 | |||
| 70d333d336 | |||
| c43957cbec | |||
| 4081a309bf | |||
| a8df49f170 | |||
| c4ce94232b | |||
| af4531b378 | |||
| b94cb5bc68 | |||
| d8e18f4576 | |||
| 75f3f0fac8 | |||
| ac9a858377 | |||
| 6e5a53c37a | |||
| d9555dbdd1 | |||
| c539cfd31a | |||
| 9fe5615f2f | |||
| 6bf758ecc4 | |||
| 02c3132f02 | |||
| 7ea4364c63 | |||
| bc95f27e56 | |||
| 5aaa570fef | |||
| ed47cce1c5 | |||
| c999cb3c5e | |||
| ce642e994d | |||
| 1c9efbd4be | |||
| f3f29fa62c | |||
| b5cf4f1483 | |||
| 1f6f092a9d | |||
| 22de887c00 | |||
| e3fc850ec2 | |||
| cbf71c380f | |||
| 716826cccd | |||
| 2a2ff55257 | |||
| b1e01970ef | |||
| 6682270b4c | |||
| 12e2cc9502 | |||
| 357b9abaef | |||
| 8af76698ed | |||
| 8f7e55a60b | |||
| 2cd330486e | |||
| d0978cea39 | |||
| 7b58ffebd0 | |||
| 2225b257cf | |||
| 7bad12c33b | |||
| ebea65777f | |||
| 7e56908306 | |||
| 5b0843728e | |||
| 616a913fa2 | |||
| 50b6edc9ba | |||
| ae85e516c0 | |||
| 096ccd410b | |||
| 3f8b56ec49 | |||
| fb2af90daa | |||
| 26798e1f7c | |||
| fc5eb101bf | |||
| 882f46e1d3 | |||
| 5da17a4b03 | |||
| a604304e87 | |||
| 4ef5986d4d | |||
| fb194a4582 | |||
| c577b24406 | |||
| a1e4444fb5 | |||
| d77dbbe7a0 | |||
| b8ec9492b4 | |||
| c317a3ee89 | |||
| 85673afb47 | |||
| 05a54b1405 | |||
| f9e9567870 | |||
| 577ad0a5ad | |||
| 3cc83c7610 | |||
| 37ca0308a7 | |||
| a4b4808d9d | |||
| f643964c68 | |||
| f9dd20eb07 | |||
| 66fb5021e9 | |||
| e2621f128e | |||
| 4fb0541916 | |||
| c622ffd95f | |||
| 02a74f2e88 | |||
| 0eef34a670 | |||
| dfb6069ad9 | |||
| 66ab0bee7a | |||
| 0bd066ee58 | |||
| 002d0542dd | |||
| 2eb9e915d9 | |||
| 079e615fbd | |||
| caa09aca36 | |||
| ecbfc1bfd8 | |||
| 06c1c7b5cb | |||
| c081efe3c6 | |||
| 197626a5bf | |||
| 2c5b296ab2 | |||
| 17c7f76da3 | |||
| a10e33979a | |||
| d22d0bd49c | |||
| 9813ea2b7a | |||
| bbd9059334 | |||
| b14ea19466 | |||
| cf3a130be6 | |||
| 5bad694b7f | |||
| d0ec39206a | |||
| cf3e90ab91 | |||
| 369760116e | |||
| 9ced486497 | |||
| b3e863fee4 | |||
| 148b2ec3e0 | |||
| cb339ac6d1 | |||
| f37924796f | |||
| 953581a92a | |||
| e4677fbf64 | |||
| 4221ae1d64 | |||
| b0d905864d | |||
| a25132986a | |||
| e5d530abae | |||
| e55cf444cc | |||
| 8ed52cb564 | |||
| e63690a2d9 | |||
| 30889f4a90 | |||
| e80500828c | |||
| 5528e70f3c | |||
| 6b45cccc37 | |||
| a0b28f8b06 | |||
| 5be158a2b6 | |||
| 5121a1bf0d | |||
| e17b8ae8a1 | |||
| e1ed422bdb | |||
| e0b7f04fd2 | |||
| 89b91fcb50 | |||
| 2b1c8aa4db | |||
| e665d2d636 | |||
| bf7208e1ed | |||
| bd819f97f1 | |||
| df627e1281 | |||
| 55d7e3f8cc | |||
| d81cd13bb3 | |||
| 2d864c3af9 | |||
| 45587f23db | |||
| 13c95efa74 | |||
| 5e09fca0f8 | |||
| 99cacaaad6 | |||
| fdc7cb6dc1 | |||
| 2eedec7479 | |||
| 93800a85b2 | |||
| eba158fb0c | |||
| 8c540a56af | |||
| 9f123f8d74 | |||
| 95ffabffdd | |||
| 9c8606e0c0 | |||
| 912cf2a028 | |||
| b758897c29 | |||
| 9716bf95ae | |||
| 9fc4b61074 | |||
| cfa42e4338 | |||
| a7d6f105e7 | |||
| 2b9d1a2ff8 | |||
| 01dc010436 | |||
| 7945f2cf40 | |||
| afb91b552e | |||
| 7b9de94003 | |||
| f87e1efd2a | |||
| 7f1140b48b | |||
| 1894426116 | |||
| fd576d9e8e | |||
| a132fd401e | |||
| ff9aeaceb0 | |||
| 43666e1308 | |||
| e3ff6ce0cc | |||
| 5874bce144 | |||
| d664d8d450 | |||
| f36dbef74e | |||
| 4dc461717f | |||
| 1a537ab98f | |||
| accf200408 | |||
| 6e9dcb87c1 | |||
| 8f4dbdad0e | |||
| eaa88e7bc7 | |||
| fc34554475 | |||
| aa5f7727d8 | |||
| 84a1248b0a | |||
| 4c86b287fd | |||
| 025e7602b9 | |||
| bf2626e4db | |||
| 0b6c9a2123 | |||
| aae77b65a5 | |||
| bbfded21ac | |||
| 52f3f5a3f6 | |||
| 3afe8ddaf8 | |||
| 8d5dd2e5c2 | |||
| 3aefd4862c | |||
| 0c6fc763f4 | |||
| 2fd011b6ff | |||
| 6da2ddcf0e | |||
| 0d413068df | |||
| 625eebad54 | |||
| 60ca3d259e | |||
| 372b3fefea | |||
| 6fc926ea4d | |||
| 01a4abb2c2 | |||
| 8550c415ef | |||
| 7fe1664bbf | |||
| 50b36ef823 | |||
| 6a370ba9e7 | |||
| ed93384817 | |||
| 1eb061f89d | |||
| ad61e7e21d | |||
| f174363f60 | |||
| 0e524ee95a | |||
| 66ff71085e | |||
| 0f468a7f35 | |||
| 9f2494da2d | |||
| 7b77ebc8c3 | |||
| 98aed21dd4 | |||
| f2c38eb62f | |||
| b34ec57682 | |||
| bf06e3d09f | |||
| 0f5792a7a1 | |||
| bc82959184 | |||
| daa8f7dfc6 | |||
| ef611df09b | |||
| 2d0f928934 | |||
| 5fe3933346 | |||
| c346ee1c29 | |||
| f48c06c0d9 | |||
| 500c55a808 | |||
| 52e280e94b | |||
| deab144e22 | |||
| e8582f2cf8 | |||
| 396a75f2ea | |||
| fc98b31c3e | |||
| 5e5a035c5b | |||
| 5aa5c39210 | |||
| 8f83540018 | |||
| f9c3c3d666 | |||
| 0b3232a160 | |||
| 3c712cf77d | |||
| c04750ab57 | |||
| facb66b8a7 | |||
| e0b489e917 | |||
| 843c09bcb0 | |||
| 1c664ff673 | |||
| 4a9b0f2bf4 | |||
| 6ca45a9d33 | |||
| faba2d8148 | |||
| 37e056c06c | |||
| 853f7ff904 | |||
| e596680939 | |||
| 6f48cb78b6 | |||
| b5c6956f31 | |||
| ae347ab493 | |||
| cbec3f012d | |||
| a2e23fa988 | |||
| e4ef88c623 | |||
| f9a7d3b90c | |||
| ba483dfbb8 | |||
| d792086ba6 | |||
| 1577ae0839 | |||
| 2d204243af | |||
| 296a90ae01 | |||
| a024d9e996 | |||
| 6c21a80ef7 | |||
| 915e677866 | |||
| e537e1650d | |||
| 5fbf3d85bf | |||
| 02504e2bdb | |||
| f0e3d2f2f8 | |||
| f8aa2896a1 | |||
| f8ef646312 | |||
| 54be266938 | |||
| d84448e25c | |||
| 318b7ec3e6 | |||
| 9e7ec59a41 | |||
| e03231e6aa | |||
| 3473b8a653 | |||
| 12aa0fe898 | |||
| bd73b7bcf5 | |||
| 7bea25a60c | |||
| b2db959619 | |||
| 68f6c81539 | |||
| 835d6dd731 | |||
| 78a765cb81 | |||
| b87058f7ac | |||
| a9f15d7372 | |||
| 2315bf52a8 | |||
| 4c7a70cb5f | |||
| 32db3f943d | |||
| 0fa538fcc8 | |||
| fefd2e5ce6 | |||
| 08f252d65a | |||
| 49367b5bec | |||
| 559c0a0eb1 | |||
| b24e365454 | |||
| bf5a01e297 | |||
| 073c2d9964 | |||
| d5ef86c9a4 | |||
| 0424ba57d7 | |||
| b0201ec55f | |||
| 82914e442c | |||
| 8d2470c035 | |||
| 51f9ff5b10 | |||
| f300deb569 | |||
| 3c73557dac | |||
| f5928a5be9 | |||
| bcbc74d4cd | |||
| 02b3518a3b | |||
| 76548e29bd | |||
| 4b35b2f968 | |||
| 77af137285 | |||
| 5abb065b3f | |||
| 28d22d7b84 | |||
| fcaa8ce3c2 | |||
| 8850a8219e | |||
| 250cfe81c5 | |||
| c7021f0bc6 | |||
| fc32903b28 | |||
| 422d519703 | |||
| c0680ae846 | |||
| ea94f7eba9 | |||
| 0c6ff36ba2 | |||
| 85450816b4 | |||
| 1b4c1ff91e | |||
| 145981c526 | |||
| e48b96b926 | |||
| 372b36c1d3 | |||
| ba8915c88c | |||
| 8e43c8f200 | |||
| 87f749277d | |||
| 03994163b5 | |||
| 73acf08844 | |||
| 8ea939f7eb | |||
| 54b7cafd2a | |||
| 8ed0319fee | |||
| 65784dddeb | |||
| a97e66eb84 | |||
| 2ea2483bec | |||
| c9671da732 | |||
| efc9837df1 | |||
| 37156a4719 | |||
| 40533dbf69 | |||
| ae21368eb9 | |||
| cb92974914 | |||
| 69772b0260 | |||
| 48ba45f856 | |||
| 37c76b815c | |||
| 01edb50815 | |||
| dc987c094a | |||
| e64857c561 | |||
| d066c44bce | |||
| 62ef27ac1e | |||
| e56e500cd9 | |||
| 72f07170f3 | |||
| e4131c0b5b | |||
| d269de0a03 | |||
| bfad61f433 | |||
| d1e4bd8543 | |||
| 6b77f50269 | |||
| 224b9ee33f | |||
| b647e65618 | |||
| ac4c0bffac | |||
| 37b02d170f | |||
| 8ba69562b5 | |||
| 9e001d4df3 | |||
| a865fd6f00 | |||
| dabc325cac | |||
| 985506c251 | |||
| d30bf1bc3c | |||
| cc2955f21c | |||
| 6c39fbc33f | |||
| 1a3ef9ccd4 | |||
| 84bb1cda4e | |||
| 582561fdc3 | |||
| 26cf82a56c | |||
| 99c86bb40c | |||
| 68dc02e302 | |||
| b04de14fbb | |||
| 0de26fd78e | |||
| a289eba357 | |||
| fefc7e3749 | |||
| 2791bb7062 | |||
| a7fa1e6f4b | |||
| 97c418ab86 | |||
| c923c59833 | |||
| 1e190b3094 | |||
| ebc637d07d | |||
| 7db54a7cc7 | |||
| 1bde621a08 | |||
| ef8a5eb620 | |||
| 6eafcbb2e1 | |||
| e2b2c3a35e | |||
| e7ccff9805 | |||
| 83acb656f1 | |||
| 72aa3f2bc5 | |||
| be1373f01a | |||
| fde99e68c0 | |||
| 7fb336322d | |||
| 2beacc07e8 | |||
| 2b579b5a09 | |||
| 75dc334d39 | |||
| c955564cb3 | |||
| 43c1c81c8c | |||
| 26c44aa7c6 | |||
| 5c9ad9d2c9 | |||
| 5c130b1429 | |||
| 105eb95b02 | |||
| e6d5de69fe | |||
| 7919d04a9b | |||
| 3b9794d13e | |||
| 3640217772 | |||
| 9b402cfa59 | |||
| bb40237498 | |||
| 13127365e2 | |||
| 8ade7f6177 | |||
| 48fd23a02a | |||
| a86e9f161d | |||
| 3b287770b9 | |||
| 9691a2dccf | |||
| 91ec3c0af2 | |||
| 22a8fa0730 | |||
| 1564be2d4c | |||
| b8f2d58f5b | |||
| 9af4ceed98 | |||
| 34a871c855 | |||
| b7d70613e4 | |||
| 2ed97b9ef3 | |||
| 2997b4c5fe | |||
| 63cde0b90d | |||
| 81865b3d52 | |||
| 14e0d43550 | |||
| 19527d79d6 | |||
| a25cfb463d | |||
| 10f6cbf41c | |||
| 7f2c14fc4f | |||
| a8ec658611 | |||
| 9120121dc7 | |||
| 039f68f1b0 | |||
| 21b6f06f9d | |||
| 46b3a504cf | |||
| 3b26e183cb | |||
| 6e3685d733 | |||
| e5d1309fcf | |||
| 2e3ccb4e8e | |||
| dad8af6b17 | |||
| afe7c8b560 | |||
| e5b5984f3c | |||
| 0f1c484ea9 | |||
| 881cd02fe2 | |||
| 49a0877b8c | |||
| 1453e79ecc | |||
| 212795db64 | |||
| e80b7940ef | |||
| c3f75c2952 | |||
| 56aae015cd | |||
| 221b5c086c | |||
| e019a6738d | |||
| 5510e2556a | |||
| 7d681cf80d | |||
| 03d1760dd5 | |||
| 8c22b4b54b | |||
| 46792849d4 | |||
| 43007af42e | |||
| b59eca22ae | |||
| 62f1a7410d | |||
| b407c58b96 | |||
| f978c99523 | |||
| bb5b5bb24d | |||
| 639fd80aa3 | |||
| c38eff62b4 | |||
| dba7186378 | |||
| d9d402916a | |||
| f49b26182b | |||
| 96b894e0e1 | |||
| f8502d45f9 | |||
| 049cd86ddd | |||
| 4884083019 | |||
| 00d7a19ec9 | |||
| 4546f40d8b | |||
| 315d0f581e | |||
| 953dddd26b | |||
| f399bdfa1a | |||
| 2320eef72d | |||
| 938bc4d503 | |||
| 95b84a0a9b | |||
| 4ee4479cd7 | |||
| a050285058 | |||
| 027aee8ad4 | |||
| 4453c157fc | |||
| 53cd921ab4 | |||
| cd00575257 | |||
| 6d2064b32f | |||
| 853e5dfcdf | |||
| 35e2ef8019 | |||
| 3a600db4ab | |||
| f5d8245801 | |||
| 011fd39091 | |||
| 3340c71a2a | |||
| c9bb92d58b | |||
| 99c94d3d83 | |||
| 8fc31ee9df | |||
| 40137b2e9e | |||
| c930f54063 | |||
| f0d3bbddff | |||
| a30c987f87 | |||
| adde942e34 | |||
| b1f67c83af | |||
| 0521a3a384 | |||
| e64c5dc4c6 | |||
| bee183f9bb | |||
| 9434c89ba0 | |||
| 3d9cb5329c | |||
| abbd878eb5 | |||
| 181850e808 | |||
| a61306f79a | |||
| 70b87804cf | |||
| c92815238e | |||
| d20727a5be | |||
| 3e6dcdc0a4 | |||
| fa5ed62a66 | |||
| 465e601e10 | |||
| dfc61fbfaa | |||
| 509c1afb8d | |||
| f1d33410fd | |||
| 283407e1ff | |||
| b6cc74f855 | |||
| baf07f9a03 | |||
| b6ec9b9d8c | |||
| 7892517b3d | |||
| 398611b7e8 | |||
| 70618cb7bf | |||
| bc12e4fe55 | |||
| eb736c272e | |||
| ea3164ac77 | |||
| ccc97b5c46 | |||
| 1cca4bef64 | |||
| 915e39cdf0 | |||
| 1017ea4f83 | |||
| 0735d7b328 | |||
| 6ae1709c6a | |||
| fb9f75c5ba | |||
| 3d1f6465da | |||
| 9a47e1764a | |||
| 14688e95ea | |||
| fdfe64e5f2 | |||
| 500fd453a1 | |||
| 2e37a697b9 | |||
| 42ab298f01 | |||
| 992c527c91 | |||
| 46743c1701 | |||
| 850be1e087 | |||
| 5498f419df | |||
| bf72e9d625 | |||
| 556f539531 | |||
| 9bbc890d96 | |||
| 3c1423c970 | |||
| 9814a514fa | |||
| 6ee71fee88 | |||
| b6b40a85e4 | |||
| b1b59c87b9 | |||
| d3dd2e463c | |||
| 06ff35c9af | |||
| 308f00f158 | |||
| 72a987ef5a | |||
| e5468a88e6 | |||
| 098efb6d3d | |||
| 8b577ab983 | |||
| b13514e33c | |||
| ac4b26a561 | |||
| 850ebec135 | |||
| 55923c8dc7 | |||
| 681ee0ef11 | |||
| d9933c5403 | |||
| b7348e1b65 | |||
| 0bf519dd05 | |||
| 1cfd5acb41 | |||
| 13c2320e38 | |||
| 2146bbb7bd | |||
| 2f0de10120 | |||
| ad079ea5da | |||
| dc0c59fdc6 | |||
| a2edf4d929 | |||
| f5ec92e4ca | |||
| 938951f4f0 | |||
| 22edfd2628 | |||
| 60d7dbb647 | |||
| 55d248941b | |||
| 463affcebf | |||
| b259342737 | |||
| b1441c9d6a | |||
| e70c8e5f0e | |||
| 7f0a094e4e | |||
| 903b66906e | |||
| d36b959dd1 | |||
| 1bf4f2386a | |||
| 7f3b6c177f | |||
| 70e55fd7c6 | |||
| 81656597e9 | |||
| 48e6be822c | |||
| c7ed293484 | |||
| 408730b7ab | |||
| 21d5a41e92 | |||
| 4cfbc5af08 | |||
| 3893936243 | |||
| ac649b2ffd | |||
| 1db23e0f12 | |||
| 9d454fed93 | |||
| e20250139a | |||
| 10c43e5642 | |||
| d97ed516a8 | |||
| 2b85894826 | |||
| 0812659e92 | |||
| 5df28f1eaa | |||
| 79797a3eb6 | |||
| 0a862b5295 | |||
| 7833c63388 | |||
| 34c406ea3a | |||
| 7b1a5fb3de | |||
| 75f619fe00 | |||
| 1ef8175c49 | |||
| 1c4f441507 | |||
| 06f62a3dd1 | |||
| 49463c4420 | |||
| f7d69085af | |||
| 5278560252 | |||
| 9bb0a8d9e9 | |||
| aa6b399b5a | |||
| 07da2c9d10 | |||
| 9517fcf80d | |||
| 88d3e7a7ba | |||
| e9f35610a5 | |||
| d296d29a1c | |||
| 332748dd55 | |||
| 848dd12a1f | |||
| 2830551e89 | |||
| 565bc3aeed | |||
| ce0516282a | |||
| 258b062295 | |||
| 2c1ec4245d | |||
| d05fb709f9 | |||
| fba3c947ef | |||
| 8bbf08f0de | |||
| a57ea2b775 | |||
| c19adb4953 | |||
| ad6f52dc54 | |||
| 16928806f9 | |||
| 23481b716b | |||
| b913e73d04 | |||
| a478757483 | |||
| 6c57ce9e09 | |||
| fad0dbb9ac | |||
| 8c10545d3c | |||
| 83d70b0f36 | |||
| 0e151e3c88 | |||
| 024dfd54af | |||
| ec97c38ff9 | |||
| 4a69877eaa | |||
| 5156222a92 | |||
| 4c7d77372e | |||
| 3f013e4cf5 | |||
| adc55608f1 | |||
| 7cd4fc2fb8 | |||
| 9c86d68b4c | |||
| 031846f2e1 | |||
| 9b97c97bd1 | |||
| 960a926055 | |||
| 53f2131681 | |||
| ceebfa1bee | |||
| 93ba5c9175 | |||
| 064fdba120 | |||
| 84590f96e5 | |||
| b3791dc4be | |||
| bc54f76875 | |||
| b7ec2ebb55 | |||
| 41c335e5a5 | |||
| b203c7c3e2 | |||
| 8df76fe0cb | |||
| 5b0ad6b5e8 | |||
| b1e0c4d119 | |||
| f85cf5d7f9 | |||
| 9d0c8a9edb | |||
| 81907af74c | |||
| fb352e3098 | |||
| 26f3514992 | |||
| 6079e22523 | |||
| 30549d65c2 | |||
| ee0822dc4d | |||
| 832f738db0 | |||
| ed52f7feea | |||
| e95c0055af | |||
| 6a65678592 | |||
| fa56623458 | |||
| fe4d518d85 | |||
| ea47cb3ffe | |||
| 451ee3991e | |||
| 7c9231ffba | |||
| 2e49bf311a | |||
| f530a24544 | |||
| abc4eeb9a7 | |||
| c91af16fa7 | |||
| e202116b56 | |||
| bd565df379 | |||
| a3ebc0ae7f | |||
| e9e6b1e22c | |||
| 617d7ff575 | |||
| 77a0ffc71d | |||
| 52c33f4af3 | |||
| 1911c63826 | |||
| cac1695099 | |||
| 38bc519e4a | |||
| a3b3a589f9 | |||
| 1fe0fc224c | |||
| 44c254c09d | |||
| 8b47361873 | |||
| 3429c27477 | |||
| 099e002667 | |||
| 3c9c964630 | |||
| c2f909fc86 | |||
| d142a796d8 | |||
| 996b6c37c7 | |||
| 1c0ca41b6e | |||
| b44cb33d2f | |||
| 1aa4621777 | |||
| fcdaaabf7c | |||
| c96f48e7c9 | |||
| a9664abb57 | |||
| 5bffcdf7e8 | |||
| f2ef81a179 | |||
| 6e4280ea81 | |||
| ba4d6c859d | |||
| 2f1d529a71 | |||
| 240b245105 | |||
| c6fa9931ed | |||
| 014e8485b5 | |||
| 7757759205 | |||
| 14b21f7271 | |||
| 2f63c58380 | |||
| 3ebcd94535 | |||
| ce2b9f83f7 | |||
| 331763a48b | |||
| a287605c3e | |||
| 0507043a55 | |||
| 58285e5468 | |||
| cd7cbe3d41 | |||
| b3d3acf75f | |||
| 5ddf3de4ce | |||
| 3859ac921a | |||
| 7e17f01b7b | |||
| a1028efdcf | |||
| 590f150d5e | |||
| 631f229827 | |||
| 8edf37903d | |||
| fd4af21350 | |||
| 5fb3869775 | |||
| 24fd39538e | |||
| 07bf9cb013 | |||
| 3dcaf1f287 | |||
| 2c92eb3175 | |||
| 33d64d0491 | |||
| 7b6d65cf20 | |||
| 62b5470b78 | |||
| 670c52f75e | |||
| 6bcf3d4311 | |||
| 3d0e2cc46c | |||
| d752bac43f | |||
| 1bccc14e05 | |||
| 9f74982a54 | |||
| 00ca8f455e | |||
| 4708d1aed7 | |||
| 9bd14d5417 | |||
| c497fe05a0 | |||
| 4e60392040 | |||
| e5b114e5b8 | |||
| 63819c1e1f | |||
| 2af5815d47 | |||
| f3c724d449 | |||
| 5caee5cc64 | |||
| fb0479da23 | |||
| 8a8c0d285e | |||
| c7ec0d599a | |||
| b8d4ac589d | |||
| 0433fe539c | |||
| 7fa0493ca0 | |||
| 7b399c4248 | |||
| 1baaac295a | |||
| 307324f4ac | |||
| 43036e0031 | |||
| 2b6d0f36f0 | |||
| bb171a0c05 | |||
| 9942757bab | |||
| f2962e5875 | |||
| aa143a3dd1 | |||
| 72e7672a6c | |||
| 3889dcf3f8 | |||
| 865e7cacca | |||
| 419060da84 | |||
| b51a78d439 | |||
| 6295f7d05b | |||
| 219a34261f | |||
| 224dac9427 | |||
| d78637102c | |||
| 60ae973142 | |||
| 799bb0cd18 | |||
| 8a96e34e33 | |||
| 70d7e83dca | |||
| 320c0bf419 | |||
| b870ad46bf | |||
| f617fbe166 | |||
| 8f2e6640e3 | |||
| e16ca08b33 | |||
| 9b5a719d80 | |||
| 157b0e7760 | |||
| 0a53afe8ba | |||
| 6bc369fc56 | |||
| 687fc11626 | |||
| 638c575c73 | |||
| d4cb564ce2 | |||
| 5e9191558d | |||
| 515f119a59 | |||
| 3880d059b3 | |||
| ec1c0608bc | |||
| fa81936a5b | |||
| c5edd20354 | |||
| 1e54e56579 | |||
| 347a1e2913 | |||
| 4790a3732e | |||
| eb20bb3b23 | |||
| 97614920ef | |||
| ae1d1b6d55 | |||
| 6694d87a23 | |||
| ee867ead1d | |||
| 62c0556c58 | |||
| 02525abd9f | |||
| c552e9eede | |||
| 5dc5b27858 | |||
| c319735d9b | |||
| 1a8d37d19e | |||
| 91cf0d1843 | |||
| 910db5c9b7 | |||
| e60825e75b | |||
| 5a042af7e3 | |||
| 0367a12b92 | |||
| 757d296382 | |||
| ceeb01dce5 | |||
| e5ff41ec9b | |||
| e8f94182f5 | |||
| 5c9f58e124 | |||
| d0de575aef | |||
| 1ebea1e0f0 | |||
| 5350fba319 | |||
| 8a415c881a | |||
| 674c618471 | |||
| f64738218a | |||
| 494d201fda | |||
| 91808e64a1 | |||
| 178fdbbda8 | |||
| 2c53e3f53d | |||
| af9be78ead | |||
| c9d70d46b1 | |||
| c4c2e2e796 | |||
| cca4ee2e46 | |||
| 21fb10c6a3 | |||
| 639836ebf0 | |||
| 6ae7caaa01 | |||
| f280e3cbd9 | |||
| 9eba360eab | |||
| 84f32bbb24 | |||
| c91c631ae2 | |||
| ca527040e2 | |||
| 114c23e411 | |||
| 748279d5f1 | |||
| e274e72869 | |||
| 4dd755443a | |||
| d19fc1264b | |||
| d3bccd7b23 | |||
| 72bb8bb73c | |||
| c53b3c5f84 | |||
| a308dfca98 | |||
| c20febdbb0 | |||
| 8a1b998b2b | |||
| 4b1a4bdb49 | |||
| 588ddf1b18 | |||
| 81cc89a3ce | |||
| bb43927077 | |||
| a0debc3a9a | |||
| ca0bd70cde | |||
| 613ff7c85d | |||
| d88ad46978 | |||
| bb7c35b99f | |||
| 2b87e78e18 | |||
| 6b3b8c59c3 | |||
| 70a58d7198 | |||
| 4761c28143 | |||
| f5a14532c2 | |||
| d792ebc5d2 | |||
| abda763073 | |||
| 8ad5eb521a | |||
| 8d1c73a912 | |||
| 16681d1080 | |||
| 8e52c0155b | |||
| ace781740c | |||
| ad7ecf1dba | |||
| fb34f36c69 | |||
| a301d1c298 | |||
| 27d718b223 | |||
| a300e7e945 | |||
| 358e3065ab | |||
| 747b7cab6c | |||
| 232c67bf76 | |||
| 5b41134ee7 | |||
| 0dd7769bb1 | |||
| 82de5b3a67 | |||
| 3421b950ce | |||
| 53dfd9536a | |||
| f834736307 | |||
| 4a12707103 | |||
| eccfd98b92 | |||
| 9b5b2540a4 | |||
| ba70ec99b3 | |||
| 7d59db4ec4 | |||
| afb406f1de | |||
| 87b7ce4415 | |||
| 2ff16d4c45 | |||
| 5466fd2606 | |||
| 4b8aeb1129 | |||
| 96f23e3da1 | |||
| e4ad7e3778 | |||
| 0245c0cd10 | |||
| 195aad8e6a | |||
| f46f7eff0c | |||
| e1d0f07c90 | |||
| 0883c6a913 | |||
| bea0c1b660 | |||
| 9fc83ac544 | |||
| e0e537d94e | |||
| ab8cb6f8a9 | |||
| 68968eda8d | |||
| 6791284994 | |||
| 08d457edcf | |||
| 0323761ea6 | |||
| 15815fb54d | |||
| 677a28fd2a | |||
| ab6bffc6f8 | |||
| 5fc2564c92 | |||
| 0c5d74ec1a | |||
| 5c090b9eec | |||
| e59b8cd905 | |||
| 95b2820214 | |||
| 91749a284b | |||
| 94de7e5d21 | |||
| dad72fd47b | |||
| a817813b50 | |||
| a25e809da1 | |||
| 46841df978 | |||
| be29c99d5a | |||
| b22c2505a8 | |||
| e5e1a3bfde | |||
| a5ba18c20e | |||
| c9a4775d49 | |||
| 12acf5603a | |||
| 0bcd66d553 | |||
| d69c1d8652 | |||
| d4af868528 | |||
| 2fc7d21971 | |||
| ec7689421d | |||
| d96ff496b4 | |||
| e3cb5f80e7 | |||
| 09d2f4ea46 | |||
| 5261961a6e | |||
| 3cce299a78 | |||
| e41ba90f17 | |||
| 423ab8ddb8 | |||
| 20784d3da2 | |||
| 1794cdc03c | |||
| c792233d9c | |||
| 4c568e6ed3 | |||
| 9519e67ad2 | |||
| b0cbd6ef77 | |||
| 23f27d8dbe | |||
| 0519e05432 | |||
| 81f07f001e | |||
| 55906457e6 | |||
| 1f82550cc8 | |||
| e00c904585 | |||
| 1920993525 | |||
| 1f7025f028 | |||
| 4ee0f212cc | |||
| 7819ec784b | |||
| 52d9685cb9 | |||
| 3aeaa34023 | |||
| c12e1ecb86 | |||
| 0fef0f2ae0 | |||
| bd2695f01b | |||
| d60107ab7a | |||
| fdfb875208 | |||
| 85f0074f23 | |||
| 0f17851562 | |||
| 53af876999 | |||
| 9c4c3eadf7 | |||
| 0f665b3f15 | |||
| 3f0707234f | |||
| cd9f85dbda | |||
| 99058ee30b | |||
| 7b4b7ceb7e | |||
| 48c52c8bbb | |||
| 40727c8369 | |||
| e3c1405254 | |||
| 37aa823112 | |||
| ef9d14f181 | |||
| 87f8cdd699 | |||
| a00818047f | |||
| 6af4a02941 | |||
| 6ff5245cf2 | |||
| 2af6775c14 | |||
| f89b705049 | |||
| bb61cc0dba | |||
| 953de60ff0 | |||
| 986e379f28 | |||
| de8e6abd1e | |||
| a6df336477 | |||
| 8097bdc2f4 | |||
| fdc0c12b7f | |||
| 05becd56e5 | |||
| d2951d6d4c | |||
| 09944a83d9 | |||
| e43bc88fc3 | |||
| cb2e831da4 | |||
| 601a159f25 | |||
| 8931f08362 | |||
| 2d92f42878 | |||
| 10294a84fa | |||
| b8e3bc9dd8 | |||
| 32251c9b04 | |||
| 9f87475129 | |||
| 71796edf95 | |||
| 8839bd572e | |||
| c9d8b541fc | |||
| 356e5d3028 | |||
| a58214f015 | |||
| 67faf1610e | |||
| 377be68d92 | |||
| aea44efaa6 | |||
| 0661aff4a5 | |||
| e9414169a3 | |||
| 64be9c8bf6 | |||
| 50fc68b981 | |||
| 1d9c0d3e12 | |||
| d25d44156b | |||
| bca5868817 | |||
| 7f6c95f2d7 | |||
| 131dab774c | |||
| f9a59f2592 | |||
| b8b8c7c9e5 | |||
| d17507052e | |||
| 49ee4d4ade | |||
| 1eb1d4c370 | |||
| c982be3924 | |||
| 85ea247cc6 | |||
| bf06bc92aa | |||
| aff420329c | |||
| 21d79abb1f | |||
| d9a5603fa3 | |||
| ee97dd5211 | |||
| 29388f80a5 | |||
| e7501b69ea | |||
| c0fda696f3 | |||
| d4f81c6d24 | |||
| 3b264d5877 | |||
| 0866a135c6 | |||
| 2849a774e3 | |||
| affc69bf1f | |||
| 22b747eae2 | |||
| 426b088754 | |||
| 60848519b5 | |||
| 61d48dd0f8 | |||
| eba8450995 | |||
| 1656e7573e | |||
| b7947d861c | |||
| 1db1422fbd | |||
| fc810434de | |||
| fe93724d3f | |||
| 65b957a5b3 | |||
| 9eaa7bd566 | |||
| 94211fb8b0 | |||
| f20edba925 | |||
| fe4f5b539e | |||
| 4e31bc5cf5 | |||
| 06b40aef91 | |||
| c97c22b7cf | |||
| 51702ffd92 | |||
| 805946baaf | |||
| 726ba0210e | |||
| 71790e12ad | |||
| 0cf45b89ec | |||
| 004801f1c5 | |||
| ddcbd2cc26 | |||
| d6d15c136a | |||
| f2f00259da | |||
| a4a739b99e | |||
| c0d4e16833 | |||
| 94703fc5b0 | |||
| 496474392e | |||
| 433c364456 | |||
| ec95efca10 | |||
| 003d048b0d | |||
| b6d1402361 | |||
| 67fd2d02ef | |||
| 1eaa074a49 | |||
| 024c836462 | |||
| 44881592c3 | |||
| 3c0b71bcec | |||
| a9d547dfee | |||
| 69ebecc54f | |||
| 8762c37c22 | |||
| a3b6a5b606 | |||
| e625b32841 | |||
| 924c01dbec | |||
| 0d7c039ea1 | |||
| 291689a178 | |||
| 1acbeb217b | |||
| 2b3424b536 | |||
| 538b13aeec | |||
| 0dde3b65d5 | |||
| 463cd09811 | |||
| 5859a531e5 | |||
| 8e8638431d | |||
| fc2d933224 | |||
| 52f46589a0 | |||
| 6909fffde1 | |||
| 19f4f2eb92 | |||
| b854d4ecd8 | |||
| b522148bd9 | |||
| 170cc0360b | |||
| a371bdac9d | |||
| 3af6001a75 | |||
| 134d0b74d3 | |||
| 3f4ec3596e | |||
| 843daca26e | |||
| f9d7f47e28 | |||
| e60a7c0d49 | |||
| e9c18c76c7 | |||
| 37459f89c9 | |||
| 4622f1e89b | |||
| dc37883702 | |||
| 6ca697bc12 | |||
| 57da72d444 | |||
| fe14e7ab24 | |||
| 61488885b5 | |||
| 472aad46a6 | |||
| 0c8e6e0e68 | |||
| 60b806f9b8 | |||
| e1ce2146f5 | |||
| eec8a20c33 | |||
| 5d913f4d72 | |||
| b729d8e821 | |||
| 6d2cbc4055 | |||
| 6d0add4285 | |||
| f597838685 | |||
| af95395fe7 | |||
| 5f8e43da85 | |||
| 6b53fe8f7b | |||
| d3e7968927 | |||
| b9ce87e8e2 | |||
| af03e000c7 | |||
| 635bbfe92b | |||
| adab462e42 | |||
| b5ac7ef2f2 | |||
| 983925c685 | |||
| 84457a5dcd | |||
| 385003e9fe | |||
| 9fa014edcd | |||
| 5330112f05 | |||
| 66f86e898c | |||
| 36d6ca529d | |||
| 2104d61d4a | |||
| fe7c5e3f64 | |||
| 0787c31f41 | |||
| 2f805ff7ad | |||
| 6d3dd24622 | |||
| fc5d412ba7 | |||
| 93d490213f | |||
| c55aee1e79 | |||
| 0442c6fa81 | |||
| 1457320702 | |||
| ecd2e8ff47 | |||
| 02397ef851 | |||
| f1076541d1 | |||
| b5e9eb742c | |||
| 6ad77b2319 | |||
| 67e0ed93a9 | |||
| 1bffe170e1 | |||
| 7b998c30e7 | |||
| 2083fdc9c0 | |||
| d1b158b9dd | |||
| 380caa1a87 | |||
| 900f17d563 | |||
| c97942cf78 | |||
| 6157db6462 | |||
| a9424868a1 | |||
| 749935866d | |||
| cbda161c39 | |||
| a63636171e | |||
| cf0ba039c3 | |||
| c75d0b8ca3 | |||
| a2b679bc26 | |||
| 45dcd156b7 | |||
| e6282b8ace | |||
| 87331ca1a0 | |||
| 65487946cc | |||
| 4823285b55 | |||
| 26a7b332cb | |||
| f07b01cc34 | |||
| bbda6f4c57 | |||
| 29b2f77b5f | |||
| 537060d96f | |||
| dbd1811d53 | |||
| 4384e77bd1 | |||
| dc714c1181 | |||
| d4861bfd1f | |||
| c07145fe28 | |||
| e09684647a | |||
| 98d678c2d2 | |||
| 4a559bc2ab | |||
| 044a322519 | |||
| e3c5c0906b | |||
| 2e9eb05751 | |||
| b122a4b436 | |||
| d00a96315e | |||
| 04970490ec | |||
| 9976074271 | |||
| 7539abecdb | |||
| d79a6eddf2 | |||
| 3f3c821800 | |||
| 97c021b17a | |||
| c946285a07 | |||
| c92135bdd1 | |||
| 9931da772d | |||
| f2311d1bfd | |||
| 5025f29378 | |||
| 435ccfdd51 | |||
| af14780526 | |||
| 2b9d2c726a | |||
| d847f4f0fd | |||
| 340e999c45 | |||
| d2143bcd44 | |||
| 53b678d5cf | |||
| d2618bfe11 | |||
| ae8c90301f | |||
| 4eec739624 | |||
| eefee8574a | |||
| be84824530 | |||
| 5229312ad2 | |||
| 99ef35a353 | |||
| 05084aa63e | |||
| 001a2c5195 | |||
| bcb49d71b4 | |||
| 59ca444b26 | |||
| 04d71da6e7 | |||
| fa5c5f4105 | |||
| 91b6c8507a | |||
| 4e27fc93f8 | |||
| 0800574c12 | |||
| 2c4079fa4b | |||
| fc43e51331 | |||
| a8d3d1f6f9 | |||
| 46991bcd62 | |||
| 85b04f0b4d | |||
| 233478e689 | |||
| 676afdc494 | |||
| 8baabdfb57 | |||
| e5e4424f11 | |||
| a44a6f6c87 | |||
| 85cc4086c8 | |||
| 97d7a4a86e | |||
| 4ed07411c3 | |||
| d6dc91b4d4 | |||
| f7bee7883b | |||
| f7e52076b6 | |||
| 88bb007d2b | |||
| ee9449c504 | |||
| 25c28c5da4 | |||
| 0513741a85 | |||
| 351589e5fb | |||
| dabf960b32 | |||
| a2be9e9fc1 | |||
| 6160104fd7 | |||
| e55784a1e8 | |||
| 868787c364 | |||
| 27e10efa66 | |||
| 3c76b33532 | |||
| 685a47b2e2 | |||
| 658f18c713 | |||
| 8be93a6de7 | |||
| 6dd8a9b6ad | |||
| 23b819efb8 | |||
| 9161e40aa0 | |||
| 5ccb4e0487 | |||
| 6dbc5e032f | |||
| af1c63c0a0 | |||
| 4ba06c3ed0 | |||
| 46e2b67ecb | |||
| 58e4a880a2 | |||
| df99e4e88d | |||
| a174a6c0b5 | |||
| d4f29a6361 | |||
| 3b1ee0549b | |||
| 871f931e95 | |||
| e3e1f704a4 | |||
| d19a05734e | |||
| 38e35d5137 | |||
| aa57833ad5 | |||
| e4e774d42b | |||
| 89c5a7584a | |||
| a4a9f56c8b | |||
| e4360294c5 | |||
| 1d02146810 | |||
| 9ab0ff6cf2 | |||
| 601778e0e6 | |||
| 810096c276 | |||
| e4a29d93fe | |||
| 54e1a8709d | |||
| 4c06a721ef | |||
| 3113b49159 | |||
| 3c1fcd5deb | |||
| b3a2444bcf | |||
| 277d64af88 | |||
| 7bd9dae53d | |||
| a33b2bed52 | |||
| b0eddeba2d | |||
| cfa5a270d3 | |||
| a7c6fedebd | |||
| b68aa12572 | |||
| 47bea69322 | |||
| aa2fabcba5 | |||
| 8512deb3cc | |||
| 7867da47cf | |||
| a788cc526b | |||
| aa17f881b1 | |||
| 4f99e5ab37 | |||
| 88cacd35c5 | |||
| 61d255887c | |||
| f1dbc7d724 | |||
| 24387c25db | |||
| 1a5820aa01 | |||
| 097891e311 | |||
| 1af084cb65 | |||
| 136121f6ee | |||
| ebde9a5e6d | |||
| 66abbf4122 | |||
| 0f984ea0f0 | |||
| 3f02c9d5b9 | |||
| 4f77434da1 | |||
| 51281f8d69 | |||
| d2dbaa4cd1 | |||
| 88a7e8cdf5 | |||
| f9ce3f4b91 | |||
| daf9de7463 | |||
| 8a95f4f0e6 | |||
| d30830d0a6 | |||
| f5a92cb43f | |||
| 3bcc3e70f1 | |||
| fd8b346c3e | |||
| 4c2584d729 | |||
| 72c715ff4f | |||
| ce01123db2 | |||
| 3a83a35ab0 | |||
| 8336a96cb9 | |||
| 9742c73254 | |||
| 793c966c40 | |||
| dafd9e3408 | |||
| b12c14514a | |||
| b4e3359448 | |||
| bac7180e02 | |||
| 2b32eee3f4 | |||
| 51f5ee6f19 | |||
| 66a5ecb7ec | |||
| 4e050e85ad | |||
| b34fc422a2 | |||
| 3871984028 | |||
| 3ac06bf063 | |||
| 20eee64426 | |||
| 85a04185d3 | |||
| 57460b1e30 | |||
| d8c80ff5a4 | |||
| 26ca124150 | |||
| 6d93a0e42c | |||
| 3f7d319fff | |||
| 3cf367c9c4 | |||
| c643af0b85 | |||
| 5e1d33329b | |||
| 9cfced4650 | |||
| a809ae4e88 | |||
| 1c6c3dfa8d | |||
| 83a49b4f6a | |||
| 352f92e437 | |||
| f5fd3e7d65 | |||
| ee302b063f | |||
| d7dd014a6e | |||
| b56a52c49b | |||
| 0bb84096a2 | |||
| 36a03dbdbf | |||
| 02bdc10062 | |||
| d3cc507380 | |||
| 1af790ecc3 | |||
| 8c64adb000 | |||
| 6ffe686ba8 | |||
| a94cd6d6e8 | |||
| ea7efd57d8 | |||
| c9e42c5050 | |||
| 6033599c88 | |||
| a924bbfc30 | |||
| 0d2f21b51e | |||
| 5c5ef9746c | |||
| 42793e16dd | |||
| a4ff46aab7 | |||
| e6bd4c9f85 | |||
| 0d082ce6fd | |||
| 5df6b4a756 | |||
| 8483f2ef2f | |||
| a60408cda5 | |||
| 68926d595c | |||
| da3a4dcbc1 | |||
| abfa5c586a | |||
| a1b4aa5e88 | |||
| c4226f0457 | |||
| aef1fc087d | |||
| 752ac19a2f | |||
| a2e04718ec | |||
| 94b3bad3c9 | |||
| 2e927c2dbd | |||
| 69fd82fc46 | |||
| 68e2df56e7 | |||
| 86fa0308fc | |||
| 0d455e05c1 | |||
| 924a65413a | |||
| 6bac5453d1 | |||
| ccbc784195 | |||
| 56a4877e30 | |||
| b204c39815 | |||
| bb917c8391 | |||
| 386be97ce2 | |||
| 7d032de7e8 | |||
| de2f7666fb | |||
| 95f087cd0b | |||
| 22a52766dc | |||
| b94e13c8ae | |||
| ee3740af00 | |||
| 9f2182abbb | |||
| 6c763e1ea5 | |||
| e03e2e7f94 | |||
| c6e5f60525 | |||
| 29cc675375 | |||
| 7ea6b356c7 | |||
| 8ad8ec679f | |||
| 0052d46b8e | |||
| a035608100 | |||
| fe59a5695f | |||
| a5f04f9e17 | |||
| b3c9842a98 | |||
| 9eb5e39ff3 | |||
| 5a227352b4 | |||
| bdff0949bb | |||
| 4262127854 | |||
| ca48e217f1 | |||
| f48939c2d7 | |||
| 39e2ebbde4 | |||
| 903ec0ec60 | |||
| 20dac7ea48 | |||
| 642942a72f | |||
| 923dbcc58f | |||
| 2ab7b7c09e | |||
| 6b5be4f1a7 | |||
| 6c235c8edb | |||
| a87b9fb4b6 | |||
| 58d8a2702a | |||
| f1f14ce403 | |||
| 76350cd30f | |||
| 47293f28cf | |||
| 325fe7e663 | |||
| 56102737d7 | |||
| c2b7c1f13b | |||
| c8f5e228fc | |||
| d3c6b85638 | |||
| 96a45e842e | |||
| c280cd7290 | |||
| 44290af516 | |||
| 649841e6bf | |||
| 606c80344a | |||
| 6ea22535e2 | |||
| e4acd74e87 | |||
| b07031b594 | |||
| 0981814473 | |||
| 3d635cb4a7 | |||
| b0aace31ec | |||
| 9eb78eeb18 | |||
| 6dfa647f05 | |||
| f8f425e34c | |||
| 206a3fcea8 | |||
| c855dcc52f | |||
| cb2052dbfe | |||
| 400572b19f | |||
| a6b178a3d9 | |||
| 4718a4bf81 | |||
| 9efaa3cce7 | |||
| ff8af10cfe | |||
| cd44aa0bb1 | |||
| d3ae175bca | |||
| deaf632881 | |||
| c67d4fc633 | |||
| f45a12439a | |||
| bd9d60c4c6 | |||
| 4d918ba40b | |||
| bf29a4d746 | |||
| 743d4ecf7b | |||
| 52855a39ad | |||
| cb7fe597a5 | |||
| 8ffc06ff72 | |||
| 186c18668c | |||
| 4009bca59a | |||
| 18cbfa4a4f | |||
| b71a168937 | |||
| 35c17f35be | |||
| 3085fc6345 | |||
| 17e860a288 | |||
| e200b88a5a | |||
| 1833b034fe | |||
| 69020666fe | |||
| 53144ee0eb | |||
| 952962a111 | |||
| c664cf3717 | |||
| dbdd357b0a | |||
| f3a03aefad | |||
| c1e5c16ff3 | |||
| c63d79c5b1 | |||
| a9d02f096e | |||
| 6a7d54f550 | |||
| 3d5e3a910f | |||
| ef0fcb9238 | |||
| b5bf756ca0 | |||
| ad8f8b0c8c | |||
| 840b1d5c94 | |||
| 974102bc7f | |||
| 5bacd8753b | |||
| cbc9745b79 | |||
| 65c2d6a2be | |||
| b16a4ba25b | |||
| 927aa1e617 | |||
| fdf2151d9f | |||
| e0aa677388 | |||
| 2ab46d9553 | |||
| 36815fe3f3 | |||
| a64b51dd94 | |||
| 55534eeb06 | |||
| b5a0d2b580 | |||
| 82616eec41 | |||
| 7e52003533 | |||
| 7b7774476e | |||
| 4df6e39bab | |||
| 54449b614b | |||
| a2fc479c0b | |||
| 9208dcb07c | |||
| 725e440d27 | |||
| 121034876d | |||
| 9627ab9462 | |||
| 499035c6ea | |||
| 71765858dc | |||
| 9a2a34f94e | |||
| 838c34eee1 | |||
| 253429d3f1 | |||
| 38f7cd7173 | |||
| eab7faf536 | |||
| 83391ac59d | |||
| a8a93a57e7 | |||
| f637629c5a | |||
| 93aa94e71e | |||
| 86b46a27cf | |||
| 1bc3077890 | |||
| fc27a343e9 | |||
| 692d6168b3 | |||
| de9787a6ac | |||
| d2bf2be8e6 | |||
| b7292bc899 | |||
| dbd4a0e5e6 | |||
| b361209d52 | |||
| 4abe6dc48d | |||
| 26f36f2ff9 | |||
| b42c11de82 | |||
| a494c75bfe | |||
| bc8c912c7a | |||
| 5247237bf0 | |||
| 8e6aae0d7a | |||
| 8681686d8f | |||
| 9012e6dd9b | |||
| 139bd30247 | |||
| 4930516652 | |||
| ad568edd7f | |||
| 62b3a20da5 | |||
| 1f41d06f9a | |||
| 1339c7f30c | |||
| 734fb18c4d | |||
| 71c6339af0 | |||
| 34a0897f90 | |||
| a32100d9ba | |||
| b5400902a7 | |||
| d35fbe6bfc | |||
| 645930387c | |||
| 44dfe62af0 | |||
| 4acb267cf4 | |||
| 8676d19dc3 | |||
| 6b4f3e5fab | |||
| dafc4e456d | |||
| 2a884cc179 | |||
| b774753922 | |||
| 5e03305da5 | |||
| 3ff1ec99ac | |||
| bc8d494617 | |||
| 35e771daab | |||
| 1ab259df9a | |||
| 0bd54a60e9 | |||
| 63b6b24cd0 | |||
| 8e49560709 | |||
| b8f57c9a96 | |||
| c6a15e1835 | |||
| 05f4416ba0 | |||
| 91ac790249 | |||
| 3cfe737581 | |||
| a2b3acfc6e | |||
| f4b23de9dd | |||
| a08c98cdfb | |||
| 279e2be56b | |||
| cdbb893b27 | |||
| 41d172f22d | |||
| 3f7ec99166 | |||
| 1102b7eff8 | |||
| da43778c1f | |||
| 9aa5ab7557 | |||
| d44c58a1fb | |||
| 7463e9b8bb | |||
| 9f201a8ebe | |||
| 91998d6424 | |||
| 420db56ffd | |||
| 07ed5e5346 | |||
| 4824ce300f | |||
| 5855eba9f3 | |||
| cdaf4c7321 | |||
| eace6adb6d | |||
| 6db9fcbc30 | |||
| b4b35cff15 | |||
| 47fb79bd8c | |||
| 6b50410336 | |||
| 6e3700593f | |||
| 6a8c5a1d27 | |||
| 50da209dc4 | |||
| b7b08fa0c3 | |||
| b1288dad40 | |||
| ac6fb17784 | |||
| 3f22f4727c | |||
| 0153e796cc | |||
| 4891818114 | |||
| db4a557187 | |||
| 04c3a534af | |||
| a32143003d | |||
| 8bd17163c7 | |||
| 81aaca8c04 | |||
| 189e1b228d | |||
| 52709c7771 | |||
| 7dbb125a34 | |||
| aff375808d | |||
| 3f5f09e730 | |||
| 332ff4bf1c | |||
| 253a4c113e | |||
| 1788c93aea | |||
| c2ecbc76ce | |||
| 4203c903f8 | |||
| 727feda935 | |||
| 39087fecdc | |||
| c725771e11 | |||
| 103212f209 | |||
| be326ff752 | |||
| ebaee3ea21 | |||
| 423bc515e5 | |||
| 941d89e06d | |||
| 281b790618 | |||
| f5d7c5f103 | |||
| 93c4bca04d | |||
| 726f0adde3 | |||
| 24d7eb0ca5 | |||
| 8ba44e7d55 | |||
| 49f539cb46 | |||
| 0a650b573b | |||
| 7e3c53b9d3 | |||
| ab912329b6 | |||
| 6ad216576d | |||
| c5a4df30c6 | |||
| cb8f1dca3b | |||
| d1ff87d94d | |||
| b16f76eede | |||
| 4792837f2e | |||
| 416830fb59 | |||
| 07b1bc2e88 | |||
| d16b3b2487 | |||
| 74d0b4cc78 | |||
| 8832a9dbd5 | |||
| c55613ccf7 | |||
| 6c399aa62a | |||
| 5862b50217 | |||
| 5696629b13 | |||
| 3a15152be5 | |||
| f1055a7e91 | |||
| d4dc6b509b | |||
| 1192779d05 | |||
| 2eb7bf4cfa | |||
| 71a1150c95 | |||
| e14ca39fd7 | |||
| 421ba8730a | |||
| 0d56524b72 | |||
| 9fded9ca53 | |||
| 441624a5fb | |||
| 25ac77e010 | |||
| 77d887898d | |||
| a32f2cd24a | |||
| eb68de9268 | |||
| ed3810f7a5 | |||
| 1c3e287d32 | |||
| 5044af69d1 | |||
| bc6544c0bc | |||
| a462f49b99 | |||
| 7622fbf895 | |||
| 3f371fe2dd | |||
| 6ca205a029 | |||
| aba2167d9c | |||
| 5db4f1f7df | |||
| a0a8d2160d | |||
| 2a5da50902 | |||
| 51758b2dd6 | |||
| 90b144cf0a | |||
| 529bd0425e | |||
| 6c36cd5d6e | |||
| c102720af4 | |||
| c63a6c472d | |||
| 5b3f721efa | |||
| e5bea2bde4 | |||
| e9d64e0a8c | |||
| f0df78b7e7 | |||
| e93d976d00 | |||
| 64aad34cb4 | |||
| 7592d58f0c | |||
| 08906ddd4b | |||
| d21761c0fd | |||
| 277ead95d9 | |||
| 5d14cc68b7 | |||
| ce80e0dc57 | |||
| 4c74e6d89d | |||
| 45d04175d4 | |||
| 687c9b7b29 | |||
| d9f66413ee | |||
| 1b1bbe4262 | |||
| 3edf7c25d4 | |||
| 54531f8e3b | |||
| b5a68f235a | |||
| 5bf64e7dfe | |||
| 51b897b672 | |||
| da4ac6b7ef | |||
| 1ba0984203 | |||
| f5e852cdf0 | |||
| ef2677b0a6 | |||
| 2aad039b4f | |||
| 8a90948a1c | |||
| 63bff33e85 | |||
| 21133a2091 | |||
| 39f995e319 | |||
| 91624e87ab | |||
| 11d492b0b9 | |||
| 17f2b56291 | |||
| d1d8ac57f3 | |||
| b418eb112c | |||
| ee9137f176 | |||
| 903bf0147e | |||
| 540aa13300 | |||
| bbbf1168dc | |||
| 18fbb72f7d | |||
| 0b5fd4f6bb | |||
| 87360c2ae5 | |||
| 17b98dd005 | |||
| 1293e99ad8 | |||
| 028d4d83d3 | |||
| be670e168a | |||
| b619477be9 | |||
| 778faddbd8 | |||
| f644634aa6 | |||
| 547f4c2c5a | |||
| 5462a6be6e | |||
| a60496f9df | |||
| acd8d3a617 | |||
| 0c92305a4b | |||
| 1ecfff0fa0 | |||
| d933034ad4 | |||
| a6fadfe1c2 | |||
| aae317c017 | |||
| 37683aca56 | |||
| 22f8fb4d5c | |||
| 7d1589d407 | |||
| b35018d955 | |||
| c29a3aa0a0 | |||
| eae5fd81e5 | |||
| 23edec83fb | |||
| e4cd430710 | |||
| 35b2cff295 | |||
| 8e5f37f87c | |||
| cee8c86b6e | |||
| c0a84dcc85 | |||
| e80b443cd9 | |||
| e309a06b47 | |||
| 86dad3aebe | |||
| 5a9fe9dedb | |||
| c7d24c0fb3 | |||
| 5d292826b2 | |||
| f378f02954 | |||
| c8561eae2d | |||
| ba575fd4ad | |||
| dd14cf6a9c | |||
| 2c81cb2f76 | |||
| 6eb34716b8 | |||
| 871bc98933 | |||
| ec7fc5adca | |||
| c0c3f4cbac | |||
| 02143cd0e2 | |||
| 1c5dcbcac8 | |||
| d24d8f2abe | |||
| 584ea43b2f | |||
| 292f62c5cc | |||
| 762481411d | |||
| d816442e4d | |||
| ea5ca16036 | |||
| 2991717191 | |||
| 0fa43e3aac | |||
| 085fb78e85 | |||
| a565aa6db9 | |||
| 2763f988da | |||
| 82ac7ea236 | |||
| f89dee4f3e | |||
| 70779d4e66 | |||
| c0ecf08ca0 | |||
| 35f43cc429 | |||
| cfafd0493c | |||
| 9119692bb8 | |||
| 8b0aa6a64d | |||
| ec26541771 | |||
| 1c825dd509 | |||
| d9eff7daeb | |||
| 3419e64dcf | |||
| 1e2ceca4df | |||
| 347246901e | |||
| 68bd156a71 | |||
| 9821fae59d | |||
| 43b2bb2c25 | |||
| a3ebafbdeb | |||
| 5cd07006f6 | |||
| 3d350a002e | |||
| f18b8cd569 | |||
| 5389d9e0d4 | |||
| 07c795408d | |||
| 5f50e7bafe | |||
| e92716a1b6 | |||
| bbcc1752b1 | |||
| 40ae06091d | |||
| d480e2e51b | |||
| 839321642e | |||
| 9f88a65873 | |||
| b77330bafc | |||
| 4a4b2a0ce6 | |||
| 0ae126d3b8 | |||
| af9332dfaf | |||
| 4103567776 | |||
| 8f0edf6a1c | |||
| ab5279f4ad | |||
| 1113c9ab10 | |||
| bf5d7c0c10 | |||
| fef8d4c990 | |||
| 5a0c85b3ef | |||
| 9fd877acc9 | |||
| ed3b56d763 | |||
| 2f79b1b087 | |||
| 7208f63221 | |||
| 572d4f4491 | |||
| 0cd4396180 | |||
| aafb7567c1 | |||
| 468431cd8f | |||
| cf5db9b94f | |||
| 589b6c15f0 | |||
| 2af0813634 | |||
| 15d2a5faf8 | |||
| b1d28d5b4a | |||
| a6fbd8287c | |||
| b0b77b3047 | |||
| 96844b0ca5 | |||
| 7fc6146973 | |||
| 6cf0910842 | |||
| 692c536ac5 | |||
| 1646a21197 | |||
| 4557971481 | |||
| 8baf46c0a8 | |||
| 0c0083ba72 | |||
| d18362c726 | |||
| b403d37267 | |||
| 2d189e24ee | |||
| c8c29b0f1a | |||
| 784dd55d88 | |||
| adb916ce82 | |||
| 15cfafb360 | |||
| d43cb4fe7c | |||
| 38c9c20a35 | |||
| 935acc500f | |||
| c189f31f23 | |||
| cbf43a54fb | |||
| 2918071a3e | |||
| 1829eba584 | |||
| 3a64607d94 | |||
| 64649a1207 | |||
| 4dfbbabf8b | |||
| 72f1ce6550 | |||
| c34c4b50d0 | |||
| 4521d66103 | |||
| 0c238c9e72 | |||
| 3d9f27b877 | |||
| 50e66a2e53 | |||
| a682f02f59 | |||
| df24bd295d | |||
| 04ebedb6f0 | |||
| 71ae1cac5f | |||
| e0b21dccf1 | |||
| bfeeb0ad70 | |||
| 2273af0166 | |||
| 604192337f | |||
| ccfc34b13f | |||
| 3f4abcb228 | |||
| f2ccce23f3 | |||
| 7d96ef2671 | |||
| 2882725927 | |||
| 062cee2933 | |||
| fcf9f117b0 | |||
| 0f1cb5ad7c | |||
| 0ab4872032 | |||
| a6274647a4 | |||
| 65f71ce2eb | |||
| 6aefb8e86f | |||
| 4aef9b1c93 | |||
| 0ac67ee8d9 | |||
| 66b3155a48 | |||
| b3adffe437 | |||
| ec92f3fefa | |||
| fb85a83108 | |||
| 41ef2bfb16 | |||
| 1ae801554d | |||
| 65998d8076 | |||
| 45a7b71cac | |||
| e1e9261450 | |||
| 819e5b19b3 | |||
| a3cb2020bc | |||
| a6017ac550 | |||
| 7faeb82585 | |||
| 48e50a7674 | |||
| dc9d775f88 | |||
| 66cbb7b911 | |||
| 9ca3a3139a | |||
| 6fb465cb4e | |||
| 8ae03fcd6e | |||
| 122250b554 | |||
| eb8883160d | |||
| 8af4fe9ed3 | |||
| adb5971494 | |||
| 377fdf5ae5 | |||
| e1272d73fe | |||
| e3e61078a5 | |||
| 13823f117b | |||
| 2e15582799 | |||
| 65bdb3a544 | |||
| ac91c45b0f | |||
| 6481cfd048 | |||
| 0f6b01a531 | |||
| 364b3f181d | |||
| 04849f26b2 | |||
| 26a7647e0e | |||
| 8eb036fb3c | |||
| fce8349c99 | |||
| 5ea912e778 | |||
| c2c8da2517 | |||
| 1be40554af | |||
| d717de5719 | |||
| bcc19a622d | |||
| fb3fc5322c | |||
| 2eff70fbf4 | |||
| d885242b61 | |||
| 46d988e2cb | |||
| 7a5122121b | |||
| 7fc14504b1 | |||
| cb1a1e9a51 | |||
| 619e038de9 | |||
| 4154bd0667 | |||
| 5408949951 | |||
| 866191478f | |||
| c9060b053d | |||
| 9dc844a6e1 | |||
| e2a9cff3dc | |||
| c3b83b8354 | |||
| e24382691f | |||
| 9074b3e980 | |||
| 65d66a05dd | |||
| 7de7891c4d | |||
| 4bec43cf79 | |||
| 6cc0107693 | |||
| ca7f964104 | |||
| b26fc6f31b | |||
| 5fa624f35e | |||
| 7955469f7c | |||
| ce62fc8371 | |||
| 2e40b7f113 | |||
| 2ac62bccec | |||
| 22eb91a7e0 | |||
| 448e3a7e58 | |||
| bf54a370e5 | |||
| 337452b4c0 | |||
| 5bb098ba5d | |||
| 4159842195 | |||
| b69b1eae8f | |||
| c4a6e1fd4d | |||
| 3456d28cc2 | |||
| f376bfe95d | |||
| a72074b33f | |||
| 5185544864 | |||
| 7834a465d5 | |||
| 1f0bfc8d83 | |||
| a122f0f248 | |||
| a31fb88fd0 | |||
| 70fb1cd603 | |||
| d2c48b898c | |||
| 2d837efba7 | |||
| 1852d0b9b8 | |||
| 837e41f9a7 | |||
| 1fd45a1b85 | |||
| 2cd7e17b65 | |||
| 8eb4f72531 | |||
| 2619099fe5 | |||
| 2959286eb5 | |||
| a4b191a7e0 | |||
| 3929e26276 | |||
| a1d5565e65 | |||
| 9638e34ab0 | |||
| ed9d4c0b2b | |||
| bb64db98d8 | |||
| 88115811a9 | |||
| 67fa8a2f47 | |||
| 560eba91e5 | |||
| 42561e1233 | |||
| 7e2c8cc9f4 | |||
| eea05f5078 | |||
| 7eaec9dd22 | |||
| e1305e8d05 | |||
| 2dd3408caa | |||
| 3651831e7e | |||
| a1d752bfc0 | |||
| d10832074e | |||
| a001ab3a44 | |||
| ef570e4e13 | |||
| 7831aae5dd | |||
| 1336da9450 | |||
| 6432f02996 | |||
| 1fb8d60fd2 | |||
| 5e92bf8e41 | |||
| 7e5d012f75 | |||
| 925ff6241f | |||
| e14c3cff85 | |||
| 984e42b0bc | |||
| 0702685e7e | |||
| 7deb8f568f | |||
| d8434e6875 | |||
| b9a1039566 | |||
| 03130548ea | |||
| 11c5a6bb4d | |||
| 8dc332721f | |||
| 189f647264 | |||
| 56baf4ed87 | |||
| 7ffb103758 | |||
| 9fcf015214 | |||
| 27bfab4e6e | |||
| ffccfa2ee9 | |||
| d3dcef4b8b | |||
| 3cd36ebc7b | |||
| 2ebdc04787 | |||
| cc8add9f66 | |||
| c2c539e3cc | |||
| 0cdff46725 | |||
| d0d115321d | |||
| 99683e958a | |||
| f572ae3474 | |||
| e65ad44b32 | |||
| 3d8614cb47 | |||
| d09cc0f30c | |||
| 80c82e10aa | |||
| 2fb652ce09 | |||
| 1bab920cf5 | |||
| bb71cb200e | |||
| 48afe1586a | |||
| e7e814fa8c | |||
| 496eed950f | |||
| f0d29cd33c | |||
| 75bb6aa9a1 | |||
| 44b2f9637a | |||
| 0643165519 | |||
| cde18648dc | |||
| 04e01e2b31 | |||
| 348b7383f9 | |||
| b2b7193374 | |||
| 47a59d72c9 | |||
| 163770f99a | |||
| 4c1e064a2b | |||
| 88555948d0 | |||
| 1893b37e23 | |||
| c3cbd302cb | |||
| 2ffa7ac0da | |||
| 885a446b10 | |||
| 8bfe620fcc | |||
| 129319b0bc | |||
| 7ce83f2a95 | |||
| 4b05765174 | |||
| 3390da6beb | |||
| 50707a2741 | |||
| 0614c40b42 | |||
| facd07a732 | |||
| 26ac81df3e | |||
| 1ec10ca565 | |||
| 26a39c733b | |||
| 15f0e2e7cb | |||
| d4640f4647 | |||
| 4c9364a803 | |||
| e951edeed3 | |||
| e7a787aa41 | |||
| 500e24d6cd | |||
| 759cbd7486 | |||
| 57545653b1 | |||
| 3c5377ca1b | |||
| a89868928b | |||
| 5bf3991f55 | |||
| 08696d92ea | |||
| 2c2466fb25 | |||
| fc3e393516 | |||
| ebaf8cc06c | |||
| 0862d69a6e | |||
| b8106e4ba4 | |||
| 6ce2f1316f | |||
| 294348939b | |||
| e2db95184f | |||
| f8597fc150 | |||
| 85b0b0cd77 | |||
| 2bd72af2ef | |||
| f729202272 | |||
| 47f30a04d2 | |||
| a42b35598e | |||
| db53f4533e | |||
| 71e33265f5 | |||
| a016f6022c | |||
| 3e3b53f815 | |||
| e2bfe0ce76 | |||
| 98c33c605d | |||
| b3269b08a1 | |||
| e59cff47d4 | |||
| 47912431e6 | |||
| 0ef803950b | |||
| 3c23a44786 | |||
| 701d0d9905 | |||
| d4e1d89901 | |||
| 14aa9eaadd | |||
| 1feabf4275 | |||
| 65c173f2a3 | |||
| 697acf7f6a | |||
| ed69bcae2d | |||
| 728545468c | |||
| 33b1e76e48 | |||
| 1d134025a5 | |||
| 96a9cfab36 | |||
| c9e10e1d0b | |||
| 60846b2b7a | |||
| 6fe7886e2b | |||
| 199c2d2fd0 | |||
| bd54ba911d | |||
| a9354fc743 | |||
| b4b69ae484 | |||
| 1c7b71bf9e | |||
| 1377f0147e | |||
| d2b1e38207 | |||
| 5acf351e4b | |||
| 9ffb67478f | |||
| 1dee848d3e | |||
| afe1c70f2d | |||
| 1b8fba8e26 | |||
| 45fbb67aba | |||
| 914005174f | |||
| 2a82467a6f | |||
| a233232b7d | |||
| ed4bf13960 | |||
| 3135063100 | |||
| 87ef6a9cc1 | |||
| ff31f90b7e | |||
| 2b2ba534e2 | |||
| 3635b3dee7 | |||
| fa613e393f | |||
| 7d3dbcb027 | |||
| db70676933 | |||
| b3b235ebc0 | |||
| 70492c2127 | |||
| f562264674 | |||
| 0a88f84847 | |||
| 139c443770 | |||
| a630ad73cb | |||
| 366e8217c2 | |||
| 01226cb8ac | |||
| 3891b72f33 | |||
| a80fcacd90 | |||
| c54ccaac31 | |||
| 79731cb0ff | |||
| 16b5fd4bf2 | |||
| fb9463c55f | |||
| 2920a8e0ec | |||
| 6a4c3b61e6 | |||
| 6360c3bf46 | |||
| e313603aac | |||
| 0f3de805f4 | |||
| 3bf22d0024 | |||
| 66567933d7 | |||
| 56e19e3494 | |||
| d2f5a10f5d | |||
| 32bb4fa950 | |||
| 8ae06b4648 | |||
| 652396678d | |||
| 59b870a87a | |||
| 0f067fd0a6 | |||
| b91f173680 | |||
| a311d1bdc0 | |||
| eb7add1828 | |||
| b152b8cbcd | |||
| 2336b0706d | |||
| 300b57dd70 | |||
| 0769bf416f | |||
| 90f2e1f8b5 | |||
| 2a4926f417 | |||
| 5e1c9099e8 | |||
| 397e9bc8d6 | |||
| 2366f2cb2e | |||
| 35f1a90df7 | |||
| 9faefa0c96 | |||
| b5adffd5c2 | |||
| 82010bf5c1 | |||
| 6234f01a6d | |||
| 44c2519d75 | |||
| ef94275eb6 | |||
| a6ca48a1c2 | |||
| 24a66a44bf | |||
| 2411b825b4 | |||
| dd7b9000ad | |||
| f1328c7395 | |||
| 9d06e58c3c | |||
| 711b136191 | |||
| a04f9e7a59 | |||
| db5b22e895 | |||
| 0d52c37e11 | |||
| 734e309b3e | |||
| 3efc645975 | |||
| 572812217b | |||
| 008507327c | |||
| f4a6c3e7ea | |||
| ff41fbc5c1 | |||
| cac864192c | |||
| b19683eb41 | |||
| 7a46d7efde | |||
| d09bd6f862 | |||
| 7676be5570 | |||
| ed9524e125 | |||
| 533bb035cf | |||
| dda2e9374b | |||
| 14754deb21 | |||
| b0dc474160 | |||
| adf89bbb33 | |||
| c103b63fe1 | |||
| a3d0882317 | |||
| 583bd1a6e2 | |||
| 53eda42da7 | |||
| c26c4a61c6 | |||
| ea2527c2d1 | |||
| 65fcf22670 | |||
| d0572538ff | |||
| 3577265508 | |||
| f28e191d70 | |||
| 38b6c44b4c | |||
| 1a24e316d5 | |||
| 9da9e8244b | |||
| 8d51ef0f35 | |||
| 9cfae823a7 | |||
| d6151eae23 | |||
| 4a0a3281c6 | |||
| 1230075011 | |||
| 7459954377 | |||
| cf38098ba8 | |||
| 8ca394efaf | |||
| f9c7931800 | |||
| 24547f40ff | |||
| 72debee125 | |||
| a3d6994afa | |||
| 08c270f65a | |||
| e585453c2e | |||
| 86f4524010 | |||
| 6d098cc230 | |||
| 434c96e625 | |||
| d6e9616256 | |||
| e9187ae38c | |||
| 978dc76653 | |||
| b409fd32ac | |||
| a2ad997e97 | |||
| e9428726ca | |||
| 400906b433 | |||
| 50d7c61c01 | |||
| d9bf522b27 | |||
| 93dc0679ec | |||
| 1ddc51cfd1 | |||
| 50bf0e10f5 | |||
| d1ccb7e47f | |||
| 6a22c5b2b5 | |||
| 7e845a3b87 | |||
| ea1c970190 | |||
| 3d207ccf11 | |||
| aaf7f5ae02 | |||
| 50e8ad285b | |||
| bb5462e327 | |||
| df2e7fa6eb | |||
| 11f36bdf9a | |||
| bc0d4585b3 | |||
| 70917f291c | |||
| 9f6f0c7424 | |||
| 4722a8df3c | |||
| 7be8a71c60 | |||
| ce859edba8 | |||
| 90820cd044 | |||
| c929f1b62f | |||
| ff88132620 | |||
| 89f8d4ae12 | |||
| 3f4ffe7844 | |||
| ed567a2dd1 | |||
| 22a00036e2 | |||
| 2aac0a5a26 | |||
| 07ad6a437e | |||
| d9a444ca1a | |||
| 766f58ed7e | |||
| 1099b4c881 | |||
| 7c0f49fc36 | |||
| 761e796201 | |||
| 8d0fbc6a1e | |||
| affcea8822 | |||
| 53f0be00a9 | |||
| 602caa9cd6 | |||
| f35ec8c955 | |||
| 1316491e50 | |||
| 2cc4309bf8 | |||
| 612d43f284 | |||
| 56824d1769 | |||
| 2238ac7d59 | |||
| 2b5b192cd7 | |||
| 64e1d23cba | |||
| 40d2904f3d | |||
| 9712cc479b | |||
| 0ef1fb0b67 | |||
| 2b67bc448d | |||
| a3f81b79ed | |||
| 8d0dae4cec | |||
| dda96264df | |||
| 4af8e5c5c4 | |||
| eff5605be5 | |||
| 2b53ab23c0 | |||
| 2010de9104 | |||
| 280a99b3b6 | |||
| 646025589b | |||
| 4502003e61 | |||
| 07abb6240e | |||
| dea0815199 | |||
| e4ed2d2e42 | |||
| c8228e5789 | |||
| 667e5e4f89 | |||
| ada703a73a | |||
| 2b8094f915 | |||
| 9e1e960116 | |||
| 82ae9ef541 | |||
| 1b07274e34 | |||
| 15ac54d5d6 | |||
| 1cdd8510fd | |||
| 039f3d01a0 | |||
| f63feea05e | |||
| fbac38d98b | |||
| ca2ab3387f | |||
| 64ded50bbf | |||
| d44ac61033 | |||
| 18ada77d8a | |||
| 6d0f1275c2 | |||
| a848eccfc6 | |||
| 2402fa4824 | |||
| 2bf4135afc | |||
| c677f132cd | |||
| ec4015d73c | |||
| 8c42dbf71c | |||
| 4ca679180d | |||
| 64da959619 | |||
| 88123e2512 | |||
| 87e98e8788 | |||
| 767857c516 | |||
| 2b60166e5c | |||
| 2e41db39f5 | |||
| a55fa8389e | |||
| d23142027f | |||
| 438fe3f9db | |||
| 5cc154147f | |||
| 9cd5a0a1e6 | |||
| 2958142e31 | |||
| 27c15bed60 | |||
| 2985739b8c | |||
| 2465d93330 | |||
| 556d211136 | |||
| 0ee2a58cdc | |||
| 7daf84fb44 | |||
| 9aff01c9a9 | |||
| a2b84e9897 | |||
| 66f3c2673c | |||
| 554d08c3a1 | |||
| 3a595ea5c4 | |||
| 03c9648f2e | |||
| e3a55af336 | |||
| be4a432bea | |||
| 0d32a24cba | |||
| e36948cfbc | |||
| 9aa647068b | |||
| 092030c1ca | |||
| 0bd261ded4 | |||
| 7ed557497d | |||
| d793ec2ffe | |||
| 271f7df343 | |||
| 08d44f588f | |||
| 84b4a5a495 | |||
| b2e20a82ba | |||
| 1b3a06a02a | |||
| 91a5e75151 | |||
| 4754b0e253 | |||
| 84b517f5a0 | |||
| 8ac88cf069 | |||
| 13a995cc1d | |||
| a93fb52632 | |||
| 4d927e73f1 | |||
| 38228709c8 | |||
| 38788a3161 | |||
| 46b6973c05 | |||
| af2b7708a8 | |||
| a233982931 | |||
| ed1439fbc6 | |||
| b379b67a32 | |||
| f3945fbddb | |||
| 8b44ee2ce1 | |||
| 7b582b71ba | |||
| 4e8c507276 | |||
| 9390c56831 | |||
| abebbf04b1 | |||
| 5e434073d4 | |||
| 3e4a566e46 | |||
| 6f5cf8c15f | |||
| b687bc807a | |||
| 5440fd6cb4 | |||
| b060151625 | |||
| be38d4ea93 | |||
| 56f21c4fd5 | |||
| 386df457a9 | |||
| e4abf6e723 | |||
| 1339ebaa84 | |||
| c9b90884da | |||
| 9b2b2c88df | |||
| e5bdab0355 | |||
| 4d46958c82 | |||
| 9dd8e4df7f | |||
| d98e07c3d3 | |||
| 78bc11465b | |||
| 8e8e4bbabc | |||
| 90671233c6 | |||
| 12bae51384 | |||
| 7b848e215f | |||
| 21872e2fb0 | |||
| 2a218b96c4 | |||
| e76cda6923 | |||
| 9d16612a9b | |||
| 63c865ace6 | |||
| 0a62de0d4f | |||
| 593996216f | |||
| 4eae23a2cc | |||
| f3699b5ac8 | |||
| 9ce0e51305 | |||
| 4c79318694 | |||
| f7ac724c5d | |||
| ee9fe1239a | |||
| b6b5c27cec | |||
| 632e07b749 | |||
| 48cd2d190f | |||
| 685797f403 | |||
| ef6f421f89 | |||
| e0ffd3e8a5 | |||
| 0d16b5fc38 | |||
| ac8a27cba9 | |||
| e5f2a8ebf2 | |||
| 54733eba6f | |||
| 93353aea70 | |||
| e16cb8b4a2 | |||
| 5bf3c1df24 | |||
| 419918076e | |||
| fb768c420d | |||
| eb067fee55 | |||
| 6390b50d6e | |||
| 5d8134ed32 | |||
| 852904e1a4 | |||
| a120adde63 | |||
| a80af177b6 | |||
| 8db7d435b9 | |||
| 901e0ddfe4 | |||
| ecb30409f6 | |||
| 44c2c77548 | |||
| 5be5efdacf | |||
| 057c3da82a | |||
| 8fa429caef | |||
| 87f526d82f | |||
| 1ae2320e09 | |||
| 54693cf7b1 | |||
| a082375d57 | |||
| 9c7adb7248 | |||
| ccebbbc0ac | |||
| ebb6915e58 | |||
| 5cc27fd3b5 | |||
| a332509e02 | |||
| 375fe81311 | |||
| d354ad1c34 | |||
| 119d8b3aca | |||
| cd9edba26f | |||
| 8f1c502d2b | |||
| 92312fbc0c | |||
| 2efcaa9e8e | |||
| aa53541235 | |||
| b863c25d21 | |||
| f77c3574af | |||
| f5105bac65 | |||
| 5a86592e93 | |||
| 2c83cfc14c | |||
| 863546e125 | |||
| 9198e30688 | |||
| 1890157faa | |||
| 0898f372b1 | |||
| b9e5256cf9 | |||
| 6b6d89b911 | |||
| d3e0193c8a | |||
| 31881209d6 | |||
| 5c7e893393 | |||
| 3c814ebf87 | |||
| 5cf1dca36e | |||
| 12338c1dc4 | |||
| 5b23752205 | |||
| 4e53f301d8 | |||
| 2b7803dbac | |||
| 446a278f3d | |||
| 0047d3f81a | |||
| 4e1f17d65b | |||
| f9b1dbe2ac | |||
| a251474144 | |||
| 8d88bb06b2 | |||
| 9f2ff3ed22 | |||
| 45cbf70265 | |||
| 59e16b88ae | |||
| 33f219dfe6 | |||
| 44db2eea70 | |||
| 12ab54648c | |||
| 19926e2979 | |||
| 1620a1e014 | |||
| 888546b6f5 | |||
| 3215db26aa | |||
| 76aff84788 | |||
| fc28ba3156 | |||
| effce0573b | |||
| e8db363431 | |||
| 9603b6877d | |||
| d5ecb5ff5a | |||
| dae73938e8 | |||
| 619b6dfae3 | |||
| 8f9c36b730 | |||
| 3eeec4faae | |||
| 972a4b95b6 | |||
| ffee1a4126 | |||
| 96e23c2ff6 | |||
| 08356007c9 | |||
| 5064b6f747 | |||
| 57d3002ee1 | |||
| a00a0dbfcd | |||
| b41d2c5c14 | |||
| 1da48beeec | |||
| b57ff73086 | |||
| 67978b5746 | |||
| 062f305d1a | |||
| 1f70d4e2a5 | |||
| aa5bc20c83 | |||
| 09af10f635 | |||
| 4d7953aa56 | |||
| 46e1560678 | |||
| 4d0148b417 | |||
| 1605d1d24d | |||
| 5190043e56 | |||
| f66a2ffa1e | |||
| d1e76a34a0 | |||
| 5b3d5f9f3c | |||
| 415a42f327 | |||
| 09f6e55338 | |||
| a351e05a17 | |||
| d37bcbdc92 | |||
| 437af37b13 | |||
| c62367612d | |||
| a92cba8484 | |||
| 5f7d922b10 | |||
| dc29632d4e | |||
| f4a7754cc0 | |||
| 6811d3d80b | |||
| 245f6273bd | |||
| 870c8d3c4e | |||
| d573472a86 | |||
| 441b6dbda0 | |||
| a7e6a1059c | |||
| 85719a0a5d | |||
| b5b52afd35 | |||
| dc35633aa4 | |||
| 9e3ba487fa | |||
| aee8425b68 | |||
| 94229bb262 | |||
| 1f6444fbea | |||
| 439ef6447d | |||
| 9cab808c5d | |||
| d41fcf7345 | |||
| ac51ba38f9 | |||
| ef85b24a78 | |||
| d88730685e | |||
| 16661847a7 | |||
| 7f782a1a24 | |||
| 9188ce68aa | |||
| 2b79a6ff8f | |||
| 70b0274c8e | |||
| 83ce1de8e7 | |||
| b1d484f827 | |||
| 123519165d | |||
| 30ff9c6775 | |||
| 906f5f7e96 | |||
| 9238316cf1 | |||
| 5e89b9a455 | |||
| e3a4ff33d2 | |||
| 5d9ea394ba | |||
| abb5c9fd92 | |||
| 266835cd2e | |||
| 92af03579c | |||
| 2e20f2b89f | |||
| e67593673f | |||
| d1b533d399 | |||
| 2647902fee | |||
| 574320ec3f | |||
| 3f2377017c | |||
| 2b5bb02817 | |||
| 302d14adef | |||
| b796ededae | |||
| f811ba8777 | |||
| eb7b45d26b | |||
| 17b2d92a3d | |||
| 22f0bcaf8f | |||
| e61277002c | |||
| ca5258f140 | |||
| 8f4473b3e3 | |||
| 51e8af9e5f | |||
| 82818e7324 | |||
| 6ae8103022 | |||
| eca2d92791 | |||
| 6778e19710 | |||
| 25f25275cd | |||
| 7e746ad2a6 | |||
| 6ffa2b01e1 | |||
| ed6ca0d7fa | |||
| 8e2a3c1d2f | |||
| 7f6dcc2745 | |||
| 76e34d6f2c | |||
| e613b17c05 | |||
| 5ba9a089e1 | |||
| f2d5d6d24e | |||
| a1ec4ea3a9 | |||
| 0fe7420638 | |||
| b304730225 | |||
| 4801526f35 | |||
| f1857030b5 | |||
| b5b3f4e1c6 | |||
| 172bb7887c | |||
| 60228d30d1 | |||
| 9592537840 | |||
| 8768a80242 | |||
| d5f73f89d8 | |||
| 19bbe6c67d | |||
| aebb65e983 | |||
| 5e327af327 | |||
| bc1f8813c2 | |||
| 80d9f624d0 | |||
| e9c46f38fc | |||
| ecfbaa267d | |||
| c25fd3349b | |||
| c3e27bcf87 | |||
| a5894f3e6b | |||
| 4db3a388dd | |||
| 6fd1a2ef52 | |||
| fe2a259eb1 | |||
| 1ba7c2f276 | |||
| 649f747f8a | |||
| 05dbaf7672 | |||
| 742a08229e | |||
| 5602d2c7bb | |||
| f3e0479a8f | |||
| a1143c4ea0 | |||
| 0314d1dd01 | |||
| 751b3f502d | |||
| bf5e09d5ab | |||
| 14e4a10312 | |||
| 53b89e1ee4 | |||
| 370f878a36 | |||
| 6e4d61c1fd | |||
| f6fe5c07f6 | |||
| c685293297 | |||
| 0e6a2c0491 | |||
| c2209ad5e4 | |||
| 5f249a3e67 | |||
| 76fb3652fc | |||
| 92925e846d | |||
| 43c04c29ce | |||
| 06b74c87da | |||
| 7f075b0b15 | |||
| c5a86c22a4 | |||
| 3621c6234c | |||
| 80c2fefc43 | |||
| a47952146a | |||
| a55950865e | |||
| ab181ac329 | |||
| db172d1053 | |||
| dad26339a9 | |||
| 3b0ed61826 | |||
| 9699e2b483 | |||
| 3048188b5b | |||
| 547bb3b053 | |||
| 7c2087cf05 | |||
| 217fea9667 | |||
| 523c3cd50b | |||
| 631126c77a | |||
| 655d381ef3 | |||
| c68fec7e97 | |||
| cdfa8a668b | |||
| 92651d228d | |||
| 90e3692603 | |||
| 3a8316ab93 | |||
| 8d3f0d0eab | |||
| ded0efb955 | |||
| cdd4354256 | |||
| bde955fc56 | |||
| abc9e98625 | |||
| d086ee14dd | |||
| f43fec7ee6 | |||
| 6385511e88 | |||
| ed4becf007 | |||
| f11ab4c569 | |||
| b12c2c76d1 | |||
| f5589445b9 | |||
| 032a61b197 | |||
| 011ed380aa | |||
| 88a18c8b6a | |||
| 51e65db715 | |||
| cc02fcd889 | |||
| 9f17c62533 | |||
| 36bd2a65e3 | |||
| 85d4e56bb1 | |||
| 381d9bafdf | |||
| ada16fd188 | |||
| c408157a4d | |||
| 6e299b582a | |||
| 9777fbacf6 | |||
| 643b4dd126 | |||
| 19ac54277b | |||
| c78a8dfd2d | |||
| b1a57c4cb2 | |||
| 54c180092d | |||
| be110d0464 | |||
| 6e733b65ae | |||
| f948a2d0c0 | |||
| 2aa47554fc | |||
| c80b270678 | |||
| dcc32e84b9 | |||
| 947d610309 | |||
| 3e01a387ba | |||
| 4dbba5ac98 | |||
| 374cc4183e | |||
| b9d9730b62 | |||
| 0a178a687a | |||
| c4c43c3d26 | |||
| 8fa86d4d34 | |||
| a22dd28e02 | |||
| 0e274fc4be | |||
| bc3da25a4a | |||
| 80492d663e | |||
| 172c539a5a | |||
| a079acc0d9 | |||
| 30df77fa4c | |||
| 71a22e45b0 | |||
| defd8a527b | |||
| 3ce29236f3 | |||
| 04ee99f1a3 | |||
| 91817bffe1 | |||
| c39b83667b | |||
| 1bd382c1d0 | |||
| 49bef1cdbf | |||
| 249c508126 | |||
| 04b27525fa | |||
| 175bcb1734 | |||
| fec2c7e715 | |||
| 07dca8cc03 | |||
| 60c093f086 | |||
| db4ab1c936 | |||
| f071207463 | |||
| 622b9d9276 | |||
| 05bfdeab7a | |||
| b4bb98ea60 | |||
| 792b7e0629 | |||
| a079c2eb7c | |||
| f7aa91e660 | |||
| 6d677bbd63 | |||
| cee3ec6dc4 | |||
| 3da17c42a4 | |||
| 2329cbc1a2 | |||
| b39ee54103 | |||
| 299f9837b7 | |||
| 6a889ed3e5 | |||
| f3ba88c87c | |||
| 498f1525b2 | |||
| e7c5120682 | |||
| 19cfaa2be7 | |||
| e97c7e042b | |||
| d8b1fc45aa | |||
| 35f27d0d3e | |||
| 330a11861e | |||
| 4827fe86bb | |||
| 72c55b56f2 | |||
| 295da7e5f3 | |||
| 4eab85d364 | |||
| 3cc83ce024 | |||
| 52c423a423 | |||
| 952f8e38cf | |||
| 542b3e8a64 | |||
| 4f79eb256d | |||
| 7620456486 | |||
| 052d209901 | |||
| e9c45ff406 | |||
| f1053d48a2 | |||
| ba12f52f6c | |||
| 456137fa24 | |||
| 692059e899 | |||
| 252ce0b581 | |||
| d24befa0bc | |||
| 5462710103 | |||
| d1b923bee9 | |||
| 81a6d1b0d4 | |||
| 04020f391a | |||
| c4ab0c09ea | |||
| 6e50e4b9ee | |||
| 1599f9f0c0 | |||
| 0c5b6e5556 | |||
| e3e04f5dae | |||
| 17bc8565f6 | |||
| c08954c18b | |||
| 7ba56a4b88 | |||
| 9b7f40ce4d | |||
| b70370f3fd | |||
| 4d3cf77ad5 | |||
| b2005ccaef | |||
| 659cf7249e | |||
| 62a010a25d | |||
| 6b4ea68bc7 | |||
| d6891c705e | |||
| 9bcb006ec7 | |||
| 02ac6ec81c | |||
| 5c91f5b71d | |||
| 16b674b984 | |||
| 65392d5e6b | |||
| 41d108ead6 | |||
| 0c9dbc61a1 | |||
| 6788fdb0d6 | |||
| 3a4b61579d | |||
| 51d7ba7446 | |||
| e608adea60 | |||
| 8dd6882222 | |||
| 5aef565fb6 | |||
| a4d6bcba09 | |||
| f09a577ab5 | |||
| 973e1acb67 | |||
| 676a724491 | |||
| 73318fd514 | |||
| cb08c15616 | |||
| a3287b85c5 | |||
| 0c0b1ec9ae | |||
| d2f87ca76c | |||
| 4935b14539 | |||
| 0835611d3a | |||
| 8b4fa2605e | |||
| c3910807c5 | |||
| c5b8b5687f | |||
| f61883b227 | |||
| 35ff9af6ce | |||
| dad2b9aac8 | |||
| 1613d30544 | |||
| b6df9debaf | |||
| b9d0dc60b0 | |||
| 37b1876807 | |||
| d206350738 | |||
| 2da1f9181a | |||
| bd396e1fd5 | |||
| f55c9ed1ba | |||
| 5da69c0b9a | |||
| a806e8cc58 | |||
| 369b260e12 | |||
| d9e7c1626a | |||
| 1a1a7bbbfd | |||
| 33e97e994d | |||
| 11e6848bb9 | |||
| 829410729c | |||
| 4995aecd62 | |||
| 0e2a3686c0 | |||
| 66b2140892 | |||
| 0d2857a242 | |||
| 17d99e6266 | |||
| ea7d4be3f8 | |||
| 05db8784ae | |||
| 68667d6057 | |||
| d58b5ef74b | |||
| f044037ec5 | |||
| a97f21ba4e | |||
| b594ed99b8 | |||
| 58b06222ff | |||
| 58dc397930 | |||
| 15073d63d9 | |||
| a6277370ca | |||
| 31b2d6be75 | |||
| 57ee14d62d | |||
| d470cfe86e | |||
| b55d8f46f4 | |||
| c15218e37a | |||
| 985aa0423d | |||
| c14a8dce93 | |||
| f5d45221ca | |||
| d668aa7c24 | |||
| e20fe421e7 | |||
| 2deb38d615 | |||
| b95d71af2b | |||
| ebe4ca6b60 | |||
| f159ed20c2 | |||
| cdbb042ce4 | |||
| 23bbe511fe | |||
| 444218e755 | |||
| 9cc60c9dd3 | |||
| cc1fbe0956 | |||
| 2c226d597d | |||
| c6ab32ffb9 | |||
| 97c6ec6d49 | |||
| 1fcf7ba5bc | |||
| 12c1e1d149 | |||
| fa222b0ea2 | |||
| 101be77d9d | |||
| a6dbef89c2 | |||
| 02f08879a4 | |||
| 61f1ee2d2d | |||
| ac4b592b4e | |||
| 93b6e80cd7 | |||
| f5de714451 | |||
| d4741eece1 | |||
| 585484cb06 | |||
| b696928a5b | |||
| 79d4e865fe | |||
| 8380879804 | |||
| 091461cece | |||
| d228c5459d | |||
| 3d5d3ea20c | |||
| de7f8eec04 | |||
| 4b6047e746 | |||
| c47673bf10 | |||
| 49432009fe | |||
| 2f6d2b08aa | |||
| 473f10877c | |||
| c7df82460c | |||
| b19697e3ac | |||
| 3e51448ef0 | |||
| 2b2e515a30 | |||
| 394e640909 | |||
| b48eb4e88b | |||
| b525480b25 | |||
| 45f18eaa52 | |||
| 4c92a2869b | |||
| 8041ab8a61 | |||
| 8251fc0811 | |||
| 827ff80c06 | |||
| 18ca998f67 | |||
| cb286a66be | |||
| 8444470e3a | |||
| f33828a1ca | |||
| 68e425f869 | |||
| da6344297a | |||
| 3cfca01372 | |||
| d934bb15b0 | |||
| 0c0a8392e5 | |||
| 98b6ce353c | |||
| 58043dac0f | |||
| d2c1f1131b | |||
| fa5c7a9e75 | |||
| ceb94d52a1 | |||
| a2716712ab | |||
| 1ac7baceff | |||
| 968d94d417 | |||
| 7842181b47 | |||
| 2ce47fda88 | |||
| ffd010767f | |||
| 635990a5b0 | |||
| 562f2375c5 | |||
| edf533c83e | |||
| c1d61c88e9 | |||
| 6360b846c6 | |||
| 57900d07f0 | |||
| 8e72e1ed88 | |||
| 10c547396d | |||
| 66dd871288 | |||
| d484939c02 | |||
| 85fd8729ce | |||
| b3e16c6423 | |||
| 30d6766db4 | |||
| 17234f82d0 | |||
| 7b57df02a7 | |||
| b65ae3b036 | |||
| bce76a7977 | |||
| 66f3e97457 | |||
| 0ee61d178f | |||
| 1ceba29f4b | |||
| 40c748a2ae | |||
| 0e9453a395 | |||
| 69d0bc8fd5 | |||
| 6a73e5a720 | |||
| e70ba29d95 | |||
| e5647cf70d | |||
| 9637cf0574 | |||
| 74cc63ba2f | |||
| 0b6e360602 | |||
| a49cda6523 | |||
| d612c72405 | |||
| eb152d7431 | |||
| 6bd143dd25 | |||
| 770d3eabc0 | |||
| 75e2ba5af3 | |||
| 1726bb6c0d | |||
| 5dfe65d53a | |||
| 83afd09f13 | |||
| d059cc7170 | |||
| 96488c1c74 | |||
| 84a81579ba | |||
| 244ba1a61a | |||
| 9dadc06e64 | |||
| 60f949e36f | |||
| af154e3053 | |||
| 9e6c290696 | |||
| 0a71063530 | |||
| 0b1ae11498 | |||
| 017a4e7c30 | |||
| 3891f18e71 | |||
| 6a2077cbd8 | |||
| aa11cc19e8 | |||
| 9267536fee | |||
| a6f5717567 | |||
| 0a58d6812a | |||
| 12507aab8a | |||
| d376fe9e17 | |||
| d21622bef4 | |||
| 7febec49b2 | |||
| 14d5098ca2 | |||
| bc8eac2439 | |||
| 4e65db80e8 | |||
| c0c71d6b3a | |||
| bac1c6d12f | |||
| ce68291d83 | |||
| 4176a0ade3 | |||
| ec10f2e72b | |||
| f36c268b9e | |||
| 824392a1c2 | |||
| 1f9a7b8fd3 | |||
| 9379e85e23 | |||
| 805c2832c1 | |||
| d33a048d89 | |||
| f77fdc0ce8 | |||
| 7da51787b9 | |||
| b1f422c1c5 | |||
| b3f966e2ca | |||
| 3f191e1b75 | |||
| 6d5fdfbf73 | |||
| 9a9e457dd6 | |||
| c316dbe2aa | |||
| b5fcb06a76 | |||
| b5a9a6793b | |||
| 0cf79155d4 | |||
| f8f9f3c438 | |||
| 1926e919be | |||
| e6c68eed51 | |||
| f9e747dbc6 | |||
| 0e86e292e4 | |||
| a590682764 | |||
| 31c40fa4cc | |||
| 1feb3838b5 | |||
| bd0732b1d0 | |||
| 0b5cbcefdd | |||
| e4a87f2f4f | |||
| 3c8cadf7ca | |||
| 7c0b26e8a0 | |||
| 982503e9a8 | |||
| 3d93675ff9 | |||
| 53d6c9b9c0 | |||
| a02e90d502 | |||
| 238dbffb48 | |||
| a9d7b6eab7 | |||
| 39c3334147 | |||
| 4223495e6c | |||
| 023e86d68f | |||
| ac57be91e1 | |||
| c2e65bafb5 | |||
| 74161b2122 | |||
| 39ee5c5a46 | |||
| 788f330d07 | |||
| af56151231 | |||
| 34d359fe03 | |||
| 4672dbda2a | |||
| 62252d157e | |||
| b1cf550123 | |||
| 9c84749e2c | |||
| cca4c47781 | |||
| 17bd9a1fa1 | |||
| 0321644bbd | |||
| 81e7988eb9 | |||
| 4985311d46 | |||
| 05348f3250 | |||
| 003609e565 | |||
| e0cfaee7aa | |||
| 9537a909f7 | |||
| e75387f029 | |||
| 8c2dd5fb9a | |||
| 27545dcc86 | |||
| 724e04e979 | |||
| dfc94c58f0 | |||
| 4b0f8d76f4 | |||
| fac895d7ba | |||
| d023f316ac | |||
| 04b40ff221 | |||
| 03a08435e2 | |||
| 4dd3ab8f32 | |||
| 8e0660ad54 | |||
| 1f42512199 | |||
| 1a29ea1038 | |||
| eab2b9dc09 | |||
| 94e92cd6c0 | |||
| 57cd6d2de1 | |||
| 822d468232 | |||
| bdaa6a1910 | |||
| 2221dcc9f2 | |||
| 2eb1ee967c | |||
| c49cfefe88 | |||
| c6a6f39d29 | |||
| a3d7811f24 | |||
| eb56ca3b0d | |||
| 755e0143fb | |||
| dfa48094dc | |||
| e585192eeb | |||
| 646924fce8 | |||
| 13c6eb42e9 | |||
| e5fb50476c | |||
| 073c590d0b | |||
| c63aa7f085 | |||
| c832e62db0 | |||
| b7a7119b1f | |||
| 19a880bb91 | |||
| 672399c751 | |||
| c54abde1bd | |||
| 95c1d2a887 | |||
| 3e6f27522b | |||
| 1b70f94282 | |||
| ebef84e9ea | |||
| 87d4970e8b | |||
| b1a772d194 | |||
| 4938765eb3 | |||
| cce78cc5e2 | |||
| f11f2bfb56 | |||
| 24f43e7ae9 | |||
| 9085b933d8 | |||
| d94d469c86 | |||
| 59502594f8 | |||
| d20c9bde7e | |||
| 62414e3073 | |||
| 505dde09de | |||
| 603d623eda | |||
| 87ebf2e50b | |||
| 37c3f0d8a0 | |||
| 48c985e775 | |||
| 7358fffb0f | |||
| de5b6386e0 | |||
| 1de2d5c2b6 | |||
| ef53a9229f | |||
| 259c39a63a | |||
| 4d87f6025e | |||
| 327b98eb13 | |||
| f977d10a19 | |||
| a0cf8c322d | |||
| 627be179c1 | |||
| 1e74f5850b | |||
| 6d83a73858 | |||
| 9b76872708 | |||
| 9b093c9a12 | |||
| 4d587c341b | |||
| f8f6cd6ef5 | |||
| cf08eac15e | |||
| 9a8552e8ae | |||
| 846317ef37 | |||
| 7e62789edf | |||
| 5865af7f6e | |||
| 852663f6d2 | |||
| c1148c4ea6 | |||
| 280dc77f8b | |||
| a9b30984a3 | |||
| 2f83c3b689 | |||
| b25ad12f1a | |||
| d95e43a6a1 | |||
| 27df987211 | |||
| 982745fb83 | |||
| 8fa8d471af | |||
| 2cc14bd0fb | |||
| 98ad72b096 | |||
| fdc8ed8d05 | |||
| 24fcb7f813 | |||
| 236c64a17d | |||
| 9e835e8edb | |||
| f96569da1e | |||
| 91ff45fbde | |||
| 1261f250c6 | |||
| 3673b45437 | |||
| 45aabc5d0d | |||
| f9bd83c854 | |||
| 499d8adb75 | |||
| 54386c82fd | |||
| 86a51015b1 | |||
| 38b9ec7a18 | |||
| 998406d20e | |||
| f7b4b750d8 | |||
| 2558ab3de7 | |||
| a4e2c56317 | |||
| 0c10ae1861 | |||
| b3cc828995 | |||
| ba8f9d8620 | |||
| 3c89a28a06 | |||
| 9c5d7716e2 | |||
| 46fd26e366 | |||
| 41a2eb5245 | |||
| c410d7a97d | |||
| 6fa63dcc0c | |||
| 3d7670a6ba | |||
| 96f25332ea | |||
| 3385d38648 | |||
| 1618c963e4 | |||
| 50462dcdc6 | |||
| 1e3be09b3b | |||
| 6e66a9222a | |||
| c3ac834526 | |||
| 9d1e8b1e1d | |||
| f605373a2b | |||
| 56b7622612 | |||
| 696a6ccd57 | |||
| 51b03b87e6 | |||
| aa7ba0bc1a | |||
| 07e4076585 | |||
| de1a459879 | |||
| 1aacb9bb15 | |||
| 9b4ecc96f6 | |||
| e3f4f874c5 | |||
| 6ace801418 | |||
| d31b93b513 | |||
| ac0fd6aa9a | |||
| c7e0888982 | |||
| 068f33cfdf | |||
| 4807cd8a6e | |||
| c703f1eed6 | |||
| 5ac5da3524 | |||
| 0c13d34ade | |||
| 35e824c287 | |||
| 1e0d290f2e | |||
| 0097a8d097 | |||
| 36cc43170d | |||
| 5578ad5e14 | |||
| d11f0a709d | |||
| 0a43b23275 | |||
| 7967683296 | |||
| 5b2c016834 | |||
| aaff125608 | |||
| 407adc7061 | |||
| d0e612dc36 | |||
| 5aa7435d25 | |||
| 7c23ec90a9 | |||
| 390957fec4 | |||
| 060a76dc3e | |||
| 6625810d2a | |||
| edc442afdb | |||
| 16b9514543 | |||
| 95c7f4a7f0 | |||
| ae6fabc6fe | |||
| 7eaadf616c | |||
| 8fed5fc5ae | |||
| f25951c412 | |||
| c11195d5e3 | |||
| 2ed5cba110 | |||
| 4c05a697fa | |||
| 1259a474ba | |||
| 3995deaf76 | |||
| 076587425e | |||
| da6aeaca46 | |||
| 8ee33ca551 | |||
| ea7f13922b | |||
| 38d0063c36 | |||
| 56d0d5986f | |||
| df83459721 | |||
| 54a9e00970 | |||
| 9bda96d39e | |||
| 053470d5a8 | |||
| 6f4160c014 | |||
| 65ef82a946 | |||
| b509a7060a | |||
| 5ad6ff239b | |||
| fdaa6ff9e3 | |||
| 2f31763335 | |||
| 350562919c | |||
| aa5c4945d6 | |||
| 6fbfc58602 | |||
| 77a5c43d50 | |||
| f28e4b86fb | |||
| 6801dd043d | |||
| b675e6ab77 | |||
| d6306f8ccb | |||
| a9817e9127 | |||
| bb5f33d13c | |||
| c08897cd10 | |||
| 384875f4fc | |||
| 9cfa84313c | |||
| f787c49b53 | |||
| fa90e14b06 | |||
| fe625a558e | |||
| 03b989251d | |||
| 95919051e0 | |||
| 46fb88c76f | |||
| 210bfaf8d6 | |||
| a50dec88d5 | |||
| 8dcec034ed | |||
| 9ef41f68fb | |||
| 05d733e707 | |||
| 4bbe28bdf0 | |||
| 0c01cf7c85 | |||
| 917cd13ce2 | |||
| cfb36443fb | |||
| 9d3826c676 | |||
| 4300bb2e1f | |||
| 6edc438789 | |||
| 955cf35d5f | |||
| 25cd7c7c50 | |||
| 0f8efb07c7 | |||
| 732cb6c45c | |||
| 4d63a89fa6 | |||
| 266a868ba9 | |||
| 8199967b31 | |||
| 9d61c18143 | |||
| 7c73e28a6d | |||
| 221bfa4c67 | |||
| aaca4987c9 | |||
| 1a8b7f7513 | |||
| 992b47b991 | |||
| 21d0f40751 | |||
| 5e7f06397f | |||
| adaace4ab8 | |||
| 739ff84732 | |||
| 2a177052de | |||
| 424eaba4c5 | |||
| e1cafa3834 | |||
| ba539eb9aa | |||
| 24de676a64 | |||
| 0c2741f7ad | |||
| f7c82baee9 | |||
| 2b34e0abdc | |||
| 6306bc3ddc | |||
| ea068dcc2c | |||
| 633fedaa96 | |||
| 4ff76cad2a | |||
| 65134c793b | |||
| 5af09e73f2 | |||
| d5f34cf34c | |||
| 6a2e559222 | |||
| cefa602601 | |||
| d773691848 | |||
| da07ad16c1 | |||
| f40707dc68 | |||
| 2d8ce500fa | |||
| ba0cea6826 | |||
| ddf1b04cce | |||
| ad5b3a4753 | |||
| 531ea5b3a2 | |||
| b468468e7e | |||
| d52e4e5df3 | |||
| 907743eee7 | |||
| 610e3dccb7 | |||
| 27392f832d | |||
| e9db7fea5b | |||
| bdd3930855 | |||
| cff0168f3a | |||
| 70d5c88026 | |||
| d83901e665 | |||
| 1e1984a586 | |||
| 2f180cea7f | |||
| f4d6a3ec4e | |||
| 7aa922ceac | |||
| 06dcc5a2c6 | |||
| 000f762fb9 | |||
| 3bc3eeb5da | |||
| 4e5699fa71 | |||
| acc576658a | |||
| a76274b549 | |||
| 803ff8ebb9 | |||
| b42152ffeb | |||
| 4015a5486c | |||
| 024b43ca06 | |||
| aae48e6fd7 | |||
| d29c7e7871 | |||
| 9448fe3db4 | |||
| 3817f3a89b | |||
| 755f4f324b | |||
| 863ab0e72e | |||
| 4ab0377c6e | |||
| 2062a7ca8f | |||
| b61a55eebf | |||
| c30078c5a3 | |||
| 39b91c97f0 | |||
| 8334ee18e6 | |||
| cc2592f582 | |||
| 96d35f7c54 | |||
| 98c5fc6ae2 | |||
| fbde0c6c96 | |||
| 602e7c83e2 | |||
| eb9218a86b | |||
| 9f2dcc3f13 | |||
| bc210b292b | |||
| 2113af9c52 | |||
| 6f417b57c1 | |||
| a7742d7d63 | |||
| 5179e37bd1 | |||
| a7b17bfaf0 | |||
| 4af1f31a3f | |||
| 0acd06d13c | |||
| fd22e98298 | |||
| 9e42e04b4a | |||
| 9103837228 | |||
| 3f3c5de851 | |||
| 167a12028d | |||
| 6af2faebd2 | |||
| 34b65be44a | |||
| fd16222613 | |||
| 1ba6cd8423 | |||
| b928ebdd53 | |||
| b42623ff9d | |||
| 59ae0e0013 | |||
| 4788de784b | |||
| 926535469d | |||
| c0f63eb21f | |||
| 5627a0cbdf | |||
| ed2a698392 | |||
| aaad1791d9 | |||
| ad6e82942b | |||
| 9a9954a036 | |||
| d60bb57d4b | |||
| 591708903b | |||
| f9d62fba7a | |||
| 85dde8a800 | |||
| 9d039c206b | |||
| cbff19ff1a | |||
| 4c3f9b2ef4 | |||
| 167bac23aa | |||
| 5d0cfa2527 | |||
| 0e523618a1 | |||
| 821fae0d94 | |||
| 3b26105f68 | |||
| 0f2f966a91 | |||
| d7d491d445 | |||
| 41effbe2da | |||
| 9b0d6862c4 | |||
| 890fcdf842 | |||
| 18dbac203f | |||
| 8d1f254dcc | |||
| e5841d3126 | |||
| 90df3af6cf | |||
| 11cc36d770 | |||
| 05f1939b02 | |||
| 050ea9762f | |||
| 0f24d4d2a1 | |||
| fc799191f4 | |||
| 8fad85edda | |||
| d70053aba5 | |||
| b699fe7a9d | |||
| 94c67faaea | |||
| b2ed5c3070 | |||
| 9fe49497bb | |||
| 5b8c10f2f8 | |||
| 24983f62e2 | |||
| f2057ce1ab | |||
| 6797fd65a5 | |||
| bf489feef1 | |||
| 947e06a860 | |||
| 6a3d925a47 | |||
| 04d5ba266f | |||
| 90be83ae99 | |||
| 5e80bd3cc9 | |||
| fb7ef76e74 | |||
| db4b1e613c | |||
| ee39081b11 | |||
| 7d842f5bcf | |||
| 4eac198270 | |||
| faac32418c | |||
| 42810621df | |||
| 61a5378aeb | |||
| 42d644ef91 | |||
| c95a56450d | |||
| dc5199feea | |||
| f88fdf6a1b | |||
| b68057d927 | |||
| e9a860d9cb | |||
| 8be86cbdfd | |||
| 5091e64a42 | |||
| 828304d587 | |||
| 9d584475f6 | |||
| bb60cb0bf9 | |||
| 25f908b320 | |||
| 9b7dca2fa1 | |||
| 55e1dfb778 | |||
| 735a79ae83 | |||
| ef2b400c61 | |||
| c2263db7bc | |||
| 53eca2ff5b | |||
| 7bbbda71df | |||
| 3a15a3821a | |||
| 9557b9f70f | |||
| 464441d8c3 | |||
| f30f1afd47 | |||
| b3db37b99d | |||
| 7a276f39fb | |||
| 415668ecf0 | |||
| 651967b95c | |||
| 8e0baf257c | |||
| c8268e65fd | |||
| 3cf4375387 | |||
| 438e2dc228 | |||
| c1adbe3189 | |||
| 7ee1816612 | |||
| b4084491e5 | |||
| 8f4f834ce6 | |||
| 411fd2b761 | |||
| 61d7d67c39 |
@@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: opencv
|
||||
@@ -34,11 +34,11 @@ This is a template helping you to create an issue which can be processed as quic
|
||||
- [ ] I report the issue, it's not a question
|
||||
<!--
|
||||
OpenCV team works with forum.opencv.org, Stack Overflow and other communities
|
||||
to discuss problems. Tickets with question without real issue statement will be
|
||||
to discuss problems. Tickets with questions without a real issue statement will be
|
||||
closed.
|
||||
-->
|
||||
- [ ] I checked the problem with documentation, FAQ, open issues,
|
||||
forum.opencv.org, Stack Overflow, etc and have not found solution
|
||||
forum.opencv.org, Stack Overflow, etc and have not found any solution
|
||||
<!--
|
||||
Places to check:
|
||||
* OpenCV documentation: https://docs.opencv.org
|
||||
@@ -47,11 +47,11 @@ This is a template helping you to create an issue which can be processed as quic
|
||||
* OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
|
||||
* Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
|
||||
-->
|
||||
- [ ] I updated to latest OpenCV version and the issue is still there
|
||||
- [ ] I updated to the latest OpenCV version and the issue is still there
|
||||
<!--
|
||||
master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
|
||||
OpenCV team supports only latest release for each branch.
|
||||
The ticket is closed, if the problem is not reproduced with modern version.
|
||||
OpenCV team supports only the latest release for each branch.
|
||||
The ticket is closed if the problem is not reproduced with the modern version.
|
||||
-->
|
||||
- [ ] There is reproducer code and related data files: videos, images, onnx, etc
|
||||
<!--
|
||||
@@ -61,9 +61,9 @@ This is a template helping you to create an issue which can be processed as quic
|
||||
to reduce attachment size
|
||||
* Use PNG for images, if you report some CV related bug, but not image reader
|
||||
issue
|
||||
* Attach the image as archive to the ticket, if you report some reader issue.
|
||||
* Attach the image as an archive to the ticket, if you report some reader issue.
|
||||
Image hosting services compress images and it breaks the repro code.
|
||||
* Provide ONNX file for some public model or ONNX file with with random weights,
|
||||
* Provide ONNX file for some public model or ONNX file with random weights,
|
||||
if you report ONNX parsing or handling issue. Architecture details diagram
|
||||
from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
|
||||
-->
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
name: Bug Report
|
||||
description: Create a report to help us reproduce and fix the bug
|
||||
labels: ["bug"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
#### Thank you for contributing! Before reporting a bug, please have a look at the [FAQ](https://github.com/opencv/opencv/wiki/FAQ), make sure the issue has no duplicate and hasn't been already addressed by searching through [the existing and past issues](https://github.com/opencv/opencv/issues?page=1&q=is%3Aissue+sort%3Acreated-desc).
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: System Information
|
||||
description: |
|
||||
Please provide the following system information to help us diagnose the bug. For example:
|
||||
|
||||
// example for c++ user
|
||||
OpenCV version: 4.8.0
|
||||
Operating System / Platform: Ubuntu 20.04
|
||||
Compiler & compiler version: GCC 9.3.0
|
||||
|
||||
// example for python user
|
||||
OpenCV python version: 4.8.0.74
|
||||
Operating System / Platform: Ubuntu 20.04
|
||||
Python version: 3.9.6
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Detailed description
|
||||
description: |
|
||||
Please provide a clear and concise description of what the bug is and paste the error log below. It helps improving readability if the error log is wrapped in ```` ```triple quotes blocks``` ````.
|
||||
placeholder: |
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
```
|
||||
# error log
|
||||
```
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
description: |
|
||||
Please provide a minimal example to help us reproduce the bug. Code should be wrapped with ```` ```triple quotes blocks``` ```` to improve readability. If the code is too long, please attach as a file or create and link a public gist: https://gist.github.com.
|
||||
|
||||
Related data files (images, onnx, etc) should be attached below as well. If the data files are too big, feel free to upload them to a online drive, share them and put the link below.
|
||||
placeholder: |
|
||||
```cpp (replace cpp with python if python code)
|
||||
# sample code to reproduce the bug
|
||||
```
|
||||
|
||||
Test data: [image](https://link/to/the/image), [model.onnx](htts://link/to/the/onnx/model)
|
||||
validations:
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Issue submission checklist
|
||||
options:
|
||||
- label: I report the issue, it's not a question
|
||||
required: true
|
||||
- label: I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
|
||||
- label: I updated to the latest OpenCV version and the issue is still there
|
||||
- label: There is reproducer code and related data files (videos, images, onnx, etc)
|
||||
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions
|
||||
url: https://forum.opencv.org/
|
||||
about: Ask questions and discuss with OpenCV community members
|
||||
@@ -0,0 +1,26 @@
|
||||
name: Documentation
|
||||
description: Report an issue related to https://docs.opencv.org/
|
||||
labels: ["category: documentation"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
#### Thank you for contributing! Before submitting a doc issue, please make sure it has no duplicate by searching through [the existing and past issues](https://github.com/opencv/opencv/issues?page=1&q=is%3Aissue+sort%3Acreated-desc)
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the doc issue
|
||||
description: >
|
||||
Please provide a clear and concise description of what content in https://docs.opencv.org/ is an issue. Note that there are multiple active branches, such as 4.x and 5.x, so please specify the branch with the problem.
|
||||
placeholder: |
|
||||
A clear and concise description of what content in https://docs.opencv.org/ is an issue.
|
||||
|
||||
Link to the doc: https://docs.opencv.org/4.x/d3/d63/classcv_1_1Mat.html
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Fix suggestion
|
||||
description: >
|
||||
Tell us how we could improve the documentation in this regard.
|
||||
@@ -0,0 +1,22 @@
|
||||
name: Feature request
|
||||
description: Submit a request for a new OpenCV feature
|
||||
labels: ["feature"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: >
|
||||
#### Thank you for contributing! Before submitting a feature request, please make sure the request has no duplicate by searching through [the existing and past issues](https://github.com/opencv/opencv/issues?page=1&q=is%3Aissue+sort%3Acreated-desc)
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the feature and motivation
|
||||
description: |
|
||||
Please provide a clear and concise proposal of the feature and outline the motivation.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional context
|
||||
description: |
|
||||
Add any other context, such as pseudo code, links, diagram, screenshots, to help the community better understand the feature request.
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
|
||||
|
||||
- [ ] I agree to contribute to the project under Apache 2 License.
|
||||
- [ ] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
|
||||
- [ ] The PR is proposed to proper branch
|
||||
- [ ] There is reference to original bug report and related work
|
||||
- [x] I agree to contribute to the project under Apache 2 License.
|
||||
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
|
||||
- [ ] The PR is proposed to the proper branch
|
||||
- [ ] There is a reference to the original bug report and related work
|
||||
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
|
||||
Patch to opencv_extra has the same branch name.
|
||||
- [ ] The feature is well documented and sample code can be built with the project CMake
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
name: PR:4.x
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- 4.x
|
||||
|
||||
jobs:
|
||||
|
||||
Linux:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-Linux.yaml@main
|
||||
with:
|
||||
workflow_branch: main
|
||||
|
||||
Ubuntu2004-ARM64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64.yaml@main
|
||||
|
||||
Ubuntu2004-ARM64-Debug:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-ARM64-Debug.yaml@main
|
||||
|
||||
Ubuntu2004-x64-OpenVINO:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-OpenVINO.yaml@main
|
||||
|
||||
Ubuntu2004-x64-CUDA:
|
||||
if: "${{ contains(github.event.pull_request.labels.*.name, 'category: dnn') }} || ${{ contains(github.event.pull_request.labels.*.name, 'category: dnn (onnx)') }}"
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-U20-Cuda.yaml@main
|
||||
|
||||
Windows10-x64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10.yaml@main
|
||||
|
||||
Windows10-x64-Vulkan:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-W10-Vulkan.yaml@main
|
||||
|
||||
macOS-ARM64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64.yaml@main
|
||||
|
||||
macOS-x64:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-x86_64.yaml@main
|
||||
|
||||
macOS-ARM64-Vulkan:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-macOS-ARM64-Vulkan.yaml@main
|
||||
|
||||
iOS:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-iOS.yaml@main
|
||||
|
||||
Android-SDK:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-4.x-Android-SDK.yaml@main
|
||||
|
||||
TIM-VX:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-timvx-backend-tests-4.x.yml@main
|
||||
|
||||
docs:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-docs.yaml@main
|
||||
|
||||
Linux-RISC-V-Clang:
|
||||
uses: opencv/ci-gha-workflow/.github/workflows/OCV-PR-4.x-RISCV.yaml@main
|
||||
@@ -2,6 +2,9 @@ name: arm64 build checks
|
||||
|
||||
on: workflow_dispatch
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
name: lint_python
|
||||
on: workflow_dispatch
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
jobs:
|
||||
lint_python:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- run: pip install --upgrade pip wheel
|
||||
- run: pip install bandit black codespell flake8 flake8-2020 flake8-bugbear
|
||||
flake8-comprehensions isort mypy pytest pyupgrade safety
|
||||
- run: bandit --recursive --skip B101 . || true # B101 is assert statements
|
||||
- run: black --check . || true
|
||||
- run: codespell || true # --ignore-words-list="" --skip="*.css,*.js,*.lock"
|
||||
- run: flake8 . --count --select=E9,F63,F7 --show-source --statistics
|
||||
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88
|
||||
--show-source --statistics
|
||||
- run: isort --check-only --profile black . || true
|
||||
- run: pip install -r requirements.txt || pip install --editable . || true
|
||||
- run: mkdir --parents --verbose .mypy_cache
|
||||
- run: mypy --ignore-missing-imports --install-types --non-interactive . || true
|
||||
- run: pytest . || true
|
||||
- run: pytest --doctest-modules . || true
|
||||
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
|
||||
- run: safety check
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
function(download_fastcv root_dir)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(FASTCV_COMMIT "2265e79b3b9a8512a9c615b8c4d0244e88f45a9d")
|
||||
|
||||
# Define actual FastCV versions
|
||||
if(ANDROID)
|
||||
if(AARCH64)
|
||||
message(STATUS "Download FastCV for Android aarch64")
|
||||
set(FCV_PACKAGE_NAME "fastcv_android_aarch64_2025_04_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "d9172a9a3e5d92d080a4192cc5691001")
|
||||
else()
|
||||
message(STATUS "Download FastCV for Android armv7")
|
||||
set(FCV_PACKAGE_NAME "fastcv_android_arm32_2025_04_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "246b5253233391cd2c74d01d49aee9c3")
|
||||
endif()
|
||||
elseif(UNIX AND NOT APPLE AND NOT IOS AND NOT XROS)
|
||||
if(AARCH64)
|
||||
set(FCV_PACKAGE_NAME "fastcv_linux_aarch64_2025_05_29.tgz")
|
||||
set(FCV_PACKAGE_HASH "decd490524f786e103125b8b948151f3")
|
||||
else()
|
||||
message("FastCV: fastcv lib for 32-bit Linux is not supported for now!")
|
||||
endif()
|
||||
endif(ANDROID)
|
||||
|
||||
# Download Package
|
||||
|
||||
set(OPENCV_FASTCV_URL "https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FASTCV_COMMIT}/fastcv/")
|
||||
|
||||
ocv_download( FILENAME ${FCV_PACKAGE_NAME}
|
||||
HASH ${FCV_PACKAGE_HASH}
|
||||
URL ${OPENCV_FASTCV_URL}
|
||||
DESTINATION_DIR ${root_dir}
|
||||
ID FASTCV
|
||||
STATUS res
|
||||
UNPACK
|
||||
RELATIVE_URL)
|
||||
if(res)
|
||||
set(HAVE_FASTCV TRUE CACHE BOOL "FastCV status")
|
||||
else()
|
||||
message(WARNING "FastCV: package download failed!")
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
Vendored
+5
-5
@@ -1,8 +1,8 @@
|
||||
# Binaries branch name: ffmpeg/master_20210608
|
||||
# Binaries were created for OpenCV: eaa9228a4fdfb9c2465aea65a50ce2d16b55dce0
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "213fcd5d4897319a83207406036c4a5957fba010")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "bab661341c30862fa88627130219c0a5")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "ac99f9767a83103c31709628af685924")
|
||||
# Binaries branch name: ffmpeg/4.x_20250625
|
||||
# Binaries were created for OpenCV: e9f1da7e8e977a65b8bf8fe7ea8b92eef9171f19
|
||||
ocv_update(FFMPEG_BINARIES_COMMIT "ea9240e39bc0d6a69d2b1f0ba4513bdc7612a41e")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN32 "2821ea672a11147a70974d760a54e9bc")
|
||||
ocv_update(FFMPEG_FILE_HASH_BIN64 "e5c6936240201064b15bcecf1816e8f4")
|
||||
ocv_update(FFMPEG_FILE_HASH_CMAKE "8862c87496e2e8c375965e1277dee1c7")
|
||||
|
||||
function(download_win_ffmpeg script_var)
|
||||
|
||||
Vendored
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
Origin: https://github.com/google/flatbuffers/tree/v23.5.9
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_ALLOCATOR_H_
|
||||
#define FLATBUFFERS_ALLOCATOR_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Allocator interface. This is flatbuffers-specific and meant only for
|
||||
// `vector_downward` usage.
|
||||
class Allocator {
|
||||
public:
|
||||
virtual ~Allocator() {}
|
||||
|
||||
// Allocate `size` bytes of memory.
|
||||
virtual uint8_t *allocate(size_t size) = 0;
|
||||
|
||||
// Deallocate `size` bytes of memory at `p` allocated by this allocator.
|
||||
virtual void deallocate(uint8_t *p, size_t size) = 0;
|
||||
|
||||
// Reallocate `new_size` bytes of memory, replacing the old region of size
|
||||
// `old_size` at `p`. In contrast to a normal realloc, this grows downwards,
|
||||
// and is intended specifcally for `vector_downward` use.
|
||||
// `in_use_back` and `in_use_front` indicate how much of `old_size` is
|
||||
// actually in use at each end, and needs to be copied.
|
||||
virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size,
|
||||
size_t new_size, size_t in_use_back,
|
||||
size_t in_use_front) {
|
||||
FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows
|
||||
uint8_t *new_p = allocate(new_size);
|
||||
memcpy_downward(old_p, old_size, new_p, new_size, in_use_back,
|
||||
in_use_front);
|
||||
deallocate(old_p, old_size);
|
||||
return new_p;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Called by `reallocate_downward` to copy memory from `old_p` of `old_size`
|
||||
// to `new_p` of `new_size`. Only memory of size `in_use_front` and
|
||||
// `in_use_back` will be copied from the front and back of the old memory
|
||||
// allocation.
|
||||
void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p,
|
||||
size_t new_size, size_t in_use_back,
|
||||
size_t in_use_front) {
|
||||
memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back,
|
||||
in_use_back);
|
||||
memcpy(new_p, old_p, in_use_front);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_ALLOCATOR_H_
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_ARRAY_H_
|
||||
#define FLATBUFFERS_ARRAY_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/stl_emulation.h"
|
||||
#include "flatbuffers/vector.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// This is used as a helper type for accessing arrays.
|
||||
template<typename T, uint16_t length> class Array {
|
||||
// Array<T> can carry only POD data types (scalars or structs).
|
||||
typedef typename flatbuffers::bool_constant<flatbuffers::is_scalar<T>::value>
|
||||
scalar_tag;
|
||||
typedef
|
||||
typename flatbuffers::conditional<scalar_tag::value, T, const T *>::type
|
||||
IndirectHelperType;
|
||||
|
||||
public:
|
||||
typedef uint16_t size_type;
|
||||
typedef typename IndirectHelper<IndirectHelperType>::return_type return_type;
|
||||
typedef VectorConstIterator<T, return_type, uoffset_t> const_iterator;
|
||||
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
// If T is a LE-scalar or a struct (!scalar_tag::value).
|
||||
static FLATBUFFERS_CONSTEXPR bool is_span_observable =
|
||||
(scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1)) ||
|
||||
!scalar_tag::value;
|
||||
|
||||
FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; }
|
||||
|
||||
return_type Get(uoffset_t i) const {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
return IndirectHelper<IndirectHelperType>::Read(Data(), i);
|
||||
}
|
||||
|
||||
return_type operator[](uoffset_t i) const { return Get(i); }
|
||||
|
||||
// If this is a Vector of enums, T will be its storage type, not the enum
|
||||
// type. This function makes it convenient to retrieve value with enum
|
||||
// type E.
|
||||
template<typename E> E GetEnum(uoffset_t i) const {
|
||||
return static_cast<E>(Get(i));
|
||||
}
|
||||
|
||||
const_iterator begin() const { return const_iterator(Data(), 0); }
|
||||
const_iterator end() const { return const_iterator(Data(), size()); }
|
||||
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
const_iterator cbegin() const { return begin(); }
|
||||
const_iterator cend() const { return end(); }
|
||||
|
||||
const_reverse_iterator crbegin() const { return rbegin(); }
|
||||
const_reverse_iterator crend() const { return rend(); }
|
||||
|
||||
// Get a mutable pointer to elements inside this array.
|
||||
// This method used to mutate arrays of structs followed by a @p Mutate
|
||||
// operation. For primitive types use @p Mutate directly.
|
||||
// @warning Assignments and reads to/from the dereferenced pointer are not
|
||||
// automatically converted to the correct endianness.
|
||||
typename flatbuffers::conditional<scalar_tag::value, void, T *>::type
|
||||
GetMutablePointer(uoffset_t i) const {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
return const_cast<T *>(&data()[i]);
|
||||
}
|
||||
|
||||
// Change elements if you have a non-const pointer to this object.
|
||||
void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); }
|
||||
|
||||
// The raw data in little endian format. Use with care.
|
||||
const uint8_t *Data() const { return data_; }
|
||||
|
||||
uint8_t *Data() { return data_; }
|
||||
|
||||
// Similarly, but typed, much like std::vector::data
|
||||
const T *data() const { return reinterpret_cast<const T *>(Data()); }
|
||||
T *data() { return reinterpret_cast<T *>(Data()); }
|
||||
|
||||
// Copy data from a span with endian conversion.
|
||||
// If this Array and the span overlap, the behavior is undefined.
|
||||
void CopyFromSpan(flatbuffers::span<const T, length> src) {
|
||||
const auto p1 = reinterpret_cast<const uint8_t *>(src.data());
|
||||
const auto p2 = Data();
|
||||
FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) &&
|
||||
!(p2 >= p1 && p2 < (p1 + length)));
|
||||
(void)p1;
|
||||
(void)p2;
|
||||
CopyFromSpanImpl(flatbuffers::bool_constant<is_span_observable>(), src);
|
||||
}
|
||||
|
||||
protected:
|
||||
void MutateImpl(flatbuffers::true_type, uoffset_t i, const T &val) {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
WriteScalar(data() + i, val);
|
||||
}
|
||||
|
||||
void MutateImpl(flatbuffers::false_type, uoffset_t i, const T &val) {
|
||||
*(GetMutablePointer(i)) = val;
|
||||
}
|
||||
|
||||
void CopyFromSpanImpl(flatbuffers::true_type,
|
||||
flatbuffers::span<const T, length> src) {
|
||||
// Use std::memcpy() instead of std::copy() to avoid performance degradation
|
||||
// due to aliasing if T is char or unsigned char.
|
||||
// The size is known at compile time, so memcpy would be inlined.
|
||||
std::memcpy(data(), src.data(), length * sizeof(T));
|
||||
}
|
||||
|
||||
// Copy data from flatbuffers::span with endian conversion.
|
||||
void CopyFromSpanImpl(flatbuffers::false_type,
|
||||
flatbuffers::span<const T, length> src) {
|
||||
for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); }
|
||||
}
|
||||
|
||||
// This class is only used to access pre-existing data. Don't ever
|
||||
// try to construct these manually.
|
||||
// 'constexpr' allows us to use 'size()' at compile time.
|
||||
// @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on
|
||||
// a constructor.
|
||||
#if defined(__cpp_constexpr)
|
||||
constexpr Array();
|
||||
#else
|
||||
Array();
|
||||
#endif
|
||||
|
||||
uint8_t data_[length * sizeof(T)];
|
||||
|
||||
private:
|
||||
// This class is a pointer. Copying will therefore create an invalid object.
|
||||
// Private and unimplemented copy constructor.
|
||||
Array(const Array &);
|
||||
Array &operator=(const Array &);
|
||||
};
|
||||
|
||||
// Specialization for Array[struct] with access using Offset<void> pointer.
|
||||
// This specialization used by idl_gen_text.cpp.
|
||||
template<typename T, uint16_t length, template<typename> class OffsetT>
|
||||
class Array<OffsetT<T>, length> {
|
||||
static_assert(flatbuffers::is_same<T, void>::value, "unexpected type T");
|
||||
|
||||
public:
|
||||
typedef const void *return_type;
|
||||
typedef uint16_t size_type;
|
||||
|
||||
const uint8_t *Data() const { return data_; }
|
||||
|
||||
// Make idl_gen_text.cpp::PrintContainer happy.
|
||||
return_type operator[](uoffset_t) const {
|
||||
FLATBUFFERS_ASSERT(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
// This class is only used to access pre-existing data.
|
||||
Array();
|
||||
Array(const Array &);
|
||||
Array &operator=(const Array &);
|
||||
|
||||
uint8_t data_[1];
|
||||
};
|
||||
|
||||
template<class U, uint16_t N>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N> &arr)
|
||||
FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(
|
||||
Array<U, N>::is_span_observable,
|
||||
"wrong type U, only plain struct, LE-scalar, or byte types are allowed");
|
||||
return span<U, N>(arr.data(), N);
|
||||
}
|
||||
|
||||
template<class U, uint16_t N>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U, N> make_span(
|
||||
const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(
|
||||
Array<U, N>::is_span_observable,
|
||||
"wrong type U, only plain struct, LE-scalar, or byte types are allowed");
|
||||
return span<const U, N>(arr.data(), N);
|
||||
}
|
||||
|
||||
template<class U, uint16_t N>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<uint8_t, sizeof(U) * N>
|
||||
make_bytes_span(Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Array<U, N>::is_span_observable,
|
||||
"internal error, Array<T> might hold only scalars or structs");
|
||||
return span<uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
|
||||
}
|
||||
|
||||
template<class U, uint16_t N>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t, sizeof(U) * N>
|
||||
make_bytes_span(const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Array<U, N>::is_span_observable,
|
||||
"internal error, Array<T> might hold only scalars or structs");
|
||||
return span<const uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
|
||||
}
|
||||
|
||||
// Cast a raw T[length] to a raw flatbuffers::Array<T, length>
|
||||
// without endian conversion. Use with care.
|
||||
// TODO: move these Cast-methods to `internal` namespace.
|
||||
template<typename T, uint16_t length>
|
||||
Array<T, length> &CastToArray(T (&arr)[length]) {
|
||||
return *reinterpret_cast<Array<T, length> *>(arr);
|
||||
}
|
||||
|
||||
template<typename T, uint16_t length>
|
||||
const Array<T, length> &CastToArray(const T (&arr)[length]) {
|
||||
return *reinterpret_cast<const Array<T, length> *>(arr);
|
||||
}
|
||||
|
||||
template<typename E, typename T, uint16_t length>
|
||||
Array<E, length> &CastToArrayOfEnum(T (&arr)[length]) {
|
||||
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
|
||||
return *reinterpret_cast<Array<E, length> *>(arr);
|
||||
}
|
||||
|
||||
template<typename E, typename T, uint16_t length>
|
||||
const Array<E, length> &CastToArrayOfEnum(const T (&arr)[length]) {
|
||||
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
|
||||
return *reinterpret_cast<const Array<E, length> *>(arr);
|
||||
}
|
||||
|
||||
template<typename T, uint16_t length>
|
||||
bool operator==(const Array<T, length> &lhs,
|
||||
const Array<T, length> &rhs) noexcept {
|
||||
return std::addressof(lhs) == std::addressof(rhs) ||
|
||||
(lhs.size() == rhs.size() &&
|
||||
std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0);
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_ARRAY_H_
|
||||
+495
@@ -0,0 +1,495 @@
|
||||
#ifndef FLATBUFFERS_BASE_H_
|
||||
#define FLATBUFFERS_BASE_H_
|
||||
|
||||
// clang-format off
|
||||
|
||||
// If activate should be declared and included first.
|
||||
#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \
|
||||
defined(_MSC_VER) && defined(_DEBUG)
|
||||
// The _CRTDBG_MAP_ALLOC inside <crtdbg.h> will replace
|
||||
// calloc/free (etc) to its debug version using #define directives.
|
||||
#define _CRTDBG_MAP_ALLOC
|
||||
#include <stdlib.h>
|
||||
#include <crtdbg.h>
|
||||
// Replace operator new by trace-enabled version.
|
||||
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
#if !defined(FLATBUFFERS_ASSERT)
|
||||
#include <assert.h>
|
||||
#define FLATBUFFERS_ASSERT assert
|
||||
#elif defined(FLATBUFFERS_ASSERT_INCLUDE)
|
||||
// Include file with forward declaration
|
||||
#include FLATBUFFERS_ASSERT_INCLUDE
|
||||
#endif
|
||||
|
||||
#ifndef ARDUINO
|
||||
#include <cstdint>
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#if defined(ARDUINO) && !defined(ARDUINOSTL_M_H) && defined(__AVR__)
|
||||
#include <utility.h>
|
||||
#else
|
||||
#include <utility>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
|
||||
#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT)
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <android/api-level.h>
|
||||
#endif
|
||||
|
||||
#if defined(__ICCARM__)
|
||||
#include <intrinsics.h>
|
||||
#endif
|
||||
|
||||
// Note the __clang__ check is needed, because clang presents itself
|
||||
// as an older GNUC compiler (4.2).
|
||||
// Clang 3.3 and later implement all of the ISO C++ 2011 standard.
|
||||
// Clang 3.4 and later implement all of the ISO C++ 2014 standard.
|
||||
// http://clang.llvm.org/cxx_status.html
|
||||
|
||||
// Note the MSVC value '__cplusplus' may be incorrect:
|
||||
// The '__cplusplus' predefined macro in the MSVC stuck at the value 199711L,
|
||||
// indicating (erroneously!) that the compiler conformed to the C++98 Standard.
|
||||
// This value should be correct starting from MSVC2017-15.7-Preview-3.
|
||||
// The '__cplusplus' will be valid only if MSVC2017-15.7-P3 and the `/Zc:__cplusplus` switch is set.
|
||||
// Workaround (for details see MSDN):
|
||||
// Use the _MSC_VER and _MSVC_LANG definition instead of the __cplusplus for compatibility.
|
||||
// The _MSVC_LANG macro reports the Standard version regardless of the '/Zc:__cplusplus' switch.
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#define FLATBUFFERS_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||
#else
|
||||
#define FLATBUFFERS_GCC 0
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
#define FLATBUFFERS_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
|
||||
#else
|
||||
#define FLATBUFFERS_CLANG 0
|
||||
#endif
|
||||
|
||||
/// @cond FLATBUFFERS_INTERNAL
|
||||
#if __cplusplus <= 199711L && \
|
||||
(!defined(_MSC_VER) || _MSC_VER < 1600) && \
|
||||
(!defined(__GNUC__) || \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400))
|
||||
#error A C++11 compatible compiler with support for the auto typing is \
|
||||
required for FlatBuffers.
|
||||
#error __cplusplus _MSC_VER __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__
|
||||
#endif
|
||||
|
||||
#if !defined(__clang__) && \
|
||||
defined(__GNUC__) && \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600)
|
||||
// Backwards compatibility for g++ 4.4, and 4.5 which don't have the nullptr
|
||||
// and constexpr keywords. Note the __clang__ check is needed, because clang
|
||||
// presents itself as an older GNUC compiler.
|
||||
#ifndef nullptr_t
|
||||
const class nullptr_t {
|
||||
public:
|
||||
template<class T> inline operator T*() const { return 0; }
|
||||
private:
|
||||
void operator&() const;
|
||||
} nullptr = {};
|
||||
#endif
|
||||
#ifndef constexpr
|
||||
#define constexpr const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// The wire format uses a little endian encoding (since that's efficient for
|
||||
// the common platforms).
|
||||
#if defined(__s390x__)
|
||||
#define FLATBUFFERS_LITTLEENDIAN 0
|
||||
#endif // __s390x__
|
||||
#if !defined(FLATBUFFERS_LITTLEENDIAN)
|
||||
#if defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__)
|
||||
#if (defined(__BIG_ENDIAN__) || \
|
||||
(defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
|
||||
#define FLATBUFFERS_LITTLEENDIAN 0
|
||||
#else
|
||||
#define FLATBUFFERS_LITTLEENDIAN 1
|
||||
#endif // __BIG_ENDIAN__
|
||||
#elif defined(_MSC_VER)
|
||||
#if defined(_M_PPC)
|
||||
#define FLATBUFFERS_LITTLEENDIAN 0
|
||||
#else
|
||||
#define FLATBUFFERS_LITTLEENDIAN 1
|
||||
#endif
|
||||
#else
|
||||
#error Unable to determine endianness, define FLATBUFFERS_LITTLEENDIAN.
|
||||
#endif
|
||||
#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
|
||||
|
||||
#define FLATBUFFERS_VERSION_MAJOR 23
|
||||
#define FLATBUFFERS_VERSION_MINOR 5
|
||||
#define FLATBUFFERS_VERSION_REVISION 9
|
||||
#define FLATBUFFERS_STRING_EXPAND(X) #X
|
||||
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
|
||||
namespace flatbuffers {
|
||||
// Returns version as string "MAJOR.MINOR.REVISION".
|
||||
const char* FLATBUFFERS_VERSION();
|
||||
}
|
||||
|
||||
#if (!defined(_MSC_VER) || _MSC_VER > 1600) && \
|
||||
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \
|
||||
defined(__clang__)
|
||||
#define FLATBUFFERS_FINAL_CLASS final
|
||||
#define FLATBUFFERS_OVERRIDE override
|
||||
#define FLATBUFFERS_EXPLICIT_CPP11 explicit
|
||||
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : flatbuffers::voffset_t
|
||||
#else
|
||||
#define FLATBUFFERS_FINAL_CLASS
|
||||
#define FLATBUFFERS_OVERRIDE
|
||||
#define FLATBUFFERS_EXPLICIT_CPP11
|
||||
#define FLATBUFFERS_VTABLE_UNDERLYING_TYPE
|
||||
#endif
|
||||
|
||||
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \
|
||||
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \
|
||||
(defined(__cpp_constexpr) && __cpp_constexpr >= 200704)
|
||||
#define FLATBUFFERS_CONSTEXPR constexpr
|
||||
#define FLATBUFFERS_CONSTEXPR_CPP11 constexpr
|
||||
#define FLATBUFFERS_CONSTEXPR_DEFINED
|
||||
#else
|
||||
#define FLATBUFFERS_CONSTEXPR const
|
||||
#define FLATBUFFERS_CONSTEXPR_CPP11
|
||||
#endif
|
||||
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201402L) || \
|
||||
(defined(__cpp_constexpr) && __cpp_constexpr >= 201304)
|
||||
#define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR_CPP11
|
||||
#else
|
||||
#define FLATBUFFERS_CONSTEXPR_CPP14
|
||||
#endif
|
||||
|
||||
#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \
|
||||
(defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023026)) || \
|
||||
defined(__clang__)
|
||||
#define FLATBUFFERS_NOEXCEPT noexcept
|
||||
#else
|
||||
#define FLATBUFFERS_NOEXCEPT
|
||||
#endif
|
||||
|
||||
// NOTE: the FLATBUFFERS_DELETE_FUNC macro may change the access mode to
|
||||
// private, so be sure to put it at the end or reset access mode explicitly.
|
||||
#if (!defined(_MSC_VER) || _MSC_FULL_VER >= 180020827) && \
|
||||
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) || \
|
||||
defined(__clang__)
|
||||
#define FLATBUFFERS_DELETE_FUNC(func) func = delete
|
||||
#else
|
||||
#define FLATBUFFERS_DELETE_FUNC(func) private: func
|
||||
#endif
|
||||
|
||||
#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \
|
||||
(!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \
|
||||
defined(__clang__)
|
||||
#define FLATBUFFERS_DEFAULT_DECLARATION
|
||||
#endif
|
||||
|
||||
// Check if we can use template aliases
|
||||
// Not possible if Microsoft Compiler before 2012
|
||||
// Possible is the language feature __cpp_alias_templates is defined well
|
||||
// Or possible if the C++ std is C+11 or newer
|
||||
#if (defined(_MSC_VER) && _MSC_VER > 1700 /* MSVC2012 */) \
|
||||
|| (defined(__cpp_alias_templates) && __cpp_alias_templates >= 200704) \
|
||||
|| (defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#define FLATBUFFERS_TEMPLATES_ALIASES
|
||||
#endif
|
||||
|
||||
#ifndef FLATBUFFERS_HAS_STRING_VIEW
|
||||
// Only provide flatbuffers::string_view if __has_include can be used
|
||||
// to detect a header that provides an implementation
|
||||
#if defined(__has_include)
|
||||
// Check for std::string_view (in c++17)
|
||||
#if __has_include(<string_view>) && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17))
|
||||
#include <string_view>
|
||||
namespace flatbuffers {
|
||||
typedef std::string_view string_view;
|
||||
}
|
||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||
// Check for std::experimental::string_view (in c++14, compiler-dependent)
|
||||
#elif __has_include(<experimental/string_view>) && (__cplusplus >= 201411)
|
||||
#include <experimental/string_view>
|
||||
namespace flatbuffers {
|
||||
typedef std::experimental::string_view string_view;
|
||||
}
|
||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||
// Check for absl::string_view
|
||||
#elif __has_include("absl/strings/string_view.h") && \
|
||||
__has_include("absl/base/config.h") && \
|
||||
(__cplusplus >= 201411)
|
||||
#include "absl/base/config.h"
|
||||
#if !defined(ABSL_USES_STD_STRING_VIEW)
|
||||
#include "absl/strings/string_view.h"
|
||||
namespace flatbuffers {
|
||||
typedef absl::string_view string_view;
|
||||
}
|
||||
#define FLATBUFFERS_HAS_STRING_VIEW 1
|
||||
#endif
|
||||
#endif
|
||||
#endif // __has_include
|
||||
#endif // !FLATBUFFERS_HAS_STRING_VIEW
|
||||
|
||||
#ifndef FLATBUFFERS_GENERAL_HEAP_ALLOC_OK
|
||||
// Allow heap allocations to be used
|
||||
#define FLATBUFFERS_GENERAL_HEAP_ALLOC_OK 1
|
||||
#endif // !FLATBUFFERS_GENERAL_HEAP_ALLOC_OK
|
||||
|
||||
#ifndef FLATBUFFERS_HAS_NEW_STRTOD
|
||||
// Modern (C++11) strtod and strtof functions are available for use.
|
||||
// 1) nan/inf strings as argument of strtod;
|
||||
// 2) hex-float as argument of strtod/strtof.
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1900) || \
|
||||
(defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \
|
||||
(defined(__clang__))
|
||||
#define FLATBUFFERS_HAS_NEW_STRTOD 1
|
||||
#endif
|
||||
#endif // !FLATBUFFERS_HAS_NEW_STRTOD
|
||||
|
||||
#ifndef FLATBUFFERS_LOCALE_INDEPENDENT
|
||||
// Enable locale independent functions {strtof_l, strtod_l,strtoll_l,
|
||||
// strtoull_l}.
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1800) || \
|
||||
(defined(__ANDROID_API__) && __ANDROID_API__>= 21) || \
|
||||
(defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 700)) && \
|
||||
(!defined(__Fuchsia__) && !defined(__ANDROID_API__))
|
||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 1
|
||||
#else
|
||||
#define FLATBUFFERS_LOCALE_INDEPENDENT 0
|
||||
#endif
|
||||
#endif // !FLATBUFFERS_LOCALE_INDEPENDENT
|
||||
|
||||
// Suppress Undefined Behavior Sanitizer (recoverable only). Usage:
|
||||
// - __suppress_ubsan__("undefined")
|
||||
// - __suppress_ubsan__("signed-integer-overflow")
|
||||
#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7))
|
||||
#define __suppress_ubsan__(type) __attribute__((no_sanitize(type)))
|
||||
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)
|
||||
#define __suppress_ubsan__(type) __attribute__((no_sanitize_undefined))
|
||||
#else
|
||||
#define __suppress_ubsan__(type)
|
||||
#endif
|
||||
|
||||
// This is constexpr function used for checking compile-time constants.
|
||||
// Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`.
|
||||
template<typename T> FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) {
|
||||
return !!t;
|
||||
}
|
||||
|
||||
// Enable C++ attribute [[]] if std:c++17 or higher.
|
||||
#if ((__cplusplus >= 201703L) \
|
||||
|| (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L)))
|
||||
// All attributes unknown to an implementation are ignored without causing an error.
|
||||
#define FLATBUFFERS_ATTRIBUTE(attr) attr
|
||||
|
||||
#define FLATBUFFERS_FALLTHROUGH() [[fallthrough]]
|
||||
#else
|
||||
#define FLATBUFFERS_ATTRIBUTE(attr)
|
||||
|
||||
#if FLATBUFFERS_CLANG >= 30800
|
||||
#define FLATBUFFERS_FALLTHROUGH() [[clang::fallthrough]]
|
||||
#elif FLATBUFFERS_GCC >= 70300
|
||||
#define FLATBUFFERS_FALLTHROUGH() [[gnu::fallthrough]]
|
||||
#else
|
||||
#define FLATBUFFERS_FALLTHROUGH()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// @endcond
|
||||
|
||||
/// @file
|
||||
namespace flatbuffers {
|
||||
|
||||
/// @cond FLATBUFFERS_INTERNAL
|
||||
// Our default offset / size type, 32bit on purpose on 64bit systems.
|
||||
// Also, using a consistent offset type maintains compatibility of serialized
|
||||
// offset values between 32bit and 64bit systems.
|
||||
typedef uint32_t uoffset_t;
|
||||
typedef uint64_t uoffset64_t;
|
||||
|
||||
// Signed offsets for references that can go in both directions.
|
||||
typedef int32_t soffset_t;
|
||||
typedef int64_t soffset64_t;
|
||||
|
||||
// Offset/index used in v-tables, can be changed to uint8_t in
|
||||
// format forks to save a bit of space if desired.
|
||||
typedef uint16_t voffset_t;
|
||||
|
||||
typedef uintmax_t largest_scalar_t;
|
||||
|
||||
// In 32bits, this evaluates to 2GB - 1
|
||||
#define FLATBUFFERS_MAX_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset_t>::max()
|
||||
#define FLATBUFFERS_MAX_64_BUFFER_SIZE std::numeric_limits<::flatbuffers::soffset64_t>::max()
|
||||
|
||||
// The minimum size buffer that can be a valid flatbuffer.
|
||||
// Includes the offset to the root table (uoffset_t), the offset to the vtable
|
||||
// of the root table (soffset_t), the size of the vtable (uint16_t), and the
|
||||
// size of the referring table (uint16_t).
|
||||
#define FLATBUFFERS_MIN_BUFFER_SIZE sizeof(uoffset_t) + sizeof(soffset_t) + \
|
||||
sizeof(uint16_t) + sizeof(uint16_t)
|
||||
|
||||
// We support aligning the contents of buffers up to this size.
|
||||
#ifndef FLATBUFFERS_MAX_ALIGNMENT
|
||||
#define FLATBUFFERS_MAX_ALIGNMENT 32
|
||||
#endif
|
||||
|
||||
/// @brief The length of a FlatBuffer file header.
|
||||
static const size_t kFileIdentifierLength = 4;
|
||||
|
||||
inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) {
|
||||
return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) &&
|
||||
(align & (align - 1)) == 0; // must be power of 2
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable: 4351) // C4351: new behavior: elements of array ... will be default initialized
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 4127) // C4127: conditional expression is constant
|
||||
#endif
|
||||
|
||||
template<typename T> T EndianSwap(T t) {
|
||||
#if defined(_MSC_VER)
|
||||
#define FLATBUFFERS_BYTESWAP16 _byteswap_ushort
|
||||
#define FLATBUFFERS_BYTESWAP32 _byteswap_ulong
|
||||
#define FLATBUFFERS_BYTESWAP64 _byteswap_uint64
|
||||
#elif defined(__ICCARM__)
|
||||
#define FLATBUFFERS_BYTESWAP16 __REV16
|
||||
#define FLATBUFFERS_BYTESWAP32 __REV
|
||||
#define FLATBUFFERS_BYTESWAP64(x) \
|
||||
((__REV(static_cast<uint32_t>(x >> 32U))) | (static_cast<uint64_t>(__REV(static_cast<uint32_t>(x)))) << 32U)
|
||||
#else
|
||||
#if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__)
|
||||
// __builtin_bswap16 was missing prior to GCC 4.8.
|
||||
#define FLATBUFFERS_BYTESWAP16(x) \
|
||||
static_cast<uint16_t>(__builtin_bswap32(static_cast<uint32_t>(x) << 16))
|
||||
#else
|
||||
#define FLATBUFFERS_BYTESWAP16 __builtin_bswap16
|
||||
#endif
|
||||
#define FLATBUFFERS_BYTESWAP32 __builtin_bswap32
|
||||
#define FLATBUFFERS_BYTESWAP64 __builtin_bswap64
|
||||
#endif
|
||||
if (sizeof(T) == 1) { // Compile-time if-then's.
|
||||
return t;
|
||||
} else if (sizeof(T) == 2) {
|
||||
union { T t; uint16_t i; } u = { t };
|
||||
u.i = FLATBUFFERS_BYTESWAP16(u.i);
|
||||
return u.t;
|
||||
} else if (sizeof(T) == 4) {
|
||||
union { T t; uint32_t i; } u = { t };
|
||||
u.i = FLATBUFFERS_BYTESWAP32(u.i);
|
||||
return u.t;
|
||||
} else if (sizeof(T) == 8) {
|
||||
union { T t; uint64_t i; } u = { t };
|
||||
u.i = FLATBUFFERS_BYTESWAP64(u.i);
|
||||
return u.t;
|
||||
} else {
|
||||
FLATBUFFERS_ASSERT(0);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
template<typename T> T EndianScalar(T t) {
|
||||
#if FLATBUFFERS_LITTLEENDIAN
|
||||
return t;
|
||||
#else
|
||||
return EndianSwap(t);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
|
||||
__suppress_ubsan__("alignment")
|
||||
T ReadScalar(const void *p) {
|
||||
return EndianScalar(*reinterpret_cast<const T *>(p));
|
||||
}
|
||||
|
||||
// See https://github.com/google/flatbuffers/issues/5950
|
||||
|
||||
#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details.
|
||||
__suppress_ubsan__("alignment")
|
||||
void WriteScalar(void *p, T t) {
|
||||
*reinterpret_cast<T *>(p) = EndianScalar(t);
|
||||
}
|
||||
|
||||
template<typename T> struct Offset;
|
||||
template<typename T> __suppress_ubsan__("alignment") void WriteScalar(void *p, Offset<T> t) {
|
||||
*reinterpret_cast<uoffset_t *>(p) = EndianScalar(t.o);
|
||||
}
|
||||
|
||||
#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
// Computes how many bytes you'd have to pad to be able to write an
|
||||
// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in
|
||||
// memory).
|
||||
__suppress_ubsan__("unsigned-integer-overflow")
|
||||
inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) {
|
||||
return ((~buf_size) + 1) & (scalar_size - 1);
|
||||
}
|
||||
|
||||
// Generic 'operator==' with conditional specialisations.
|
||||
// T e - new value of a scalar field.
|
||||
// T def - default of scalar (is known at compile-time).
|
||||
template<typename T> inline bool IsTheSameAs(T e, T def) { return e == def; }
|
||||
|
||||
#if defined(FLATBUFFERS_NAN_DEFAULTS) && \
|
||||
defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0)
|
||||
// Like `operator==(e, def)` with weak NaN if T=(float|double).
|
||||
template<typename T> inline bool IsFloatTheSameAs(T e, T def) {
|
||||
return (e == def) || ((def != def) && (e != e));
|
||||
}
|
||||
template<> inline bool IsTheSameAs<float>(float e, float def) {
|
||||
return IsFloatTheSameAs(e, def);
|
||||
}
|
||||
template<> inline bool IsTheSameAs<double>(double e, double def) {
|
||||
return IsFloatTheSameAs(e, def);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Check 'v' is out of closed range [low; high].
|
||||
// Workaround for GCC warning [-Werror=type-limits]:
|
||||
// comparison is always true due to limited range of data type.
|
||||
template<typename T>
|
||||
inline bool IsOutRange(const T &v, const T &low, const T &high) {
|
||||
return (v < low) || (high < v);
|
||||
}
|
||||
|
||||
// Check 'v' is in closed range [low; high].
|
||||
template<typename T>
|
||||
inline bool IsInRange(const T &v, const T &low, const T &high) {
|
||||
return !IsOutRange(v, low, high);
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
#endif // FLATBUFFERS_BASE_H_
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_BUFFER_H_
|
||||
#define FLATBUFFERS_BUFFER_H_
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Wrapper for uoffset_t to allow safe template specialization.
|
||||
// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset).
|
||||
template<typename T = void> struct Offset {
|
||||
// The type of offset to use.
|
||||
typedef uoffset_t offset_type;
|
||||
|
||||
offset_type o;
|
||||
Offset() : o(0) {}
|
||||
Offset(const offset_type _o) : o(_o) {}
|
||||
Offset<> Union() const { return o; }
|
||||
bool IsNull() const { return !o; }
|
||||
};
|
||||
|
||||
// Wrapper for uoffset64_t Offsets.
|
||||
template<typename T = void> struct Offset64 {
|
||||
// The type of offset to use.
|
||||
typedef uoffset64_t offset_type;
|
||||
|
||||
offset_type o;
|
||||
Offset64() : o(0) {}
|
||||
Offset64(const offset_type offset) : o(offset) {}
|
||||
Offset64<> Union() const { return o; }
|
||||
bool IsNull() const { return !o; }
|
||||
};
|
||||
|
||||
// Litmus check for ensuring the Offsets are the expected size.
|
||||
static_assert(sizeof(Offset<>) == 4, "Offset has wrong size");
|
||||
static_assert(sizeof(Offset64<>) == 8, "Offset64 has wrong size");
|
||||
|
||||
inline void EndianCheck() {
|
||||
int endiantest = 1;
|
||||
// If this fails, see FLATBUFFERS_LITTLEENDIAN above.
|
||||
FLATBUFFERS_ASSERT(*reinterpret_cast<char *>(&endiantest) ==
|
||||
FLATBUFFERS_LITTLEENDIAN);
|
||||
(void)endiantest;
|
||||
}
|
||||
|
||||
template<typename T> FLATBUFFERS_CONSTEXPR size_t AlignOf() {
|
||||
// clang-format off
|
||||
#ifdef _MSC_VER
|
||||
return __alignof(T);
|
||||
#else
|
||||
#ifndef alignof
|
||||
return __alignof__(T);
|
||||
#else
|
||||
return alignof(T);
|
||||
#endif
|
||||
#endif
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
// Lexicographically compare two strings (possibly containing nulls), and
|
||||
// return true if the first is less than the second.
|
||||
static inline bool StringLessThan(const char *a_data, uoffset_t a_size,
|
||||
const char *b_data, uoffset_t b_size) {
|
||||
const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size));
|
||||
return cmp == 0 ? a_size < b_size : cmp < 0;
|
||||
}
|
||||
|
||||
// When we read serialized data from memory, in the case of most scalars,
|
||||
// we want to just read T, but in the case of Offset, we want to actually
|
||||
// perform the indirection and return a pointer.
|
||||
// The template specialization below does just that.
|
||||
// It is wrapped in a struct since function templates can't overload on the
|
||||
// return type like this.
|
||||
// The typedef is for the convenience of callers of this function
|
||||
// (avoiding the need for a trailing return decltype)
|
||||
template<typename T> struct IndirectHelper {
|
||||
typedef T return_type;
|
||||
typedef T mutable_return_type;
|
||||
static const size_t element_stride = sizeof(T);
|
||||
|
||||
static return_type Read(const uint8_t *p, const size_t i) {
|
||||
return EndianScalar((reinterpret_cast<const T *>(p))[i]);
|
||||
}
|
||||
static mutable_return_type Read(uint8_t *p, const size_t i) {
|
||||
return reinterpret_cast<mutable_return_type>(
|
||||
Read(const_cast<const uint8_t *>(p), i));
|
||||
}
|
||||
};
|
||||
|
||||
// For vector of Offsets.
|
||||
template<typename T, template<typename> class OffsetT>
|
||||
struct IndirectHelper<OffsetT<T>> {
|
||||
typedef const T *return_type;
|
||||
typedef T *mutable_return_type;
|
||||
typedef typename OffsetT<T>::offset_type offset_type;
|
||||
static const offset_type element_stride = sizeof(offset_type);
|
||||
|
||||
static return_type Read(const uint8_t *const p, const offset_type i) {
|
||||
// Offsets are relative to themselves, so first update the pointer to
|
||||
// point to the offset location.
|
||||
const uint8_t *const offset_location = p + i * element_stride;
|
||||
|
||||
// Then read the scalar value of the offset (which may be 32 or 64-bits) and
|
||||
// then determine the relative location from the offset location.
|
||||
return reinterpret_cast<return_type>(
|
||||
offset_location + ReadScalar<offset_type>(offset_location));
|
||||
}
|
||||
static mutable_return_type Read(uint8_t *const p, const offset_type i) {
|
||||
// Offsets are relative to themselves, so first update the pointer to
|
||||
// point to the offset location.
|
||||
uint8_t *const offset_location = p + i * element_stride;
|
||||
|
||||
// Then read the scalar value of the offset (which may be 32 or 64-bits) and
|
||||
// then determine the relative location from the offset location.
|
||||
return reinterpret_cast<mutable_return_type>(
|
||||
offset_location + ReadScalar<offset_type>(offset_location));
|
||||
}
|
||||
};
|
||||
|
||||
// For vector of structs.
|
||||
template<typename T> struct IndirectHelper<const T *> {
|
||||
typedef const T *return_type;
|
||||
typedef T *mutable_return_type;
|
||||
static const size_t element_stride = sizeof(T);
|
||||
|
||||
static return_type Read(const uint8_t *const p, const size_t i) {
|
||||
// Structs are stored inline, relative to the first struct pointer.
|
||||
return reinterpret_cast<return_type>(p + i * element_stride);
|
||||
}
|
||||
static mutable_return_type Read(uint8_t *const p, const size_t i) {
|
||||
// Structs are stored inline, relative to the first struct pointer.
|
||||
return reinterpret_cast<mutable_return_type>(p + i * element_stride);
|
||||
}
|
||||
};
|
||||
|
||||
/// @brief Get a pointer to the file_identifier section of the buffer.
|
||||
/// @return Returns a const char pointer to the start of the file_identifier
|
||||
/// characters in the buffer. The returned char * has length
|
||||
/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'.
|
||||
/// This function is UNDEFINED for FlatBuffers whose schema does not include
|
||||
/// a file_identifier (likely points at padding or the start of a the root
|
||||
/// vtable).
|
||||
inline const char *GetBufferIdentifier(const void *buf,
|
||||
bool size_prefixed = false) {
|
||||
return reinterpret_cast<const char *>(buf) +
|
||||
((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t));
|
||||
}
|
||||
|
||||
// Helper to see if the identifier in a buffer has the expected value.
|
||||
inline bool BufferHasIdentifier(const void *buf, const char *identifier,
|
||||
bool size_prefixed = false) {
|
||||
return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier,
|
||||
flatbuffers::kFileIdentifierLength) == 0;
|
||||
}
|
||||
|
||||
/// @cond FLATBUFFERS_INTERNAL
|
||||
// Helpers to get a typed pointer to the root object contained in the buffer.
|
||||
template<typename T> T *GetMutableRoot(void *buf) {
|
||||
if (!buf) return nullptr;
|
||||
EndianCheck();
|
||||
return reinterpret_cast<T *>(
|
||||
reinterpret_cast<uint8_t *>(buf) +
|
||||
EndianScalar(*reinterpret_cast<uoffset_t *>(buf)));
|
||||
}
|
||||
|
||||
template<typename T, typename SizeT = uoffset_t>
|
||||
T *GetMutableSizePrefixedRoot(void *buf) {
|
||||
return GetMutableRoot<T>(reinterpret_cast<uint8_t *>(buf) + sizeof(SizeT));
|
||||
}
|
||||
|
||||
template<typename T> const T *GetRoot(const void *buf) {
|
||||
return GetMutableRoot<T>(const_cast<void *>(buf));
|
||||
}
|
||||
|
||||
template<typename T, typename SizeT = uoffset_t>
|
||||
const T *GetSizePrefixedRoot(const void *buf) {
|
||||
return GetRoot<T>(reinterpret_cast<const uint8_t *>(buf) + sizeof(SizeT));
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_BUFFER_H_
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_BUFFER_REF_H_
|
||||
#define FLATBUFFERS_BUFFER_REF_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/verifier.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Convenient way to bundle a buffer and its length, to pass it around
|
||||
// typed by its root.
|
||||
// A BufferRef does not own its buffer.
|
||||
struct BufferRefBase {}; // for std::is_base_of
|
||||
|
||||
template<typename T> struct BufferRef : BufferRefBase {
|
||||
BufferRef() : buf(nullptr), len(0), must_free(false) {}
|
||||
BufferRef(uint8_t *_buf, uoffset_t _len)
|
||||
: buf(_buf), len(_len), must_free(false) {}
|
||||
|
||||
~BufferRef() {
|
||||
if (must_free) free(buf);
|
||||
}
|
||||
|
||||
const T *GetRoot() const { return flatbuffers::GetRoot<T>(buf); }
|
||||
|
||||
bool Verify() {
|
||||
Verifier verifier(buf, len);
|
||||
return verifier.VerifyBuffer<T>(nullptr);
|
||||
}
|
||||
|
||||
uint8_t *buf;
|
||||
uoffset_t len;
|
||||
bool must_free;
|
||||
};
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_BUFFER_REF_H_
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_
|
||||
#define FLATBUFFERS_DEFAULT_ALLOCATOR_H_
|
||||
|
||||
#include "flatbuffers/allocator.h"
|
||||
#include "flatbuffers/base.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// DefaultAllocator uses new/delete to allocate memory regions
|
||||
class DefaultAllocator : public Allocator {
|
||||
public:
|
||||
uint8_t *allocate(size_t size) FLATBUFFERS_OVERRIDE {
|
||||
return new uint8_t[size];
|
||||
}
|
||||
|
||||
void deallocate(uint8_t *p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; }
|
||||
|
||||
static void dealloc(void *p, size_t) { delete[] static_cast<uint8_t *>(p); }
|
||||
};
|
||||
|
||||
// These functions allow for a null allocator to mean use the default allocator,
|
||||
// as used by DetachedBuffer and vector_downward below.
|
||||
// This is to avoid having a statically or dynamically allocated default
|
||||
// allocator, or having to move it between the classes that may own it.
|
||||
inline uint8_t *Allocate(Allocator *allocator, size_t size) {
|
||||
return allocator ? allocator->allocate(size)
|
||||
: DefaultAllocator().allocate(size);
|
||||
}
|
||||
|
||||
inline void Deallocate(Allocator *allocator, uint8_t *p, size_t size) {
|
||||
if (allocator)
|
||||
allocator->deallocate(p, size);
|
||||
else
|
||||
DefaultAllocator().deallocate(p, size);
|
||||
}
|
||||
|
||||
inline uint8_t *ReallocateDownward(Allocator *allocator, uint8_t *old_p,
|
||||
size_t old_size, size_t new_size,
|
||||
size_t in_use_back, size_t in_use_front) {
|
||||
return allocator ? allocator->reallocate_downward(old_p, old_size, new_size,
|
||||
in_use_back, in_use_front)
|
||||
: DefaultAllocator().reallocate_downward(
|
||||
old_p, old_size, new_size, in_use_back, in_use_front);
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_DETACHED_BUFFER_H_
|
||||
#define FLATBUFFERS_DETACHED_BUFFER_H_
|
||||
|
||||
#include "flatbuffers/allocator.h"
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/default_allocator.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// DetachedBuffer is a finished flatbuffer memory region, detached from its
|
||||
// builder. The original memory region and allocator are also stored so that
|
||||
// the DetachedBuffer can manage the memory lifetime.
|
||||
class DetachedBuffer {
|
||||
public:
|
||||
DetachedBuffer()
|
||||
: allocator_(nullptr),
|
||||
own_allocator_(false),
|
||||
buf_(nullptr),
|
||||
reserved_(0),
|
||||
cur_(nullptr),
|
||||
size_(0) {}
|
||||
|
||||
DetachedBuffer(Allocator *allocator, bool own_allocator, uint8_t *buf,
|
||||
size_t reserved, uint8_t *cur, size_t sz)
|
||||
: allocator_(allocator),
|
||||
own_allocator_(own_allocator),
|
||||
buf_(buf),
|
||||
reserved_(reserved),
|
||||
cur_(cur),
|
||||
size_(sz) {}
|
||||
|
||||
DetachedBuffer(DetachedBuffer &&other) noexcept
|
||||
: allocator_(other.allocator_),
|
||||
own_allocator_(other.own_allocator_),
|
||||
buf_(other.buf_),
|
||||
reserved_(other.reserved_),
|
||||
cur_(other.cur_),
|
||||
size_(other.size_) {
|
||||
other.reset();
|
||||
}
|
||||
|
||||
DetachedBuffer &operator=(DetachedBuffer &&other) noexcept {
|
||||
if (this == &other) return *this;
|
||||
|
||||
destroy();
|
||||
|
||||
allocator_ = other.allocator_;
|
||||
own_allocator_ = other.own_allocator_;
|
||||
buf_ = other.buf_;
|
||||
reserved_ = other.reserved_;
|
||||
cur_ = other.cur_;
|
||||
size_ = other.size_;
|
||||
|
||||
other.reset();
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
~DetachedBuffer() { destroy(); }
|
||||
|
||||
const uint8_t *data() const { return cur_; }
|
||||
|
||||
uint8_t *data() { return cur_; }
|
||||
|
||||
size_t size() const { return size_; }
|
||||
|
||||
// These may change access mode, leave these at end of public section
|
||||
FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer &other));
|
||||
FLATBUFFERS_DELETE_FUNC(
|
||||
DetachedBuffer &operator=(const DetachedBuffer &other));
|
||||
|
||||
protected:
|
||||
Allocator *allocator_;
|
||||
bool own_allocator_;
|
||||
uint8_t *buf_;
|
||||
size_t reserved_;
|
||||
uint8_t *cur_;
|
||||
size_t size_;
|
||||
|
||||
inline void destroy() {
|
||||
if (buf_) Deallocate(allocator_, buf_, reserved_);
|
||||
if (own_allocator_ && allocator_) { delete allocator_; }
|
||||
reset();
|
||||
}
|
||||
|
||||
inline void reset() {
|
||||
allocator_ = nullptr;
|
||||
own_allocator_ = false;
|
||||
buf_ = nullptr;
|
||||
reserved_ = 0;
|
||||
cur_ = nullptr;
|
||||
size_ = 0;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_DETACHED_BUFFER_H_
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,273 @@
|
||||
/*
|
||||
* Copyright 2014 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_H_
|
||||
#define FLATBUFFERS_H_
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
// TODO: These includes are for mitigating the pains of users editing their
|
||||
// source because they relied on flatbuffers.h to include everything for them.
|
||||
#include "flatbuffers/array.h"
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/buffer.h"
|
||||
#include "flatbuffers/buffer_ref.h"
|
||||
#include "flatbuffers/detached_buffer.h"
|
||||
#include "flatbuffers/flatbuffer_builder.h"
|
||||
#include "flatbuffers/stl_emulation.h"
|
||||
#include "flatbuffers/string.h"
|
||||
#include "flatbuffers/struct.h"
|
||||
#include "flatbuffers/table.h"
|
||||
#include "flatbuffers/vector.h"
|
||||
#include "flatbuffers/vector_downward.h"
|
||||
#include "flatbuffers/verifier.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
/// @brief This can compute the start of a FlatBuffer from a root pointer, i.e.
|
||||
/// it is the opposite transformation of GetRoot().
|
||||
/// This may be useful if you want to pass on a root and have the recipient
|
||||
/// delete the buffer afterwards.
|
||||
inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
|
||||
auto table = reinterpret_cast<const Table *>(root);
|
||||
auto vtable = table->GetVTable();
|
||||
// Either the vtable is before the root or after the root.
|
||||
auto start = (std::min)(vtable, reinterpret_cast<const uint8_t *>(root));
|
||||
// Align to at least sizeof(uoffset_t).
|
||||
start = reinterpret_cast<const uint8_t *>(reinterpret_cast<uintptr_t>(start) &
|
||||
~(sizeof(uoffset_t) - 1));
|
||||
// Additionally, there may be a file_identifier in the buffer, and the root
|
||||
// offset. The buffer may have been aligned to any size between
|
||||
// sizeof(uoffset_t) and FLATBUFFERS_MAX_ALIGNMENT (see "force_align").
|
||||
// Sadly, the exact alignment is only known when constructing the buffer,
|
||||
// since it depends on the presence of values with said alignment properties.
|
||||
// So instead, we simply look at the next uoffset_t values (root,
|
||||
// file_identifier, and alignment padding) to see which points to the root.
|
||||
// None of the other values can "impersonate" the root since they will either
|
||||
// be 0 or four ASCII characters.
|
||||
static_assert(flatbuffers::kFileIdentifierLength == sizeof(uoffset_t),
|
||||
"file_identifier is assumed to be the same size as uoffset_t");
|
||||
for (auto possible_roots = FLATBUFFERS_MAX_ALIGNMENT / sizeof(uoffset_t) + 1;
|
||||
possible_roots; possible_roots--) {
|
||||
start -= sizeof(uoffset_t);
|
||||
if (ReadScalar<uoffset_t>(start) + start ==
|
||||
reinterpret_cast<const uint8_t *>(root))
|
||||
return start;
|
||||
}
|
||||
// We didn't find the root, either the "root" passed isn't really a root,
|
||||
// or the buffer is corrupt.
|
||||
// Assert, because calling this function with bad data may cause reads
|
||||
// outside of buffer boundaries.
|
||||
FLATBUFFERS_ASSERT(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// @brief This return the prefixed size of a FlatBuffer.
|
||||
template<typename SizeT = uoffset_t>
|
||||
inline SizeT GetPrefixedSize(const uint8_t *buf) {
|
||||
return ReadScalar<SizeT>(buf);
|
||||
}
|
||||
|
||||
// Base class for native objects (FlatBuffer data de-serialized into native
|
||||
// C++ data structures).
|
||||
// Contains no functionality, purely documentative.
|
||||
struct NativeTable {};
|
||||
|
||||
/// @brief Function types to be used with resolving hashes into objects and
|
||||
/// back again. The resolver gets a pointer to a field inside an object API
|
||||
/// object that is of the type specified in the schema using the attribute
|
||||
/// `cpp_type` (it is thus important whatever you write to this address
|
||||
/// matches that type). The value of this field is initially null, so you
|
||||
/// may choose to implement a delayed binding lookup using this function
|
||||
/// if you wish. The resolver does the opposite lookup, for when the object
|
||||
/// is being serialized again.
|
||||
typedef uint64_t hash_value_t;
|
||||
typedef std::function<void(void **pointer_adr, hash_value_t hash)>
|
||||
resolver_function_t;
|
||||
typedef std::function<hash_value_t(void *pointer)> rehasher_function_t;
|
||||
|
||||
// Helper function to test if a field is present, using any of the field
|
||||
// enums in the generated code.
|
||||
// `table` must be a generated table type. Since this is a template parameter,
|
||||
// this is not typechecked to be a subclass of Table, so beware!
|
||||
// Note: this function will return false for fields equal to the default
|
||||
// value, since they're not stored in the buffer (unless force_defaults was
|
||||
// used).
|
||||
template<typename T>
|
||||
bool IsFieldPresent(const T *table, typename T::FlatBuffersVTableOffset field) {
|
||||
// Cast, since Table is a private baseclass of any table types.
|
||||
return reinterpret_cast<const Table *>(table)->CheckField(
|
||||
static_cast<voffset_t>(field));
|
||||
}
|
||||
|
||||
// Utility function for reverse lookups on the EnumNames*() functions
|
||||
// (in the generated C++ code)
|
||||
// names must be NULL terminated.
|
||||
inline int LookupEnum(const char **names, const char *name) {
|
||||
for (const char **p = names; *p; p++)
|
||||
if (!strcmp(*p, name)) return static_cast<int>(p - names);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// These macros allow us to layout a struct with a guarantee that they'll end
|
||||
// up looking the same on different compilers and platforms.
|
||||
// It does this by disallowing the compiler to do any padding, and then
|
||||
// does padding itself by inserting extra padding fields that make every
|
||||
// element aligned to its own size.
|
||||
// Additionally, it manually sets the alignment of the struct as a whole,
|
||||
// which is typically its largest element, or a custom size set in the schema
|
||||
// by the force_align attribute.
|
||||
// These are used in the generated code only.
|
||||
|
||||
// clang-format off
|
||||
#if defined(_MSC_VER)
|
||||
#define FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(alignment) \
|
||||
__pragma(pack(1)) \
|
||||
struct __declspec(align(alignment))
|
||||
#define FLATBUFFERS_STRUCT_END(name, size) \
|
||||
__pragma(pack()) \
|
||||
static_assert(sizeof(name) == size, "compiler breaks packing rules")
|
||||
#elif defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__)
|
||||
#define FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(alignment) \
|
||||
_Pragma("pack(1)") \
|
||||
struct __attribute__((aligned(alignment)))
|
||||
#define FLATBUFFERS_STRUCT_END(name, size) \
|
||||
_Pragma("pack()") \
|
||||
static_assert(sizeof(name) == size, "compiler breaks packing rules")
|
||||
#else
|
||||
#error Unknown compiler, please define structure alignment macros
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
// Minimal reflection via code generation.
|
||||
// Besides full-fat reflection (see reflection.h) and parsing/printing by
|
||||
// loading schemas (see idl.h), we can also have code generation for minimal
|
||||
// reflection data which allows pretty-printing and other uses without needing
|
||||
// a schema or a parser.
|
||||
// Generate code with --reflect-types (types only) or --reflect-names (names
|
||||
// also) to enable.
|
||||
// See minireflect.h for utilities using this functionality.
|
||||
|
||||
// These types are organized slightly differently as the ones in idl.h.
|
||||
enum SequenceType { ST_TABLE, ST_STRUCT, ST_UNION, ST_ENUM };
|
||||
|
||||
// Scalars have the same order as in idl.h
|
||||
// clang-format off
|
||||
#define FLATBUFFERS_GEN_ELEMENTARY_TYPES(ET) \
|
||||
ET(ET_UTYPE) \
|
||||
ET(ET_BOOL) \
|
||||
ET(ET_CHAR) \
|
||||
ET(ET_UCHAR) \
|
||||
ET(ET_SHORT) \
|
||||
ET(ET_USHORT) \
|
||||
ET(ET_INT) \
|
||||
ET(ET_UINT) \
|
||||
ET(ET_LONG) \
|
||||
ET(ET_ULONG) \
|
||||
ET(ET_FLOAT) \
|
||||
ET(ET_DOUBLE) \
|
||||
ET(ET_STRING) \
|
||||
ET(ET_SEQUENCE) // See SequenceType.
|
||||
|
||||
enum ElementaryType {
|
||||
#define FLATBUFFERS_ET(E) E,
|
||||
FLATBUFFERS_GEN_ELEMENTARY_TYPES(FLATBUFFERS_ET)
|
||||
#undef FLATBUFFERS_ET
|
||||
};
|
||||
|
||||
inline const char * const *ElementaryTypeNames() {
|
||||
static const char * const names[] = {
|
||||
#define FLATBUFFERS_ET(E) #E,
|
||||
FLATBUFFERS_GEN_ELEMENTARY_TYPES(FLATBUFFERS_ET)
|
||||
#undef FLATBUFFERS_ET
|
||||
};
|
||||
return names;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
// Basic type info cost just 16bits per field!
|
||||
// We're explicitly defining the signedness since the signedness of integer
|
||||
// bitfields is otherwise implementation-defined and causes warnings on older
|
||||
// GCC compilers.
|
||||
struct TypeCode {
|
||||
// ElementaryType
|
||||
unsigned short base_type : 4;
|
||||
// Either vector (in table) or array (in struct)
|
||||
unsigned short is_repeating : 1;
|
||||
// Index into type_refs below, or -1 for none.
|
||||
signed short sequence_ref : 11;
|
||||
};
|
||||
|
||||
static_assert(sizeof(TypeCode) == 2, "TypeCode");
|
||||
|
||||
struct TypeTable;
|
||||
|
||||
// Signature of the static method present in each type.
|
||||
typedef const TypeTable *(*TypeFunction)();
|
||||
|
||||
struct TypeTable {
|
||||
SequenceType st;
|
||||
size_t num_elems; // of type_codes, values, names (but not type_refs).
|
||||
const TypeCode *type_codes; // num_elems count
|
||||
const TypeFunction *type_refs; // less than num_elems entries (see TypeCode).
|
||||
const int16_t *array_sizes; // less than num_elems entries (see TypeCode).
|
||||
const int64_t *values; // Only set for non-consecutive enum/union or structs.
|
||||
const char *const *names; // Only set if compiled with --reflect-names.
|
||||
};
|
||||
|
||||
// String which identifies the current version of FlatBuffers.
|
||||
inline const char *flatbuffers_version_string() {
|
||||
return "FlatBuffers " FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MAJOR) "."
|
||||
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_MINOR) "."
|
||||
FLATBUFFERS_STRING(FLATBUFFERS_VERSION_REVISION);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
#define FLATBUFFERS_DEFINE_BITMASK_OPERATORS(E, T)\
|
||||
inline E operator | (E lhs, E rhs){\
|
||||
return E(T(lhs) | T(rhs));\
|
||||
}\
|
||||
inline E operator & (E lhs, E rhs){\
|
||||
return E(T(lhs) & T(rhs));\
|
||||
}\
|
||||
inline E operator ^ (E lhs, E rhs){\
|
||||
return E(T(lhs) ^ T(rhs));\
|
||||
}\
|
||||
inline E operator ~ (E lhs){\
|
||||
return E(~T(lhs));\
|
||||
}\
|
||||
inline E operator |= (E &lhs, E rhs){\
|
||||
lhs = lhs | rhs;\
|
||||
return lhs;\
|
||||
}\
|
||||
inline E operator &= (E &lhs, E rhs){\
|
||||
lhs = lhs & rhs;\
|
||||
return lhs;\
|
||||
}\
|
||||
inline E operator ^= (E &lhs, E rhs){\
|
||||
lhs = lhs ^ rhs;\
|
||||
return lhs;\
|
||||
}\
|
||||
inline bool operator !(E rhs) \
|
||||
{\
|
||||
return !bool(T(rhs)); \
|
||||
}
|
||||
/// @endcond
|
||||
} // namespace flatbuffers
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // FLATBUFFERS_H_
|
||||
@@ -0,0 +1,513 @@
|
||||
/*
|
||||
* Copyright 2017 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_STL_EMULATION_H_
|
||||
#define FLATBUFFERS_STL_EMULATION_H_
|
||||
|
||||
// clang-format off
|
||||
#include "flatbuffers/base.h"
|
||||
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <limits>
|
||||
|
||||
#ifndef FLATBUFFERS_USE_STD_OPTIONAL
|
||||
// Detect C++17 compatible compiler.
|
||||
// __cplusplus >= 201703L - a compiler has support of 'static inline' variables.
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201703L) \
|
||||
|| (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
#define FLATBUFFERS_USE_STD_OPTIONAL 1
|
||||
#else
|
||||
#define FLATBUFFERS_USE_STD_OPTIONAL 0
|
||||
#endif // (defined(__cplusplus) && __cplusplus >= 201703L) ...
|
||||
#endif // FLATBUFFERS_USE_STD_OPTIONAL
|
||||
|
||||
#if FLATBUFFERS_USE_STD_OPTIONAL
|
||||
#include <optional>
|
||||
#endif
|
||||
|
||||
#ifndef FLATBUFFERS_USE_STD_SPAN
|
||||
// Testing __cpp_lib_span requires including either <version> or <span>,
|
||||
// both of which were added in C++20.
|
||||
// See: https://en.cppreference.com/w/cpp/utility/feature_test
|
||||
#if defined(__cplusplus) && __cplusplus >= 202002L
|
||||
#define FLATBUFFERS_USE_STD_SPAN 1
|
||||
#endif
|
||||
#endif // FLATBUFFERS_USE_STD_SPAN
|
||||
|
||||
#if defined(FLATBUFFERS_USE_STD_SPAN)
|
||||
#include <array>
|
||||
#include <span>
|
||||
#else
|
||||
// Disable non-trivial ctors if FLATBUFFERS_SPAN_MINIMAL defined.
|
||||
#if !defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
#define FLATBUFFERS_SPAN_MINIMAL
|
||||
#else
|
||||
// Enable implicit construction of a span<T,N> from a std::array<T,N>.
|
||||
#include <array>
|
||||
#endif
|
||||
#endif // defined(FLATBUFFERS_USE_STD_SPAN)
|
||||
|
||||
// This header provides backwards compatibility for older versions of the STL.
|
||||
namespace flatbuffers {
|
||||
|
||||
#if defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
template <typename T>
|
||||
using numeric_limits = std::numeric_limits<T>;
|
||||
#else
|
||||
template <typename T> class numeric_limits :
|
||||
public std::numeric_limits<T> {};
|
||||
#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
|
||||
#if defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
template <typename T> using is_scalar = std::is_scalar<T>;
|
||||
template <typename T, typename U> using is_same = std::is_same<T,U>;
|
||||
template <typename T> using is_floating_point = std::is_floating_point<T>;
|
||||
template <typename T> using is_unsigned = std::is_unsigned<T>;
|
||||
template <typename T> using is_enum = std::is_enum<T>;
|
||||
template <typename T> using make_unsigned = std::make_unsigned<T>;
|
||||
template<bool B, class T, class F>
|
||||
using conditional = std::conditional<B, T, F>;
|
||||
template<class T, T v>
|
||||
using integral_constant = std::integral_constant<T, v>;
|
||||
template <bool B>
|
||||
using bool_constant = integral_constant<bool, B>;
|
||||
using true_type = std::true_type;
|
||||
using false_type = std::false_type;
|
||||
#else
|
||||
// MSVC 2010 doesn't support C++11 aliases.
|
||||
template <typename T> struct is_scalar : public std::is_scalar<T> {};
|
||||
template <typename T, typename U> struct is_same : public std::is_same<T,U> {};
|
||||
template <typename T> struct is_floating_point :
|
||||
public std::is_floating_point<T> {};
|
||||
template <typename T> struct is_unsigned : public std::is_unsigned<T> {};
|
||||
template <typename T> struct is_enum : public std::is_enum<T> {};
|
||||
template <typename T> struct make_unsigned : public std::make_unsigned<T> {};
|
||||
template<bool B, class T, class F>
|
||||
struct conditional : public std::conditional<B, T, F> {};
|
||||
template<class T, T v>
|
||||
struct integral_constant : public std::integral_constant<T, v> {};
|
||||
template <bool B>
|
||||
struct bool_constant : public integral_constant<bool, B> {};
|
||||
typedef bool_constant<true> true_type;
|
||||
typedef bool_constant<false> false_type;
|
||||
#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
|
||||
#if defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
template <class T> using unique_ptr = std::unique_ptr<T>;
|
||||
#else
|
||||
// MSVC 2010 doesn't support C++11 aliases.
|
||||
// We're manually "aliasing" the class here as we want to bring unique_ptr
|
||||
// into the flatbuffers namespace. We have unique_ptr in the flatbuffers
|
||||
// namespace we have a completely independent implementation (see below)
|
||||
// for C++98 STL implementations.
|
||||
template <class T> class unique_ptr : public std::unique_ptr<T> {
|
||||
public:
|
||||
unique_ptr() {}
|
||||
explicit unique_ptr(T* p) : std::unique_ptr<T>(p) {}
|
||||
unique_ptr(std::unique_ptr<T>&& u) { *this = std::move(u); }
|
||||
unique_ptr(unique_ptr&& u) { *this = std::move(u); }
|
||||
unique_ptr& operator=(std::unique_ptr<T>&& u) {
|
||||
std::unique_ptr<T>::reset(u.release());
|
||||
return *this;
|
||||
}
|
||||
unique_ptr& operator=(unique_ptr&& u) {
|
||||
std::unique_ptr<T>::reset(u.release());
|
||||
return *this;
|
||||
}
|
||||
unique_ptr& operator=(T* p) {
|
||||
return std::unique_ptr<T>::operator=(p);
|
||||
}
|
||||
};
|
||||
#endif // defined(FLATBUFFERS_TEMPLATES_ALIASES)
|
||||
|
||||
#if FLATBUFFERS_USE_STD_OPTIONAL
|
||||
template<class T>
|
||||
using Optional = std::optional<T>;
|
||||
using nullopt_t = std::nullopt_t;
|
||||
inline constexpr nullopt_t nullopt = std::nullopt;
|
||||
|
||||
#else
|
||||
// Limited implementation of Optional<T> type for a scalar T.
|
||||
// This implementation limited by trivial types compatible with
|
||||
// std::is_arithmetic<T> or std::is_enum<T> type traits.
|
||||
|
||||
// A tag to indicate an empty flatbuffers::optional<T>.
|
||||
struct nullopt_t {
|
||||
explicit FLATBUFFERS_CONSTEXPR_CPP11 nullopt_t(int) {}
|
||||
};
|
||||
|
||||
#if defined(FLATBUFFERS_CONSTEXPR_DEFINED)
|
||||
namespace internal {
|
||||
template <class> struct nullopt_holder {
|
||||
static constexpr nullopt_t instance_ = nullopt_t(0);
|
||||
};
|
||||
template<class Dummy>
|
||||
constexpr nullopt_t nullopt_holder<Dummy>::instance_;
|
||||
}
|
||||
static constexpr const nullopt_t &nullopt = internal::nullopt_holder<void>::instance_;
|
||||
|
||||
#else
|
||||
namespace internal {
|
||||
template <class> struct nullopt_holder {
|
||||
static const nullopt_t instance_;
|
||||
};
|
||||
template<class Dummy>
|
||||
const nullopt_t nullopt_holder<Dummy>::instance_ = nullopt_t(0);
|
||||
}
|
||||
static const nullopt_t &nullopt = internal::nullopt_holder<void>::instance_;
|
||||
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
class Optional FLATBUFFERS_FINAL_CLASS {
|
||||
// Non-scalar 'T' would extremely complicated Optional<T>.
|
||||
// Use is_scalar<T> checking because flatbuffers flatbuffers::is_arithmetic<T>
|
||||
// isn't implemented.
|
||||
static_assert(flatbuffers::is_scalar<T>::value, "unexpected type T");
|
||||
|
||||
public:
|
||||
~Optional() {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 Optional() FLATBUFFERS_NOEXCEPT
|
||||
: value_(), has_value_(false) {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 Optional(nullopt_t) FLATBUFFERS_NOEXCEPT
|
||||
: value_(), has_value_(false) {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 Optional(T val) FLATBUFFERS_NOEXCEPT
|
||||
: value_(val), has_value_(true) {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 Optional(const Optional &other) FLATBUFFERS_NOEXCEPT
|
||||
: value_(other.value_), has_value_(other.has_value_) {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(const Optional &other) FLATBUFFERS_NOEXCEPT {
|
||||
value_ = other.value_;
|
||||
has_value_ = other.has_value_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(nullopt_t) FLATBUFFERS_NOEXCEPT {
|
||||
value_ = T();
|
||||
has_value_ = false;
|
||||
return *this;
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP14 Optional &operator=(T val) FLATBUFFERS_NOEXCEPT {
|
||||
value_ = val;
|
||||
has_value_ = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void reset() FLATBUFFERS_NOEXCEPT {
|
||||
*this = nullopt;
|
||||
}
|
||||
|
||||
void swap(Optional &other) FLATBUFFERS_NOEXCEPT {
|
||||
std::swap(value_, other.value_);
|
||||
std::swap(has_value_, other.has_value_);
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 FLATBUFFERS_EXPLICIT_CPP11 operator bool() const FLATBUFFERS_NOEXCEPT {
|
||||
return has_value_;
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool has_value() const FLATBUFFERS_NOEXCEPT {
|
||||
return has_value_;
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 const T& operator*() const FLATBUFFERS_NOEXCEPT {
|
||||
return value_;
|
||||
}
|
||||
|
||||
const T& value() const {
|
||||
FLATBUFFERS_ASSERT(has_value());
|
||||
return value_;
|
||||
}
|
||||
|
||||
T value_or(T default_value) const FLATBUFFERS_NOEXCEPT {
|
||||
return has_value() ? value_ : default_value;
|
||||
}
|
||||
|
||||
private:
|
||||
T value_;
|
||||
bool has_value_;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& opt, nullopt_t) FLATBUFFERS_NOEXCEPT {
|
||||
return !opt;
|
||||
}
|
||||
template<class T>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(nullopt_t, const Optional<T>& opt) FLATBUFFERS_NOEXCEPT {
|
||||
return !opt;
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& lhs, const U& rhs) FLATBUFFERS_NOEXCEPT {
|
||||
return static_cast<bool>(lhs) && (*lhs == rhs);
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const T& lhs, const Optional<U>& rhs) FLATBUFFERS_NOEXCEPT {
|
||||
return static_cast<bool>(rhs) && (lhs == *rhs);
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool operator==(const Optional<T>& lhs, const Optional<U>& rhs) FLATBUFFERS_NOEXCEPT {
|
||||
return static_cast<bool>(lhs) != static_cast<bool>(rhs)
|
||||
? false
|
||||
: !static_cast<bool>(lhs) ? false : (*lhs == *rhs);
|
||||
}
|
||||
#endif // FLATBUFFERS_USE_STD_OPTIONAL
|
||||
|
||||
|
||||
// Very limited and naive partial implementation of C++20 std::span<T,Extent>.
|
||||
#if defined(FLATBUFFERS_USE_STD_SPAN)
|
||||
inline constexpr std::size_t dynamic_extent = std::dynamic_extent;
|
||||
template<class T, std::size_t Extent = std::dynamic_extent>
|
||||
using span = std::span<T, Extent>;
|
||||
|
||||
#else // !defined(FLATBUFFERS_USE_STD_SPAN)
|
||||
FLATBUFFERS_CONSTEXPR std::size_t dynamic_extent = static_cast<std::size_t>(-1);
|
||||
|
||||
// Exclude this code if MSVC2010 or non-STL Android is active.
|
||||
// The non-STL Android doesn't have `std::is_convertible` required for SFINAE.
|
||||
#if !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
namespace internal {
|
||||
// This is SFINAE helper class for checking of a common condition:
|
||||
// > This overload only participates in overload resolution
|
||||
// > Check whether a pointer to an array of From can be converted
|
||||
// > to a pointer to an array of To.
|
||||
// This helper is used for checking of 'From -> const From'.
|
||||
template<class To, std::size_t Extent, class From, std::size_t N>
|
||||
struct is_span_convertible {
|
||||
using type =
|
||||
typename std::conditional<std::is_convertible<From (*)[], To (*)[]>::value
|
||||
&& (Extent == dynamic_extent || N == Extent),
|
||||
int, void>::type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct SpanIterator {
|
||||
// TODO: upgrade to std::random_access_iterator_tag.
|
||||
using iterator_category = std::forward_iterator_tag;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using value_type = typename std::remove_cv<T>::type;
|
||||
using reference = T&;
|
||||
using pointer = T*;
|
||||
|
||||
// Convince MSVC compiler that this iterator is trusted (it is verified).
|
||||
#ifdef _MSC_VER
|
||||
using _Unchecked_type = pointer;
|
||||
#endif // _MSC_VER
|
||||
|
||||
SpanIterator(pointer ptr) : ptr_(ptr) {}
|
||||
reference operator*() const { return *ptr_; }
|
||||
pointer operator->() { return ptr_; }
|
||||
SpanIterator& operator++() { ptr_++; return *this; }
|
||||
SpanIterator operator++(int) { auto tmp = *this; ++(*this); return tmp; }
|
||||
|
||||
friend bool operator== (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ == rhs.ptr_; }
|
||||
friend bool operator!= (const SpanIterator& lhs, const SpanIterator& rhs) { return lhs.ptr_ != rhs.ptr_; }
|
||||
|
||||
private:
|
||||
pointer ptr_;
|
||||
};
|
||||
} // namespace internal
|
||||
#endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
|
||||
// T - element type; must be a complete type that is not an abstract
|
||||
// class type.
|
||||
// Extent - the number of elements in the sequence, or dynamic.
|
||||
template<class T, std::size_t Extent = dynamic_extent>
|
||||
class span FLATBUFFERS_FINAL_CLASS {
|
||||
public:
|
||||
typedef T element_type;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
typedef std::size_t size_type;
|
||||
|
||||
static FLATBUFFERS_CONSTEXPR size_type extent = Extent;
|
||||
|
||||
// Returns the number of elements in the span.
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 size_type size() const FLATBUFFERS_NOEXCEPT {
|
||||
return count_;
|
||||
}
|
||||
|
||||
// Returns the size of the sequence in bytes.
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
size_type size_bytes() const FLATBUFFERS_NOEXCEPT {
|
||||
return size() * sizeof(element_type);
|
||||
}
|
||||
|
||||
// Checks if the span is empty.
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 bool empty() const FLATBUFFERS_NOEXCEPT {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
// Returns a pointer to the beginning of the sequence.
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 pointer data() const FLATBUFFERS_NOEXCEPT {
|
||||
return data_;
|
||||
}
|
||||
|
||||
#if !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
using Iterator = internal::SpanIterator<T>;
|
||||
|
||||
Iterator begin() const { return Iterator(data()); }
|
||||
Iterator end() const { return Iterator(data() + size()); }
|
||||
#endif
|
||||
|
||||
// Returns a reference to the idx-th element of the sequence.
|
||||
// The behavior is undefined if the idx is greater than or equal to size().
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 reference operator[](size_type idx) const {
|
||||
return data()[idx];
|
||||
}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span(const span &other) FLATBUFFERS_NOEXCEPT
|
||||
: data_(other.data_), count_(other.count_) {}
|
||||
|
||||
FLATBUFFERS_CONSTEXPR_CPP14 span &operator=(const span &other)
|
||||
FLATBUFFERS_NOEXCEPT {
|
||||
data_ = other.data_;
|
||||
count_ = other.count_;
|
||||
}
|
||||
|
||||
// Limited implementation of
|
||||
// `template <class It> constexpr std::span(It first, size_type count);`.
|
||||
//
|
||||
// Constructs a span that is a view over the range [first, first + count);
|
||||
// the resulting span has: data() == first and size() == count.
|
||||
// The behavior is undefined if [first, first + count) is not a valid range,
|
||||
// or if (extent != flatbuffers::dynamic_extent && count != extent).
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
explicit span(pointer first, size_type count) FLATBUFFERS_NOEXCEPT
|
||||
: data_ (Extent == dynamic_extent ? first : (Extent == count ? first : nullptr)),
|
||||
count_(Extent == dynamic_extent ? count : (Extent == count ? Extent : 0)) {
|
||||
// Make span empty if the count argument is incompatible with span<T,N>.
|
||||
}
|
||||
|
||||
// Exclude this code if MSVC2010 is active. The MSVC2010 isn't C++11
|
||||
// compliant, it doesn't support default template arguments for functions.
|
||||
#if defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr),
|
||||
count_(0) {
|
||||
static_assert(extent == 0 || extent == dynamic_extent, "invalid span");
|
||||
}
|
||||
|
||||
#else
|
||||
// Constructs an empty span whose data() == nullptr and size() == 0.
|
||||
// This overload only participates in overload resolution if
|
||||
// extent == 0 || extent == flatbuffers::dynamic_extent.
|
||||
// A dummy template argument N is need dependency for SFINAE.
|
||||
template<std::size_t N = 0,
|
||||
typename internal::is_span_convertible<element_type, Extent, element_type, (N - N)>::type = 0>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span() FLATBUFFERS_NOEXCEPT : data_(nullptr),
|
||||
count_(0) {
|
||||
static_assert(extent == 0 || extent == dynamic_extent, "invalid span");
|
||||
}
|
||||
|
||||
// Constructs a span that is a view over the array arr; the resulting span
|
||||
// has size() == N and data() == std::data(arr). These overloads only
|
||||
// participate in overload resolution if
|
||||
// extent == std::dynamic_extent || N == extent is true and
|
||||
// std::remove_pointer_t<decltype(std::data(arr))>(*)[]
|
||||
// is convertible to element_type (*)[].
|
||||
template<std::size_t N,
|
||||
typename internal::is_span_convertible<element_type, Extent, element_type, N>::type = 0>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span(element_type (&arr)[N]) FLATBUFFERS_NOEXCEPT
|
||||
: data_(arr), count_(N) {}
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename internal::is_span_convertible<element_type, Extent, U, N>::type = 0>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span(std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
|
||||
: data_(arr.data()), count_(N) {}
|
||||
|
||||
//template<class U, std::size_t N,
|
||||
// int = 0>
|
||||
//FLATBUFFERS_CONSTEXPR_CPP11 span(std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
|
||||
// : data_(arr.data()), count_(N) {}
|
||||
|
||||
template<class U, std::size_t N,
|
||||
typename internal::is_span_convertible<element_type, Extent, U, N>::type = 0>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span(const std::array<U, N> &arr) FLATBUFFERS_NOEXCEPT
|
||||
: data_(arr.data()), count_(N) {}
|
||||
|
||||
// Converting constructor from another span s;
|
||||
// the resulting span has size() == s.size() and data() == s.data().
|
||||
// This overload only participates in overload resolution
|
||||
// if extent == std::dynamic_extent || N == extent is true and U (*)[]
|
||||
// is convertible to element_type (*)[].
|
||||
template<class U, std::size_t N,
|
||||
typename internal::is_span_convertible<element_type, Extent, U, N>::type = 0>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 span(const flatbuffers::span<U, N> &s) FLATBUFFERS_NOEXCEPT
|
||||
: span(s.data(), s.size()) {
|
||||
}
|
||||
|
||||
#endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
|
||||
private:
|
||||
// This is a naive implementation with 'count_' member even if (Extent != dynamic_extent).
|
||||
pointer const data_;
|
||||
size_type count_;
|
||||
};
|
||||
#endif // defined(FLATBUFFERS_USE_STD_SPAN)
|
||||
|
||||
#if !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<ElementType, Extent> make_span(ElementType(&arr)[Extent]) FLATBUFFERS_NOEXCEPT {
|
||||
return span<ElementType, Extent>(arr);
|
||||
}
|
||||
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<const ElementType, Extent> make_span(const ElementType(&arr)[Extent]) FLATBUFFERS_NOEXCEPT {
|
||||
return span<const ElementType, Extent>(arr);
|
||||
}
|
||||
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<ElementType, Extent> make_span(std::array<ElementType, Extent> &arr) FLATBUFFERS_NOEXCEPT {
|
||||
return span<ElementType, Extent>(arr);
|
||||
}
|
||||
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<const ElementType, Extent> make_span(const std::array<ElementType, Extent> &arr) FLATBUFFERS_NOEXCEPT {
|
||||
return span<const ElementType, Extent>(arr);
|
||||
}
|
||||
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<ElementType, dynamic_extent> make_span(ElementType *first, std::size_t count) FLATBUFFERS_NOEXCEPT {
|
||||
return span<ElementType, dynamic_extent>(first, count);
|
||||
}
|
||||
|
||||
template<class ElementType, std::size_t Extent>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11
|
||||
flatbuffers::span<const ElementType, dynamic_extent> make_span(const ElementType *first, std::size_t count) FLATBUFFERS_NOEXCEPT {
|
||||
return span<const ElementType, dynamic_extent>(first, count);
|
||||
}
|
||||
#endif // !defined(FLATBUFFERS_SPAN_MINIMAL)
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_STL_EMULATION_H_
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_STRING_H_
|
||||
#define FLATBUFFERS_STRING_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/vector.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
struct String : public Vector<char> {
|
||||
const char *c_str() const { return reinterpret_cast<const char *>(Data()); }
|
||||
std::string str() const { return std::string(c_str(), size()); }
|
||||
|
||||
// clang-format off
|
||||
#ifdef FLATBUFFERS_HAS_STRING_VIEW
|
||||
flatbuffers::string_view string_view() const {
|
||||
return flatbuffers::string_view(c_str(), size());
|
||||
}
|
||||
#endif // FLATBUFFERS_HAS_STRING_VIEW
|
||||
// clang-format on
|
||||
|
||||
bool operator<(const String &o) const {
|
||||
return StringLessThan(this->data(), this->size(), o.data(), o.size());
|
||||
}
|
||||
};
|
||||
|
||||
// Convenience function to get std::string from a String returning an empty
|
||||
// string on null pointer.
|
||||
static inline std::string GetString(const String *str) {
|
||||
return str ? str->str() : "";
|
||||
}
|
||||
|
||||
// Convenience function to get char* from a String returning an empty string on
|
||||
// null pointer.
|
||||
static inline const char *GetCstring(const String *str) {
|
||||
return str ? str->c_str() : "";
|
||||
}
|
||||
|
||||
#ifdef FLATBUFFERS_HAS_STRING_VIEW
|
||||
// Convenience function to get string_view from a String returning an empty
|
||||
// string_view on null pointer.
|
||||
static inline flatbuffers::string_view GetStringView(const String *str) {
|
||||
return str ? str->string_view() : flatbuffers::string_view();
|
||||
}
|
||||
#endif // FLATBUFFERS_HAS_STRING_VIEW
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_STRING_H_
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_STRUCT_H_
|
||||
#define FLATBUFFERS_STRUCT_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// "structs" are flat structures that do not have an offset table, thus
|
||||
// always have all members present and do not support forwards/backwards
|
||||
// compatible extensions.
|
||||
|
||||
class Struct FLATBUFFERS_FINAL_CLASS {
|
||||
public:
|
||||
template<typename T> T GetField(uoffset_t o) const {
|
||||
return ReadScalar<T>(&data_[o]);
|
||||
}
|
||||
|
||||
template<typename T> T GetStruct(uoffset_t o) const {
|
||||
return reinterpret_cast<T>(&data_[o]);
|
||||
}
|
||||
|
||||
const uint8_t *GetAddressOf(uoffset_t o) const { return &data_[o]; }
|
||||
uint8_t *GetAddressOf(uoffset_t o) { return &data_[o]; }
|
||||
|
||||
private:
|
||||
// private constructor & copy constructor: you obtain instances of this
|
||||
// class by pointing to existing data only
|
||||
Struct();
|
||||
Struct(const Struct &);
|
||||
Struct &operator=(const Struct &);
|
||||
|
||||
uint8_t data_[1];
|
||||
};
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_STRUCT_H_
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_TABLE_H_
|
||||
#define FLATBUFFERS_TABLE_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/verifier.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// "tables" use an offset table (possibly shared) that allows fields to be
|
||||
// omitted and added at will, but uses an extra indirection to read.
|
||||
class Table {
|
||||
public:
|
||||
const uint8_t *GetVTable() const {
|
||||
return data_ - ReadScalar<soffset_t>(data_);
|
||||
}
|
||||
|
||||
// This gets the field offset for any of the functions below it, or 0
|
||||
// if the field was not present.
|
||||
voffset_t GetOptionalFieldOffset(voffset_t field) const {
|
||||
// The vtable offset is always at the start.
|
||||
auto vtable = GetVTable();
|
||||
// The first element is the size of the vtable (fields + type id + itself).
|
||||
auto vtsize = ReadScalar<voffset_t>(vtable);
|
||||
// If the field we're accessing is outside the vtable, we're reading older
|
||||
// data, so it's the same as if the offset was 0 (not present).
|
||||
return field < vtsize ? ReadScalar<voffset_t>(vtable + field) : 0;
|
||||
}
|
||||
|
||||
template<typename T> T GetField(voffset_t field, T defaultval) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
return field_offset ? ReadScalar<T>(data_ + field_offset) : defaultval;
|
||||
}
|
||||
|
||||
template<typename P, typename OffsetSize = uoffset_t>
|
||||
P GetPointer(voffset_t field) {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
auto p = data_ + field_offset;
|
||||
return field_offset ? reinterpret_cast<P>(p + ReadScalar<OffsetSize>(p))
|
||||
: nullptr;
|
||||
}
|
||||
template<typename P, typename OffsetSize = uoffset_t>
|
||||
P GetPointer(voffset_t field) const {
|
||||
return const_cast<Table *>(this)->GetPointer<P, OffsetSize>(field);
|
||||
}
|
||||
|
||||
template<typename P> P GetPointer64(voffset_t field) {
|
||||
return GetPointer<P, uoffset64_t>(field);
|
||||
}
|
||||
|
||||
template<typename P> P GetPointer64(voffset_t field) const {
|
||||
return GetPointer<P, uoffset64_t>(field);
|
||||
}
|
||||
|
||||
template<typename P> P GetStruct(voffset_t field) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
auto p = const_cast<uint8_t *>(data_ + field_offset);
|
||||
return field_offset ? reinterpret_cast<P>(p) : nullptr;
|
||||
}
|
||||
|
||||
template<typename Raw, typename Face>
|
||||
flatbuffers::Optional<Face> GetOptional(voffset_t field) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
auto p = data_ + field_offset;
|
||||
return field_offset ? Optional<Face>(static_cast<Face>(ReadScalar<Raw>(p)))
|
||||
: Optional<Face>();
|
||||
}
|
||||
|
||||
template<typename T> bool SetField(voffset_t field, T val, T def) {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
if (!field_offset) return IsTheSameAs(val, def);
|
||||
WriteScalar(data_ + field_offset, val);
|
||||
return true;
|
||||
}
|
||||
template<typename T> bool SetField(voffset_t field, T val) {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
if (!field_offset) return false;
|
||||
WriteScalar(data_ + field_offset, val);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SetPointer(voffset_t field, const uint8_t *val) {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
if (!field_offset) return false;
|
||||
WriteScalar(data_ + field_offset,
|
||||
static_cast<uoffset_t>(val - (data_ + field_offset)));
|
||||
return true;
|
||||
}
|
||||
|
||||
uint8_t *GetAddressOf(voffset_t field) {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
return field_offset ? data_ + field_offset : nullptr;
|
||||
}
|
||||
const uint8_t *GetAddressOf(voffset_t field) const {
|
||||
return const_cast<Table *>(this)->GetAddressOf(field);
|
||||
}
|
||||
|
||||
bool CheckField(voffset_t field) const {
|
||||
return GetOptionalFieldOffset(field) != 0;
|
||||
}
|
||||
|
||||
// Verify the vtable of this table.
|
||||
// Call this once per table, followed by VerifyField once per field.
|
||||
bool VerifyTableStart(Verifier &verifier) const {
|
||||
return verifier.VerifyTableStart(data_);
|
||||
}
|
||||
|
||||
// Verify a particular field.
|
||||
template<typename T>
|
||||
bool VerifyField(const Verifier &verifier, voffset_t field,
|
||||
size_t align) const {
|
||||
// Calling GetOptionalFieldOffset should be safe now thanks to
|
||||
// VerifyTable().
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
// Check the actual field.
|
||||
return !field_offset || verifier.VerifyField<T>(data_, field_offset, align);
|
||||
}
|
||||
|
||||
// VerifyField for required fields.
|
||||
template<typename T>
|
||||
bool VerifyFieldRequired(const Verifier &verifier, voffset_t field,
|
||||
size_t align) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
return verifier.Check(field_offset != 0) &&
|
||||
verifier.VerifyField<T>(data_, field_offset, align);
|
||||
}
|
||||
|
||||
// Versions for offsets.
|
||||
template<typename OffsetT = uoffset_t>
|
||||
bool VerifyOffset(const Verifier &verifier, voffset_t field) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
return !field_offset || verifier.VerifyOffset<OffsetT>(data_, field_offset);
|
||||
}
|
||||
|
||||
template<typename OffsetT = uoffset_t>
|
||||
bool VerifyOffsetRequired(const Verifier &verifier, voffset_t field) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
return verifier.Check(field_offset != 0) &&
|
||||
verifier.VerifyOffset<OffsetT>(data_, field_offset);
|
||||
}
|
||||
|
||||
bool VerifyOffset64(const Verifier &verifier, voffset_t field) const {
|
||||
return VerifyOffset<uoffset64_t>(verifier, field);
|
||||
}
|
||||
|
||||
bool VerifyOffset64Required(const Verifier &verifier, voffset_t field) const {
|
||||
return VerifyOffsetRequired<uoffset64_t>(verifier, field);
|
||||
}
|
||||
|
||||
private:
|
||||
// private constructor & copy constructor: you obtain instances of this
|
||||
// class by pointing to existing data only
|
||||
Table();
|
||||
Table(const Table &other);
|
||||
Table &operator=(const Table &);
|
||||
|
||||
uint8_t data_[1];
|
||||
};
|
||||
|
||||
// This specialization allows avoiding warnings like:
|
||||
// MSVC C4800: type: forcing value to bool 'true' or 'false'.
|
||||
template<>
|
||||
inline flatbuffers::Optional<bool> Table::GetOptional<uint8_t, bool>(
|
||||
voffset_t field) const {
|
||||
auto field_offset = GetOptionalFieldOffset(field);
|
||||
auto p = data_ + field_offset;
|
||||
return field_offset ? Optional<bool>(ReadScalar<uint8_t>(p) != 0)
|
||||
: Optional<bool>();
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_TABLE_H_
|
||||
+400
@@ -0,0 +1,400 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_VECTOR_H_
|
||||
#define FLATBUFFERS_VECTOR_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/buffer.h"
|
||||
#include "flatbuffers/stl_emulation.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
struct String;
|
||||
|
||||
// An STL compatible iterator implementation for Vector below, effectively
|
||||
// calling Get() for every element.
|
||||
template<typename T, typename IT, typename Data = uint8_t *,
|
||||
typename SizeT = uoffset_t>
|
||||
struct VectorIterator {
|
||||
typedef std::random_access_iterator_tag iterator_category;
|
||||
typedef IT value_type;
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef IT *pointer;
|
||||
typedef IT &reference;
|
||||
|
||||
static const SizeT element_stride = IndirectHelper<T>::element_stride;
|
||||
|
||||
VectorIterator(Data data, SizeT i) : data_(data + element_stride * i) {}
|
||||
VectorIterator(const VectorIterator &other) : data_(other.data_) {}
|
||||
VectorIterator() : data_(nullptr) {}
|
||||
|
||||
VectorIterator &operator=(const VectorIterator &other) {
|
||||
data_ = other.data_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
VectorIterator &operator=(VectorIterator &&other) {
|
||||
data_ = other.data_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const VectorIterator &other) const {
|
||||
return data_ == other.data_;
|
||||
}
|
||||
|
||||
bool operator<(const VectorIterator &other) const {
|
||||
return data_ < other.data_;
|
||||
}
|
||||
|
||||
bool operator!=(const VectorIterator &other) const {
|
||||
return data_ != other.data_;
|
||||
}
|
||||
|
||||
difference_type operator-(const VectorIterator &other) const {
|
||||
return (data_ - other.data_) / element_stride;
|
||||
}
|
||||
|
||||
// Note: return type is incompatible with the standard
|
||||
// `reference operator*()`.
|
||||
IT operator*() const { return IndirectHelper<T>::Read(data_, 0); }
|
||||
|
||||
// Note: return type is incompatible with the standard
|
||||
// `pointer operator->()`.
|
||||
IT operator->() const { return IndirectHelper<T>::Read(data_, 0); }
|
||||
|
||||
VectorIterator &operator++() {
|
||||
data_ += element_stride;
|
||||
return *this;
|
||||
}
|
||||
|
||||
VectorIterator operator++(int) {
|
||||
VectorIterator temp(data_, 0);
|
||||
data_ += element_stride;
|
||||
return temp;
|
||||
}
|
||||
|
||||
VectorIterator operator+(const SizeT &offset) const {
|
||||
return VectorIterator(data_ + offset * element_stride, 0);
|
||||
}
|
||||
|
||||
VectorIterator &operator+=(const SizeT &offset) {
|
||||
data_ += offset * element_stride;
|
||||
return *this;
|
||||
}
|
||||
|
||||
VectorIterator &operator--() {
|
||||
data_ -= element_stride;
|
||||
return *this;
|
||||
}
|
||||
|
||||
VectorIterator operator--(int) {
|
||||
VectorIterator temp(data_, 0);
|
||||
data_ -= element_stride;
|
||||
return temp;
|
||||
}
|
||||
|
||||
VectorIterator operator-(const SizeT &offset) const {
|
||||
return VectorIterator(data_ - offset * element_stride, 0);
|
||||
}
|
||||
|
||||
VectorIterator &operator-=(const SizeT &offset) {
|
||||
data_ -= offset * element_stride;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
Data data_;
|
||||
};
|
||||
|
||||
template<typename T, typename IT, typename SizeT = uoffset_t>
|
||||
using VectorConstIterator = VectorIterator<T, IT, const uint8_t *, SizeT>;
|
||||
|
||||
template<typename Iterator>
|
||||
struct VectorReverseIterator : public std::reverse_iterator<Iterator> {
|
||||
explicit VectorReverseIterator(Iterator iter)
|
||||
: std::reverse_iterator<Iterator>(iter) {}
|
||||
|
||||
// Note: return type is incompatible with the standard
|
||||
// `reference operator*()`.
|
||||
typename Iterator::value_type operator*() const {
|
||||
auto tmp = std::reverse_iterator<Iterator>::current;
|
||||
return *--tmp;
|
||||
}
|
||||
|
||||
// Note: return type is incompatible with the standard
|
||||
// `pointer operator->()`.
|
||||
typename Iterator::value_type operator->() const {
|
||||
auto tmp = std::reverse_iterator<Iterator>::current;
|
||||
return *--tmp;
|
||||
}
|
||||
};
|
||||
|
||||
// This is used as a helper type for accessing vectors.
|
||||
// Vector::data() assumes the vector elements start after the length field.
|
||||
template<typename T, typename SizeT = uoffset_t> class Vector {
|
||||
public:
|
||||
typedef VectorIterator<T,
|
||||
typename IndirectHelper<T>::mutable_return_type,
|
||||
uint8_t *, SizeT>
|
||||
iterator;
|
||||
typedef VectorConstIterator<T, typename IndirectHelper<T>::return_type,
|
||||
SizeT>
|
||||
const_iterator;
|
||||
typedef VectorReverseIterator<iterator> reverse_iterator;
|
||||
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
|
||||
|
||||
typedef typename flatbuffers::bool_constant<flatbuffers::is_scalar<T>::value>
|
||||
scalar_tag;
|
||||
|
||||
static FLATBUFFERS_CONSTEXPR bool is_span_observable =
|
||||
scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1);
|
||||
|
||||
SizeT size() const { return EndianScalar(length_); }
|
||||
|
||||
// Deprecated: use size(). Here for backwards compatibility.
|
||||
FLATBUFFERS_ATTRIBUTE([[deprecated("use size() instead")]])
|
||||
SizeT Length() const { return size(); }
|
||||
|
||||
typedef SizeT size_type;
|
||||
typedef typename IndirectHelper<T>::return_type return_type;
|
||||
typedef typename IndirectHelper<T>::mutable_return_type
|
||||
mutable_return_type;
|
||||
typedef return_type value_type;
|
||||
|
||||
return_type Get(SizeT i) const {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
return IndirectHelper<T>::Read(Data(), i);
|
||||
}
|
||||
|
||||
return_type operator[](SizeT i) const { return Get(i); }
|
||||
|
||||
// If this is a Vector of enums, T will be its storage type, not the enum
|
||||
// type. This function makes it convenient to retrieve value with enum
|
||||
// type E.
|
||||
template<typename E> E GetEnum(SizeT i) const {
|
||||
return static_cast<E>(Get(i));
|
||||
}
|
||||
|
||||
// If this a vector of unions, this does the cast for you. There's no check
|
||||
// to make sure this is the right type!
|
||||
template<typename U> const U *GetAs(SizeT i) const {
|
||||
return reinterpret_cast<const U *>(Get(i));
|
||||
}
|
||||
|
||||
// If this a vector of unions, this does the cast for you. There's no check
|
||||
// to make sure this is actually a string!
|
||||
const String *GetAsString(SizeT i) const {
|
||||
return reinterpret_cast<const String *>(Get(i));
|
||||
}
|
||||
|
||||
const void *GetStructFromOffset(size_t o) const {
|
||||
return reinterpret_cast<const void *>(Data() + o);
|
||||
}
|
||||
|
||||
iterator begin() { return iterator(Data(), 0); }
|
||||
const_iterator begin() const { return const_iterator(Data(), 0); }
|
||||
|
||||
iterator end() { return iterator(Data(), size()); }
|
||||
const_iterator end() const { return const_iterator(Data(), size()); }
|
||||
|
||||
reverse_iterator rbegin() { return reverse_iterator(end()); }
|
||||
const_reverse_iterator rbegin() const {
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
reverse_iterator rend() { return reverse_iterator(begin()); }
|
||||
const_reverse_iterator rend() const {
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
const_iterator cbegin() const { return begin(); }
|
||||
|
||||
const_iterator cend() const { return end(); }
|
||||
|
||||
const_reverse_iterator crbegin() const { return rbegin(); }
|
||||
|
||||
const_reverse_iterator crend() const { return rend(); }
|
||||
|
||||
// Change elements if you have a non-const pointer to this object.
|
||||
// Scalars only. See reflection.h, and the documentation.
|
||||
void Mutate(SizeT i, const T &val) {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
WriteScalar(data() + i, val);
|
||||
}
|
||||
|
||||
// Change an element of a vector of tables (or strings).
|
||||
// "val" points to the new table/string, as you can obtain from
|
||||
// e.g. reflection::AddFlatBuffer().
|
||||
void MutateOffset(SizeT i, const uint8_t *val) {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
static_assert(sizeof(T) == sizeof(SizeT), "Unrelated types");
|
||||
WriteScalar(data() + i,
|
||||
static_cast<SizeT>(val - (Data() + i * sizeof(SizeT))));
|
||||
}
|
||||
|
||||
// Get a mutable pointer to tables/strings inside this vector.
|
||||
mutable_return_type GetMutableObject(SizeT i) const {
|
||||
FLATBUFFERS_ASSERT(i < size());
|
||||
return const_cast<mutable_return_type>(IndirectHelper<T>::Read(Data(), i));
|
||||
}
|
||||
|
||||
// The raw data in little endian format. Use with care.
|
||||
const uint8_t *Data() const {
|
||||
return reinterpret_cast<const uint8_t *>(&length_ + 1);
|
||||
}
|
||||
|
||||
uint8_t *Data() { return reinterpret_cast<uint8_t *>(&length_ + 1); }
|
||||
|
||||
// Similarly, but typed, much like std::vector::data
|
||||
const T *data() const { return reinterpret_cast<const T *>(Data()); }
|
||||
T *data() { return reinterpret_cast<T *>(Data()); }
|
||||
|
||||
template<typename K> return_type LookupByKey(K key) const {
|
||||
void *search_result = std::bsearch(
|
||||
&key, Data(), size(), IndirectHelper<T>::element_stride, KeyCompare<K>);
|
||||
|
||||
if (!search_result) {
|
||||
return nullptr; // Key not found.
|
||||
}
|
||||
|
||||
const uint8_t *element = reinterpret_cast<const uint8_t *>(search_result);
|
||||
|
||||
return IndirectHelper<T>::Read(element, 0);
|
||||
}
|
||||
|
||||
template<typename K> mutable_return_type MutableLookupByKey(K key) {
|
||||
return const_cast<mutable_return_type>(LookupByKey(key));
|
||||
}
|
||||
|
||||
protected:
|
||||
// This class is only used to access pre-existing data. Don't ever
|
||||
// try to construct these manually.
|
||||
Vector();
|
||||
|
||||
SizeT length_;
|
||||
|
||||
private:
|
||||
// This class is a pointer. Copying will therefore create an invalid object.
|
||||
// Private and unimplemented copy constructor.
|
||||
Vector(const Vector &);
|
||||
Vector &operator=(const Vector &);
|
||||
|
||||
template<typename K> static int KeyCompare(const void *ap, const void *bp) {
|
||||
const K *key = reinterpret_cast<const K *>(ap);
|
||||
const uint8_t *data = reinterpret_cast<const uint8_t *>(bp);
|
||||
auto table = IndirectHelper<T>::Read(data, 0);
|
||||
|
||||
// std::bsearch compares with the operands transposed, so we negate the
|
||||
// result here.
|
||||
return -table->KeyCompareWithValue(*key);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> using Vector64 = Vector<T, uoffset64_t>;
|
||||
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U> &vec)
|
||||
FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::is_span_observable,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return span<U>(vec.data(), vec.size());
|
||||
}
|
||||
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U> make_span(
|
||||
const Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::is_span_observable,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return span<const U>(vec.data(), vec.size());
|
||||
}
|
||||
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<uint8_t> make_bytes_span(
|
||||
Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::scalar_tag::value,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return span<uint8_t>(vec.Data(), vec.size() * sizeof(U));
|
||||
}
|
||||
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t> make_bytes_span(
|
||||
const Vector<U> &vec) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::scalar_tag::value,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return span<const uint8_t>(vec.Data(), vec.size() * sizeof(U));
|
||||
}
|
||||
|
||||
// Convenient helper functions to get a span of any vector, regardless
|
||||
// of whether it is null or not (the field is not set).
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U> make_span(Vector<U> *ptr)
|
||||
FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::is_span_observable,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return ptr ? make_span(*ptr) : span<U>();
|
||||
}
|
||||
|
||||
template<class U>
|
||||
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U> make_span(
|
||||
const Vector<U> *ptr) FLATBUFFERS_NOEXCEPT {
|
||||
static_assert(Vector<U>::is_span_observable,
|
||||
"wrong type U, only LE-scalar, or byte types are allowed");
|
||||
return ptr ? make_span(*ptr) : span<const U>();
|
||||
}
|
||||
|
||||
// Represent a vector much like the template above, but in this case we
|
||||
// don't know what the element types are (used with reflection.h).
|
||||
class VectorOfAny {
|
||||
public:
|
||||
uoffset_t size() const { return EndianScalar(length_); }
|
||||
|
||||
const uint8_t *Data() const {
|
||||
return reinterpret_cast<const uint8_t *>(&length_ + 1);
|
||||
}
|
||||
uint8_t *Data() { return reinterpret_cast<uint8_t *>(&length_ + 1); }
|
||||
|
||||
protected:
|
||||
VectorOfAny();
|
||||
|
||||
uoffset_t length_;
|
||||
|
||||
private:
|
||||
VectorOfAny(const VectorOfAny &);
|
||||
VectorOfAny &operator=(const VectorOfAny &);
|
||||
};
|
||||
|
||||
template<typename T, typename U>
|
||||
Vector<Offset<T>> *VectorCast(Vector<Offset<U>> *ptr) {
|
||||
static_assert(std::is_base_of<T, U>::value, "Unrelated types");
|
||||
return reinterpret_cast<Vector<Offset<T>> *>(ptr);
|
||||
}
|
||||
|
||||
template<typename T, typename U>
|
||||
const Vector<Offset<T>> *VectorCast(const Vector<Offset<U>> *ptr) {
|
||||
static_assert(std::is_base_of<T, U>::value, "Unrelated types");
|
||||
return reinterpret_cast<const Vector<Offset<T>> *>(ptr);
|
||||
}
|
||||
|
||||
// Convenient helper function to get the length of any vector, regardless
|
||||
// of whether it is null or not (the field is not set).
|
||||
template<typename T> static inline size_t VectorLength(const Vector<T> *v) {
|
||||
return v ? v->size() : 0;
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_VERIFIER_H_
|
||||
@@ -0,0 +1,288 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_VECTOR_DOWNWARD_H_
|
||||
#define FLATBUFFERS_VECTOR_DOWNWARD_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/default_allocator.h"
|
||||
#include "flatbuffers/detached_buffer.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// This is a minimal replication of std::vector<uint8_t> functionality,
|
||||
// except growing from higher to lower addresses. i.e. push_back() inserts data
|
||||
// in the lowest address in the vector.
|
||||
// Since this vector leaves the lower part unused, we support a "scratch-pad"
|
||||
// that can be stored there for temporary data, to share the allocated space.
|
||||
// Essentially, this supports 2 std::vectors in a single buffer.
|
||||
template<typename SizeT = uoffset_t> class vector_downward {
|
||||
public:
|
||||
explicit vector_downward(size_t initial_size, Allocator *allocator,
|
||||
bool own_allocator, size_t buffer_minalign,
|
||||
const SizeT max_size = FLATBUFFERS_MAX_BUFFER_SIZE)
|
||||
: allocator_(allocator),
|
||||
own_allocator_(own_allocator),
|
||||
initial_size_(initial_size),
|
||||
max_size_(max_size),
|
||||
buffer_minalign_(buffer_minalign),
|
||||
reserved_(0),
|
||||
size_(0),
|
||||
buf_(nullptr),
|
||||
cur_(nullptr),
|
||||
scratch_(nullptr) {}
|
||||
|
||||
vector_downward(vector_downward &&other) noexcept
|
||||
// clang-format on
|
||||
: allocator_(other.allocator_),
|
||||
own_allocator_(other.own_allocator_),
|
||||
initial_size_(other.initial_size_),
|
||||
max_size_(other.max_size_),
|
||||
buffer_minalign_(other.buffer_minalign_),
|
||||
reserved_(other.reserved_),
|
||||
size_(other.size_),
|
||||
buf_(other.buf_),
|
||||
cur_(other.cur_),
|
||||
scratch_(other.scratch_) {
|
||||
// No change in other.allocator_
|
||||
// No change in other.initial_size_
|
||||
// No change in other.buffer_minalign_
|
||||
other.own_allocator_ = false;
|
||||
other.reserved_ = 0;
|
||||
other.buf_ = nullptr;
|
||||
other.cur_ = nullptr;
|
||||
other.scratch_ = nullptr;
|
||||
}
|
||||
|
||||
vector_downward &operator=(vector_downward &&other) noexcept {
|
||||
// Move construct a temporary and swap idiom
|
||||
vector_downward temp(std::move(other));
|
||||
swap(temp);
|
||||
return *this;
|
||||
}
|
||||
|
||||
~vector_downward() {
|
||||
clear_buffer();
|
||||
clear_allocator();
|
||||
}
|
||||
|
||||
void reset() {
|
||||
clear_buffer();
|
||||
clear();
|
||||
}
|
||||
|
||||
void clear() {
|
||||
if (buf_) {
|
||||
cur_ = buf_ + reserved_;
|
||||
} else {
|
||||
reserved_ = 0;
|
||||
cur_ = nullptr;
|
||||
}
|
||||
size_ = 0;
|
||||
clear_scratch();
|
||||
}
|
||||
|
||||
void clear_scratch() { scratch_ = buf_; }
|
||||
|
||||
void clear_allocator() {
|
||||
if (own_allocator_ && allocator_) { delete allocator_; }
|
||||
allocator_ = nullptr;
|
||||
own_allocator_ = false;
|
||||
}
|
||||
|
||||
void clear_buffer() {
|
||||
if (buf_) Deallocate(allocator_, buf_, reserved_);
|
||||
buf_ = nullptr;
|
||||
}
|
||||
|
||||
// Relinquish the pointer to the caller.
|
||||
uint8_t *release_raw(size_t &allocated_bytes, size_t &offset) {
|
||||
auto *buf = buf_;
|
||||
allocated_bytes = reserved_;
|
||||
offset = vector_downward::offset();
|
||||
|
||||
// release_raw only relinquishes the buffer ownership.
|
||||
// Does not deallocate or reset the allocator. Destructor will do that.
|
||||
buf_ = nullptr;
|
||||
clear();
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Relinquish the pointer to the caller.
|
||||
DetachedBuffer release() {
|
||||
// allocator ownership (if any) is transferred to DetachedBuffer.
|
||||
DetachedBuffer fb(allocator_, own_allocator_, buf_, reserved_, cur_,
|
||||
size());
|
||||
if (own_allocator_) {
|
||||
allocator_ = nullptr;
|
||||
own_allocator_ = false;
|
||||
}
|
||||
buf_ = nullptr;
|
||||
clear();
|
||||
return fb;
|
||||
}
|
||||
|
||||
size_t ensure_space(size_t len) {
|
||||
FLATBUFFERS_ASSERT(cur_ >= scratch_ && scratch_ >= buf_);
|
||||
// If the length is larger than the unused part of the buffer, we need to
|
||||
// grow.
|
||||
if (len > unused_buffer_size()) { reallocate(len); }
|
||||
FLATBUFFERS_ASSERT(size() < max_size_);
|
||||
return len;
|
||||
}
|
||||
|
||||
inline uint8_t *make_space(size_t len) {
|
||||
if (len) {
|
||||
ensure_space(len);
|
||||
cur_ -= len;
|
||||
size_ += static_cast<SizeT>(len);
|
||||
}
|
||||
return cur_;
|
||||
}
|
||||
|
||||
// Returns nullptr if using the DefaultAllocator.
|
||||
Allocator *get_custom_allocator() { return allocator_; }
|
||||
|
||||
// The current offset into the buffer.
|
||||
size_t offset() const { return cur_ - buf_; }
|
||||
|
||||
// The total size of the vector (both the buffer and scratch parts).
|
||||
inline SizeT size() const { return size_; }
|
||||
|
||||
// The size of the buffer part of the vector that is currently unused.
|
||||
SizeT unused_buffer_size() const { return static_cast<SizeT>(cur_ - scratch_); }
|
||||
|
||||
// The size of the scratch part of the vector.
|
||||
SizeT scratch_size() const { return static_cast<SizeT>(scratch_ - buf_); }
|
||||
|
||||
size_t capacity() const { return reserved_; }
|
||||
|
||||
uint8_t *data() const {
|
||||
FLATBUFFERS_ASSERT(cur_);
|
||||
return cur_;
|
||||
}
|
||||
|
||||
uint8_t *scratch_data() const {
|
||||
FLATBUFFERS_ASSERT(buf_);
|
||||
return buf_;
|
||||
}
|
||||
|
||||
uint8_t *scratch_end() const {
|
||||
FLATBUFFERS_ASSERT(scratch_);
|
||||
return scratch_;
|
||||
}
|
||||
|
||||
uint8_t *data_at(size_t offset) const { return buf_ + reserved_ - offset; }
|
||||
|
||||
void push(const uint8_t *bytes, size_t num) {
|
||||
if (num > 0) { memcpy(make_space(num), bytes, num); }
|
||||
}
|
||||
|
||||
// Specialized version of push() that avoids memcpy call for small data.
|
||||
template<typename T> void push_small(const T &little_endian_t) {
|
||||
make_space(sizeof(T));
|
||||
*reinterpret_cast<T *>(cur_) = little_endian_t;
|
||||
}
|
||||
|
||||
template<typename T> void scratch_push_small(const T &t) {
|
||||
ensure_space(sizeof(T));
|
||||
*reinterpret_cast<T *>(scratch_) = t;
|
||||
scratch_ += sizeof(T);
|
||||
}
|
||||
|
||||
// fill() is most frequently called with small byte counts (<= 4),
|
||||
// which is why we're using loops rather than calling memset.
|
||||
void fill(size_t zero_pad_bytes) {
|
||||
make_space(zero_pad_bytes);
|
||||
for (size_t i = 0; i < zero_pad_bytes; i++) cur_[i] = 0;
|
||||
}
|
||||
|
||||
// Version for when we know the size is larger.
|
||||
// Precondition: zero_pad_bytes > 0
|
||||
void fill_big(size_t zero_pad_bytes) {
|
||||
memset(make_space(zero_pad_bytes), 0, zero_pad_bytes);
|
||||
}
|
||||
|
||||
void pop(size_t bytes_to_remove) {
|
||||
cur_ += bytes_to_remove;
|
||||
size_ -= static_cast<SizeT>(bytes_to_remove);
|
||||
}
|
||||
|
||||
void scratch_pop(size_t bytes_to_remove) { scratch_ -= bytes_to_remove; }
|
||||
|
||||
void swap(vector_downward &other) {
|
||||
using std::swap;
|
||||
swap(allocator_, other.allocator_);
|
||||
swap(own_allocator_, other.own_allocator_);
|
||||
swap(initial_size_, other.initial_size_);
|
||||
swap(buffer_minalign_, other.buffer_minalign_);
|
||||
swap(reserved_, other.reserved_);
|
||||
swap(size_, other.size_);
|
||||
swap(max_size_, other.max_size_);
|
||||
swap(buf_, other.buf_);
|
||||
swap(cur_, other.cur_);
|
||||
swap(scratch_, other.scratch_);
|
||||
}
|
||||
|
||||
void swap_allocator(vector_downward &other) {
|
||||
using std::swap;
|
||||
swap(allocator_, other.allocator_);
|
||||
swap(own_allocator_, other.own_allocator_);
|
||||
}
|
||||
|
||||
private:
|
||||
// You shouldn't really be copying instances of this class.
|
||||
FLATBUFFERS_DELETE_FUNC(vector_downward(const vector_downward &));
|
||||
FLATBUFFERS_DELETE_FUNC(vector_downward &operator=(const vector_downward &));
|
||||
|
||||
Allocator *allocator_;
|
||||
bool own_allocator_;
|
||||
size_t initial_size_;
|
||||
|
||||
// The maximum size the vector can be.
|
||||
SizeT max_size_;
|
||||
size_t buffer_minalign_;
|
||||
size_t reserved_;
|
||||
SizeT size_;
|
||||
uint8_t *buf_;
|
||||
uint8_t *cur_; // Points at location between empty (below) and used (above).
|
||||
uint8_t *scratch_; // Points to the end of the scratchpad in use.
|
||||
|
||||
void reallocate(size_t len) {
|
||||
auto old_reserved = reserved_;
|
||||
auto old_size = size();
|
||||
auto old_scratch_size = scratch_size();
|
||||
reserved_ +=
|
||||
(std::max)(len, old_reserved ? old_reserved / 2 : initial_size_);
|
||||
reserved_ = (reserved_ + buffer_minalign_ - 1) & ~(buffer_minalign_ - 1);
|
||||
if (buf_) {
|
||||
buf_ = ReallocateDownward(allocator_, buf_, old_reserved, reserved_,
|
||||
old_size, old_scratch_size);
|
||||
} else {
|
||||
buf_ = Allocate(allocator_, reserved_);
|
||||
}
|
||||
cur_ = buf_ + reserved_ - old_size;
|
||||
scratch_ = buf_ + old_scratch_size;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_VECTOR_DOWNWARD_H_
|
||||
+330
@@ -0,0 +1,330 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef FLATBUFFERS_VERIFIER_H_
|
||||
#define FLATBUFFERS_VERIFIER_H_
|
||||
|
||||
#include "flatbuffers/base.h"
|
||||
#include "flatbuffers/vector.h"
|
||||
|
||||
namespace flatbuffers {
|
||||
|
||||
// Helper class to verify the integrity of a FlatBuffer
|
||||
class Verifier FLATBUFFERS_FINAL_CLASS {
|
||||
public:
|
||||
struct Options {
|
||||
// The maximum nesting of tables and vectors before we call it invalid.
|
||||
uoffset_t max_depth = 64;
|
||||
// The maximum number of tables we will verify before we call it invalid.
|
||||
uoffset_t max_tables = 1000000;
|
||||
// If true, verify all data is aligned.
|
||||
bool check_alignment = true;
|
||||
// If true, run verifier on nested flatbuffers
|
||||
bool check_nested_flatbuffers = true;
|
||||
// The maximum size of a buffer.
|
||||
size_t max_size = FLATBUFFERS_MAX_BUFFER_SIZE;
|
||||
// Use assertions to check for errors.
|
||||
bool assert = false;
|
||||
};
|
||||
|
||||
explicit Verifier(const uint8_t *const buf, const size_t buf_len,
|
||||
const Options &opts)
|
||||
: buf_(buf), size_(buf_len), opts_(opts) {
|
||||
FLATBUFFERS_ASSERT(size_ < opts.max_size);
|
||||
}
|
||||
|
||||
// Deprecated API, please construct with Verifier::Options.
|
||||
Verifier(const uint8_t *const buf, const size_t buf_len,
|
||||
const uoffset_t max_depth = 64, const uoffset_t max_tables = 1000000,
|
||||
const bool check_alignment = true)
|
||||
: Verifier(buf, buf_len, [&] {
|
||||
Options opts;
|
||||
opts.max_depth = max_depth;
|
||||
opts.max_tables = max_tables;
|
||||
opts.check_alignment = check_alignment;
|
||||
return opts;
|
||||
}()) {}
|
||||
|
||||
// Central location where any verification failures register.
|
||||
bool Check(const bool ok) const {
|
||||
// clang-format off
|
||||
#ifdef FLATBUFFERS_DEBUG_VERIFICATION_FAILURE
|
||||
if (opts_.assert) { FLATBUFFERS_ASSERT(ok); }
|
||||
#endif
|
||||
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
|
||||
if (!ok)
|
||||
upper_bound_ = 0;
|
||||
#endif
|
||||
// clang-format on
|
||||
return ok;
|
||||
}
|
||||
|
||||
// Verify any range within the buffer.
|
||||
bool Verify(const size_t elem, const size_t elem_len) const {
|
||||
// clang-format off
|
||||
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
|
||||
auto upper_bound = elem + elem_len;
|
||||
if (upper_bound_ < upper_bound)
|
||||
upper_bound_ = upper_bound;
|
||||
#endif
|
||||
// clang-format on
|
||||
return Check(elem_len < size_ && elem <= size_ - elem_len);
|
||||
}
|
||||
|
||||
bool VerifyAlignment(const size_t elem, const size_t align) const {
|
||||
return Check((elem & (align - 1)) == 0 || !opts_.check_alignment);
|
||||
}
|
||||
|
||||
// Verify a range indicated by sizeof(T).
|
||||
template<typename T> bool Verify(const size_t elem) const {
|
||||
return VerifyAlignment(elem, sizeof(T)) && Verify(elem, sizeof(T));
|
||||
}
|
||||
|
||||
bool VerifyFromPointer(const uint8_t *const p, const size_t len) {
|
||||
return Verify(static_cast<size_t>(p - buf_), len);
|
||||
}
|
||||
|
||||
// Verify relative to a known-good base pointer.
|
||||
bool VerifyFieldStruct(const uint8_t *const base, const voffset_t elem_off,
|
||||
const size_t elem_len, const size_t align) const {
|
||||
const auto f = static_cast<size_t>(base - buf_) + elem_off;
|
||||
return VerifyAlignment(f, align) && Verify(f, elem_len);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool VerifyField(const uint8_t *const base, const voffset_t elem_off,
|
||||
const size_t align) const {
|
||||
const auto f = static_cast<size_t>(base - buf_) + elem_off;
|
||||
return VerifyAlignment(f, align) && Verify(f, sizeof(T));
|
||||
}
|
||||
|
||||
// Verify a pointer (may be NULL) of a table type.
|
||||
template<typename T> bool VerifyTable(const T *const table) {
|
||||
return !table || table->Verify(*this);
|
||||
}
|
||||
|
||||
// Verify a pointer (may be NULL) of any vector type.
|
||||
template<int &..., typename T, typename LenT>
|
||||
bool VerifyVector(const Vector<T, LenT> *const vec) const {
|
||||
return !vec || VerifyVectorOrString<LenT>(
|
||||
reinterpret_cast<const uint8_t *>(vec), sizeof(T));
|
||||
}
|
||||
|
||||
// Verify a pointer (may be NULL) of a vector to struct.
|
||||
template<int &..., typename T, typename LenT>
|
||||
bool VerifyVector(const Vector<const T *, LenT> *const vec) const {
|
||||
return VerifyVector(reinterpret_cast<const Vector<T, LenT> *>(vec));
|
||||
}
|
||||
|
||||
// Verify a pointer (may be NULL) to string.
|
||||
bool VerifyString(const String *const str) const {
|
||||
size_t end;
|
||||
return !str || (VerifyVectorOrString<uoffset_t>(
|
||||
reinterpret_cast<const uint8_t *>(str), 1, &end) &&
|
||||
Verify(end, 1) && // Must have terminator
|
||||
Check(buf_[end] == '\0')); // Terminating byte must be 0.
|
||||
}
|
||||
|
||||
// Common code between vectors and strings.
|
||||
template<typename LenT = uoffset_t>
|
||||
bool VerifyVectorOrString(const uint8_t *const vec, const size_t elem_size,
|
||||
size_t *const end = nullptr) const {
|
||||
const auto vec_offset = static_cast<size_t>(vec - buf_);
|
||||
// Check we can read the size field.
|
||||
if (!Verify<LenT>(vec_offset)) return false;
|
||||
// Check the whole array. If this is a string, the byte past the array must
|
||||
// be 0.
|
||||
const LenT size = ReadScalar<LenT>(vec);
|
||||
const auto max_elems = opts_.max_size / elem_size;
|
||||
if (!Check(size < max_elems))
|
||||
return false; // Protect against byte_size overflowing.
|
||||
const auto byte_size = sizeof(LenT) + elem_size * size;
|
||||
if (end) *end = vec_offset + byte_size;
|
||||
return Verify(vec_offset, byte_size);
|
||||
}
|
||||
|
||||
// Special case for string contents, after the above has been called.
|
||||
bool VerifyVectorOfStrings(const Vector<Offset<String>> *const vec) const {
|
||||
if (vec) {
|
||||
for (uoffset_t i = 0; i < vec->size(); i++) {
|
||||
if (!VerifyString(vec->Get(i))) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Special case for table contents, after the above has been called.
|
||||
template<typename T>
|
||||
bool VerifyVectorOfTables(const Vector<Offset<T>> *const vec) {
|
||||
if (vec) {
|
||||
for (uoffset_t i = 0; i < vec->size(); i++) {
|
||||
if (!vec->Get(i)->Verify(*this)) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
__suppress_ubsan__("unsigned-integer-overflow") bool VerifyTableStart(
|
||||
const uint8_t *const table) {
|
||||
// Check the vtable offset.
|
||||
const auto tableo = static_cast<size_t>(table - buf_);
|
||||
if (!Verify<soffset_t>(tableo)) return false;
|
||||
// This offset may be signed, but doing the subtraction unsigned always
|
||||
// gives the result we want.
|
||||
const auto vtableo =
|
||||
tableo - static_cast<size_t>(ReadScalar<soffset_t>(table));
|
||||
// Check the vtable size field, then check vtable fits in its entirety.
|
||||
if (!(VerifyComplexity() && Verify<voffset_t>(vtableo) &&
|
||||
VerifyAlignment(ReadScalar<voffset_t>(buf_ + vtableo),
|
||||
sizeof(voffset_t))))
|
||||
return false;
|
||||
const auto vsize = ReadScalar<voffset_t>(buf_ + vtableo);
|
||||
return Check((vsize & 1) == 0) && Verify(vtableo, vsize);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool VerifyBufferFromStart(const char *const identifier, const size_t start) {
|
||||
// Buffers have to be of some size to be valid. The reason it is a runtime
|
||||
// check instead of static_assert, is that nested flatbuffers go through
|
||||
// this call and their size is determined at runtime.
|
||||
if (!Check(size_ >= FLATBUFFERS_MIN_BUFFER_SIZE)) return false;
|
||||
|
||||
// If an identifier is provided, check that we have a buffer
|
||||
if (identifier && !Check((size_ >= 2 * sizeof(flatbuffers::uoffset_t) &&
|
||||
BufferHasIdentifier(buf_ + start, identifier)))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Call T::Verify, which must be in the generated code for this type.
|
||||
const auto o = VerifyOffset<uoffset_t>(start);
|
||||
return Check(o != 0) &&
|
||||
reinterpret_cast<const T *>(buf_ + start + o)->Verify(*this)
|
||||
// clang-format off
|
||||
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
|
||||
&& GetComputedSize()
|
||||
#endif
|
||||
;
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
template<typename T, int &..., typename SizeT>
|
||||
bool VerifyNestedFlatBuffer(const Vector<uint8_t, SizeT> *const buf,
|
||||
const char *const identifier) {
|
||||
// Caller opted out of this.
|
||||
if (!opts_.check_nested_flatbuffers) return true;
|
||||
|
||||
// An empty buffer is OK as it indicates not present.
|
||||
if (!buf) return true;
|
||||
|
||||
// If there is a nested buffer, it must be greater than the min size.
|
||||
if (!Check(buf->size() >= FLATBUFFERS_MIN_BUFFER_SIZE)) return false;
|
||||
|
||||
Verifier nested_verifier(buf->data(), buf->size(), opts_);
|
||||
return nested_verifier.VerifyBuffer<T>(identifier);
|
||||
}
|
||||
|
||||
// Verify this whole buffer, starting with root type T.
|
||||
template<typename T> bool VerifyBuffer() { return VerifyBuffer<T>(nullptr); }
|
||||
|
||||
template<typename T> bool VerifyBuffer(const char *const identifier) {
|
||||
return VerifyBufferFromStart<T>(identifier, 0);
|
||||
}
|
||||
|
||||
template<typename T, typename SizeT = uoffset_t>
|
||||
bool VerifySizePrefixedBuffer(const char *const identifier) {
|
||||
return Verify<SizeT>(0U) &&
|
||||
Check(ReadScalar<SizeT>(buf_) == size_ - sizeof(SizeT)) &&
|
||||
VerifyBufferFromStart<T>(identifier, sizeof(SizeT));
|
||||
}
|
||||
|
||||
template<typename OffsetT = uoffset_t, typename SOffsetT = soffset_t>
|
||||
size_t VerifyOffset(const size_t start) const {
|
||||
if (!Verify<OffsetT>(start)) return 0;
|
||||
const auto o = ReadScalar<OffsetT>(buf_ + start);
|
||||
// May not point to itself.
|
||||
if (!Check(o != 0)) return 0;
|
||||
// Can't wrap around larger than the max size.
|
||||
if (!Check(static_cast<SOffsetT>(o) >= 0)) return 0;
|
||||
// Must be inside the buffer to create a pointer from it (pointer outside
|
||||
// buffer is UB).
|
||||
if (!Verify(start + o, 1)) return 0;
|
||||
return o;
|
||||
}
|
||||
|
||||
template<typename OffsetT = uoffset_t>
|
||||
size_t VerifyOffset(const uint8_t *const base, const voffset_t start) const {
|
||||
return VerifyOffset<OffsetT>(static_cast<size_t>(base - buf_) + start);
|
||||
}
|
||||
|
||||
// Called at the start of a table to increase counters measuring data
|
||||
// structure depth and amount, and possibly bails out with false if limits set
|
||||
// by the constructor have been hit. Needs to be balanced with EndTable().
|
||||
bool VerifyComplexity() {
|
||||
depth_++;
|
||||
num_tables_++;
|
||||
return Check(depth_ <= opts_.max_depth && num_tables_ <= opts_.max_tables);
|
||||
}
|
||||
|
||||
// Called at the end of a table to pop the depth count.
|
||||
bool EndTable() {
|
||||
depth_--;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Returns the message size in bytes
|
||||
size_t GetComputedSize() const {
|
||||
// clang-format off
|
||||
#ifdef FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE
|
||||
uintptr_t size = upper_bound_;
|
||||
// Align the size to uoffset_t
|
||||
size = (size - 1 + sizeof(uoffset_t)) & ~(sizeof(uoffset_t) - 1);
|
||||
return (size > size_) ? 0 : size;
|
||||
#else
|
||||
// Must turn on FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE for this to work.
|
||||
(void)upper_bound_;
|
||||
FLATBUFFERS_ASSERT(false);
|
||||
return 0;
|
||||
#endif
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
std::vector<uint8_t> *GetFlexReuseTracker() { return flex_reuse_tracker_; }
|
||||
|
||||
void SetFlexReuseTracker(std::vector<uint8_t> *const rt) {
|
||||
flex_reuse_tracker_ = rt;
|
||||
}
|
||||
|
||||
private:
|
||||
const uint8_t *buf_;
|
||||
const size_t size_;
|
||||
const Options opts_;
|
||||
|
||||
mutable size_t upper_bound_ = 0;
|
||||
|
||||
uoffset_t depth_ = 0;
|
||||
uoffset_t num_tables_ = 0;
|
||||
std::vector<uint8_t> *flex_reuse_tracker_ = nullptr;
|
||||
};
|
||||
|
||||
// Specialization for 64-bit offsets.
|
||||
template<>
|
||||
inline size_t Verifier::VerifyOffset<uoffset64_t>(const size_t start) const {
|
||||
return VerifyOffset<uoffset64_t, soffset64_t>(start);
|
||||
}
|
||||
|
||||
} // namespace flatbuffers
|
||||
|
||||
#endif // FLATBUFFERS_VERIFIER_H_
|
||||
+6
-14
@@ -2,19 +2,9 @@
|
||||
// File: vk_platform.h
|
||||
//
|
||||
/*
|
||||
** Copyright (c) 2014-2017 The Khronos Group Inc.
|
||||
** Copyright 2014-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
|
||||
@@ -52,7 +42,7 @@ extern "C"
|
||||
#define VKAPI_CALL __stdcall
|
||||
#define VKAPI_PTR VKAPI_CALL
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
|
||||
#error "Vulkan isn't supported for the 'armeabi' NDK ABI"
|
||||
#error "Vulkan is not supported for the 'armeabi' NDK ABI"
|
||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
|
||||
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
|
||||
// calling convention, i.e. float parameters are passed in registers. This
|
||||
@@ -68,7 +58,9 @@ extern "C"
|
||||
#define VKAPI_PTR
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#if !defined(VK_NO_STDDEF_H)
|
||||
#include <stddef.h>
|
||||
#endif // !defined(VK_NO_STDDEF_H)
|
||||
|
||||
#if !defined(VK_NO_STDINT_H)
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||
|
||||
Vendored
+34
-18
@@ -2,19 +2,9 @@
|
||||
#define VULKAN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include "vk_platform.h"
|
||||
@@ -38,20 +28,16 @@
|
||||
#include "vulkan_macos.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_MIR_KHR
|
||||
#include <mir_toolkit/client_types.h>
|
||||
#include "vulkan_mir.h"
|
||||
#ifdef VK_USE_PLATFORM_METAL_EXT
|
||||
#include "vulkan_metal.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_VI_NN
|
||||
#include "vulkan_vi.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||
#include <wayland-client.h>
|
||||
#include "vulkan_wayland.h"
|
||||
#endif
|
||||
|
||||
@@ -74,10 +60,40 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_DIRECTFB_EXT
|
||||
#include <directfb.h>
|
||||
#include "vulkan_directfb.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#include "vulkan_xlib_xrandr.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
#include <ggp_c/vulkan_types.h>
|
||||
#include "vulkan_ggp.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCREEN_QNX
|
||||
#include <screen/screen.h>
|
||||
#include "vulkan_screen.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_USE_PLATFORM_SCI
|
||||
#include <nvscisync.h>
|
||||
#include <nvscibuf.h>
|
||||
#include "vulkan_sci.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VK_ENABLE_BETA_EXTENSIONS
|
||||
#include "vulkan_beta.h"
|
||||
#endif
|
||||
|
||||
#endif // VULKAN_H_
|
||||
|
||||
+22
-23
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_ANDROID_H_
|
||||
#define VULKAN_ANDROID_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,14 +13,17 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_android_surface 1
|
||||
struct ANativeWindow;
|
||||
|
||||
#define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
|
||||
|
||||
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkAndroidSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -42,7 +31,6 @@ typedef struct VkAndroidSurfaceCreateInfoKHR {
|
||||
struct ANativeWindow* window;
|
||||
} VkAndroidSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
@@ -53,12 +41,11 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_ANDROID_external_memory_android_hardware_buffer 1
|
||||
struct AHardwareBuffer;
|
||||
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
|
||||
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
|
||||
|
||||
typedef struct VkAndroidHardwareBufferUsageANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
@@ -103,6 +90,18 @@ typedef struct VkExternalFormatANDROID {
|
||||
uint64_t externalFormat;
|
||||
} VkExternalFormatANDROID;
|
||||
|
||||
typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFormat format;
|
||||
uint64_t externalFormat;
|
||||
VkFormatFeatureFlags2 formatFeatures;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkAndroidHardwareBufferFormatProperties2ANDROID;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
|
||||
|
||||
+492
@@ -0,0 +1,492 @@
|
||||
#ifndef VULKAN_BETA_H_
|
||||
#define VULKAN_BETA_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_portability_subset 1
|
||||
#define VK_KHR_PORTABILITY_SUBSET_SPEC_VERSION 1
|
||||
#define VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME "VK_KHR_portability_subset"
|
||||
typedef struct VkPhysicalDevicePortabilitySubsetFeaturesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 constantAlphaColorBlendFactors;
|
||||
VkBool32 events;
|
||||
VkBool32 imageViewFormatReinterpretation;
|
||||
VkBool32 imageViewFormatSwizzle;
|
||||
VkBool32 imageView2DOn3DImage;
|
||||
VkBool32 multisampleArrayImage;
|
||||
VkBool32 mutableComparisonSamplers;
|
||||
VkBool32 pointPolygons;
|
||||
VkBool32 samplerMipLodBias;
|
||||
VkBool32 separateStencilMaskRef;
|
||||
VkBool32 shaderSampleRateInterpolationFunctions;
|
||||
VkBool32 tessellationIsolines;
|
||||
VkBool32 tessellationPointMode;
|
||||
VkBool32 triangleFans;
|
||||
VkBool32 vertexAttributeAccessBeyondStride;
|
||||
} VkPhysicalDevicePortabilitySubsetFeaturesKHR;
|
||||
|
||||
typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t minVertexInputBindingStrideAlignment;
|
||||
} VkPhysicalDevicePortabilitySubsetPropertiesKHR;
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_video_encode_queue 1
|
||||
#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 8
|
||||
#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue"
|
||||
|
||||
typedef enum VkVideoEncodeTuningModeKHR {
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0,
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1,
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2,
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3,
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4,
|
||||
VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeTuningModeKHR;
|
||||
typedef VkFlags VkVideoEncodeFlagsKHR;
|
||||
|
||||
typedef enum VkVideoEncodeCapabilityFlagBitsKHR {
|
||||
VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001,
|
||||
VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeCapabilityFlagBitsKHR;
|
||||
typedef VkFlags VkVideoEncodeCapabilityFlagsKHR;
|
||||
|
||||
typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
|
||||
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR = 0,
|
||||
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR = 0x00000001,
|
||||
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0x00000002,
|
||||
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0x00000004,
|
||||
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeRateControlModeFlagBitsKHR;
|
||||
typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR;
|
||||
|
||||
typedef enum VkVideoEncodeFeedbackFlagBitsKHR {
|
||||
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BUFFER_OFFSET_BIT_KHR = 0x00000001,
|
||||
VK_VIDEO_ENCODE_FEEDBACK_BITSTREAM_BYTES_WRITTEN_BIT_KHR = 0x00000002,
|
||||
VK_VIDEO_ENCODE_FEEDBACK_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeFeedbackFlagBitsKHR;
|
||||
typedef VkFlags VkVideoEncodeFeedbackFlagsKHR;
|
||||
|
||||
typedef enum VkVideoEncodeUsageFlagBitsKHR {
|
||||
VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0,
|
||||
VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001,
|
||||
VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002,
|
||||
VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004,
|
||||
VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008,
|
||||
VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeUsageFlagBitsKHR;
|
||||
typedef VkFlags VkVideoEncodeUsageFlagsKHR;
|
||||
|
||||
typedef enum VkVideoEncodeContentFlagBitsKHR {
|
||||
VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0,
|
||||
VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001,
|
||||
VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002,
|
||||
VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004,
|
||||
VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
|
||||
} VkVideoEncodeContentFlagBitsKHR;
|
||||
typedef VkFlags VkVideoEncodeContentFlagsKHR;
|
||||
typedef VkFlags VkVideoEncodeRateControlFlagsKHR;
|
||||
typedef struct VkVideoEncodeInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkVideoEncodeFlagsKHR flags;
|
||||
uint32_t qualityLevel;
|
||||
VkBuffer dstBuffer;
|
||||
VkDeviceSize dstBufferOffset;
|
||||
VkDeviceSize dstBufferRange;
|
||||
VkVideoPictureResourceInfoKHR srcPictureResource;
|
||||
const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot;
|
||||
uint32_t referenceSlotCount;
|
||||
const VkVideoReferenceSlotInfoKHR* pReferenceSlots;
|
||||
uint32_t precedingExternallyEncodedBytes;
|
||||
} VkVideoEncodeInfoKHR;
|
||||
|
||||
typedef struct VkVideoEncodeCapabilitiesKHR {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkVideoEncodeCapabilityFlagsKHR flags;
|
||||
VkVideoEncodeRateControlModeFlagsKHR rateControlModes;
|
||||
uint32_t maxRateControlLayers;
|
||||
uint32_t maxQualityLevels;
|
||||
VkExtent2D inputImageDataFillAlignment;
|
||||
VkVideoEncodeFeedbackFlagsKHR supportedEncodeFeedbackFlags;
|
||||
} VkVideoEncodeCapabilitiesKHR;
|
||||
|
||||
typedef struct VkQueryPoolVideoEncodeFeedbackCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkVideoEncodeFeedbackFlagsKHR encodeFeedbackFlags;
|
||||
} VkQueryPoolVideoEncodeFeedbackCreateInfoKHR;
|
||||
|
||||
typedef struct VkVideoEncodeUsageInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkVideoEncodeUsageFlagsKHR videoUsageHints;
|
||||
VkVideoEncodeContentFlagsKHR videoContentHints;
|
||||
VkVideoEncodeTuningModeKHR tuningMode;
|
||||
} VkVideoEncodeUsageInfoKHR;
|
||||
|
||||
typedef struct VkVideoEncodeRateControlLayerInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint64_t averageBitrate;
|
||||
uint64_t maxBitrate;
|
||||
uint32_t frameRateNumerator;
|
||||
uint32_t frameRateDenominator;
|
||||
uint32_t virtualBufferSizeInMs;
|
||||
uint32_t initialVirtualBufferSizeInMs;
|
||||
} VkVideoEncodeRateControlLayerInfoKHR;
|
||||
|
||||
typedef struct VkVideoEncodeRateControlInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkVideoEncodeRateControlFlagsKHR flags;
|
||||
VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode;
|
||||
uint32_t layerCount;
|
||||
const VkVideoEncodeRateControlLayerInfoKHR* pLayers;
|
||||
} VkVideoEncodeRateControlInfoKHR;
|
||||
|
||||
typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR void VKAPI_CALL vkCmdEncodeVideoKHR(
|
||||
VkCommandBuffer commandBuffer,
|
||||
const VkVideoEncodeInfoKHR* pEncodeInfo);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_EXT_video_encode_h264 1
|
||||
#include "vk_video/vulkan_video_codec_h264std.h"
|
||||
#include "vk_video/vulkan_video_codec_h264std_encode.h"
|
||||
#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 10
|
||||
#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264"
|
||||
|
||||
typedef enum VkVideoEncodeH264RateControlStructureEXT {
|
||||
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
|
||||
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
|
||||
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
|
||||
VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH264RateControlStructureEXT;
|
||||
|
||||
typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT {
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0x00000001,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT = 0x00000002,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000004,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT = 0x00000008,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000010,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000040,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000080,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000100,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00000200,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT = 0x00000400,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT = 0x00000800,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00001000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00002000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00004000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00008000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00010000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00020000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00040000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT = 0x00080000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00100000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT = 0x00200000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0x00400000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x00800000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x01000000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x02000000,
|
||||
VK_VIDEO_ENCODE_H264_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH264CapabilityFlagBitsEXT;
|
||||
typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT;
|
||||
typedef struct VkVideoEncodeH264CapabilitiesEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkVideoEncodeH264CapabilityFlagsEXT flags;
|
||||
uint32_t maxPPictureL0ReferenceCount;
|
||||
uint32_t maxBPictureL0ReferenceCount;
|
||||
uint32_t maxL1ReferenceCount;
|
||||
VkBool32 motionVectorsOverPicBoundariesFlag;
|
||||
uint32_t maxBytesPerPicDenom;
|
||||
uint32_t maxBitsPerMbDenom;
|
||||
uint32_t log2MaxMvLengthHorizontal;
|
||||
uint32_t log2MaxMvLengthVertical;
|
||||
} VkVideoEncodeH264CapabilitiesEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t stdSPSCount;
|
||||
const StdVideoH264SequenceParameterSet* pStdSPSs;
|
||||
uint32_t stdPPSCount;
|
||||
const StdVideoH264PictureParameterSet* pStdPPSs;
|
||||
} VkVideoEncodeH264SessionParametersAddInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t maxStdSPSCount;
|
||||
uint32_t maxStdPPSCount;
|
||||
const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo;
|
||||
} VkVideoEncodeH264SessionParametersCreateInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264NaluSliceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t mbCount;
|
||||
const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists;
|
||||
const StdVideoEncodeH264SliceHeader* pStdSliceHeader;
|
||||
} VkVideoEncodeH264NaluSliceInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264VclFrameInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const StdVideoEncodeH264ReferenceListsInfo* pStdReferenceFinalLists;
|
||||
uint32_t naluSliceEntryCount;
|
||||
const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries;
|
||||
const StdVideoEncodeH264PictureInfo* pStdPictureInfo;
|
||||
} VkVideoEncodeH264VclFrameInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264DpbSlotInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const StdVideoEncodeH264ReferenceInfo* pStdReferenceInfo;
|
||||
} VkVideoEncodeH264DpbSlotInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264ProfileInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
StdVideoH264ProfileIdc stdProfileIdc;
|
||||
} VkVideoEncodeH264ProfileInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264RateControlInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t gopFrameCount;
|
||||
uint32_t idrPeriod;
|
||||
uint32_t consecutiveBFrameCount;
|
||||
VkVideoEncodeH264RateControlStructureEXT rateControlStructure;
|
||||
uint32_t temporalLayerCount;
|
||||
} VkVideoEncodeH264RateControlInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264QpEXT {
|
||||
int32_t qpI;
|
||||
int32_t qpP;
|
||||
int32_t qpB;
|
||||
} VkVideoEncodeH264QpEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264FrameSizeEXT {
|
||||
uint32_t frameISize;
|
||||
uint32_t framePSize;
|
||||
uint32_t frameBSize;
|
||||
} VkVideoEncodeH264FrameSizeEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH264RateControlLayerInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t temporalLayerId;
|
||||
VkBool32 useInitialRcQp;
|
||||
VkVideoEncodeH264QpEXT initialRcQp;
|
||||
VkBool32 useMinQp;
|
||||
VkVideoEncodeH264QpEXT minQp;
|
||||
VkBool32 useMaxQp;
|
||||
VkVideoEncodeH264QpEXT maxQp;
|
||||
VkBool32 useMaxFrameSize;
|
||||
VkVideoEncodeH264FrameSizeEXT maxFrameSize;
|
||||
} VkVideoEncodeH264RateControlLayerInfoEXT;
|
||||
|
||||
|
||||
|
||||
#define VK_EXT_video_encode_h265 1
|
||||
#include "vk_video/vulkan_video_codec_h265std.h"
|
||||
#include "vk_video/vulkan_video_codec_h265std_encode.h"
|
||||
#define VK_EXT_VIDEO_ENCODE_H265_SPEC_VERSION 10
|
||||
#define VK_EXT_VIDEO_ENCODE_H265_EXTENSION_NAME "VK_EXT_video_encode_h265"
|
||||
|
||||
typedef enum VkVideoEncodeH265RateControlStructureEXT {
|
||||
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
|
||||
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
|
||||
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
|
||||
VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH265RateControlStructureEXT;
|
||||
|
||||
typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT {
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000001,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000002,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT = 0x00000004,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT = 0x00000008,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT = 0x00000010,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT = 0x00000040,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000080,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT = 0x00000100,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT = 0x00000200,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT = 0x00000400,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT = 0x00000800,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00001000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT = 0x00002000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00004000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT = 0x00008000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT = 0x00010000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT = 0x00020000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT = 0x00040000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT = 0x00080000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT = 0x00100000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT = 0x00200000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00400000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0x00800000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0x01000000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0x02000000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_REFERENCE_FINAL_LISTS_BIT_EXT = 0x04000000,
|
||||
VK_VIDEO_ENCODE_H265_CAPABILITY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH265CapabilityFlagBitsEXT;
|
||||
typedef VkFlags VkVideoEncodeH265CapabilityFlagsEXT;
|
||||
|
||||
typedef enum VkVideoEncodeH265CtbSizeFlagBitsEXT {
|
||||
VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0x00000001,
|
||||
VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0x00000002,
|
||||
VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004,
|
||||
VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH265CtbSizeFlagBitsEXT;
|
||||
typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT;
|
||||
|
||||
typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT {
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001,
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002,
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004,
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008,
|
||||
VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT;
|
||||
typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT;
|
||||
typedef struct VkVideoEncodeH265CapabilitiesEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkVideoEncodeH265CapabilityFlagsEXT flags;
|
||||
VkVideoEncodeH265CtbSizeFlagsEXT ctbSizes;
|
||||
VkVideoEncodeH265TransformBlockSizeFlagsEXT transformBlockSizes;
|
||||
uint32_t maxPPictureL0ReferenceCount;
|
||||
uint32_t maxBPictureL0ReferenceCount;
|
||||
uint32_t maxL1ReferenceCount;
|
||||
uint32_t maxSubLayersCount;
|
||||
uint32_t minLog2MinLumaCodingBlockSizeMinus3;
|
||||
uint32_t maxLog2MinLumaCodingBlockSizeMinus3;
|
||||
uint32_t minLog2MinLumaTransformBlockSizeMinus2;
|
||||
uint32_t maxLog2MinLumaTransformBlockSizeMinus2;
|
||||
uint32_t minMaxTransformHierarchyDepthInter;
|
||||
uint32_t maxMaxTransformHierarchyDepthInter;
|
||||
uint32_t minMaxTransformHierarchyDepthIntra;
|
||||
uint32_t maxMaxTransformHierarchyDepthIntra;
|
||||
uint32_t maxDiffCuQpDeltaDepth;
|
||||
uint32_t minMaxNumMergeCand;
|
||||
uint32_t maxMaxNumMergeCand;
|
||||
} VkVideoEncodeH265CapabilitiesEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t stdVPSCount;
|
||||
const StdVideoH265VideoParameterSet* pStdVPSs;
|
||||
uint32_t stdSPSCount;
|
||||
const StdVideoH265SequenceParameterSet* pStdSPSs;
|
||||
uint32_t stdPPSCount;
|
||||
const StdVideoH265PictureParameterSet* pStdPPSs;
|
||||
} VkVideoEncodeH265SessionParametersAddInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t maxStdVPSCount;
|
||||
uint32_t maxStdSPSCount;
|
||||
uint32_t maxStdPPSCount;
|
||||
const VkVideoEncodeH265SessionParametersAddInfoEXT* pParametersAddInfo;
|
||||
} VkVideoEncodeH265SessionParametersCreateInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265NaluSliceSegmentInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t ctbCount;
|
||||
const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists;
|
||||
const StdVideoEncodeH265SliceSegmentHeader* pStdSliceSegmentHeader;
|
||||
} VkVideoEncodeH265NaluSliceSegmentInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265VclFrameInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const StdVideoEncodeH265ReferenceListsInfo* pStdReferenceFinalLists;
|
||||
uint32_t naluSliceSegmentEntryCount;
|
||||
const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries;
|
||||
const StdVideoEncodeH265PictureInfo* pStdPictureInfo;
|
||||
} VkVideoEncodeH265VclFrameInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265DpbSlotInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
const StdVideoEncodeH265ReferenceInfo* pStdReferenceInfo;
|
||||
} VkVideoEncodeH265DpbSlotInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265ProfileInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
StdVideoH265ProfileIdc stdProfileIdc;
|
||||
} VkVideoEncodeH265ProfileInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265RateControlInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t gopFrameCount;
|
||||
uint32_t idrPeriod;
|
||||
uint32_t consecutiveBFrameCount;
|
||||
VkVideoEncodeH265RateControlStructureEXT rateControlStructure;
|
||||
uint32_t subLayerCount;
|
||||
} VkVideoEncodeH265RateControlInfoEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265QpEXT {
|
||||
int32_t qpI;
|
||||
int32_t qpP;
|
||||
int32_t qpB;
|
||||
} VkVideoEncodeH265QpEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265FrameSizeEXT {
|
||||
uint32_t frameISize;
|
||||
uint32_t framePSize;
|
||||
uint32_t frameBSize;
|
||||
} VkVideoEncodeH265FrameSizeEXT;
|
||||
|
||||
typedef struct VkVideoEncodeH265RateControlLayerInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t temporalId;
|
||||
VkBool32 useInitialRcQp;
|
||||
VkVideoEncodeH265QpEXT initialRcQp;
|
||||
VkBool32 useMinQp;
|
||||
VkVideoEncodeH265QpEXT minQp;
|
||||
VkBool32 useMaxQp;
|
||||
VkVideoEncodeH265QpEXT maxQp;
|
||||
VkBool32 useMaxFrameSize;
|
||||
VkVideoEncodeH265FrameSizeEXT maxFrameSize;
|
||||
} VkVideoEncodeH265RateControlLayerInfoEXT;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+10286
-1804
File diff suppressed because it is too large
Load Diff
+54
@@ -0,0 +1,54 @@
|
||||
#ifndef VULKAN_DIRECTFB_H_
|
||||
#define VULKAN_DIRECTFB_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_EXT_directfb_surface 1
|
||||
#define VK_EXT_DIRECTFB_SURFACE_SPEC_VERSION 1
|
||||
#define VK_EXT_DIRECTFB_SURFACE_EXTENSION_NAME "VK_EXT_directfb_surface"
|
||||
typedef VkFlags VkDirectFBSurfaceCreateFlagsEXT;
|
||||
typedef struct VkDirectFBSurfaceCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDirectFBSurfaceCreateFlagsEXT flags;
|
||||
IDirectFB* dfb;
|
||||
IDirectFBSurface* surface;
|
||||
} VkDirectFBSurfaceCreateInfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateDirectFBSurfaceEXT)(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(
|
||||
VkInstance instance,
|
||||
const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
IDirectFB* dfb);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+219
-19
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_FUCHSIA_H_
|
||||
#define VULKAN_FUCHSIA_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_FUCHSIA_imagepipe_surface 1
|
||||
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_SPEC_VERSION 1
|
||||
#define VK_FUCHSIA_IMAGEPIPE_SURFACE_EXTENSION_NAME "VK_FUCHSIA_imagepipe_surface"
|
||||
|
||||
typedef VkFlags VkImagePipeSurfaceCreateFlagsFUCHSIA;
|
||||
|
||||
typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -40,7 +30,6 @@ typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
|
||||
zx_handle_t imagePipeHandle;
|
||||
} VkImagePipeSurfaceCreateInfoFUCHSIA;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
@@ -51,6 +40,217 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_FUCHSIA_external_memory 1
|
||||
#define VK_FUCHSIA_EXTERNAL_MEMORY_SPEC_VERSION 1
|
||||
#define VK_FUCHSIA_EXTERNAL_MEMORY_EXTENSION_NAME "VK_FUCHSIA_external_memory"
|
||||
typedef struct VkImportMemoryZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
zx_handle_t handle;
|
||||
} VkImportMemoryZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef struct VkMemoryZirconHandlePropertiesFUCHSIA {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
} VkMemoryZirconHandlePropertiesFUCHSIA;
|
||||
|
||||
typedef struct VkMemoryGetZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)(VkDevice device, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
|
||||
zx_handle_t* pZirconHandle);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
|
||||
VkDevice device,
|
||||
VkExternalMemoryHandleTypeFlagBits handleType,
|
||||
zx_handle_t zirconHandle,
|
||||
VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_FUCHSIA_external_semaphore 1
|
||||
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_SPEC_VERSION 1
|
||||
#define VK_FUCHSIA_EXTERNAL_SEMAPHORE_EXTENSION_NAME "VK_FUCHSIA_external_semaphore"
|
||||
typedef struct VkImportSemaphoreZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkSemaphoreImportFlags flags;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
zx_handle_t zirconHandle;
|
||||
} VkImportSemaphoreZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef struct VkSemaphoreGetZirconHandleInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
} VkSemaphoreGetZirconHandleInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
|
||||
zx_handle_t* pZirconHandle);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_FUCHSIA_buffer_collection 1
|
||||
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA)
|
||||
#define VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION 2
|
||||
#define VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME "VK_FUCHSIA_buffer_collection"
|
||||
typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA;
|
||||
|
||||
typedef enum VkImageConstraintsInfoFlagBitsFUCHSIA {
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA = 0x00000001,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA = 0x00000002,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA = 0x00000004,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = 0x00000008,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = 0x00000010,
|
||||
VK_IMAGE_CONSTRAINTS_INFO_FLAG_BITS_MAX_ENUM_FUCHSIA = 0x7FFFFFFF
|
||||
} VkImageConstraintsInfoFlagBitsFUCHSIA;
|
||||
typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA;
|
||||
typedef struct VkBufferCollectionCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
zx_handle_t collectionToken;
|
||||
} VkBufferCollectionCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkImportMemoryBufferCollectionFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkImportMemoryBufferCollectionFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionImageCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkBufferCollectionImageCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t minBufferCount;
|
||||
uint32_t maxBufferCount;
|
||||
uint32_t minBufferCountForCamping;
|
||||
uint32_t minBufferCountForDedicatedSlack;
|
||||
uint32_t minBufferCountForSharedSlack;
|
||||
} VkBufferCollectionConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCreateInfo createInfo;
|
||||
VkFormatFeatureFlags requiredFormatFeatures;
|
||||
VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
|
||||
} VkBufferConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionBufferCreateInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkBufferCollectionFUCHSIA collection;
|
||||
uint32_t index;
|
||||
} VkBufferCollectionBufferCreateInfoFUCHSIA;
|
||||
|
||||
typedef struct VkSysmemColorSpaceFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t colorSpace;
|
||||
} VkSysmemColorSpaceFUCHSIA;
|
||||
|
||||
typedef struct VkBufferCollectionPropertiesFUCHSIA {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
uint32_t memoryTypeBits;
|
||||
uint32_t bufferCount;
|
||||
uint32_t createInfoIndex;
|
||||
uint64_t sysmemPixelFormat;
|
||||
VkFormatFeatureFlags formatFeatures;
|
||||
VkSysmemColorSpaceFUCHSIA sysmemColorSpaceIndex;
|
||||
VkComponentMapping samplerYcbcrConversionComponents;
|
||||
VkSamplerYcbcrModelConversion suggestedYcbcrModel;
|
||||
VkSamplerYcbcrRange suggestedYcbcrRange;
|
||||
VkChromaLocation suggestedXChromaOffset;
|
||||
VkChromaLocation suggestedYChromaOffset;
|
||||
} VkBufferCollectionPropertiesFUCHSIA;
|
||||
|
||||
typedef struct VkImageFormatConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImageCreateInfo imageCreateInfo;
|
||||
VkFormatFeatureFlags requiredFormatFeatures;
|
||||
VkImageFormatConstraintsFlagsFUCHSIA flags;
|
||||
uint64_t sysmemPixelFormat;
|
||||
uint32_t colorSpaceCount;
|
||||
const VkSysmemColorSpaceFUCHSIA* pColorSpaces;
|
||||
} VkImageFormatConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef struct VkImageConstraintsInfoFUCHSIA {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
uint32_t formatConstraintsCount;
|
||||
const VkImageFormatConstraintsInfoFUCHSIA* pFormatConstraints;
|
||||
VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
|
||||
VkImageConstraintsInfoFlagsFUCHSIA flags;
|
||||
} VkImageConstraintsInfoFUCHSIA;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferCollectionFUCHSIA)(VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionImageConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
|
||||
typedef void (VKAPI_PTR *PFN_vkDestroyBufferCollectionFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkAllocationCallbacks* pAllocator);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA(
|
||||
VkDevice device,
|
||||
const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkBufferCollectionFUCHSIA* pCollection);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
|
||||
|
||||
VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
const VkAllocationCallbacks* pAllocator);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA(
|
||||
VkDevice device,
|
||||
VkBufferCollectionFUCHSIA collection,
|
||||
VkBufferCollectionPropertiesFUCHSIA* pProperties);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
#ifndef VULKAN_GGP_H_
|
||||
#define VULKAN_GGP_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_GGP_stream_descriptor_surface 1
|
||||
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_SPEC_VERSION 1
|
||||
#define VK_GGP_STREAM_DESCRIPTOR_SURFACE_EXTENSION_NAME "VK_GGP_stream_descriptor_surface"
|
||||
typedef VkFlags VkStreamDescriptorSurfaceCreateFlagsGGP;
|
||||
typedef struct VkStreamDescriptorSurfaceCreateInfoGGP {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkStreamDescriptorSurfaceCreateFlagsGGP flags;
|
||||
GgpStreamDescriptor streamDescriptor;
|
||||
} VkStreamDescriptorSurfaceCreateInfoGGP;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
|
||||
VkInstance instance,
|
||||
const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_GGP_frame_token 1
|
||||
#define VK_GGP_FRAME_TOKEN_SPEC_VERSION 1
|
||||
#define VK_GGP_FRAME_TOKEN_EXTENSION_NAME "VK_GGP_frame_token"
|
||||
typedef struct VkPresentFrameTokenGGP {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
GgpFrameToken frameToken;
|
||||
} VkPresentFrameTokenGGP;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+9
-20
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_IOS_H_
|
||||
#define VULKAN_IOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_MVK_ios_surface 1
|
||||
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 2
|
||||
#define VK_MVK_IOS_SURFACE_SPEC_VERSION 3
|
||||
#define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface"
|
||||
|
||||
typedef VkFlags VkIOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkIOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -40,7 +30,6 @@ typedef struct VkIOSSurfaceCreateInfoMVK {
|
||||
const void* pView;
|
||||
} VkIOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
||||
+9
-20
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_MACOS_H_
|
||||
#define VULKAN_MACOS_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_MVK_macos_surface 1
|
||||
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2
|
||||
#define VK_MVK_MACOS_SURFACE_SPEC_VERSION 3
|
||||
#define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface"
|
||||
|
||||
typedef VkFlags VkMacOSSurfaceCreateFlagsMVK;
|
||||
|
||||
typedef struct VkMacOSSurfaceCreateInfoMVK {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -40,7 +30,6 @@ typedef struct VkMacOSSurfaceCreateInfoMVK {
|
||||
const void* pView;
|
||||
} VkMacOSSurfaceCreateInfoMVK;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
#ifndef VULKAN_METAL_H_
|
||||
#define VULKAN_METAL_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_EXT_metal_surface 1
|
||||
#ifdef __OBJC__
|
||||
@class CAMetalLayer;
|
||||
#else
|
||||
typedef void CAMetalLayer;
|
||||
#endif
|
||||
|
||||
#define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
|
||||
#define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
|
||||
typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
|
||||
typedef struct VkMetalSurfaceCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMetalSurfaceCreateFlagsEXT flags;
|
||||
const CAMetalLayer* pLayer;
|
||||
} VkMetalSurfaceCreateInfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
|
||||
VkInstance instance,
|
||||
const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_EXT_metal_objects 1
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLDevice;
|
||||
typedef id<MTLDevice> MTLDevice_id;
|
||||
#else
|
||||
typedef void* MTLDevice_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLCommandQueue;
|
||||
typedef id<MTLCommandQueue> MTLCommandQueue_id;
|
||||
#else
|
||||
typedef void* MTLCommandQueue_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLBuffer;
|
||||
typedef id<MTLBuffer> MTLBuffer_id;
|
||||
#else
|
||||
typedef void* MTLBuffer_id;
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLTexture;
|
||||
typedef id<MTLTexture> MTLTexture_id;
|
||||
#else
|
||||
typedef void* MTLTexture_id;
|
||||
#endif
|
||||
|
||||
typedef struct __IOSurface* IOSurfaceRef;
|
||||
#ifdef __OBJC__
|
||||
@protocol MTLSharedEvent;
|
||||
typedef id<MTLSharedEvent> MTLSharedEvent_id;
|
||||
#else
|
||||
typedef void* MTLSharedEvent_id;
|
||||
#endif
|
||||
|
||||
#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1
|
||||
#define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
|
||||
|
||||
typedef enum VkExportMetalObjectTypeFlagBitsEXT {
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0x00000001,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = 0x00000002,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = 0x00000004,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0x00000008,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0x00000010,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0x00000020,
|
||||
VK_EXPORT_METAL_OBJECT_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkExportMetalObjectTypeFlagBitsEXT;
|
||||
typedef VkFlags VkExportMetalObjectTypeFlagsEXT;
|
||||
typedef struct VkExportMetalObjectCreateInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkExportMetalObjectTypeFlagBitsEXT exportObjectType;
|
||||
} VkExportMetalObjectCreateInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalObjectsInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
} VkExportMetalObjectsInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalDeviceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLDevice_id mtlDevice;
|
||||
} VkExportMetalDeviceInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalCommandQueueInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkQueue queue;
|
||||
MTLCommandQueue_id mtlCommandQueue;
|
||||
} VkExportMetalCommandQueueInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalBufferInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkDeviceMemory memory;
|
||||
MTLBuffer_id mtlBuffer;
|
||||
} VkExportMetalBufferInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalBufferInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLBuffer_id mtlBuffer;
|
||||
} VkImportMetalBufferInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalTextureInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImage image;
|
||||
VkImageView imageView;
|
||||
VkBufferView bufferView;
|
||||
VkImageAspectFlagBits plane;
|
||||
MTLTexture_id mtlTexture;
|
||||
} VkExportMetalTextureInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalTextureInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImageAspectFlagBits plane;
|
||||
MTLTexture_id mtlTexture;
|
||||
} VkImportMetalTextureInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalIOSurfaceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkImage image;
|
||||
IOSurfaceRef ioSurface;
|
||||
} VkExportMetalIOSurfaceInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalIOSurfaceInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
IOSurfaceRef ioSurface;
|
||||
} VkImportMetalIOSurfaceInfoEXT;
|
||||
|
||||
typedef struct VkExportMetalSharedEventInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkSemaphore semaphore;
|
||||
VkEvent event;
|
||||
MTLSharedEvent_id mtlSharedEvent;
|
||||
} VkExportMetalSharedEventInfoEXT;
|
||||
|
||||
typedef struct VkImportMetalSharedEventInfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
MTLSharedEvent_id mtlSharedEvent;
|
||||
} VkImportMetalSharedEventInfoEXT;
|
||||
|
||||
typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
|
||||
VkDevice device,
|
||||
VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
-65
@@ -1,65 +0,0 @@
|
||||
#ifndef VULKAN_MIR_H_
|
||||
#define VULKAN_MIR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#define VK_KHR_mir_surface 1
|
||||
#define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
|
||||
#define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface"
|
||||
|
||||
typedef VkFlags VkMirSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkMirSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkMirSurfaceCreateFlagsKHR flags;
|
||||
MirConnection* connection;
|
||||
MirSurface* mirSurface;
|
||||
} VkMirSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR(
|
||||
VkInstance instance,
|
||||
const VkMirSurfaceCreateInfoKHR* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
MirConnection* connection);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
#ifndef VULKAN_SCREEN_H_
|
||||
#define VULKAN_SCREEN_H_ 1
|
||||
|
||||
/*
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos Vulkan XML API Registry.
|
||||
**
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_QNX_screen_surface 1
|
||||
#define VK_QNX_SCREEN_SURFACE_SPEC_VERSION 1
|
||||
#define VK_QNX_SCREEN_SURFACE_EXTENSION_NAME "VK_QNX_screen_surface"
|
||||
typedef VkFlags VkScreenSurfaceCreateFlagsQNX;
|
||||
typedef struct VkScreenSurfaceCreateInfoQNX {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
VkScreenSurfaceCreateFlagsQNX flags;
|
||||
struct _screen_context* context;
|
||||
struct _screen_window* window;
|
||||
} VkScreenSurfaceCreateInfoQNX;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateScreenSurfaceQNX)(VkInstance instance, const VkScreenSurfaceCreateInfoQNX* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(
|
||||
VkInstance instance,
|
||||
const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
|
||||
const VkAllocationCallbacks* pAllocator,
|
||||
VkSurfaceKHR* pSurface);
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t queueFamilyIndex,
|
||||
struct _screen_window* window);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Vendored
+8
-19
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_VI_H_
|
||||
#define VULKAN_VI_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_NN_vi_surface 1
|
||||
#define VK_NN_VI_SURFACE_SPEC_VERSION 1
|
||||
#define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
|
||||
|
||||
typedef VkFlags VkViSurfaceCreateFlagsNN;
|
||||
|
||||
typedef struct VkViSurfaceCreateInfoNN {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -40,7 +30,6 @@ typedef struct VkViSurfaceCreateInfoNN {
|
||||
void* window;
|
||||
} VkViSurfaceCreateInfoNN;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
|
||||
+8
-19
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_WAYLAND_H_
|
||||
#define VULKAN_WAYLAND_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_wayland_surface 1
|
||||
#define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
|
||||
|
||||
typedef VkFlags VkWaylandSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWaylandSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -41,7 +31,6 @@ typedef struct VkWaylandSurfaceCreateInfoKHR {
|
||||
struct wl_surface* surface;
|
||||
} VkWaylandSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
|
||||
|
||||
|
||||
+88
-31
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_WIN32_H_
|
||||
#define VULKAN_WIN32_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_win32_surface 1
|
||||
#define VK_KHR_WIN32_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_WIN32_SURFACE_EXTENSION_NAME "VK_KHR_win32_surface"
|
||||
|
||||
typedef VkFlags VkWin32SurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkWin32SurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -41,7 +31,6 @@ typedef struct VkWin32SurfaceCreateInfoKHR {
|
||||
HWND hwnd;
|
||||
} VkWin32SurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
|
||||
|
||||
@@ -57,10 +46,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
|
||||
uint32_t queueFamilyIndex);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_KHR_external_memory_win32 1
|
||||
#define VK_KHR_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_KHR_external_memory_win32"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -90,7 +79,6 @@ typedef struct VkMemoryGetWin32HandleInfoKHR {
|
||||
VkExternalMemoryHandleTypeFlagBits handleType;
|
||||
} VkMemoryGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
|
||||
@@ -107,10 +95,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
|
||||
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_KHR_win32_keyed_mutex 1
|
||||
#define VK_KHR_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
||||
#define VK_KHR_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_KHR_win32_keyed_mutex"
|
||||
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -128,7 +116,6 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoKHR {
|
||||
#define VK_KHR_external_semaphore_win32 1
|
||||
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME "VK_KHR_external_semaphore_win32"
|
||||
|
||||
typedef struct VkImportSemaphoreWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -163,7 +150,6 @@ typedef struct VkSemaphoreGetWin32HandleInfoKHR {
|
||||
VkExternalSemaphoreHandleTypeFlagBits handleType;
|
||||
} VkSemaphoreGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
@@ -178,10 +164,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_KHR_external_fence_win32 1
|
||||
#define VK_KHR_EXTERNAL_FENCE_WIN32_SPEC_VERSION 1
|
||||
#define VK_KHR_EXTERNAL_FENCE_WIN32_EXTENSION_NAME "VK_KHR_external_fence_win32"
|
||||
|
||||
typedef struct VkImportFenceWin32HandleInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -207,7 +193,6 @@ typedef struct VkFenceGetWin32HandleInfoKHR {
|
||||
VkExternalFenceHandleTypeFlagBits handleType;
|
||||
} VkFenceGetWin32HandleInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
|
||||
|
||||
@@ -222,10 +207,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_NV_external_memory_win32 1
|
||||
#define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
|
||||
#define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
|
||||
|
||||
typedef struct VkImportMemoryWin32HandleInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -240,7 +225,6 @@ typedef struct VkExportMemoryWin32HandleInfoNV {
|
||||
DWORD dwAccess;
|
||||
} VkExportMemoryWin32HandleInfoNV;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
@@ -251,10 +235,10 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
|
||||
HANDLE* pHandle);
|
||||
#endif
|
||||
|
||||
#define VK_NV_win32_keyed_mutex 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
|
||||
|
||||
#define VK_NV_win32_keyed_mutex 1
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 2
|
||||
#define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
|
||||
typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -269,6 +253,79 @@ typedef struct VkWin32KeyedMutexAcquireReleaseInfoNV {
|
||||
|
||||
|
||||
|
||||
#define VK_EXT_full_screen_exclusive 1
|
||||
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_SPEC_VERSION 4
|
||||
#define VK_EXT_FULL_SCREEN_EXCLUSIVE_EXTENSION_NAME "VK_EXT_full_screen_exclusive"
|
||||
|
||||
typedef enum VkFullScreenExclusiveEXT {
|
||||
VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = 0,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT = 1,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT = 2,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT = 3,
|
||||
VK_FULL_SCREEN_EXCLUSIVE_MAX_ENUM_EXT = 0x7FFFFFFF
|
||||
} VkFullScreenExclusiveEXT;
|
||||
typedef struct VkSurfaceFullScreenExclusiveInfoEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkFullScreenExclusiveEXT fullScreenExclusive;
|
||||
} VkSurfaceFullScreenExclusiveInfoEXT;
|
||||
|
||||
typedef struct VkSurfaceCapabilitiesFullScreenExclusiveEXT {
|
||||
VkStructureType sType;
|
||||
void* pNext;
|
||||
VkBool32 fullScreenExclusiveSupported;
|
||||
} VkSurfaceCapabilitiesFullScreenExclusiveEXT;
|
||||
|
||||
typedef struct VkSurfaceFullScreenExclusiveWin32InfoEXT {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
HMONITOR hmonitor;
|
||||
} VkSurfaceFullScreenExclusiveWin32InfoEXT;
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModes2EXT)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice device, VkSwapchainKHR swapchain);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
|
||||
VkDevice device,
|
||||
VkSwapchainKHR swapchain);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
|
||||
VkDevice device,
|
||||
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
|
||||
VkDeviceGroupPresentModeFlagsKHR* pModes);
|
||||
#endif
|
||||
|
||||
|
||||
#define VK_NV_acquire_winrt_display 1
|
||||
#define VK_NV_ACQUIRE_WINRT_DISPLAY_SPEC_VERSION 1
|
||||
#define VK_NV_ACQUIRE_WINRT_DISPLAY_EXTENSION_NAME "VK_NV_acquire_winrt_display"
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physicalDevice, VkDisplayKHR display);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay);
|
||||
|
||||
#ifndef VK_NO_PROTOTYPES
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
VkDisplayKHR display);
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
|
||||
VkPhysicalDevice physicalDevice,
|
||||
uint32_t deviceRelativeId,
|
||||
VkDisplayKHR* pDisplay);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Vendored
+8
-19
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_XCB_H_
|
||||
#define VULKAN_XCB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_xcb_surface 1
|
||||
#define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
|
||||
|
||||
typedef VkFlags VkXcbSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXcbSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -41,7 +31,6 @@ typedef struct VkXcbSurfaceCreateInfoKHR {
|
||||
xcb_window_t window;
|
||||
} VkXcbSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
|
||||
|
||||
|
||||
+8
-19
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_XLIB_H_
|
||||
#define VULKAN_XLIB_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,12 +13,16 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_KHR_xlib_surface 1
|
||||
#define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
|
||||
#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
|
||||
|
||||
typedef VkFlags VkXlibSurfaceCreateFlagsKHR;
|
||||
|
||||
typedef struct VkXlibSurfaceCreateInfoKHR {
|
||||
VkStructureType sType;
|
||||
const void* pNext;
|
||||
@@ -41,7 +31,6 @@ typedef struct VkXlibSurfaceCreateInfoKHR {
|
||||
Window window;
|
||||
} VkXlibSurfaceCreateInfoKHR;
|
||||
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
|
||||
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
|
||||
|
||||
|
||||
+8
-17
@@ -1,24 +1,10 @@
|
||||
#ifndef VULKAN_XLIB_XRANDR_H_
|
||||
#define VULKAN_XLIB_XRANDR_H_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2015-2018 The Khronos Group Inc.
|
||||
** Copyright 2015-2023 The Khronos Group Inc.
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -27,10 +13,15 @@ extern "C" {
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VK_EXT_acquire_xlib_display 1
|
||||
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
|
||||
#define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
|
||||
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display);
|
||||
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
|
||||
|
||||
|
||||
Vendored
+2
-2
@@ -10,7 +10,7 @@ if(HAVE_IPP_ICV)
|
||||
add_definitions(-DICV_BASE)
|
||||
endif()
|
||||
|
||||
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c)
|
||||
file(GLOB lib_srcs ${IPP_IW_PATH}/src/*.c ${IPP_IW_PATH}/src/*.cpp)
|
||||
file(GLOB lib_hdrs ${IPP_IW_PATH}/include/*.h ${IPP_IW_PATH}/include/iw/*.h ${IPP_IW_PATH}/include/iw++/*.hpp)
|
||||
|
||||
# ----------------------------------------------------------------------------------
|
||||
@@ -24,7 +24,7 @@ if(UNIX)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function -Wno-missing-braces -Wno-missing-field-initializers")
|
||||
endif()
|
||||
if(CV_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-self-assign -Wno-strict-prototypes")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+20
-11
@@ -2,32 +2,41 @@ function(download_ippicv root_var)
|
||||
set(${root_var} "" PARENT_SCOPE)
|
||||
|
||||
# Commit SHA in the opencv_3rdparty repo
|
||||
set(IPPICV_COMMIT "a56b6ac6f030c312b2dce17430eef13aed9af274")
|
||||
set(IPPICV_COMMIT "767426b2a40a011eb2fa7f44c677c13e60e205ad")
|
||||
# Define actual ICV versions
|
||||
if(APPLE)
|
||||
set(IPPICV_COMMIT "0cc4aa06bf2bef4b05d237c69a5a96b9cd0cb85a")
|
||||
set(OPENCV_ICV_PLATFORM "macosx")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_mac")
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_mac_intel64_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "1c3d675c2a2395d094d523024896e01b")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.9.1_mac_intel64_20230919_general.tgz")
|
||||
set(OPENCV_ICV_HASH "14f01c5a4780bfae9dde9b0aaf5e56fc")
|
||||
elseif((UNIX AND NOT ANDROID) OR (UNIX AND ANDROID_ABI MATCHES "x86"))
|
||||
set(OPENCV_ICV_PLATFORM "linux")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_lnx")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_lnx_intel64_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "7421de0095c7a39162ae13a6098782f9")
|
||||
set(OPENCV_ICV_NAME "ippicv_2022.1.0_lnx_intel64_20250130_general.tgz")
|
||||
set(OPENCV_ICV_HASH "98ff71fc242d52db9cc538388e502f57")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_lnx_ia32_20191018_general.tgz")
|
||||
set(OPENCV_ICV_HASH "ad189a940fb60eb71f291321322fe3e8")
|
||||
if(ANDROID)
|
||||
set(IPPICV_COMMIT "c7c6d527dde5fee7cb914ee9e4e20f7436aab3a1")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.10.1_lnx_ia32_20231206_general.tgz")
|
||||
set(OPENCV_ICV_HASH "d9510f3ce08f6074aac472a5c19a3b53")
|
||||
else()
|
||||
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.12.0_lnx_ia32_20240425_general.tgz")
|
||||
set(OPENCV_ICV_HASH "85ffa2b9ed7802b93c23fa27b0097d36")
|
||||
endif()
|
||||
endif()
|
||||
elseif(WIN32 AND NOT ARM)
|
||||
set(OPENCV_ICV_PLATFORM "windows")
|
||||
set(OPENCV_ICV_PACKAGE_SUBDIR "ippicv_win")
|
||||
if(X86_64)
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_win_intel64_20191018_general.zip")
|
||||
set(OPENCV_ICV_HASH "879741a7946b814455eee6c6ffde2984")
|
||||
set(OPENCV_ICV_NAME "ippicv_2022.1.0_win_intel64_20250130_general.zip")
|
||||
set(OPENCV_ICV_HASH "67a611ab22410f392239bddff6f91df7")
|
||||
else()
|
||||
set(OPENCV_ICV_NAME "ippicv_2020_win_ia32_20191018_general.zip")
|
||||
set(OPENCV_ICV_HASH "cd39bdf0c2e1cac9a61101dad7a2413e")
|
||||
set(IPPICV_COMMIT "7f55c0c26be418d494615afca15218566775c725")
|
||||
set(OPENCV_ICV_NAME "ippicv_2021.12.0_win_ia32_20240425_general.zip")
|
||||
set(OPENCV_ICV_HASH "8b1d2a23957d57624d0de8f2a5cae5f1")
|
||||
endif()
|
||||
else()
|
||||
return()
|
||||
|
||||
Vendored
+7
-2
@@ -24,7 +24,6 @@ set(ITT_PUBLIC_HDRS
|
||||
include/ittnotify.h
|
||||
include/jitprofiling.h
|
||||
include/libittnotify.h
|
||||
include/llvm_jit_event_listener.hpp
|
||||
)
|
||||
set(ITT_PRIVATE_HDRS
|
||||
src/ittnotify/disable_warnings.h
|
||||
@@ -39,6 +38,11 @@ set(ITT_SRCS
|
||||
|
||||
add_library(${ITT_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${ITT_SRCS} ${ITT_PUBLIC_HDRS} ${ITT_PRIVATE_HDRS})
|
||||
|
||||
file(STRINGS "src/ittnotify/ittnotify_config.h" API_VERSION_NUM REGEX "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]+)")
|
||||
if(API_VERSION_NUM MATCHES "#define\[ \t]+API_VERSION_NUM[ \t]+([0-9\.]*)")
|
||||
set(ITTNOTIFY_VERSION "${CMAKE_MATCH_1}" CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
if(HAVE_DL_LIBRARY)
|
||||
target_link_libraries(${ITT_LIBRARY} dl)
|
||||
@@ -54,6 +58,7 @@ set_target_properties(${ITT_LIBRARY} PROPERTIES
|
||||
)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wundef -Wsign-compare)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wstrict-prototypes) # clang15
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${ITT_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
@@ -63,4 +68,4 @@ if(NOT BUILD_SHARED_LIBS)
|
||||
ocv_install_target(${ITT_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev OPTIONAL)
|
||||
endif()
|
||||
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/LICENSE.BSD src/ittnotify/LICENSE.GPL)
|
||||
ocv_install_3rdparty_licenses(ittnotify src/ittnotify/BSD-3-Clause.txt src/ittnotify/GPL-2.0-only.txt)
|
||||
|
||||
+643
-101
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _ITTNOTIFY_H_
|
||||
#define _ITTNOTIFY_H_
|
||||
|
||||
@@ -63,7 +11,8 @@
|
||||
@brief Public User API functions and types
|
||||
@mainpage
|
||||
|
||||
The ITT API is used to annotate a user's program with additional information
|
||||
The Instrumentation and Tracing Technology API (ITT API) is used to
|
||||
annotate a user's program with additional information
|
||||
that can be used by correctness and performance tools. The user inserts
|
||||
calls in their program. Those calls generate information that is collected
|
||||
at runtime, and used by Intel(R) Threading Tools.
|
||||
@@ -141,6 +90,10 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -148,6 +101,8 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__)
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -169,6 +124,10 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -176,6 +135,8 @@ The same ID may not be reused for different instances, unless a previous
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -228,7 +189,12 @@ The same ID may not be reused for different instances, unless a previous
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -289,20 +255,20 @@ The same ID may not be reused for different instances, unless a previous
|
||||
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
|
||||
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
|
||||
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
@@ -340,7 +306,7 @@ extern "C" {
|
||||
* only pauses tracing and analyzing memory access.
|
||||
* It does not pause tracing or analyzing threading APIs.
|
||||
* .
|
||||
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
@@ -355,35 +321,143 @@ void ITTAPI __itt_resume(void);
|
||||
/** @brief Detach collection */
|
||||
void ITTAPI __itt_detach(void);
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_scope
|
||||
* @brief Enumerator for collection scopes
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_scope_host = 1 << 0,
|
||||
__itt_collection_scope_offload = 1 << 1,
|
||||
__itt_collection_scope_all = 0x7FFFFFFF
|
||||
} __itt_collection_scope;
|
||||
|
||||
/** @brief Pause scoped collection */
|
||||
void ITTAPI __itt_pause_scoped(__itt_collection_scope);
|
||||
/** @brief Resume scoped collection */
|
||||
void ITTAPI __itt_resume_scoped(__itt_collection_scope);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, pause, (void))
|
||||
ITT_STUBV(ITTAPI, void, resume, (void))
|
||||
ITT_STUBV(ITTAPI, void, detach, (void))
|
||||
#define __itt_pause ITTNOTIFY_VOID(pause)
|
||||
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
|
||||
#define __itt_resume ITTNOTIFY_VOID(resume)
|
||||
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
|
||||
#define __itt_detach ITTNOTIFY_VOID(detach)
|
||||
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
|
||||
ITT_STUBV(ITTAPI, void, pause, (void))
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, resume, (void))
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope))
|
||||
ITT_STUBV(ITTAPI, void, detach, (void))
|
||||
#define __itt_pause ITTNOTIFY_VOID(pause)
|
||||
#define __itt_pause_ptr ITTNOTIFY_NAME(pause)
|
||||
#define __itt_pause_scoped ITTNOTIFY_VOID(pause_scoped)
|
||||
#define __itt_pause_scoped_ptr ITTNOTIFY_NAME(pause_scoped)
|
||||
#define __itt_resume ITTNOTIFY_VOID(resume)
|
||||
#define __itt_resume_ptr ITTNOTIFY_NAME(resume)
|
||||
#define __itt_resume_scoped ITTNOTIFY_VOID(resume_scoped)
|
||||
#define __itt_resume_scoped_ptr ITTNOTIFY_NAME(resume_scoped)
|
||||
#define __itt_detach ITTNOTIFY_VOID(detach)
|
||||
#define __itt_detach_ptr ITTNOTIFY_NAME(detach)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_pause()
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_scoped(scope)
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_resume()
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped(scope)
|
||||
#define __itt_resume_scoped_ptr 0
|
||||
#define __itt_detach()
|
||||
#define __itt_detach_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#define __itt_pause_ptr 0
|
||||
#define __itt_pause_scoped_ptr 0
|
||||
#define __itt_resume_ptr 0
|
||||
#define __itt_resume_scoped_ptr 0
|
||||
#define __itt_detach_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
/** @} control group */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @defgroup Intel Processor Trace control
|
||||
* API from this group provides control over collection and analysis of Intel Processor Trace (Intel PT) data
|
||||
* Information about Intel Processor Trace technology can be found here (Volume 3 chapter 35):
|
||||
* https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf
|
||||
* Use this API to mark particular code regions for loading detailed performance statistics.
|
||||
* This mode makes your analysis faster and more accurate.
|
||||
* @{
|
||||
*/
|
||||
typedef unsigned char __itt_pt_region;
|
||||
|
||||
/**
|
||||
* @brief function saves a region name marked with Intel PT API and returns a region id.
|
||||
* Only 7 names can be registered. Attempts to register more names will be ignored and a region id with auto names will be returned.
|
||||
* For automatic naming of regions pass NULL as function parameter
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_pt_region ITTAPI __itt_pt_region_createA(const char *name);
|
||||
__itt_pt_region ITTAPI __itt_pt_region_createW(const wchar_t *name);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_pt_region_create __itt_pt_region_createW
|
||||
#else /* UNICODE */
|
||||
# define __itt_pt_region_create __itt_pt_region_createA
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_pt_region ITTAPI __itt_pt_region_create(const char *name);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name))
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA ITTNOTIFY_DATA(pt_region_createA)
|
||||
#define __itt_pt_region_createA_ptr ITTNOTIFY_NAME(pt_region_createA)
|
||||
#define __itt_pt_region_createW ITTNOTIFY_DATA(pt_region_createW)
|
||||
#define __itt_pt_region_createW_ptr ITTNOTIFY_NAME(pt_region_createW)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create ITTNOTIFY_DATA(pt_region_create)
|
||||
#define __itt_pt_region_create_ptr ITTNOTIFY_NAME(pt_region_create)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_createA_ptr 0
|
||||
#define __itt_pt_region_createW(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create(name) (__itt_pt_region)0
|
||||
#define __itt_pt_region_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_pt_region_createA_ptr 0
|
||||
#define __itt_pt_region_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_pt_region_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief function contains a special code pattern identified on the post-processing stage and
|
||||
* marks the beginning of a code region targeted for Intel PT analysis
|
||||
* @param[in] region - region id, 0 <= region < 8
|
||||
*/
|
||||
void __itt_mark_pt_region_begin(__itt_pt_region region);
|
||||
/**
|
||||
* @brief function contains a special code pattern identified on the post-processing stage and
|
||||
* marks the end of a code region targeted for Intel PT analysis
|
||||
* @param[in] region - region id, 0 <= region < 8
|
||||
*/
|
||||
void __itt_mark_pt_region_end(__itt_pt_region region);
|
||||
/** @} Intel PT control group*/
|
||||
|
||||
/**
|
||||
* @defgroup threads Threads
|
||||
* @ingroup public
|
||||
@@ -541,14 +615,26 @@ ITT_STUBV(ITTAPI, void, suppress_pop, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @enum __itt_model_disable
|
||||
* @brief Enumerator for the disable methods
|
||||
* @enum __itt_suppress_mode
|
||||
* @brief Enumerator for the suppressing modes
|
||||
*/
|
||||
typedef enum __itt_suppress_mode {
|
||||
__itt_unsuppress_range,
|
||||
__itt_suppress_range
|
||||
} __itt_suppress_mode_t;
|
||||
|
||||
/**
|
||||
* @enum __itt_collection_state
|
||||
* @brief Enumerator for collection state.
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_collection_uninitialized = 0, /* uninitialized */
|
||||
__itt_collection_init_fail = 1, /* failed to init */
|
||||
__itt_collection_collector_absent = 2, /* non work state collector is absent */
|
||||
__itt_collection_collector_exists = 3, /* work state collector exists */
|
||||
__itt_collection_init_successful = 4 /* success to init */
|
||||
} __itt_collection_state;
|
||||
|
||||
/**
|
||||
* @brief Mark a range of memory for error suppression or unsuppression for error types included in mask
|
||||
*/
|
||||
@@ -1496,7 +1582,7 @@ ITT_STUBV(ITTAPI, void, heap_allocate_end, (__itt_heap_function h, void** addr,
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an free begin occurrence.
|
||||
* @brief Record a free begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_begin(__itt_heap_function h, void* addr);
|
||||
|
||||
@@ -1516,7 +1602,7 @@ ITT_STUBV(ITTAPI, void, heap_free_begin, (__itt_heap_function h, void* addr))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an free end occurrence.
|
||||
* @brief Record a free end occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_free_end(__itt_heap_function h, void* addr);
|
||||
|
||||
@@ -1536,7 +1622,7 @@ ITT_STUBV(ITTAPI, void, heap_free_end, (__itt_heap_function h, void* addr))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an reallocation begin occurrence.
|
||||
* @brief Record a reallocation begin occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_reallocate_begin(__itt_heap_function h, void* addr, size_t new_size, int initialized);
|
||||
|
||||
@@ -1556,7 +1642,7 @@ ITT_STUBV(ITTAPI, void, heap_reallocate_begin, (__itt_heap_function h, void* add
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Record an reallocation end occurrence.
|
||||
* @brief Record a reallocation end occurrence.
|
||||
*/
|
||||
void ITTAPI __itt_heap_reallocate_end(__itt_heap_function h, void* addr, void** new_addr, size_t new_size, int initialized);
|
||||
|
||||
@@ -2692,7 +2778,7 @@ ITT_STUB(ITTAPI, __itt_clock_domain*, clock_domain_create, (__itt_get_clock_info
|
||||
|
||||
/**
|
||||
* @ingroup clockdomains
|
||||
* @brief Recalculate clock domains frequences and clock base timestamps.
|
||||
* @brief Recalculate clock domains frequencies and clock base timestamps.
|
||||
*/
|
||||
void ITTAPI __itt_clock_domain_reset(void);
|
||||
|
||||
@@ -3597,11 +3683,12 @@ ITT_STUBV(ITTAPI, void, enable_attach, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Module load info
|
||||
* This API is used to report necessary information in case of module relocation
|
||||
* @param[in] start_addr - relocated module start address
|
||||
* @param[in] end_addr - relocated module end address
|
||||
* @param[in] path - file system path to the module
|
||||
* @brief Module load notification
|
||||
* This API is used to report necessary information in case of bypassing default system loader.
|
||||
* Notification should be done immidiatelly after this module is loaded to process memory.
|
||||
* @param[in] start_addr - module start address
|
||||
* @param[in] end_addr - module end address
|
||||
* @param[in] path - file system full path to the module
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
void ITTAPI __itt_module_loadA(void *start_addr, void *end_addr, const char *path);
|
||||
@@ -3656,7 +3743,462 @@ ITT_STUB(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const ch
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Report module unload
|
||||
* This API is used to report necessary information in case of bypassing default system loader.
|
||||
* Notification should be done just before the module is unloaded from process memory.
|
||||
* @param[in] addr - base address of loaded module
|
||||
*/
|
||||
void ITTAPI __itt_module_unload(void *addr);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_unload, (void *addr))
|
||||
#define __itt_module_unload ITTNOTIFY_VOID(module_unload)
|
||||
#define __itt_module_unload_ptr ITTNOTIFY_NAME(module_unload)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_unload(addr)
|
||||
#define __itt_module_unload_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_unload_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
typedef enum
|
||||
{
|
||||
__itt_module_type_unknown = 0,
|
||||
__itt_module_type_elf,
|
||||
__itt_module_type_coff
|
||||
} __itt_module_type;
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
typedef enum
|
||||
{
|
||||
itt_section_type_unknown,
|
||||
itt_section_type_bss, /* notifies that the section contains uninitialized data. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_NOBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_UNINITIALIZED_DATA section type
|
||||
*/
|
||||
itt_section_type_data, /* notifies that section contains initialized data. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_PROGBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_INITIALIZED_DATA section type
|
||||
*/
|
||||
itt_section_type_text /* notifies that the section contains executable code. These are the relevant section types and the modules that contain them:
|
||||
* ELF module: SHT_PROGBITS section type
|
||||
* COFF module: IMAGE_SCN_CNT_CODE section type
|
||||
*/
|
||||
} __itt_section_type;
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be executed as code:
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_X section attribute
|
||||
* COFF module: IMAGE_SCN_MEM_EXECUTE attribute
|
||||
*/
|
||||
#define __itt_section_exec 0x20000000
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be read.
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_R attribute
|
||||
* COFF module: IMAGE_SCN_MEM_READ attribute
|
||||
*/
|
||||
#define __itt_section_read 0x40000000
|
||||
|
||||
/**
|
||||
* @hideinitializer
|
||||
* @brief bit-mask, detects a section attribute that indicates whether a section can be written to.
|
||||
* These are the relevant section attributes and the modules that contain them:
|
||||
* ELF module: PF_W attribute
|
||||
* COFF module: IMAGE_SCN_MEM_WRITE attribute
|
||||
*/
|
||||
#define __itt_section_write 0x80000000
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_section_info
|
||||
{
|
||||
const char* name; /*!< Section name in UTF8 */
|
||||
__itt_section_type type; /*!< Section content and semantics description */
|
||||
size_t flags; /*!< Section bit flags that describe attributes using bit mask
|
||||
* Zero if disabled, non-zero if enabled
|
||||
*/
|
||||
void* start_addr; /*!< Section load(relocated) start address */
|
||||
size_t size; /*!< Section file offset */
|
||||
size_t file_offset; /*!< Section size */
|
||||
} __itt_section_info;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_module_object
|
||||
{
|
||||
unsigned int version; /*!< API version*/
|
||||
__itt_id module_id; /*!< Unique identifier. This is unchanged for sections that belong to the same module */
|
||||
__itt_module_type module_type; /*!< Binary module format */
|
||||
const char* module_name; /*!< Unique module name or path to module in UTF8
|
||||
* Contains module name when module_bufer and module_size exist
|
||||
* Contains module path when module_bufer and module_size absent
|
||||
* module_name remains the same for the certain module_id
|
||||
*/
|
||||
void* module_buffer; /*!< Module buffer content */
|
||||
size_t module_size; /*!< Module buffer size */
|
||||
/*!< If module_buffer and module_size exist, the binary module is dumped onto the system.
|
||||
* If module_buffer and module_size do not exist,
|
||||
* the binary module exists on the system already.
|
||||
* The module_name parameter contains the path to the module.
|
||||
*/
|
||||
__itt_section_info* section_array; /*!< Reference to section information */
|
||||
size_t section_number;
|
||||
} __itt_module_object;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Load module content and its loaded(relocated) sections.
|
||||
* This API is useful to save a module, or specify its location on the system and report information about loaded sections.
|
||||
* The target module is saved on the system if module buffer content and size are available.
|
||||
* If module buffer content and size are unavailable, the module name contains the path to the existing binary module.
|
||||
* @param[in] module_obj - provides module and section information, along with unique module identifiers (name,module ID)
|
||||
* which bind the binary module to particular sections.
|
||||
*/
|
||||
void ITTAPI __itt_module_load_with_sections(__itt_module_object* module_obj);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj))
|
||||
#define __itt_module_load_with_sections ITTNOTIFY_VOID(module_load_with_sections)
|
||||
#define __itt_module_load_with_sections_ptr ITTNOTIFY_NAME(module_load_with_sections)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_load_with_sections(module_obj)
|
||||
#define __itt_module_load_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_load_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Unload a module and its loaded(relocated) sections.
|
||||
* This API notifies that the module and its sections were unloaded.
|
||||
* @param[in] module_obj - provides module and sections information, along with unique module identifiers (name,module ID)
|
||||
* which bind the binary module to particular sections.
|
||||
*/
|
||||
void ITTAPI __itt_module_unload_with_sections(__itt_module_object* module_obj);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj))
|
||||
#define __itt_module_unload_with_sections ITTNOTIFY_VOID(module_unload_with_sections)
|
||||
#define __itt_module_unload_with_sections_ptr ITTNOTIFY_NAME(module_unload_with_sections)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_module_unload_with_sections(module_obj)
|
||||
#define __itt_module_unload_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_module_unload_with_sections_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_histogram
|
||||
{
|
||||
const __itt_domain* domain; /*!< Domain of the histogram*/
|
||||
const char* nameA; /*!< Name of the histogram */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* nameW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* nameW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
__itt_metadata_type x_type; /*!< Type of the histogram X axis */
|
||||
__itt_metadata_type y_type; /*!< Type of the histogram Y axis */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_histogram* next;
|
||||
} __itt_histogram;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed histogram instance with given name/domain.
|
||||
* @param[in] domain The domain controlling the call.
|
||||
* @param[in] name The name of the histogram.
|
||||
* @param[in] x_type The type of the X axis in histogram (may be 0 to calculate batch statistics).
|
||||
* @param[in] y_type The type of the Y axis in histogram.
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_histogram* ITTAPI __itt_histogram_createA(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
__itt_histogram* ITTAPI __itt_histogram_createW(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_histogram_create __itt_histogram_createW
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createW_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_histogram_create __itt_histogram_createA
|
||||
# define __itt_histogram_create_ptr __itt_histogram_createA_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_histogram* ITTAPI __itt_histogram_create(const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA ITTNOTIFY_DATA(histogram_createA)
|
||||
#define __itt_histogram_createA_ptr ITTNOTIFY_NAME(histogram_createA)
|
||||
#define __itt_histogram_createW ITTNOTIFY_DATA(histogram_createW)
|
||||
#define __itt_histogram_createW_ptr ITTNOTIFY_NAME(histogram_createW)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create ITTNOTIFY_DATA(histogram_create)
|
||||
#define __itt_histogram_create_ptr ITTNOTIFY_NAME(histogram_create)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create(domain, name, x_type, y_type) (__itt_histogram*)0
|
||||
#define __itt_histogram_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_histogram_createA_ptr 0
|
||||
#define __itt_histogram_createW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_histogram_create_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Submit statistics for a histogram instance.
|
||||
* @param[in] hist Pointer to the histogram instance to which the histogram statistic is to be dumped.
|
||||
* @param[in] length The number of elements in dumped axis data array.
|
||||
* @param[in] x_data The X axis dumped data itself (may be NULL to calculate batch statistics).
|
||||
* @param[in] y_data The Y axis dumped data itself.
|
||||
*/
|
||||
void ITTAPI __itt_histogram_submit(__itt_histogram* hist, size_t length, void* x_data, void* y_data);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data))
|
||||
#define __itt_histogram_submit ITTNOTIFY_VOID(histogram_submit)
|
||||
#define __itt_histogram_submit_ptr ITTNOTIFY_NAME(histogram_submit)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_histogram_submit(hist, length, x_data, y_data)
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_histogram_submit_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
|
||||
/**
|
||||
* @brief function allows to obtain the current collection state at the moment
|
||||
* @return collection state as a enum __itt_collection_state
|
||||
*/
|
||||
__itt_collection_state __itt_get_collection_state(void);
|
||||
|
||||
/**
|
||||
* @brief function releases resources allocated by ITT API static part
|
||||
* this API should be called from the library destructor
|
||||
* @return void
|
||||
*/
|
||||
void __itt_release_resources(void);
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Create a typed counter with given domain pointer, string name and counter type
|
||||
*/
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
__itt_counter ITTAPI __itt_counter_createA_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
|
||||
__itt_counter ITTAPI __itt_counter_createW_v3(const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type);
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_counter_create_v3 __itt_counter_createW_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createW_v3_ptr
|
||||
#else /* UNICODE */
|
||||
# define __itt_counter_create_v3 __itt_counter_createA_v3
|
||||
# define __itt_counter_create_v3_ptr __itt_counter_createA_v3_ptr
|
||||
#endif /* UNICODE */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
__itt_counter ITTAPI __itt_counter_create_v3(const __itt_domain* domain, const char* name, __itt_metadata_type type);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type type))
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char* name, __itt_metadata_type type))
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3 ITTNOTIFY_DATA(counter_createA_v3)
|
||||
#define __itt_counter_createA_v3_ptr ITTNOTIFY_NAME(counter_createA_v3)
|
||||
#define __itt_counter_createW_v3 ITTNOTIFY_DATA(counter_createW_v3)
|
||||
#define __itt_counter_createW_v3_ptr ITTNOTIFY_NAME(counter_createW_v3)
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3 ITTNOTIFY_DATA(counter_create_v3)
|
||||
#define __itt_counter_create_v3_ptr ITTNOTIFY_NAME(counter_create_v3)
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_createA_v3_ptr 0
|
||||
#define __itt_counter_createW_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_typedW_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3(domain, name, type) (__itt_counter)0
|
||||
#define __itt_counter_create_v3_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define __itt_counter_createA_v3_ptr 0
|
||||
#define __itt_counter_createW_v3_ptr 0
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#define __itt_counter_create_v3_ptr 0
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Set the counter value api
|
||||
*/
|
||||
void ITTAPI __itt_counter_set_value_v3(__itt_counter counter, void *value_ptr);
|
||||
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr))
|
||||
#define __itt_counter_set_value_v3 ITTNOTIFY_VOID(counter_set_value_v3)
|
||||
#define __itt_counter_set_value_v3_ptr ITTNOTIFY_NAME(counter_set_value_v3)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_counter_set_value_v3(counter, value_ptr)
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_counter_set_value_v3_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief describes the type of context metadata
|
||||
*/
|
||||
typedef enum {
|
||||
__itt_context_unknown = 0, /*!< Undefined type */
|
||||
__itt_context_nameA, /*!< ASCII string char* type */
|
||||
__itt_context_nameW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_deviceA, /*!< ASCII string char* type */
|
||||
__itt_context_deviceW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_unitsA, /*!< ASCII string char* type */
|
||||
__itt_context_unitsW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_pci_addrA, /*!< ASCII string char* type */
|
||||
__itt_context_pci_addrW, /*!< Unicode string wchar_t* type */
|
||||
__itt_context_tid, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_max_val, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_bandwidth_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_latency_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_occupancy_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_on_thread_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_is_abs_val_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_instructions_flag, /*!< Unsigned 64-bit integer type */
|
||||
__itt_context_cpu_cycles_flag /*!< Unsigned 64-bit integer type */
|
||||
} __itt_context_type;
|
||||
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
# define __itt_context_name __itt_context_nameW
|
||||
# define __itt_context_device __itt_context_deviceW
|
||||
# define __itt_context_units __itt_context_unitsW
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrW
|
||||
#else /* UNICODE || _UNICODE */
|
||||
# define __itt_context_name __itt_context_nameA
|
||||
# define __itt_context_device __itt_context_deviceA
|
||||
# define __itt_context_units __itt_context_unitsA
|
||||
# define __itt_context_pci_addr __itt_context_pci_addrA
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_context_metadata
|
||||
{
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
void* value; /*!< Pointer to context metadata value itself */
|
||||
} __itt_context_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#pragma pack(push, 8)
|
||||
|
||||
typedef struct ___itt_counter_metadata
|
||||
{
|
||||
__itt_counter counter; /*!< Associated context metadata counter */
|
||||
__itt_context_type type; /*!< Type of the context metadata value */
|
||||
const char* str_valueA; /*!< String context metadata value */
|
||||
#if defined(UNICODE) || defined(_UNICODE)
|
||||
const wchar_t* str_valueW;
|
||||
#else /* UNICODE || _UNICODE */
|
||||
void* str_valueW;
|
||||
#endif /* UNICODE || _UNICODE */
|
||||
unsigned long long value; /*!< Numeric context metadata value */
|
||||
int extra1; /*!< Reserved to the runtime */
|
||||
void* extra2; /*!< Reserved to the runtime */
|
||||
struct ___itt_counter_metadata* next;
|
||||
} __itt_counter_metadata;
|
||||
|
||||
#pragma pack(pop)
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Bind context metadata to counter instance
|
||||
* @param[in] counter Pointer to the counter instance to which the context metadata is to be associated.
|
||||
* @param[in] length The number of elements in context metadata array.
|
||||
* @param[in] metadata The context metadata itself.
|
||||
*/
|
||||
void ITTAPI __itt_bind_context_metadata_to_counter(__itt_counter counter, size_t length, __itt_context_metadata* metadata);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
#ifndef INTEL_NO_MACRO_BODY
|
||||
#ifndef INTEL_NO_ITTNOTIFY_API
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata))
|
||||
#define __itt_bind_context_metadata_to_counter ITTNOTIFY_VOID(bind_context_metadata_to_counter)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr ITTNOTIFY_NAME(bind_context_metadata_to_counter)
|
||||
#else /* INTEL_NO_ITTNOTIFY_API */
|
||||
#define __itt_bind_context_metadata_to_counter(counter, length, metadata)
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_ITTNOTIFY_API */
|
||||
#else /* INTEL_NO_MACRO_BODY */
|
||||
#define __itt_bind_context_metadata_to_counter_ptr 0
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -4005,7 +4547,7 @@ ITT_STUB(ITTAPI, __itt_caller, stack_caller_create, (void))
|
||||
/** @endcond */
|
||||
|
||||
/**
|
||||
* @brief Destroy the inforamtion about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
|
||||
* @brief Destroy the information about stitch point identified by the pointer previously returned by __itt_stack_caller_create()
|
||||
*/
|
||||
void ITTAPI __itt_stack_caller_destroy(__itt_caller id);
|
||||
|
||||
|
||||
+23
-75
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef __JITPROFILING_H__
|
||||
#define __JITPROFILING_H__
|
||||
@@ -66,7 +14,7 @@
|
||||
* generated code that can be used by performance tools. The user inserts
|
||||
* calls in the code generator to report information before JIT-compiled
|
||||
* code goes to execution. This information is collected at runtime and used
|
||||
* by tools like Intel(R) VTune(TM) Amplifier to display performance metrics
|
||||
* by tools like Intel(R) VTune(TM) Profiler to display performance metrics
|
||||
* associated with JIT-compiled code.
|
||||
*
|
||||
* These APIs can be used to\n
|
||||
@@ -97,16 +45,16 @@
|
||||
* * Expected behavior:
|
||||
* * If any iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED event overwrites an
|
||||
* already reported method, then such a method becomes invalid and its
|
||||
* memory region is treated as unloaded. VTune Amplifier displays the metrics
|
||||
* memory region is treated as unloaded. VTune Profiler displays the metrics
|
||||
* collected by the method until it is overwritten.
|
||||
* * If supplied line number information contains multiple source lines for
|
||||
* the same assembly instruction (code location), then VTune Amplifier picks up
|
||||
* the same assembly instruction (code location), then VTune Profiler picks up
|
||||
* the first line number.
|
||||
* * Dynamically generated code can be associated with a module name.
|
||||
* Use the iJIT_Method_Load_V2 structure.\n
|
||||
* Clarification of some cases:
|
||||
* * If you register a function with the same method ID multiple times,
|
||||
* specifying different module names, then the VTune Amplifier picks up
|
||||
* specifying different module names, then the VTune Profiler picks up
|
||||
* the module name registered first. If you want to distinguish the same
|
||||
* function between different JIT engines, supply different method IDs for
|
||||
* each function. Other symbolic information (for example, source file)
|
||||
@@ -143,18 +91,18 @@
|
||||
* belonging to the same method. Symbolic information (method name,
|
||||
* source file name) will be taken from the first notification, and all
|
||||
* subsequent notifications with the same method ID will be processed
|
||||
* only for line number table information. So, the VTune Amplifier will map
|
||||
* only for line number table information. So, the VTune Profiler will map
|
||||
* samples to a source line using the line number table from the current
|
||||
* notification while taking the source file name from the very first one.\n
|
||||
* Clarification of some cases:\n
|
||||
* * If you register a second code region with a different source file
|
||||
* name and the same method ID, then this information will be saved and
|
||||
* will not be considered as an extension of the first code region, but
|
||||
* VTune Amplifier will use the source file of the first code region and map
|
||||
* VTune Profiler will use the source file of the first code region and map
|
||||
* performance metrics incorrectly.
|
||||
* * If you register a second code region with the same source file as
|
||||
* for the first region and the same method ID, then the source file will be
|
||||
* discarded but VTune Amplifier will map metrics to the source file correctly.
|
||||
* discarded but VTune Profiler will map metrics to the source file correctly.
|
||||
* * If you register a second code region with a null source file and
|
||||
* the same method ID, then provided line number info will be associated
|
||||
* with the source file of the first code region.
|
||||
@@ -293,7 +241,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
|
||||
* @brief Description of a single entry in the line number information of a code region.
|
||||
* @details A table of line number entries gives information about how the reported code region
|
||||
* is mapped to source file.
|
||||
* Intel(R) VTune(TM) Amplifier uses line number information to attribute
|
||||
* Intel(R) VTune(TM) Profiler uses line number information to attribute
|
||||
* the samples (virtual address) to a line number. \n
|
||||
* It is acceptable to report different code addresses for the same source line:
|
||||
* @code
|
||||
@@ -304,7 +252,7 @@ typedef enum _iJIT_IsProfilingActiveFlags
|
||||
* 18 1
|
||||
* 21 30
|
||||
*
|
||||
* VTune Amplifier constructs the following table using the client data
|
||||
* VTune Profiler constructs the following table using the client data
|
||||
*
|
||||
* Code subrange Line number
|
||||
* 0-1 2
|
||||
@@ -428,7 +376,7 @@ typedef struct _iJIT_Method_Load_V2
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
The module name can be useful for distinguishing among
|
||||
different JIT engines. VTune Amplifier will display
|
||||
different JIT engines. VTune Profiler will display
|
||||
reported methods grouped by specific module. */
|
||||
|
||||
} *piJIT_Method_Load_V2, iJIT_Method_Load_V2;
|
||||
@@ -480,7 +428,7 @@ typedef struct _iJIT_Method_Load_V3
|
||||
|
||||
char* module_name; /**<\brief Module name. Can be NULL.
|
||||
* The module name can be useful for distinguishing among
|
||||
* different JIT engines. VTune Amplifier will display
|
||||
* different JIT engines. VTune Profiler will display
|
||||
* reported methods grouped by specific module. */
|
||||
|
||||
iJIT_CodeArchitecture module_arch; /**<\brief Architecture of the method's code region.
|
||||
@@ -490,9 +438,9 @@ typedef struct _iJIT_Method_Load_V3
|
||||
* engine generates 64-bit code.
|
||||
*
|
||||
* If JIT engine reports both 32-bit and 64-bit types
|
||||
* of methods then VTune Amplifier splits the methods
|
||||
* of methods then VTune Profiler splits the methods
|
||||
* with the same module name but with different
|
||||
* architectures in two different modules. VTune Amplifier
|
||||
* architectures in two different modules. VTune Profiler
|
||||
* modifies the original name provided with a 64-bit method
|
||||
* version by ending it with '(64)' */
|
||||
|
||||
@@ -561,9 +509,9 @@ typedef enum _iJIT_SegmentType
|
||||
iJIT_CT_CODE, /**<\brief Executable code. */
|
||||
|
||||
iJIT_CT_DATA, /**<\brief Data (not executable code).
|
||||
* VTune Amplifier uses the format string
|
||||
* VTune Profiler uses the format string
|
||||
* (see iJIT_Method_Update) to represent
|
||||
* this data in the VTune Amplifier GUI */
|
||||
* this data in the VTune Profiler GUI */
|
||||
|
||||
iJIT_CT_KEEP, /**<\brief Use the previous markup for the trace.
|
||||
* Can be used for the following
|
||||
@@ -580,11 +528,11 @@ typedef enum _iJIT_SegmentType
|
||||
* structure to describe the update of the content within a JIT-compiled method,
|
||||
* use iJVM_EVENT_TYPE_METHOD_UPDATE_V2 as an event type to report it.
|
||||
*
|
||||
* On the first Update event, VTune Amplifier copies the original code range reported by
|
||||
* On the first Update event, VTune Profiler copies the original code range reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event, then modifies it with the supplied bytes and
|
||||
* adds the modified range to the original method. For next update events, VTune Amplifier
|
||||
* adds the modified range to the original method. For next update events, VTune Profiler
|
||||
* does the same but it uses the latest modified version of a code region for update.
|
||||
* Eventually, VTune Amplifier GUI displays multiple code ranges for the method reported by
|
||||
* Eventually, VTune Profiler GUI displays multiple code ranges for the method reported by
|
||||
* the iJVM_EVENT_TYPE_METHOD_LOAD event.
|
||||
* Notes:
|
||||
* - Multiple update events with different types for the same trace are allowed
|
||||
@@ -673,7 +621,7 @@ iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive(void);
|
||||
* @brief Reports infomation about JIT-compiled code to the agent.
|
||||
*
|
||||
* The reported information is used to attribute samples obtained from any
|
||||
* Intel(R) VTune(TM) Amplifier collector. This API needs to be called
|
||||
* Intel(R) VTune(TM) Profiler collector. This API needs to be called
|
||||
* after JIT compilation and before the first entry into the JIT-compiled
|
||||
* code.
|
||||
*
|
||||
|
||||
+39
-74
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _LEGACY_ITTNOTIFY_H_
|
||||
#define _LEGACY_ITTNOTIFY_H_
|
||||
|
||||
@@ -80,6 +28,10 @@
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -87,6 +39,8 @@
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -108,6 +62,10 @@
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -115,6 +73,8 @@
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -167,7 +127,12 @@
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -219,20 +184,20 @@
|
||||
#define ITTNOTIFY_VOID(n) (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)
|
||||
#define ITTNOTIFY_DATA(n) (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)
|
||||
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_VOID_D0(n,d) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_VOID_D1(n,d,x) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_VOID_D2(n,d,x,y) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_VOID_D3(n,d,x,y,z) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_VOID_D4(n,d,x,y,z,a) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_VOID_D5(n,d,x,y,z,a,b) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_VOID_D6(n,d,x,y,z,a,b,c) (d == NULL) ? (void)0 : (!(d)->flags) ? (void)0 : (!ITTNOTIFY_NAME(n)) ? (void)0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
#define ITTNOTIFY_DATA_D0(n,d) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d)
|
||||
#define ITTNOTIFY_DATA_D1(n,d,x) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x)
|
||||
#define ITTNOTIFY_DATA_D2(n,d,x,y) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y)
|
||||
#define ITTNOTIFY_DATA_D3(n,d,x,y,z) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z)
|
||||
#define ITTNOTIFY_DATA_D4(n,d,x,y,z,a) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a)
|
||||
#define ITTNOTIFY_DATA_D5(n,d,x,y,z,a,b) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b)
|
||||
#define ITTNOTIFY_DATA_D6(n,d,x,y,z,a,b,c) (d == NULL) ? 0 : (!(d)->flags) ? 0 : (!ITTNOTIFY_NAME(n)) ? 0 : ITTNOTIFY_NAME(n)(d,x,y,z,a,b,c)
|
||||
|
||||
#ifdef ITT_STUB
|
||||
#undef ITT_STUB
|
||||
@@ -269,7 +234,7 @@ extern "C" {
|
||||
* only pauses tracing and analyzing memory access.
|
||||
* It does not pause tracing or analyzing threading APIs.
|
||||
* .
|
||||
* - Intel(R) Parallel Amplifier and Intel(R) VTune(TM) Amplifier XE:
|
||||
* - Intel(R) VTune(TM) Profiler:
|
||||
* - Does continue to record when new threads are started.
|
||||
* .
|
||||
* - Other effects:
|
||||
@@ -1005,9 +970,9 @@ ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain))
|
||||
#endif /* INTEL_NO_MACRO_BODY */
|
||||
/** @endcond */
|
||||
|
||||
/** @brief Record an frame begin occurrence. */
|
||||
/** @brief Record a frame begin occurrence. */
|
||||
void ITTAPI __itt_frame_begin(__itt_frame frame);
|
||||
/** @brief Record an frame end occurrence. */
|
||||
/** @brief Record a frame end occurrence. */
|
||||
void ITTAPI __itt_frame_end (__itt_frame frame);
|
||||
|
||||
/** @cond exclude_from_documentation */
|
||||
|
||||
+4
-56
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef _LIBITTNOTIFY_H_
|
||||
#define _LIBITTNOTIFY_H_
|
||||
|
||||
@@ -1,241 +0,0 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
|
||||
/*
|
||||
* This file implements an interface bridge from Low-Level Virtual Machine
|
||||
* llvm::JITEventListener to Intel JIT Profiling API. It passes the function
|
||||
* and line information to the appropriate functions in the JIT profiling
|
||||
* interface so that any LLVM-based JIT engine can emit the JIT code
|
||||
* notifications that the profiler will receive.
|
||||
*
|
||||
* Usage model:
|
||||
*
|
||||
* 1. Register the listener implementation instance with the execution engine:
|
||||
*
|
||||
* #include <llvm_jit_event_listener.hpp>
|
||||
* ...
|
||||
* ExecutionEngine *TheExecutionEngine;
|
||||
* ...
|
||||
* TheExecutionEngine = EngineBuilder(TheModule).create();
|
||||
* ...
|
||||
* __itt_llvm_jit_event_listener jitListener;
|
||||
* TheExecutionEngine->RegisterJITEventListener(&jitListener);
|
||||
* ...
|
||||
*
|
||||
* 2. When compiling make sure to add the ITT API include directory to the
|
||||
* compiler include directories, ITT API library directory to the linker
|
||||
* library directories and link with jitprofling static library.
|
||||
*/
|
||||
|
||||
#ifndef __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
#define __ITT_LLVM_JIT_EVENT_LISTENER_HPP__
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
#include <llvm/Function.h>
|
||||
#include <llvm/ExecutionEngine/JITEventListener.h>
|
||||
#include <llvm/ADT/StringRef.h>
|
||||
#include <llvm/Analysis/DebugInfo.h>
|
||||
|
||||
#include <map>
|
||||
#include <cassert>
|
||||
|
||||
// Uncomment the line below to turn on logging to stderr
|
||||
#define JITPROFILING_DEBUG_ENABLE
|
||||
|
||||
// Some elementary logging support
|
||||
#ifdef JITPROFILING_DEBUG_ENABLE
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
static void _jit_debug(const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
// Use the macro as JITDEBUG(("foo: %d", foo_val));
|
||||
#define JITDEBUG(x) \
|
||||
do { \
|
||||
_jit_debug("jit-listener: "); \
|
||||
_jit_debug x; \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define JITDEBUG(x)
|
||||
#endif
|
||||
|
||||
// LLVM JIT event listener, translates the notifications to the JIT profiling
|
||||
// API information.
|
||||
class __itt_llvm_jit_event_listener : public llvm::JITEventListener
|
||||
{
|
||||
public:
|
||||
__itt_llvm_jit_event_listener() {}
|
||||
|
||||
public:
|
||||
virtual void NotifyFunctionEmitted(const llvm::Function &F,
|
||||
void *Code, size_t Size, const EmittedFunctionDetails &Details)
|
||||
{
|
||||
std::string name = F.getName().str();
|
||||
JITDEBUG(("function jitted:\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)Code));
|
||||
JITDEBUG((" name=`%s'\n", name.c_str()));
|
||||
JITDEBUG((" code-size=%d\n", (int)Size));
|
||||
JITDEBUG((" line-infos-count=%d\n", Details.LineStarts.size()));
|
||||
|
||||
// The method must not be in the map - the entry must have been cleared
|
||||
// from the map in NotifyFreeingMachineCode in case of rejitting.
|
||||
assert(m_addr2MethodId.find(Code) == m_addr2MethodId.end());
|
||||
|
||||
int mid = iJIT_GetNewMethodID();
|
||||
m_addr2MethodId[Code] = mid;
|
||||
|
||||
iJIT_Method_Load mload;
|
||||
memset(&mload, 0, sizeof mload);
|
||||
mload.method_id = mid;
|
||||
|
||||
// Populate the method size and name information
|
||||
// TODO: The JIT profiling API should have members as const char pointers.
|
||||
mload.method_name = (char*)name.c_str();
|
||||
mload.method_load_address = Code;
|
||||
mload.method_size = (unsigned int)Size;
|
||||
|
||||
// Populate line information now.
|
||||
// From the JIT API documentation it is not quite clear whether the
|
||||
// line information can be given in ranges, so we'll populate it for
|
||||
// every byte of the function, hmm.
|
||||
std::string srcFilePath;
|
||||
std::vector<LineNumberInfo> lineInfos;
|
||||
char *addr = (char*)Code;
|
||||
char *lineAddr = addr; // Exclusive end point at which current
|
||||
// line info changes.
|
||||
const llvm::DebugLoc* loc = 0; // Current line info
|
||||
int lineIndex = -1; // Current index into the line info table
|
||||
for (int i = 0; i < Size; ++i, ++addr) {
|
||||
while (addr >= lineAddr) {
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
loc = &Details.LineStarts[lineIndex].Loc;
|
||||
std::string p = getSrcFilePath(F.getContext(), *loc);
|
||||
assert(srcFilePath.empty() || p == srcFilePath);
|
||||
srcFilePath = p;
|
||||
} else {
|
||||
loc = NULL;
|
||||
}
|
||||
lineIndex++;
|
||||
if (lineIndex >= 0 && lineIndex < Details.LineStarts.size()) {
|
||||
lineAddr = (char*)Details.LineStarts[lineIndex].Address;
|
||||
} else {
|
||||
lineAddr = addr + Size;
|
||||
}
|
||||
}
|
||||
if (loc) {
|
||||
int line = loc->getLine();
|
||||
LineNumberInfo info = { i, line };
|
||||
lineInfos.push_back(info);
|
||||
JITDEBUG((" addr 0x%08x -> line %d\n", addr, line));
|
||||
}
|
||||
}
|
||||
if (!lineInfos.empty()) {
|
||||
mload.line_number_size = lineInfos.size();
|
||||
JITDEBUG((" translated to %d line infos to JIT", (int)lineInfos.size()));
|
||||
mload.line_number_table = &lineInfos[0];
|
||||
mload.source_file_name = (char*)srcFilePath.c_str();
|
||||
}
|
||||
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, &mload);
|
||||
}
|
||||
|
||||
virtual void NotifyFreeingMachineCode(void *OldPtr)
|
||||
{
|
||||
JITDEBUG(("function unjitted\n"));
|
||||
JITDEBUG((" addr=0x%08x\n", (int)OldPtr));
|
||||
Addr2MethodId::iterator it = m_addr2MethodId.find(OldPtr);
|
||||
assert(it != m_addr2MethodId.end());
|
||||
iJIT_Method_Id mid = { it->second };
|
||||
iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_UNLOAD_START, &mid);
|
||||
m_addr2MethodId.erase(it);
|
||||
}
|
||||
|
||||
private:
|
||||
std::string getSrcFilePath(const llvm::LLVMContext& ctx, const llvm::DebugLoc& loc)
|
||||
{
|
||||
llvm::MDNode* node = loc.getAsMDNode(ctx);
|
||||
llvm::DILocation srcLoc(node);
|
||||
return srcLoc.getDirectory().str() + "/" + srcLoc.getFilename().str();
|
||||
}
|
||||
|
||||
private:
|
||||
/// Don't copy
|
||||
__itt_llvm_jit_event_listener(const __itt_llvm_jit_event_listener&);
|
||||
__itt_llvm_jit_event_listener& operator=(const __itt_llvm_jit_event_listener&);
|
||||
|
||||
private:
|
||||
typedef std::vector<LineNumberInfo> LineInfoList;
|
||||
|
||||
// The method unload notification in VTune JIT profiling API takes the
|
||||
// method ID, not method address so have to maintain the mapping. Is
|
||||
// there a more efficient and simple way to do this like attaching the
|
||||
// method ID information somehow to the LLVM function instance?
|
||||
//
|
||||
// TODO: It would be more convenient for the JIT API to take the method
|
||||
// address, not method ID.
|
||||
typedef std::map<const void*, int> Addr2MethodId;
|
||||
Addr2MethodId m_addr2MethodId;
|
||||
};
|
||||
|
||||
#endif // Header guard
|
||||
Vendored
+6
-5
@@ -1,7 +1,8 @@
|
||||
Copyright (c) 2011, Intel Corporation
|
||||
All rights reserved.
|
||||
Copyright (c) 2019 Intel Corporation. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
• Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
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. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
Vendored
+49
-11
@@ -1,65 +1,103 @@
|
||||
The GNU General Public License (GPL)
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
One line to give the program's name and a brief idea of what it does.
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
<one line to give the program's name and an idea of what it does.>
|
||||
Copyright (C) < yyyy> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
signature of Ty Coon, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
|
||||
+8
-56
@@ -1,71 +1,23 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
|
||||
#if defined _MSC_VER
|
||||
|
||||
#pragma warning (disable: 593) /* parameter "XXXX" was set but never used */
|
||||
#pragma warning (disable: 344) /* typedef name has already been declared (with same type) */
|
||||
#pragma warning (disable: 174) /* expression has no effect */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
#pragma warning (disable: 4306) /* conversion from '?' to '?' of greater size */
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if defined __INTEL_COMPILER
|
||||
|
||||
+197
-80
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
#ifndef _ITTNOTIFY_CONFIG_H_
|
||||
#define _ITTNOTIFY_CONFIG_H_
|
||||
|
||||
@@ -75,6 +23,10 @@
|
||||
# define ITT_OS_FREEBSD 4
|
||||
#endif /* ITT_OS_FREEBSD */
|
||||
|
||||
#ifndef ITT_OS_OPENBSD
|
||||
# define ITT_OS_OPENBSD 5
|
||||
#endif /* ITT_OS_OPENBSD */
|
||||
|
||||
#ifndef ITT_OS
|
||||
# if defined WIN32 || defined _WIN32
|
||||
# define ITT_OS ITT_OS_WIN
|
||||
@@ -82,6 +34,8 @@
|
||||
# define ITT_OS ITT_OS_MAC
|
||||
# elif defined( __FreeBSD__ )
|
||||
# define ITT_OS ITT_OS_FREEBSD
|
||||
# elif defined( __OpenBSD__ )
|
||||
# define ITT_OS ITT_OS_OPENBSD
|
||||
# else
|
||||
# define ITT_OS ITT_OS_LINUX
|
||||
# endif
|
||||
@@ -103,6 +57,10 @@
|
||||
# define ITT_PLATFORM_FREEBSD 4
|
||||
#endif /* ITT_PLATFORM_FREEBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM_OPENBSD
|
||||
# define ITT_PLATFORM_OPENBSD 5
|
||||
#endif /* ITT_PLATFORM_OPENBSD */
|
||||
|
||||
#ifndef ITT_PLATFORM
|
||||
# if ITT_OS==ITT_OS_WIN
|
||||
# define ITT_PLATFORM ITT_PLATFORM_WIN
|
||||
@@ -110,6 +68,8 @@
|
||||
# define ITT_PLATFORM ITT_PLATFORM_MAC
|
||||
# elif ITT_OS==ITT_OS_FREEBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_FREEBSD
|
||||
# elif ITT_OS==ITT_OS_OPENBSD
|
||||
# define ITT_PLATFORM ITT_PLATFORM_OPENBSD
|
||||
# else
|
||||
# define ITT_PLATFORM ITT_PLATFORM_POSIX
|
||||
# endif
|
||||
@@ -162,7 +122,12 @@
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
/* use __forceinline (VC++ specific) */
|
||||
#define ITT_INLINE __forceinline
|
||||
#if defined(__MINGW32__) && !defined(__cplusplus)
|
||||
#define ITT_INLINE static __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#else
|
||||
#define ITT_INLINE static __forceinline
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#define ITT_INLINE_ATTRIBUTE /* nothing */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
/*
|
||||
@@ -188,6 +153,10 @@
|
||||
# define ITT_ARCH_IA32E 2
|
||||
#endif /* ITT_ARCH_IA32E */
|
||||
|
||||
#ifndef ITT_ARCH_IA64
|
||||
# define ITT_ARCH_IA64 3
|
||||
#endif /* ITT_ARCH_IA64 */
|
||||
|
||||
#ifndef ITT_ARCH_ARM
|
||||
# define ITT_ARCH_ARM 4
|
||||
#endif /* ITT_ARCH_ARM */
|
||||
@@ -196,9 +165,9 @@
|
||||
# define ITT_ARCH_PPC64 5
|
||||
#endif /* ITT_ARCH_PPC64 */
|
||||
|
||||
#ifndef ITT_ARCH_AARCH64 /* 64-bit ARM */
|
||||
# define ITT_ARCH_AARCH64 6
|
||||
#endif /* ITT_ARCH_AARCH64 */
|
||||
#ifndef ITT_ARCH_ARM64
|
||||
# define ITT_ARCH_ARM64 6
|
||||
#endif /* ITT_ARCH_ARM64 */
|
||||
|
||||
#ifndef ITT_ARCH
|
||||
# if defined _M_IX86 || defined __i386__
|
||||
@@ -210,7 +179,7 @@
|
||||
# elif defined _M_ARM || defined __arm__
|
||||
# define ITT_ARCH ITT_ARCH_ARM
|
||||
# elif defined __aarch64__
|
||||
# define ITT_ARCH ITT_ARCH_AARCH64
|
||||
# define ITT_ARCH ITT_ARCH_ARM64
|
||||
# elif defined __powerpc64__
|
||||
# define ITT_ARCH ITT_ARCH_PPC64
|
||||
# endif
|
||||
@@ -239,10 +208,10 @@
|
||||
#define ITT_MAGIC { 0xED, 0xAB, 0xAB, 0xEC, 0x0D, 0xEE, 0xDA, 0x30 }
|
||||
|
||||
/* Replace with snapshot date YYYYMMDD for promotion build. */
|
||||
#define API_VERSION_BUILD 20151119
|
||||
#define API_VERSION_BUILD 20250113
|
||||
|
||||
#ifndef API_VERSION_NUM
|
||||
#define API_VERSION_NUM 0.0.0
|
||||
#define API_VERSION_NUM 3.25.4
|
||||
#endif /* API_VERSION_NUM */
|
||||
|
||||
#define API_VERSION "ITT-API-Version " ITT_TO_STR(API_VERSION_NUM) \
|
||||
@@ -254,7 +223,11 @@
|
||||
typedef HMODULE lib_t;
|
||||
typedef DWORD TIDT;
|
||||
typedef CRITICAL_SECTION mutex_t;
|
||||
#ifdef __cplusplus
|
||||
#define MUTEX_INITIALIZER {}
|
||||
#else
|
||||
#define MUTEX_INITIALIZER { 0 }
|
||||
#endif
|
||||
#define strong_alias(name, aliasname) /* empty for Windows */
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#include <dlfcn.h>
|
||||
@@ -282,13 +255,13 @@ typedef pthread_mutex_t mutex_t;
|
||||
#define __itt_mutex_init(mutex) InitializeCriticalSection(mutex)
|
||||
#define __itt_mutex_lock(mutex) EnterCriticalSection(mutex)
|
||||
#define __itt_mutex_unlock(mutex) LeaveCriticalSection(mutex)
|
||||
#define __itt_mutex_destroy(mutex) DeleteCriticalSection(mutex)
|
||||
#define __itt_load_lib(name) LoadLibraryA(name)
|
||||
#define __itt_unload_lib(handle) FreeLibrary(handle)
|
||||
#define __itt_system_error() (int)GetLastError()
|
||||
#define __itt_fstrcmp(s1, s2) lstrcmpA(s1, s2)
|
||||
#define __itt_fstrnlen(s, l) strnlen_s(s, l)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy_s(s1, b, s2, l)
|
||||
#define __itt_fstrdup(s) _strdup(s)
|
||||
#define __itt_thread_id() GetCurrentThreadId()
|
||||
#define __itt_thread_yield() SwitchToThread()
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
@@ -298,6 +271,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return InterlockedIncrement(ptr);
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return InterlockedCompareExchange(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
#define DL_SYMBOLS (1)
|
||||
@@ -327,6 +307,7 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
}
|
||||
#define __itt_mutex_lock(mutex) pthread_mutex_lock(mutex)
|
||||
#define __itt_mutex_unlock(mutex) pthread_mutex_unlock(mutex)
|
||||
#define __itt_mutex_destroy(mutex) pthread_mutex_destroy(mutex)
|
||||
#define __itt_load_lib(name) dlopen(name, RTLD_LAZY)
|
||||
#define __itt_unload_lib(handle) dlclose(handle)
|
||||
#define __itt_system_error() errno
|
||||
@@ -341,10 +322,18 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
#ifdef SDL_STRNCPY_S
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) SDL_STRNCPY_S(s1, b, s2, l)
|
||||
#else
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) strncpy(s1, s2, b)
|
||||
#define __itt_fstrcpyn(s1, b, s2, l) { \
|
||||
if (b > 0) { \
|
||||
/* 'volatile' is used to suppress the warning that a destination */ \
|
||||
/* bound depends on the length of the source. */ \
|
||||
volatile size_t num_to_copy = (size_t)(b - 1) < (size_t)(l) ? \
|
||||
(size_t)(b - 1) : (size_t)(l); \
|
||||
strncpy(s1, s2, num_to_copy); \
|
||||
s1[num_to_copy] = 0; \
|
||||
} \
|
||||
}
|
||||
#endif /* SDL_STRNCPY_S */
|
||||
|
||||
#define __itt_fstrdup(s) strdup(s)
|
||||
#define __itt_thread_id() pthread_self()
|
||||
#define __itt_thread_yield() sched_yield()
|
||||
#if ITT_ARCH==ITT_ARCH_IA64
|
||||
@@ -360,12 +349,12 @@ ITT_INLINE long __TBB_machine_fetchadd4(volatile void* ptr, long addend)
|
||||
{
|
||||
long result;
|
||||
__asm__ __volatile__("lock\nxadd %0,%1"
|
||||
: "=r"(result),"=m"(*(int*)ptr)
|
||||
: "0"(addend), "m"(*(int*)ptr)
|
||||
: "=r"(result),"=m"(*(volatile int*)ptr)
|
||||
: "0"(addend), "m"(*(volatile int*)ptr)
|
||||
: "memory");
|
||||
return result;
|
||||
}
|
||||
#elif ITT_ARCH==ITT_ARCH_ARM || ITT_ARCH==ITT_ARCH_AARCH64 || ITT_ARCH==ITT_ARCH_PPC64
|
||||
#else
|
||||
#define __TBB_machine_fetchadd4(addr, val) __sync_fetch_and_add(addr, val)
|
||||
#endif /* ITT_ARCH==ITT_ARCH_IA64 */
|
||||
#ifndef ITT_SIMPLE_INIT
|
||||
@@ -375,6 +364,13 @@ ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
|
||||
{
|
||||
return __TBB_machine_fetchadd4(ptr, 1) + 1L;
|
||||
}
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand) ITT_INLINE_ATTRIBUTE;
|
||||
ITT_INLINE long
|
||||
__itt_interlocked_compare_exchange(volatile long* ptr, long exchange, long comperand)
|
||||
{
|
||||
return __sync_val_compare_and_swap(ptr, exchange, comperand);
|
||||
}
|
||||
#endif /* ITT_SIMPLE_INIT */
|
||||
|
||||
void* dlopen(const char*, int) __attribute__((weak));
|
||||
@@ -394,10 +390,20 @@ pthread_t pthread_self(void) __attribute__((weak));
|
||||
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
typedef enum {
|
||||
__itt_collection_normal = 0,
|
||||
__itt_collection_paused = 1
|
||||
} __itt_collection_state;
|
||||
/* strdup() is not included into C99 which results in a compiler warning about
|
||||
* implicitly declared symbol. To avoid the issue strdup is implemented
|
||||
* manually.
|
||||
*/
|
||||
#define ITT_STRDUP_MAX_STRING_SIZE 4096
|
||||
#define __itt_fstrdup(s, new_s) do { \
|
||||
if (s != NULL) { \
|
||||
size_t s_len = __itt_fstrnlen(s, ITT_STRDUP_MAX_STRING_SIZE); \
|
||||
new_s = (char *)malloc(s_len + 1); \
|
||||
if (new_s != NULL) { \
|
||||
__itt_fstrcpyn(new_s, s_len + 1, s, s_len); \
|
||||
} \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
typedef enum {
|
||||
__itt_thread_normal = 0,
|
||||
@@ -463,6 +469,10 @@ typedef struct __itt_counter_info
|
||||
|
||||
struct ___itt_domain;
|
||||
struct ___itt_string_handle;
|
||||
struct ___itt_histogram;
|
||||
struct ___itt_counter_metadata;
|
||||
|
||||
#include "ittnotify.h"
|
||||
|
||||
typedef struct ___itt_global
|
||||
{
|
||||
@@ -484,7 +494,10 @@ typedef struct ___itt_global
|
||||
struct ___itt_domain* domain_list;
|
||||
struct ___itt_string_handle* string_list;
|
||||
__itt_collection_state state;
|
||||
__itt_counter_info_t* counter_list;
|
||||
__itt_counter_info_t* counter_list;
|
||||
unsigned int ipt_collect_events;
|
||||
struct ___itt_histogram* histogram_list;
|
||||
struct ___itt_counter_metadata* counter_metadata_list;
|
||||
} __itt_global;
|
||||
|
||||
#pragma pack(pop)
|
||||
@@ -510,7 +523,9 @@ typedef struct ___itt_global
|
||||
h = (__itt_thread_info*)malloc(sizeof(__itt_thread_info)); \
|
||||
if (h != NULL) { \
|
||||
h->tid = t; \
|
||||
h->nameA = n ? __itt_fstrdup(n) : NULL; \
|
||||
char *n_copy = NULL; \
|
||||
__itt_fstrdup(n, n_copy); \
|
||||
h->nameA = n_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->state = s; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
@@ -543,7 +558,9 @@ typedef struct ___itt_global
|
||||
h = (__itt_domain*)malloc(sizeof(__itt_domain)); \
|
||||
if (h != NULL) { \
|
||||
h->flags = 1; /* domain is enabled by default */ \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
@@ -573,7 +590,9 @@ typedef struct ___itt_global
|
||||
#define NEW_STRING_HANDLE_A(gptr,h,h_tail,name) { \
|
||||
h = (__itt_string_handle*)malloc(sizeof(__itt_string_handle)); \
|
||||
if (h != NULL) { \
|
||||
h->strA = name ? __itt_fstrdup(name) : NULL; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->strA = name_copy; \
|
||||
h->strW = NULL; \
|
||||
h->extra1 = 0; /* reserved */ \
|
||||
h->extra2 = NULL; /* reserved */ \
|
||||
@@ -591,7 +610,7 @@ typedef struct ___itt_global
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->domainA = NULL; \
|
||||
h->domainW = name ? _wcsdup(domain) : NULL; \
|
||||
h->domainW = domain ? _wcsdup(domain) : NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
h->next = NULL; \
|
||||
@@ -605,9 +624,13 @@ typedef struct ___itt_global
|
||||
#define NEW_COUNTER_A(gptr,h,h_tail,name,domain,type) { \
|
||||
h = (__itt_counter_info_t*)malloc(sizeof(__itt_counter_info_t)); \
|
||||
if (h != NULL) { \
|
||||
h->nameA = name ? __itt_fstrdup(name) : NULL; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->domainA = domain ? __itt_fstrdup(domain) : NULL; \
|
||||
char *domain_copy = NULL; \
|
||||
__itt_fstrdup(domain, domain_copy); \
|
||||
h->domainA = domain_copy; \
|
||||
h->domainW = NULL; \
|
||||
h->type = type; \
|
||||
h->index = 0; \
|
||||
@@ -619,4 +642,98 @@ typedef struct ___itt_global
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_W(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
h->nameA = NULL; \
|
||||
h->nameW = name ? _wcsdup(name) : NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_HISTOGRAM_A(gptr,h,h_tail,domain,name,x_type,y_type) { \
|
||||
h = (__itt_histogram*)malloc(sizeof(__itt_histogram)); \
|
||||
if (h != NULL) { \
|
||||
h->domain = domain; \
|
||||
char *name_copy = NULL; \
|
||||
__itt_fstrdup(name, name_copy); \
|
||||
h->nameA = name_copy; \
|
||||
h->nameW = NULL; \
|
||||
h->x_type = x_type; \
|
||||
h->y_type = y_type; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->histogram_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_NUM(gptr,h,h_tail,counter,type,value) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = value; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_A(gptr,h,h_tail,counter,type,str_valueA) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
char *str_value_copy = NULL; \
|
||||
__itt_fstrdup(str_valueA, str_value_copy); \
|
||||
h->str_valueA = str_value_copy; \
|
||||
h->str_valueW = NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NEW_COUNTER_METADATA_STR_W(gptr,h,h_tail,counter,type,str_valueW) { \
|
||||
h = (__itt_counter_metadata*)malloc(sizeof(__itt_counter_metadata)); \
|
||||
if (h != NULL) { \
|
||||
h->counter = counter; \
|
||||
h->type = type; \
|
||||
h->str_valueA = NULL; \
|
||||
h->str_valueW = str_valueW ? _wcsdup(str_valueW) : NULL; \
|
||||
h->value = 0; \
|
||||
h->extra1 = 0; \
|
||||
h->extra2 = NULL; \
|
||||
h->next = NULL; \
|
||||
if (h_tail == NULL) \
|
||||
(gptr)->counter_metadata_list = h; \
|
||||
else \
|
||||
h_tail->next = h; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _ITTNOTIFY_CONFIG_H_ */
|
||||
|
||||
+699
-252
File diff suppressed because it is too large
Load Diff
+40
-61
@@ -1,60 +1,8 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
@@ -81,6 +29,9 @@ ITT_STUB(ITTAPI, __itt_domain*, domain_createW, (const wchar_t *name), (ITT_FORM
|
||||
ITT_STUB(ITTAPI, __itt_domain*, domain_create, (const char *name), (ITT_FORMAT name), domain_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, module_load_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_load_with_sections, __itt_group_module, "%p")
|
||||
ITT_STUBV(ITTAPI, void, module_unload_with_sections, (__itt_module_object* module_obj), (ITT_FORMAT module_obj), module_unload_with_sections, __itt_group_module, "%p")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createA, (const char *name), (ITT_FORMAT name), string_handle_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_string_handle*, string_handle_createW, (const wchar_t *name), (ITT_FORMAT name), string_handle_createW, __itt_group_structure, "\"%S\"")
|
||||
@@ -105,6 +56,8 @@ ITT_STUB(ITTAPI, __itt_counter, counter_create_typed, (const char *name, con
|
||||
|
||||
ITT_STUBV(ITTAPI, void, pause, (void), (ITT_NO_PARAMS), pause, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, resume, (void), (ITT_NO_PARAMS), resume, __itt_group_control | __itt_group_legacy, "no args")
|
||||
ITT_STUBV(ITTAPI, void, pause_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), pause_scoped, __itt_group_control, "%d")
|
||||
ITT_STUBV(ITTAPI, void, resume_scoped, (__itt_collection_scope scope), (ITT_FORMAT scope), resume_scoped, __itt_group_control, "%d")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, thread_set_nameA, (const char *name), (ITT_FORMAT name), thread_set_nameA, __itt_group_thread, "\"%s\"")
|
||||
@@ -121,6 +74,23 @@ ITT_STUB(LIBITTAPI, int, thr_name_setW, (const wchar_t *name, int namelen), (IT
|
||||
ITT_STUB(LIBITTAPI, int, thr_name_set, (const char *name, int namelen), (ITT_FORMAT name, namelen), thr_name_set, __itt_group_thread | __itt_group_legacy, "\"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(LIBITTAPI, void, thr_ignore, (void), (ITT_NO_PARAMS), thr_ignore, __itt_group_thread | __itt_group_legacy, "no args")
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createA, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createA, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_createW, (const __itt_domain* domain, const wchar_t* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_createW, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_histogram*, histogram_create, (const __itt_domain* domain, const char* name, __itt_metadata_type x_type, __itt_metadata_type y_type), (ITT_FORMAT domain, name, x_type, y_type), histogram_create, __itt_group_structure, "%p, \"%s\", %d, %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createA_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createA_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_createW_v3, (const __itt_domain* domain, const wchar_t *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_createW_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_counter, counter_create_v3, (const __itt_domain* domain, const char *name, __itt_metadata_type type), (ITT_FORMAT domain, name, type), counter_create_v3, __itt_group_counter, "%p, \"%s\", %d")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, bind_context_metadata_to_counter, (__itt_counter counter, size_t length, __itt_context_metadata* metadata), (ITT_FORMAT counter, length, metadata), bind_context_metadata_to_counter, __itt_group_structure, "%p, %lu, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
ITT_STUBV(ITTAPI, void, enable_attach, (void), (ITT_NO_PARAMS), enable_attach, __itt_group_all, "no args")
|
||||
@@ -296,6 +266,13 @@ ITT_STUB(ITTAPI, __itt_frame, frame_createW, (const wchar_t *domain), (ITT_FORMA
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_frame, frame_create, (const char *domain), (ITT_FORMAT domain), frame_create, __itt_group_frame, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createA, (const char *name), (ITT_FORMAT name), pt_region_createA, __itt_group_structure, "\"%s\"")
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_createW, (const wchar_t *name), (ITT_FORMAT name), pt_region_createW, __itt_group_structure, "\"%S\"")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUB(ITTAPI, __itt_pt_region, pt_region_create, (const char *name), (ITT_FORMAT name), pt_region_create, __itt_group_structure, "\"%s\"")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, frame_begin, (__itt_frame frame), (ITT_FORMAT frame), frame_begin, __itt_group_frame, "%p")
|
||||
ITT_STUBV(ITTAPI, void, frame_end, (__itt_frame frame), (ITT_FORMAT frame), frame_end, __itt_group_frame, "%p")
|
||||
@@ -376,14 +353,16 @@ ITT_STUB(ITTAPI, int, av_save, (void *data, int rank, const int *dimensions, in
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
|
||||
#ifndef __ITT_INTERNAL_BODY
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadA, (void *start_addr, void* end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_loadA, __itt_group_module, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_loadW, (void *start_addr, void* end_addr, const wchar_t *path), (ITT_FORMAT start_addr, end_addr, path), module_loadW, __itt_group_module, "%p, %p, %p")
|
||||
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_none, "%p, %p, %p")
|
||||
ITT_STUBV(ITTAPI, void, module_load, (void *start_addr, void *end_addr, const char *path), (ITT_FORMAT start_addr, end_addr, path), module_load, __itt_group_module, "%p, %p, %p")
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#endif /* __ITT_INTERNAL_BODY */
|
||||
ITT_STUBV(ITTAPI, void, module_unload, (void *start_addr), (ITT_FORMAT start_addr), module_unload, __itt_group_module, "%p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, histogram_submit, (__itt_histogram* hist, size_t length, void* x_data, void* y_data), (ITT_FORMAT hist, length, x_data, y_data), histogram_submit, __itt_group_structure, "%p, %lu, %p, %p")
|
||||
|
||||
ITT_STUBV(ITTAPI, void, counter_set_value_v3, (__itt_counter counter, void *value_ptr), (ITT_FORMAT counter, value_ptr), counter_set_value_v3, __itt_group_counter, "%p, %p")
|
||||
|
||||
#endif /* __ITT_INTERNAL_INIT */
|
||||
|
||||
+25
-75
@@ -1,85 +1,34 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef _ITTNOTIFY_TYPES_H_
|
||||
#define _ITTNOTIFY_TYPES_H_
|
||||
|
||||
typedef enum ___itt_group_id
|
||||
{
|
||||
__itt_group_none = 0,
|
||||
__itt_group_legacy = 1<<0,
|
||||
__itt_group_control = 1<<1,
|
||||
__itt_group_thread = 1<<2,
|
||||
__itt_group_mark = 1<<3,
|
||||
__itt_group_sync = 1<<4,
|
||||
__itt_group_fsync = 1<<5,
|
||||
__itt_group_jit = 1<<6,
|
||||
__itt_group_model = 1<<7,
|
||||
__itt_group_splitter_min = 1<<7,
|
||||
__itt_group_counter = 1<<8,
|
||||
__itt_group_frame = 1<<9,
|
||||
__itt_group_stitch = 1<<10,
|
||||
__itt_group_heap = 1<<11,
|
||||
__itt_group_splitter_max = 1<<12,
|
||||
__itt_group_structure = 1<<12,
|
||||
__itt_group_suppress = 1<<13,
|
||||
__itt_group_arrays = 1<<14,
|
||||
__itt_group_all = -1
|
||||
__itt_group_none = 0,
|
||||
__itt_group_legacy = 1<<0,
|
||||
__itt_group_control = 1<<1,
|
||||
__itt_group_thread = 1<<2,
|
||||
__itt_group_mark = 1<<3,
|
||||
__itt_group_sync = 1<<4,
|
||||
__itt_group_fsync = 1<<5,
|
||||
__itt_group_jit = 1<<6,
|
||||
__itt_group_model = 1<<7,
|
||||
__itt_group_splitter_min = 1<<7,
|
||||
__itt_group_counter = 1<<8,
|
||||
__itt_group_frame = 1<<9,
|
||||
__itt_group_stitch = 1<<10,
|
||||
__itt_group_heap = 1<<11,
|
||||
__itt_group_splitter_max = 1<<12,
|
||||
__itt_group_structure = 1<<12,
|
||||
__itt_group_suppress = 1<<13,
|
||||
__itt_group_arrays = 1<<14,
|
||||
__itt_group_module = 1<<15,
|
||||
__itt_group_all = -1
|
||||
} __itt_group_id;
|
||||
|
||||
#pragma pack(push, 8)
|
||||
@@ -109,6 +58,7 @@ typedef struct ___itt_group_list
|
||||
{ __itt_group_structure, "structure" }, \
|
||||
{ __itt_group_suppress, "suppress" }, \
|
||||
{ __itt_group_arrays, "arrays" }, \
|
||||
{ __itt_group_module, "module" }, \
|
||||
{ __itt_group_none, NULL } \
|
||||
}
|
||||
|
||||
|
||||
+45
-95
@@ -1,76 +1,24 @@
|
||||
/* <copyright>
|
||||
This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
redistributing this file, you may do so under either license.
|
||||
/*
|
||||
Copyright (C) 2005-2019 Intel Corporation
|
||||
|
||||
GPL LICENSE SUMMARY
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of version 2 of the GNU General Public License as
|
||||
published by the Free Software Foundation.
|
||||
|
||||
This program 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
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
The full GNU General Public License is included in this distribution
|
||||
in the file called LICENSE.GPL.
|
||||
|
||||
Contact Information:
|
||||
http://software.intel.com/en-us/articles/intel-vtune-amplifier-xe/
|
||||
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 2005-2014 Intel Corporation. All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Intel Corporation nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</copyright> */
|
||||
SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "ittnotify_config.h"
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#include <windows.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD
|
||||
#if ITT_PLATFORM != ITT_PLATFORM_MAC && ITT_PLATFORM != ITT_PLATFORM_FREEBSD && ITT_PLATFORM != ITT_PLATFORM_OPENBSD
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "jitprofiling.h"
|
||||
|
||||
static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
|
||||
#define DLL_ENVIRONMENT_VAR "VS_PROFILER"
|
||||
static const char rcsid[] = "\n@(#) $Revision$\n";
|
||||
|
||||
#ifndef NEW_DLL_ENVIRONMENT_VAR
|
||||
#if ITT_ARCH==ITT_ARCH_IA32
|
||||
@@ -81,13 +29,10 @@ static const char rcsid[] = "\n@(#) $Revision: 471937 $\n";
|
||||
#endif /* NEW_DLL_ENVIRONMENT_VAR */
|
||||
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
#define DEFAULT_DLLNAME "JitPI.dll"
|
||||
HINSTANCE m_libHandle = NULL;
|
||||
#elif ITT_PLATFORM==ITT_PLATFORM_MAC
|
||||
#define DEFAULT_DLLNAME "libJitPI.dylib"
|
||||
void* m_libHandle = NULL;
|
||||
#else
|
||||
#define DEFAULT_DLLNAME "libJitPI.so"
|
||||
void* m_libHandle = NULL;
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
@@ -169,6 +114,38 @@ ITT_EXTERN_C iJIT_IsProfilingActiveFlags JITAPI iJIT_IsProfilingActive()
|
||||
return executionMode;
|
||||
}
|
||||
|
||||
#if ITT_PLATFORM == ITT_PLATFORM_WIN
|
||||
static int isValidAbsolutePath(char *path, size_t maxPathLength)
|
||||
{
|
||||
if (path == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t pathLength = strnlen(path, maxPathLength);
|
||||
if (pathLength == maxPathLength)
|
||||
{
|
||||
/* The strnlen() function returns maxPathLength if there is no null terminating
|
||||
* among the first maxPathLength characters in the string pointed to by path.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (pathLength > 2)
|
||||
{
|
||||
if (isalpha(path[0]) && path[1] == ':' && path[2] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (path[0] == '\\' && path[1] == '\\')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function loads the collector dll and the relevant functions.
|
||||
* on success: all functions load, iJIT_DLL_is_missing = 0, return value = 1
|
||||
* on failure: all functions are NULL, iJIT_DLL_is_missing = 1, return value = 0
|
||||
@@ -212,7 +189,7 @@ static int loadiJIT_Funcs()
|
||||
{
|
||||
envret = GetEnvironmentVariableA(NEW_DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
if (envret && isValidAbsolutePath(dllName, dNameLength))
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryExA(dllName,
|
||||
@@ -220,30 +197,9 @@ static int loadiJIT_Funcs()
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
} else {
|
||||
/* Try to use old VS_PROFILER variable */
|
||||
dNameLength = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR, NULL, 0);
|
||||
if (dNameLength)
|
||||
{
|
||||
DWORD envret = 0;
|
||||
dllName = (char*)malloc(sizeof(char) * (dNameLength + 1));
|
||||
if(dllName != NULL)
|
||||
{
|
||||
envret = GetEnvironmentVariableA(DLL_ENVIRONMENT_VAR,
|
||||
dllName, dNameLength);
|
||||
if (envret)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = LoadLibraryA(dllName);
|
||||
}
|
||||
free(dllName);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
dllName = getenv(NEW_DLL_ENVIRONMENT_VAR);
|
||||
if (!dllName)
|
||||
dllName = getenv(DLL_ENVIRONMENT_VAR);
|
||||
#if defined(__ANDROID__) || defined(ANDROID)
|
||||
if (!dllName)
|
||||
dllName = ANDROID_JIT_AGENT_PATH;
|
||||
@@ -251,19 +207,13 @@ static int loadiJIT_Funcs()
|
||||
if (dllName)
|
||||
{
|
||||
/* Try to load the dll from the PATH... */
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
if (DL_SYMBOLS)
|
||||
{
|
||||
m_libHandle = dlopen(dllName, RTLD_LAZY);
|
||||
}
|
||||
}
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
|
||||
if (!m_libHandle)
|
||||
{
|
||||
#if ITT_PLATFORM==ITT_PLATFORM_WIN
|
||||
m_libHandle = LoadLibraryA(DEFAULT_DLLNAME);
|
||||
#else /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
m_libHandle = dlopen(DEFAULT_DLLNAME, RTLD_LAZY);
|
||||
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
|
||||
}
|
||||
|
||||
/* if the dll wasn't loaded - exit. */
|
||||
if (!m_libHandle)
|
||||
{
|
||||
|
||||
Vendored
+1
-1
@@ -889,7 +889,7 @@ int jas_stream_copy(jas_stream_t *out, jas_stream_t *in, int n)
|
||||
while (all || m > 0) {
|
||||
if ((c = jas_stream_getc_macro(in)) == EOF) {
|
||||
/* The next character of input could not be read. */
|
||||
/* Return with an error if an I/O error occured
|
||||
/* Return with an error if an I/O error occurred
|
||||
(not including EOF) or if an explicit copy count
|
||||
was specified. */
|
||||
return (!all || jas_stream_error(in)) ? (-1) : 0;
|
||||
|
||||
Vendored
+1
-1
@@ -100,7 +100,7 @@
|
||||
#define JPC_BITSTREAM_NOCLOSE 0x01
|
||||
/* End of file has been reached while reading. */
|
||||
#define JPC_BITSTREAM_EOF 0x02
|
||||
/* An I/O error has occured. */
|
||||
/* An I/O error has occurerd. */
|
||||
#define JPC_BITSTREAM_ERR 0x04
|
||||
|
||||
/******************************************************************************\
|
||||
|
||||
+163
-28
@@ -1,12 +1,43 @@
|
||||
project(${JPEG_LIBRARY} C)
|
||||
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||
macro(boolean_number var)
|
||||
if(${var})
|
||||
set(${var} 1 ${ARGN})
|
||||
else()
|
||||
set(${var} 0 ${ARGN})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
set(VERSION_MAJOR 2)
|
||||
set(VERSION_MINOR 1)
|
||||
set(VERSION_REVISION 0)
|
||||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION})
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER 2001000)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough)
|
||||
if(APPLE)
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-variable) # NEON flags are not used on Mac
|
||||
endif()
|
||||
|
||||
if(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||
# src/jchuff.c:1042:22: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
|
||||
ocv_warnings_disable(CMAKE_C_FLAGS -Wstringop-overflow)
|
||||
endif()
|
||||
|
||||
set(VERSION 3.1.0)
|
||||
set(COPYRIGHT_YEAR "1991-2024")
|
||||
string(REPLACE "." ";" VERSION_TRIPLET ${VERSION})
|
||||
list(GET VERSION_TRIPLET 0 VERSION_MAJOR)
|
||||
list(GET VERSION_TRIPLET 1 VERSION_MINOR)
|
||||
list(GET VERSION_TRIPLET 2 VERSION_REVISION)
|
||||
function(pad_number NUMBER OUTPUT_LEN)
|
||||
string(LENGTH "${${NUMBER}}" INPUT_LEN)
|
||||
if(INPUT_LEN LESS OUTPUT_LEN)
|
||||
math(EXPR ZEROES "${OUTPUT_LEN} - ${INPUT_LEN} - 1")
|
||||
set(NUM ${${NUMBER}})
|
||||
foreach(C RANGE ${ZEROES})
|
||||
set(NUM "0${NUM}")
|
||||
endforeach()
|
||||
set(${NUMBER} ${NUM} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
pad_number(VERSION_MINOR 3)
|
||||
pad_number(VERSION_REVISION 3)
|
||||
set(LIBJPEG_TURBO_VERSION_NUMBER ${VERSION_MAJOR}${VERSION_MINOR}${VERSION_REVISION})
|
||||
|
||||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
@@ -15,15 +46,59 @@ endif()
|
||||
|
||||
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}")
|
||||
|
||||
math(EXPR BITS "${CMAKE_SIZEOF_VOID_P} * 8")
|
||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" CMAKE_SYSTEM_PROCESSOR_LC)
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86_64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "amd64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "i[0-9]86" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "x86" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "ia32")
|
||||
if(BITS EQUAL 64 OR CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
|
||||
set(CPU_TYPE x86_64)
|
||||
else()
|
||||
set(CPU_TYPE i386)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ${CPU_TYPE})
|
||||
set(CMAKE_SYSTEM_PROCESSOR ${CPU_TYPE})
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR_LC STREQUAL "aarch64" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^arm")
|
||||
if(BITS EQUAL 64)
|
||||
set(CPU_TYPE arm64)
|
||||
else()
|
||||
set(CPU_TYPE arm)
|
||||
endif()
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^ppc" OR
|
||||
CMAKE_SYSTEM_PROCESSOR_LC MATCHES "^powerpc")
|
||||
set(CPU_TYPE powerpc)
|
||||
else()
|
||||
set(CPU_TYPE ${CMAKE_SYSTEM_PROCESSOR_LC})
|
||||
endif()
|
||||
if(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64" OR
|
||||
CMAKE_OSX_ARCHITECTURES MATCHES "arm64" OR
|
||||
CMAKE_OSX_ARCHITECTURES MATCHES "i386")
|
||||
set(CPU_TYPE ${CMAKE_OSX_ARCHITECTURES})
|
||||
endif()
|
||||
if(CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
|
||||
set(CPU_TYPE powerpc)
|
||||
endif()
|
||||
if(MSVC_IDE AND CMAKE_GENERATOR_PLATFORM MATCHES "arm64")
|
||||
set(CPU_TYPE arm64)
|
||||
endif()
|
||||
|
||||
OCV_OPTION(ENABLE_LIBJPEG_TURBO_SIMD "Include SIMD extensions for libjpeg-turbo, if available for this platform" (NOT CV_DISABLE_OPTIMIZATION))
|
||||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE)
|
||||
set(WITH_SIMD 1)
|
||||
set(HAVE_LIBJPEG_TURBO_SIMD 0 PARENT_SCOPE)
|
||||
|
||||
include(CheckCSourceCompiles)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckTypeSize)
|
||||
|
||||
check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
|
||||
check_type_size("size_t" SIZE_T)
|
||||
check_type_size("unsigned long" UNSIGNED_LONG)
|
||||
|
||||
if(SIZEOF_SIZE_T EQUAL SIZEOF_UNSIGNED_LONG)
|
||||
check_c_source_compiles("int main(int argc, char **argv) { unsigned long a = argc; return __builtin_ctzl(a); }"
|
||||
@@ -59,34 +134,34 @@ if(WITH_ARITH_DEC)
|
||||
set(D_ARITH_CODING_SUPPORTED 1)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB_VERSION 62)
|
||||
set(JPEG_LIB_VERSION 70)
|
||||
|
||||
# OpenCV
|
||||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE)
|
||||
|
||||
set(THREAD_LOCAL "") # WITH_TURBOJPEG is not used
|
||||
|
||||
add_definitions(-DNO_GETENV -DNO_PUTENV)
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-W3 -wd4996 -wd4018)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
configure_file(jconfig.h.win.in jconfig.h)
|
||||
else()
|
||||
configure_file(jconfig.h.in jconfig.h)
|
||||
endif()
|
||||
configure_file(jconfigint.h.in jconfigint.h)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||
|
||||
set(JPEG_SOURCES
|
||||
jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c jcicc.c
|
||||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c
|
||||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c
|
||||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c jdmainct.c jdmarker.c
|
||||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c
|
||||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c
|
||||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
set(JPEG16_SOURCES jcapistd.c jccolor.c jcdiffct.c jclossls.c jcmainct.c
|
||||
jcprepct.c jcsample.c jdapistd.c jdcolor.c jddiffct.c jdlossls.c jdmainct.c
|
||||
jdpostct.c jdsample.c jutils.c)
|
||||
|
||||
set(JPEG12_SOURCES ${JPEG16_SOURCES} jccoefct.c jcdctmgr.c jdcoefct.c
|
||||
jddctmgr.c jdmerge.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c
|
||||
jidctred.c jquant1.c jquant2.c)
|
||||
|
||||
set(JPEG_SOURCES ${JPEG12_SOURCES} jcapimin.c jchuff.c jcicc.c jcinit.c
|
||||
jclhuff.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c jctrans.c
|
||||
jdapimin.c jdatadst.c jdatasrc.c jdhuff.c jdicc.c jdinput.c jdlhuff.c
|
||||
jdmarker.c jdmaster.c jdphuff.c jdtrans.c jerror.c jfdctflt.c jmemmgr.c
|
||||
jmemnobs.c jpeg_nbits.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
@@ -100,12 +175,70 @@ if(WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c)
|
||||
endif()
|
||||
|
||||
# No SIMD
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c)
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
# Use the maximum optimization level for release builds
|
||||
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
if(${var} MATCHES "-O2")
|
||||
string(REGEX REPLACE "-O2" "-O3" ${var} "${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "SunPro")
|
||||
# Use the maximum optimization level for release builds
|
||||
foreach(var CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
if(${var} MATCHES "-xO3")
|
||||
string(REGEX REPLACE "-xO3" "-xO5" ${var} "${${var}}")
|
||||
endif()
|
||||
if(${var} MATCHES "-xO2")
|
||||
string(REGEX REPLACE "-xO2" "-xO5" ${var} "${${var}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CheckTypeSize)
|
||||
check_type_size("size_t" SIZE_T)
|
||||
check_type_size("unsigned long" UNSIGNED_LONG)
|
||||
|
||||
if(ENABLE_LIBJPEG_TURBO_SIMD)
|
||||
add_subdirectory(simd)
|
||||
if(NEON_INTRINSICS)
|
||||
add_definitions(-DNEON_INTRINSICS)
|
||||
endif()
|
||||
else()
|
||||
set(WITH_SIMD 0)
|
||||
endif()
|
||||
|
||||
if(WITH_SIMD)
|
||||
message(STATUS "SIMD extensions: ${CPU_TYPE} (WITH_SIMD = ${WITH_SIMD})")
|
||||
set(HAVE_LIBJPEG_TURBO_SIMD 1 PARENT_SCOPE)
|
||||
if(MSVC_IDE OR XCODE)
|
||||
set_source_files_properties(${SIMD_OBJS} PROPERTIES GENERATED 1)
|
||||
endif()
|
||||
set(SIMD_TARGET_OBJECTS $<TARGET_OBJECTS:simd>)
|
||||
endif()
|
||||
|
||||
configure_file(jversion.h.in jversion.h)
|
||||
configure_file(jconfig.h.in jconfig.h)
|
||||
configure_file(jconfigint.h.in jconfigint.h)
|
||||
|
||||
ocv_list_add_prefix(JPEG16_SOURCES src/)
|
||||
ocv_list_add_prefix(JPEG12_SOURCES src/)
|
||||
ocv_list_add_prefix(JPEG_SOURCES src/)
|
||||
|
||||
add_library(${JPEG_LIBRARY} STATIC ${OPENCV_3RDPARTY_EXCLUDE_FROM_ALL} ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} ${SIMD_OBJS})
|
||||
|
||||
add_library(jpeg12-static OBJECT ${JPEG12_SOURCES})
|
||||
set_property(TARGET jpeg12-static PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=12")
|
||||
add_library(jpeg16-static OBJECT ${JPEG16_SOURCES})
|
||||
set_property(TARGET jpeg16-static PROPERTY COMPILE_FLAGS
|
||||
"-DBITS_IN_JSAMPLE=16")
|
||||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_TARGET_OBJECTS}
|
||||
${SIMD_OBJS} $<TARGET_OBJECTS:jpeg12-static>
|
||||
$<TARGET_OBJECTS:jpeg16-static>)
|
||||
|
||||
set_target_properties(${JPEG_LIBRARY}
|
||||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
|
||||
@@ -116,7 +249,9 @@ set_target_properties(${JPEG_LIBRARY}
|
||||
)
|
||||
|
||||
if(ENABLE_SOLUTION_FOLDERS)
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty")
|
||||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(jpeg12-static PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(jpeg16-static PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
endif()
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
|
||||
Vendored
+18
-15
@@ -1,30 +1,33 @@
|
||||
libjpeg-turbo Licenses
|
||||
======================
|
||||
|
||||
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
||||
libjpeg-turbo is covered by two compatible BSD-style open source licenses:
|
||||
|
||||
- The IJG (Independent JPEG Group) License, which is listed in
|
||||
[README.ijg](README.ijg)
|
||||
|
||||
This license applies to the libjpeg API library and associated programs
|
||||
(any code inherited from libjpeg, and any modifications to that code.)
|
||||
This license applies to the libjpeg API library and associated programs,
|
||||
including any code inherited from libjpeg and any modifications to that
|
||||
code. Note that the libjpeg-turbo SIMD source code bears the
|
||||
[zlib License](https://opensource.org/licenses/Zlib), but in the context of
|
||||
the overall libjpeg API library, the terms of the zlib License are subsumed
|
||||
by the terms of the IJG License.
|
||||
|
||||
- The Modified (3-clause) BSD License, which is listed below
|
||||
|
||||
This license covers the TurboJPEG API library and associated programs, as
|
||||
well as the build system.
|
||||
|
||||
- The [zlib License](https://opensource.org/licenses/Zlib)
|
||||
|
||||
This license is a subset of the other two, and it covers the libjpeg-turbo
|
||||
SIMD extensions.
|
||||
This license applies to the TurboJPEG API library and associated programs, as
|
||||
well as the build system. Note that the TurboJPEG API library wraps the
|
||||
libjpeg API library, so in the context of the overall TurboJPEG API library,
|
||||
both the terms of the IJG License and the terms of the Modified (3-clause)
|
||||
BSD License apply.
|
||||
|
||||
|
||||
Complying with the libjpeg-turbo Licenses
|
||||
=========================================
|
||||
|
||||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the
|
||||
best of our understanding.
|
||||
best of our understanding. This is not a license in and of itself. It is
|
||||
intended solely for clarification.
|
||||
|
||||
1. If you are distributing a modified version of the libjpeg-turbo source,
|
||||
then:
|
||||
@@ -38,7 +41,7 @@ best of our understanding.
|
||||
- Clauses 1 and 3 of the zlib License
|
||||
|
||||
2. You must add your own copyright notice to the header of each source
|
||||
file you modified, so others can tell that you modified that file (if
|
||||
file you modified, so others can tell that you modified that file. (If
|
||||
there is not an existing copyright header in that file, then you can
|
||||
simply add a notice stating that you modified the file.)
|
||||
|
||||
@@ -91,7 +94,7 @@ best of our understanding.
|
||||
The Modified (3-clause) BSD License
|
||||
===================================
|
||||
|
||||
Copyright (C)2009-2021 D. R. Commander. All Rights Reserved.<br>
|
||||
Copyright (C)2009-2024 D. R. Commander. All Rights Reserved.<br>
|
||||
Copyright (C)2015 Viktor Szathmáry. All Rights Reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -119,8 +122,8 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
Why Three Licenses?
|
||||
===================
|
||||
Why Two Licenses?
|
||||
=================
|
||||
|
||||
The zlib License could have been used instead of the Modified (3-clause) BSD
|
||||
License, and since the IJG License effectively subsumes the distribution
|
||||
|
||||
Vendored
+25
-23
@@ -36,16 +36,18 @@ TO DO Plans for future IJG releases.
|
||||
Other documentation files in the distribution are:
|
||||
|
||||
User documentation:
|
||||
usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
*.1 Unix-style man pages for programs (same info as usage.txt).
|
||||
wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
change.log Version-to-version change highlights.
|
||||
doc/usage.txt Usage instructions for cjpeg, djpeg, jpegtran,
|
||||
rdjpgcom, and wrjpgcom.
|
||||
doc/*.1 Unix-style man pages for programs (same info as
|
||||
usage.txt).
|
||||
doc/wizard.txt Advanced usage instructions for JPEG wizards only.
|
||||
doc/change.log Version-to-version change highlights.
|
||||
Programmer and internal documentation:
|
||||
libjpeg.txt How to use the JPEG library in your own programs.
|
||||
example.txt Sample code for calling the JPEG library.
|
||||
structure.txt Overview of the JPEG library's internal structure.
|
||||
coderules.txt Coding style rules --- please read if you contribute code.
|
||||
doc/libjpeg.txt How to use the JPEG library in your own programs.
|
||||
src/example.c Sample code for calling the JPEG library.
|
||||
doc/structure.txt Overview of the JPEG library's internal structure.
|
||||
doc/coderules.txt Coding style rules --- please read if you contribute
|
||||
code.
|
||||
|
||||
Please read at least usage.txt. Some information can also be found in the JPEG
|
||||
FAQ (Frequently Asked Questions) article. See ARCHIVE LOCATIONS below to find
|
||||
@@ -68,17 +70,17 @@ other abrupt features may not compress well with JPEG, and a higher JPEG
|
||||
quality may have to be used to avoid visible compression artifacts with such
|
||||
images.
|
||||
|
||||
JPEG is lossy, meaning that the output pixels are not necessarily identical to
|
||||
the input pixels. However, on photographic content and other "smooth" images,
|
||||
very good compression ratios can be obtained with no visible compression
|
||||
artifacts, and extremely high compression ratios are possible if you are
|
||||
willing to sacrifice image quality (by reducing the "quality" setting in the
|
||||
compressor.)
|
||||
JPEG is normally lossy, meaning that the output pixels are not necessarily
|
||||
identical to the input pixels. However, on photographic content and other
|
||||
"smooth" images, very good compression ratios can be obtained with no visible
|
||||
compression artifacts, and extremely high compression ratios are possible if
|
||||
you are willing to sacrifice image quality (by reducing the "quality" setting
|
||||
in the compressor.)
|
||||
|
||||
This software implements JPEG baseline, extended-sequential, and progressive
|
||||
compression processes. Provision is made for supporting all variants of these
|
||||
processes, although some uncommon parameter settings aren't implemented yet.
|
||||
We have made no provision for supporting the hierarchical or lossless
|
||||
This software implements JPEG baseline, extended-sequential, progressive, and
|
||||
lossless compression processes. Provision is made for supporting all variants
|
||||
of these processes, although some uncommon parameter settings aren't
|
||||
implemented yet. We have made no provision for supporting the hierarchical
|
||||
processes defined in the standard.
|
||||
|
||||
We provide a set of library routines for reading and writing JPEG image files,
|
||||
@@ -89,9 +91,9 @@ The library is intended to be reused in other applications.
|
||||
In order to support file conversion and viewing software, we have included
|
||||
considerable functionality beyond the bare JPEG coding/decoding capability;
|
||||
for example, the color quantization modules are not strictly part of JPEG
|
||||
decoding, but they are essential for output to colormapped file formats or
|
||||
colormapped displays. These extra functions can be compiled out of the
|
||||
library if not required for a particular application.
|
||||
decoding, but they are essential for output to colormapped file formats. These
|
||||
extra functions can be compiled out of the library if not required for a
|
||||
particular application.
|
||||
|
||||
We have also included "jpegtran", a utility for lossless transcoding between
|
||||
different JPEG processes, and "rdjpgcom" and "wrjpgcom", two simple
|
||||
@@ -241,7 +243,7 @@ This software implements ITU T.81 | ISO/IEC 10918 with some extensions from
|
||||
ITU T.871 | ISO/IEC 10918-5 (JPEG File Interchange Format-- see REFERENCES).
|
||||
Informally, the term "JPEG image" or "JPEG file" most often refers to JFIF or
|
||||
a subset thereof, but there are other formats containing the name "JPEG" that
|
||||
are incompatible with the DCT-based JPEG standard or with JFIF (for instance,
|
||||
are incompatible with the original JPEG standard or with JFIF (for instance,
|
||||
JPEG 2000 and JPEG XR). This software therefore does not support these
|
||||
formats. Indeed, one of the original reasons for developing this free software
|
||||
was to help force convergence on a common, interoperable format standard for
|
||||
|
||||
Vendored
+59
-41
@@ -21,7 +21,26 @@ derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and
|
||||
VirtualGL projects made numerous enhancements to the codec in 2009, and in
|
||||
early 2010, libjpeg-turbo spun off into an independent project, with the goal
|
||||
of making high-speed JPEG compression/decompression technology available to a
|
||||
broader range of users and developers.
|
||||
broader range of users and developers. libjpeg-turbo is an ISO/IEC and ITU-T
|
||||
reference implementation of the JPEG standard.
|
||||
|
||||
More information about libjpeg-turbo can be found at
|
||||
<https://libjpeg-turbo.org>.
|
||||
|
||||
|
||||
Funding
|
||||
=======
|
||||
|
||||
libjpeg-turbo is an independent open source project, but we rely on patronage
|
||||
and funded development in order to maintain that independence. The easiest way
|
||||
to ensure that libjpeg-turbo remains community-focused and free of any one
|
||||
organization's agenda is to
|
||||
[sponsor our project through GitHub](https://github.com/sponsors/libjpeg-turbo).
|
||||
All sponsorship money goes directly toward funding the labor necessary to
|
||||
maintain libjpeg-turbo, support the user community, and implement bug fixes and
|
||||
strategically important features.
|
||||
|
||||
[](https://github.com/sponsors/libjpeg-turbo)
|
||||
|
||||
|
||||
License
|
||||
@@ -50,9 +69,12 @@ JPEG images:
|
||||
generating planar YUV images and performing multiple simultaneous lossless
|
||||
transforms on an image. The Java interface for libjpeg-turbo is written on
|
||||
top of the TurboJPEG API. The TurboJPEG API is recommended for first-time
|
||||
users of libjpeg-turbo. Refer to [tjexample.c](tjexample.c) and
|
||||
[TJExample.java](java/TJExample.java) for examples of its usage and to
|
||||
<http://libjpeg-turbo.org/Documentation/Documentation> for API documentation.
|
||||
users of libjpeg-turbo. Refer to [tjcomp.c](src/tjcomp.c),
|
||||
[tjdecomp.c](src/tjdecomp.c), [tjtran.c](src/tjtran.c),
|
||||
[TJComp.java](java/TJComp.java), [TJDecomp.java](java/TJDecomp.java), and
|
||||
[TJTran.java](java/TJTran.java) for examples of its usage and to
|
||||
<https://libjpeg-turbo.org/Documentation/Documentation> for API
|
||||
documentation.
|
||||
|
||||
- **libjpeg API**<br>
|
||||
This is the de facto industry-standard API for compressing and decompressing
|
||||
@@ -60,8 +82,9 @@ JPEG images:
|
||||
more powerful. The libjpeg API implementation in libjpeg-turbo is both
|
||||
API/ABI-compatible and mathematically compatible with libjpeg v6b. It can
|
||||
also optionally be configured to be API/ABI-compatible with libjpeg v7 and v8
|
||||
(see below.) Refer to [cjpeg.c](cjpeg.c) and [djpeg.c](djpeg.c) for examples
|
||||
of its usage and to [libjpeg.txt](libjpeg.txt) for API documentation.
|
||||
(see below.) Refer to [cjpeg.c](src/cjpeg.c) and [djpeg.c](src/djpeg.c) for
|
||||
examples of its usage and to [libjpeg.txt](doc/libjpeg.txt) for API
|
||||
documentation.
|
||||
|
||||
There is no significant performance advantage to either API when both are used
|
||||
to perform similar operations.
|
||||
@@ -113,9 +136,9 @@ extensions at compile time with:
|
||||
|
||||
#ifdef JCS_ALPHA_EXTENSIONS
|
||||
|
||||
[jcstest.c](jcstest.c), located in the libjpeg-turbo source tree, demonstrates
|
||||
how to check for the existence of the colorspace extensions at compile time and
|
||||
run time.
|
||||
[jcstest.c](src/jcstest.c), located in the libjpeg-turbo source tree,
|
||||
demonstrates how to check for the existence of the colorspace extensions at
|
||||
compile time and run time.
|
||||
|
||||
libjpeg v7 and v8 API/ABI Emulation
|
||||
-----------------------------------
|
||||
@@ -180,7 +203,7 @@ supported and which aren't.
|
||||
NOTE: As of this writing, extensive research has been conducted into the
|
||||
usefulness of DCT scaling as a means of data reduction and SmartScale as a
|
||||
means of quality improvement. Readers are invited to peruse the research at
|
||||
<http://www.libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
<https://libjpeg-turbo.org/About/SmartScale> and draw their own conclusions,
|
||||
but it is the general belief of our project that these features have not
|
||||
demonstrated sufficient usefulness to justify inclusion in libjpeg-turbo.
|
||||
|
||||
@@ -245,16 +268,6 @@ programs that need them, without breaking ABI compatibility for programs that
|
||||
don't, and it allows those functions to be provided in the "official"
|
||||
libjpeg-turbo binaries.
|
||||
|
||||
Those who are concerned about maintaining strict conformance with the libjpeg
|
||||
v6b or v7 API can pass an argument of `-DWITH_MEM_SRCDST=0` to `cmake` prior to
|
||||
building libjpeg-turbo. This will restore the pre-1.3 behavior, in which
|
||||
`jpeg_mem_src()` and `jpeg_mem_dest()` are only included when emulating the
|
||||
libjpeg v8 API/ABI.
|
||||
|
||||
On Un*x systems, including the in-memory source/destination managers changes
|
||||
the dynamic library version from 62.2.0 to 62.3.0 if using libjpeg v6b API/ABI
|
||||
emulation and from 7.2.0 to 7.3.0 if using libjpeg v7 API/ABI emulation.
|
||||
|
||||
Note that, on most Un*x systems, the dynamic linker will not look for a
|
||||
function in a library until that function is actually used. Thus, if a program
|
||||
is built against libjpeg-turbo 1.3+ and uses `jpeg_mem_src()` or
|
||||
@@ -274,30 +287,35 @@ Mathematical Compatibility
|
||||
==========================
|
||||
|
||||
For the most part, libjpeg-turbo should produce identical output to libjpeg
|
||||
v6b. The one exception to this is when using the floating point DCT/IDCT, in
|
||||
which case the outputs of libjpeg v6b and libjpeg-turbo can differ for the
|
||||
following reasons:
|
||||
v6b. There are two exceptions:
|
||||
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever so
|
||||
slightly more accurate than the implementation in libjpeg v6b, but not by
|
||||
any amount perceptible to human vision (generally in the range of 0.01 to
|
||||
0.08 dB gain in PNSR.)
|
||||
1. When decompressing a JPEG image that uses 4:4:0 chrominance subsampling, the
|
||||
outputs of libjpeg v6b and libjpeg-turbo can differ because libjpeg-turbo
|
||||
implements a "fancy" (smooth) 4:4:0 upsampling algorithm and libjpeg did not.
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the floating
|
||||
point IDCT in line with the accuracy of the accurate integer IDCT. The
|
||||
floating point DCT/IDCT algorithms are mainly a legacy feature, and they do
|
||||
not produce significantly more accuracy than the accurate integer algorithms
|
||||
(to put numbers on this, the typical difference in PNSR between the two
|
||||
algorithms is less than 0.10 dB, whereas changing the quality level by 1 in
|
||||
the upper range of the quality scale is typically more like a 1.0 dB
|
||||
difference.)
|
||||
2. When using the floating point DCT/IDCT, the outputs of libjpeg v6b and
|
||||
libjpeg-turbo can differ for the following reasons:
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented using
|
||||
SIMD instructions on a particular platform, then the accuracy of the
|
||||
floating point DCT/IDCT can depend on the compiler settings.
|
||||
- The SSE/SSE2 floating point DCT implementation in libjpeg-turbo is ever
|
||||
so slightly more accurate than the implementation in libjpeg v6b, but not
|
||||
by any amount perceptible to human vision (generally in the range of 0.01
|
||||
to 0.08 dB gain in PNSR.)
|
||||
|
||||
- When not using the SIMD extensions, libjpeg-turbo uses the more accurate
|
||||
(and slightly faster) floating point IDCT algorithm introduced in libjpeg
|
||||
v8a as opposed to the algorithm used in libjpeg v6b. It should be noted,
|
||||
however, that this algorithm basically brings the accuracy of the
|
||||
floating point IDCT in line with the accuracy of the accurate integer
|
||||
IDCT. The floating point DCT/IDCT algorithms are mainly a legacy
|
||||
feature, and they do not produce significantly more accuracy than the
|
||||
accurate integer algorithms. (To put numbers on this, the typical
|
||||
difference in PNSR between the two algorithms is less than 0.10 dB,
|
||||
whereas changing the quality level by 1 in the upper range of the quality
|
||||
scale is typically more like a 1.0 dB difference.)
|
||||
|
||||
- If the floating point algorithms in libjpeg-turbo are not implemented
|
||||
using SIMD instructions on a particular platform, then the accuracy of
|
||||
the floating point DCT/IDCT can depend on the compiler settings.
|
||||
|
||||
While libjpeg-turbo does emulate the libjpeg v8 API/ABI, under the hood it is
|
||||
still using the same algorithms as libjpeg v6b, so there are several specific
|
||||
|
||||
Vendored
+30
-38
@@ -9,60 +9,52 @@
|
||||
/* libjpeg-turbo version in integer form */
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
/* Support arithmetic encoding when using 8-bit samples */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
/* Support arithmetic decoding when using 8-bit samples */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support in-memory source/destination managers */
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED 1
|
||||
#define MEM_SRCDST_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
/* Use accelerated SIMD routines when using 8-bit samples */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
/* This version of libjpeg-turbo supports run-time selection of data precision,
|
||||
* so BITS_IN_JSAMPLE is no longer used to specify the data precision at build
|
||||
* time. However, some downstream software expects the macro to be defined.
|
||||
* Since 12-bit data precision is an opt-in feature that requires explicitly
|
||||
* calling 12-bit-specific libjpeg API functions and using 12-bit-specific data
|
||||
* types, the unmodified portion of the libjpeg API still behaves as if it were
|
||||
* built for 8-bit precision, and JSAMPLE is still literally an 8-bit data
|
||||
* type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here.
|
||||
*/
|
||||
#ifndef BITS_IN_JSAMPLE
|
||||
#define BITS_IN_JSAMPLE 8
|
||||
#endif
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
#ifdef _WIN32
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#cmakedefine HAVE_STDDEF_H 1
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#cmakedefine HAVE_STDLIB_H 1
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define if you need to include <sys/types.h> to get size_t. */
|
||||
#cmakedefine NEED_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have BSD-like bzero and bcopy in <strings.h> rather than
|
||||
memset/memcpy in <string.h>. */
|
||||
#cmakedefine NEED_BSD_STRINGS 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned char'. */
|
||||
#cmakedefine HAVE_UNSIGNED_CHAR 1
|
||||
|
||||
/* Define to 1 if the system has the type `unsigned short'. */
|
||||
#cmakedefine HAVE_UNSIGNED_SHORT 1
|
||||
|
||||
/* Compiler does not support pointers to undefined structures. */
|
||||
#cmakedefine INCOMPLETE_TYPES_BROKEN 1
|
||||
#else
|
||||
|
||||
/* Define if your (broken) compiler shifts signed values as if they were
|
||||
unsigned. */
|
||||
#cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
#endif
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
#define JPEG_LIB_VERSION @JPEG_LIB_VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION @VERSION@
|
||||
#define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@
|
||||
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
#cmakedefine WITH_SIMD
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_STDLIB_H
|
||||
#undef NEED_SYS_TYPES_H
|
||||
#undef NEED_BSD_STRINGS
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
#undef INCOMPLETE_TYPES_BROKEN
|
||||
#undef RIGHT_SHIFT_IS_UNSIGNED
|
||||
|
||||
/* Define "boolean" as unsigned char, not int, per Windows custom */
|
||||
#ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */
|
||||
typedef unsigned char boolean;
|
||||
#endif
|
||||
#define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */
|
||||
|
||||
/* Define "INT32" as int, not long, per Windows custom */
|
||||
#if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */
|
||||
typedef short INT16;
|
||||
typedef signed int INT32;
|
||||
#endif
|
||||
#define XMD_H /* prevent jmorecfg.h from redefining it */
|
||||
+44
-10
@@ -1,19 +1,14 @@
|
||||
/* libjpeg-turbo build number */
|
||||
#define BUILD "@BUILD@"
|
||||
|
||||
/* How to hide global symbols. */
|
||||
#define HIDDEN @HIDDEN@
|
||||
|
||||
/* Compiler's inline keyword */
|
||||
#undef inline
|
||||
|
||||
/* How to obtain function inlining. */
|
||||
#ifndef INLINE
|
||||
#if defined(__GNUC__)
|
||||
#define INLINE inline __attribute__((always_inline))
|
||||
#elif defined(_MSC_VER)
|
||||
#define INLINE __forceinline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
#define INLINE @INLINE@
|
||||
|
||||
/* How to obtain thread-local storage */
|
||||
#define THREAD_LOCAL @THREAD_LOCAL@
|
||||
@@ -25,7 +20,7 @@
|
||||
#define VERSION "@VERSION@"
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||
#define SIZEOF_SIZE_T @SIZE_T@
|
||||
|
||||
/* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */
|
||||
#cmakedefine HAVE_BUILTIN_CTZL
|
||||
@@ -40,3 +35,42 @@
|
||||
#define HAVE_BITSCANFORWARD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__has_attribute)
|
||||
#if __has_attribute(fallthrough)
|
||||
#define FALLTHROUGH __attribute__((fallthrough));
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
#else
|
||||
#define FALLTHROUGH
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
*/
|
||||
|
||||
#ifndef BITS_IN_JSAMPLE
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
#endif
|
||||
|
||||
#undef C_ARITH_CODING_SUPPORTED
|
||||
#undef D_ARITH_CODING_SUPPORTED
|
||||
#undef WITH_SIMD
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/* Support arithmetic encoding */
|
||||
#cmakedefine C_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Support arithmetic decoding */
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED 1
|
||||
|
||||
/* Use accelerated SIMD routines. */
|
||||
#cmakedefine WITH_SIMD 1
|
||||
|
||||
#endif
|
||||
|
||||
+8
-6
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2010, 2012-2021, D. R. Commander.
|
||||
* Copyright (C) 2010, 2012-2024, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -36,19 +36,21 @@
|
||||
* their code
|
||||
*/
|
||||
|
||||
#define JCOPYRIGHT \
|
||||
"Copyright (C) 2009-2021 D. R. Commander\n" \
|
||||
#define JCOPYRIGHT1 \
|
||||
"Copyright (C) 2009-2024 D. R. Commander\n" \
|
||||
"Copyright (C) 2015, 2020 Google, Inc.\n" \
|
||||
"Copyright (C) 2019-2020 Arm Limited\n" \
|
||||
"Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \
|
||||
"Copyright (C) 2011-2016 Siarhei Siamashka\n" \
|
||||
"Copyright (C) 2015 Intel Corporation\n" \
|
||||
"Copyright (C) 2015 Intel Corporation\n"
|
||||
#define JCOPYRIGHT2 \
|
||||
"Copyright (C) 2013-2014 Linaro Limited\n" \
|
||||
"Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \
|
||||
"Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \
|
||||
"Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \
|
||||
"Copyright (C) 1999-2006 MIYASAKA Masaru\n" \
|
||||
"Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding"
|
||||
"Copyright (C) 1999 Ken Murchison\n" \
|
||||
"Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n"
|
||||
|
||||
#define JCOPYRIGHT_SHORT \
|
||||
"Copyright (C) 1991-2021 The libjpeg-turbo Project and many others"
|
||||
"Copyright (C) @COPYRIGHT_YEAR@ The libjpeg-turbo Project and many others"
|
||||
+544
@@ -0,0 +1,544 @@
|
||||
macro(simd_fail message)
|
||||
if(REQUIRE_SIMD)
|
||||
message(FATAL_ERROR "${message}.")
|
||||
else()
|
||||
message(STATUS "${message}. Performance will suffer.")
|
||||
set(WITH_SIMD 0 PARENT_SCOPE)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# x86[-64] (NASM)
|
||||
###############################################################################
|
||||
|
||||
if(CPU_TYPE STREQUAL "x86_64" OR CPU_TYPE STREQUAL "i386")
|
||||
|
||||
set(CMAKE_ASM_NASM_FLAGS_DEBUG_INIT "-g")
|
||||
set(CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO_INIT "-g")
|
||||
|
||||
# Allow the location of the NASM executable to be specified using the ASM_NASM
|
||||
# environment variable. This should happen automatically, but unfortunately
|
||||
# enable_language(ASM_NASM) doesn't parse the ASM_NASM environment variable
|
||||
# until after CMAKE_ASM_NASM_COMPILER has been populated with the results of
|
||||
# searching for NASM or Yasm in the PATH.
|
||||
if(NOT DEFINED CMAKE_ASM_NASM_COMPILER AND DEFINED ENV{ASM_NASM})
|
||||
set(CMAKE_ASM_NASM_COMPILER $ENV{ASM_NASM})
|
||||
endif()
|
||||
|
||||
if(CPU_TYPE STREQUAL "x86_64")
|
||||
if(CYGWIN)
|
||||
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
||||
endif()
|
||||
if(CMAKE_C_COMPILER_ABI MATCHES "ELF X32")
|
||||
set(CMAKE_ASM_NASM_OBJECT_FORMAT elfx32)
|
||||
endif()
|
||||
elseif(CPU_TYPE STREQUAL "i386")
|
||||
if(BORLAND)
|
||||
set(CMAKE_ASM_NASM_OBJECT_FORMAT obj)
|
||||
elseif(CYGWIN)
|
||||
set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT REQUIRE_SIMD)
|
||||
include(CheckLanguage)
|
||||
check_language(ASM_NASM)
|
||||
if(NOT CMAKE_ASM_NASM_COMPILER)
|
||||
simd_fail("SIMD extensions disabled: could not find NASM compiler")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
enable_language(ASM_NASM)
|
||||
message(STATUS "CMAKE_ASM_NASM_COMPILER = ${CMAKE_ASM_NASM_COMPILER}")
|
||||
|
||||
if(CMAKE_ASM_NASM_OBJECT_FORMAT MATCHES "^macho")
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DMACHO")
|
||||
elseif(CMAKE_ASM_NASM_OBJECT_FORMAT MATCHES "^elf")
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DELF")
|
||||
set(CMAKE_ASM_NASM_DEBUG_FORMAT "dwarf2")
|
||||
endif()
|
||||
if(CPU_TYPE STREQUAL "x86_64")
|
||||
if(WIN32 OR CYGWIN)
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DWIN64")
|
||||
endif()
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -D__x86_64__")
|
||||
elseif(CPU_TYPE STREQUAL "i386")
|
||||
if(BORLAND)
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DOBJ32")
|
||||
elseif(WIN32 OR CYGWIN)
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DWIN32")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "CMAKE_ASM_NASM_OBJECT_FORMAT = ${CMAKE_ASM_NASM_OBJECT_FORMAT}")
|
||||
|
||||
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
||||
simd_fail("SIMD extensions disabled: could not determine NASM object format")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_filename_component(CMAKE_ASM_NASM_COMPILER_TYPE
|
||||
"${CMAKE_ASM_NASM_COMPILER}" NAME_WE)
|
||||
if(CMAKE_ASM_NASM_COMPILER_TYPE MATCHES "yasm")
|
||||
foreach(var CMAKE_ASM_NASM_FLAGS_DEBUG CMAKE_ASM_NASM_FLAGS_RELWITHDEBINFO)
|
||||
if(${var} STREQUAL "-g")
|
||||
if(CMAKE_ASM_NASM_DEBUG_FORMAT)
|
||||
set_property(CACHE ${var} PROPERTY VALUE "-g ${CMAKE_ASM_NASM_DEBUG_FORMAT}")
|
||||
else()
|
||||
set_property(CACHE ${var} PROPERTY VALUE "")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -DPIC")
|
||||
endif()
|
||||
|
||||
if(CPU_TYPE STREQUAL "x86_64" AND CMAKE_ASM_NASM_OBJECT_FORMAT MATCHES "^elf")
|
||||
check_c_source_compiles("
|
||||
#if (__CET__ & 3) == 0
|
||||
#error \"CET not enabled\"
|
||||
#endif
|
||||
int main(void) { return 0; }" HAVE_CET)
|
||||
|
||||
if(HAVE_CET)
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -D__CET__")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
|
||||
set(EFFECTIVE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} ${CMAKE_ASM_NASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||
message(STATUS "CMAKE_ASM_NASM_FLAGS = ${EFFECTIVE_ASM_NASM_FLAGS}")
|
||||
|
||||
set(CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS} -I\"${CMAKE_CURRENT_SOURCE_DIR}/nasm/\" -I\"${CMAKE_CURRENT_SOURCE_DIR}/${CPU_TYPE}/\"")
|
||||
|
||||
set(GREP grep)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
set(GREP ggrep)
|
||||
endif()
|
||||
add_custom_target(jsimdcfg COMMAND
|
||||
${CMAKE_C_COMPILER} -E -I${CMAKE_BINARY_DIR} -I${CMAKE_CURRENT_BINARY_DIR}
|
||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nasm/jsimdcfg.inc.h |
|
||||
${GREP} -E '^[\;%]|^\ %' | sed 's%_cpp_protection_%%' |
|
||||
sed 's@% define@%define@g' >${CMAKE_CURRENT_SOURCE_DIR}/nasm/jsimdcfg.inc)
|
||||
|
||||
if(CPU_TYPE STREQUAL "x86_64")
|
||||
set(SIMD_SOURCES x86_64/jsimdcpu.asm x86_64/jfdctflt-sse.asm
|
||||
x86_64/jccolor-sse2.asm x86_64/jcgray-sse2.asm x86_64/jchuff-sse2.asm
|
||||
x86_64/jcphuff-sse2.asm x86_64/jcsample-sse2.asm x86_64/jdcolor-sse2.asm
|
||||
x86_64/jdmerge-sse2.asm x86_64/jdsample-sse2.asm x86_64/jfdctfst-sse2.asm
|
||||
x86_64/jfdctint-sse2.asm x86_64/jidctflt-sse2.asm x86_64/jidctfst-sse2.asm
|
||||
x86_64/jidctint-sse2.asm x86_64/jidctred-sse2.asm x86_64/jquantf-sse2.asm
|
||||
x86_64/jquanti-sse2.asm
|
||||
x86_64/jccolor-avx2.asm x86_64/jcgray-avx2.asm x86_64/jcsample-avx2.asm
|
||||
x86_64/jdcolor-avx2.asm x86_64/jdmerge-avx2.asm x86_64/jdsample-avx2.asm
|
||||
x86_64/jfdctint-avx2.asm x86_64/jidctint-avx2.asm x86_64/jquanti-avx2.asm)
|
||||
else()
|
||||
set(SIMD_SOURCES i386/jsimdcpu.asm i386/jfdctflt-3dn.asm
|
||||
i386/jidctflt-3dn.asm i386/jquant-3dn.asm
|
||||
i386/jccolor-mmx.asm i386/jcgray-mmx.asm i386/jcsample-mmx.asm
|
||||
i386/jdcolor-mmx.asm i386/jdmerge-mmx.asm i386/jdsample-mmx.asm
|
||||
i386/jfdctfst-mmx.asm i386/jfdctint-mmx.asm i386/jidctfst-mmx.asm
|
||||
i386/jidctint-mmx.asm i386/jidctred-mmx.asm i386/jquant-mmx.asm
|
||||
i386/jfdctflt-sse.asm i386/jidctflt-sse.asm i386/jquant-sse.asm
|
||||
i386/jccolor-sse2.asm i386/jcgray-sse2.asm i386/jchuff-sse2.asm
|
||||
i386/jcphuff-sse2.asm i386/jcsample-sse2.asm i386/jdcolor-sse2.asm
|
||||
i386/jdmerge-sse2.asm i386/jdsample-sse2.asm i386/jfdctfst-sse2.asm
|
||||
i386/jfdctint-sse2.asm i386/jidctflt-sse2.asm i386/jidctfst-sse2.asm
|
||||
i386/jidctint-sse2.asm i386/jidctred-sse2.asm i386/jquantf-sse2.asm
|
||||
i386/jquanti-sse2.asm
|
||||
i386/jccolor-avx2.asm i386/jcgray-avx2.asm i386/jcsample-avx2.asm
|
||||
i386/jdcolor-avx2.asm i386/jdmerge-avx2.asm i386/jdsample-avx2.asm
|
||||
i386/jfdctint-avx2.asm i386/jidctint-avx2.asm i386/jquanti-avx2.asm)
|
||||
endif()
|
||||
|
||||
if(MSVC_IDE)
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
|
||||
string(REGEX REPLACE " " ";" CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS}")
|
||||
elseif(XCODE)
|
||||
set(OBJDIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
string(REGEX REPLACE " " ";" CMAKE_ASM_NASM_FLAGS "${CMAKE_ASM_NASM_FLAGS}")
|
||||
endif()
|
||||
|
||||
file(GLOB INC_FILES nasm/*.inc)
|
||||
|
||||
foreach(file ${SIMD_SOURCES})
|
||||
set(OBJECT_DEPENDS "")
|
||||
if(${file} MATCHES jccolor)
|
||||
string(REGEX REPLACE "jccolor" "jccolext" DEPFILE ${file})
|
||||
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
|
||||
endif()
|
||||
if(${file} MATCHES jcgray)
|
||||
string(REGEX REPLACE "jcgray" "jcgryext" DEPFILE ${file})
|
||||
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
|
||||
endif()
|
||||
if(${file} MATCHES jdcolor)
|
||||
string(REGEX REPLACE "jdcolor" "jdcolext" DEPFILE ${file})
|
||||
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
|
||||
endif()
|
||||
if(${file} MATCHES jdmerge)
|
||||
string(REGEX REPLACE "jdmerge" "jdmrgext" DEPFILE ${file})
|
||||
set(OBJECT_DEPENDS ${OBJECT_DEPENDS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${DEPFILE})
|
||||
endif()
|
||||
set(OBJECT_DEPENDS ${OBJECT_DEPENDS} ${INC_FILES})
|
||||
if(MSVC_IDE OR XCODE)
|
||||
# The CMake Visual Studio generators do not work properly with the ASM_NASM
|
||||
# language, so we have to go rogue here and use a custom command like we
|
||||
# did in prior versions of libjpeg-turbo. (This is why we can't have nice
|
||||
# things.)
|
||||
string(REGEX REPLACE "${CPU_TYPE}/" "" filename ${file})
|
||||
set(SIMD_OBJ ${OBJDIR}/${filename}${CMAKE_C_OUTPUT_EXTENSION})
|
||||
add_custom_command(OUTPUT ${SIMD_OBJ} DEPENDS ${file} ${OBJECT_DEPENDS}
|
||||
COMMAND ${CMAKE_ASM_NASM_COMPILER} -f${CMAKE_ASM_NASM_OBJECT_FORMAT}
|
||||
${CMAKE_ASM_NASM_FLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||
-o${SIMD_OBJ})
|
||||
set(SIMD_OBJS ${SIMD_OBJS} ${SIMD_OBJ})
|
||||
else()
|
||||
set_source_files_properties(${file} PROPERTIES OBJECT_DEPENDS
|
||||
"${OBJECT_DEPENDS}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(MSVC_IDE OR XCODE)
|
||||
set(SIMD_OBJS ${SIMD_OBJS} PARENT_SCOPE)
|
||||
add_library(simd OBJECT ${CPU_TYPE}/jsimd.c)
|
||||
add_custom_target(simd-objs DEPENDS ${SIMD_OBJS})
|
||||
add_dependencies(simd simd-objs)
|
||||
set_target_properties(simd PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(simd-objs PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
set_target_properties(jsimdcfg PROPERTIES FOLDER "3rdparty/jpeg")
|
||||
else()
|
||||
add_library(simd OBJECT ${SIMD_SOURCES} ${CPU_TYPE}/jsimd.c)
|
||||
endif()
|
||||
if(NOT WIN32 AND (CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED))
|
||||
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Arm (Intrinsics or GAS)
|
||||
###############################################################################
|
||||
|
||||
elseif(CPU_TYPE STREQUAL "arm64" OR CPU_TYPE STREQUAL "arm")
|
||||
|
||||
# If Neon instructions are not explicitly enabled at compile time (e.g. using
|
||||
# -mfpu=neon) with an AArch32 Linux or Android build, then the AArch32 SIMD
|
||||
# dispatcher will parse /proc/cpuinfo to determine whether the Neon SIMD
|
||||
# extensions can be enabled at run time. In order to support all AArch32 CPUs
|
||||
# using the same code base, i.e. to support run-time FPU and Neon
|
||||
# auto-detection, it is necessary to compile the scalar C source code using
|
||||
# -mfloat-abi=soft (which is usually the default) but compile the intrinsics
|
||||
# implementation of the Neon SIMD extensions using -mfloat-abi=softfp. The
|
||||
# following test determines whether -mfloat-abi=softfp should be explicitly
|
||||
# added to the compile flags for the intrinsics implementation of the Neon SIMD
|
||||
# extensions.
|
||||
if(BITS EQUAL 32)
|
||||
check_c_source_compiles("
|
||||
#if defined(__ARM_NEON__) || (!defined(__linux__) && !defined(ANDROID) && !defined(__ANDROID__))
|
||||
#error \"Neon run-time auto-detection will not be used\"
|
||||
#endif
|
||||
#if __ARM_PCS_VFP == 1
|
||||
#error \"float ABI = hard\"
|
||||
#endif
|
||||
#if __SOFTFP__ != 1
|
||||
#error \"float ABI = softfp\"
|
||||
#endif
|
||||
int main(void) { return 0; }" NEED_SOFTFP_FOR_INTRINSICS)
|
||||
if(NEED_SOFTFP_FOR_INTRINSICS)
|
||||
set(SOFTFP_FLAG -mfloat-abi=softfp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(BITS EQUAL 32)
|
||||
set(CMAKE_REQUIRED_FLAGS "-mfpu=neon ${SOFTFP_FLAG}")
|
||||
check_c_source_compiles("
|
||||
#include <arm_neon.h>
|
||||
int main(int argc, char **argv) {
|
||||
uint16x8_t input = vdupq_n_u16((uint16_t)argc);
|
||||
uint8x8_t output = vmovn_u16(input);
|
||||
return (int)output[0];
|
||||
}" HAVE_NEON)
|
||||
if(NOT HAVE_NEON)
|
||||
simd_fail("SIMD extensions not available for this architecture")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
check_c_source_compiles("
|
||||
#include <arm_neon.h>
|
||||
int main(int argc, char **argv) {
|
||||
int16_t input[12];
|
||||
int16x4x3_t output;
|
||||
int i;
|
||||
for (i = 0; i < 12; i++) input[i] = (int16_t)argc;
|
||||
output = vld1_s16_x3(input);
|
||||
vst3_s16(input, output);
|
||||
return (int)input[0];
|
||||
}" HAVE_VLD1_S16_X3)
|
||||
check_c_source_compiles("
|
||||
#include <arm_neon.h>
|
||||
int main(int argc, char **argv) {
|
||||
uint16_t input[8];
|
||||
uint16x4x2_t output;
|
||||
int i;
|
||||
for (i = 0; i < 8; i++) input[i] = (uint16_t)argc;
|
||||
output = vld1_u16_x2(input);
|
||||
vst2_u16(input, output);
|
||||
return (int)input[0];
|
||||
}" HAVE_VLD1_U16_X2)
|
||||
check_c_source_compiles("
|
||||
#include <arm_neon.h>
|
||||
int main(int argc, char **argv) {
|
||||
uint8_t input[64];
|
||||
uint8x16x4_t output;
|
||||
int i;
|
||||
for (i = 0; i < 64; i++) input[i] = (uint8_t)argc;
|
||||
output = vld1q_u8_x4(input);
|
||||
vst4q_u8(input, output);
|
||||
return (int)input[0];
|
||||
}" HAVE_VLD1Q_U8_X4)
|
||||
if(BITS EQUAL 32)
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
endif()
|
||||
configure_file(arm/neon-compat.h.in arm/neon-compat.h @ONLY)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/arm)
|
||||
|
||||
# GCC 11 and earlier and some older versions of Clang do not have a full or
|
||||
# optimal set of Neon intrinsics, so for performance reasons, when using those
|
||||
# compilers, we default to using the older GAS implementation of the Neon SIMD
|
||||
# extensions for certain algorithms. The presence or absence of the three
|
||||
# intrinsics we tested above is a reasonable proxy for this, except with GCC 10
|
||||
# and 11.
|
||||
if((HAVE_VLD1_S16_X3 AND HAVE_VLD1_U16_X2 AND HAVE_VLD1Q_U8_X4 AND
|
||||
(NOT CMAKE_COMPILER_IS_GNUCC OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_EQUAL 12.0.0 OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER 12.0.0)))
|
||||
set(DEFAULT_NEON_INTRINSICS 1)
|
||||
else()
|
||||
set(DEFAULT_NEON_INTRINSICS 0)
|
||||
endif()
|
||||
option(NEON_INTRINSICS
|
||||
"Because GCC (as of this writing) and some older versions of Clang do not have a full or optimal set of Neon intrinsics, for performance reasons, the default when building libjpeg-turbo with those compilers is to continue using the older GAS implementation of the Neon SIMD extensions for certain algorithms. Setting this option forces the full Neon intrinsics implementation to be used with all compilers. Unsetting this option forces the hybrid GAS/intrinsics implementation to be used with all compilers."
|
||||
${DEFAULT_NEON_INTRINSICS})
|
||||
if(NOT NEON_INTRINSICS)
|
||||
enable_language(ASM)
|
||||
|
||||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ASM_FLAGS}")
|
||||
|
||||
# Test whether gas-preprocessor.pl would be needed to build the GAS
|
||||
# implementation of the Neon SIMD extensions. If so, then automatically
|
||||
# enable the full Neon intrinsics implementation.
|
||||
if(CPU_TYPE STREQUAL "arm")
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gastest.S "
|
||||
.text
|
||||
.fpu neon
|
||||
.arch armv7a
|
||||
.object_arch armv4
|
||||
.arm
|
||||
pld [r0]
|
||||
vmovn.u16 d0, q0")
|
||||
else()
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gastest.S "
|
||||
.text
|
||||
MYVAR .req x0
|
||||
movi v0.16b, #100
|
||||
mov MYVAR, #100
|
||||
.unreq MYVAR")
|
||||
endif()
|
||||
separate_arguments(CMAKE_ASM_FLAGS_SEP UNIX_COMMAND "${CMAKE_ASM_FLAGS}")
|
||||
execute_process(COMMAND ${CMAKE_ASM_COMPILER} ${CMAKE_ASM_FLAGS_SEP}
|
||||
-x assembler-with-cpp -c ${CMAKE_CURRENT_BINARY_DIR}/gastest.S
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} RESULT_VARIABLE RESULT
|
||||
OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE ERROR)
|
||||
if(NOT RESULT EQUAL 0)
|
||||
message(WARNING "GAS appears to be broken. Using the full Neon SIMD intrinsics implementation.")
|
||||
set(NEON_INTRINSICS 1 CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
boolean_number(NEON_INTRINSICS PARENT_SCOPE)
|
||||
if(NEON_INTRINSICS)
|
||||
add_definitions(-DNEON_INTRINSICS)
|
||||
message(STATUS "Use full Neon SIMD intrinsics implementation (NEON_INTRINSICS = ${NEON_INTRINSICS})")
|
||||
else()
|
||||
message(STATUS "Use partial Neon SIMD intrinsics implementation (NEON_INTRINSICS = ${NEON_INTRINSICS})")
|
||||
endif()
|
||||
|
||||
set(SIMD_SOURCES arm/jcgray-neon.c arm/jcphuff-neon.c arm/jcsample-neon.c
|
||||
arm/jdmerge-neon.c arm/jdsample-neon.c arm/jfdctfst-neon.c
|
||||
arm/jidctred-neon.c arm/jquanti-neon.c)
|
||||
if(NEON_INTRINSICS)
|
||||
set(SIMD_SOURCES ${SIMD_SOURCES} arm/jccolor-neon.c arm/jidctint-neon.c)
|
||||
endif()
|
||||
if(NEON_INTRINSICS OR BITS EQUAL 64)
|
||||
set(SIMD_SOURCES ${SIMD_SOURCES} arm/jidctfst-neon.c)
|
||||
endif()
|
||||
if(NEON_INTRINSICS OR BITS EQUAL 32)
|
||||
set(SIMD_SOURCES ${SIMD_SOURCES} arm/aarch${BITS}/jchuff-neon.c
|
||||
arm/jdcolor-neon.c arm/jfdctint-neon.c)
|
||||
endif()
|
||||
if(BITS EQUAL 32)
|
||||
set_source_files_properties(${SIMD_SOURCES} COMPILE_FLAGS "-mfpu=neon ${SOFTFP_FLAG}")
|
||||
endif()
|
||||
if(NOT NEON_INTRINSICS)
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
|
||||
set(EFFECTIVE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||
message(STATUS "CMAKE_ASM_FLAGS = ${EFFECTIVE_ASM_FLAGS}")
|
||||
|
||||
set(SIMD_SOURCES ${SIMD_SOURCES} arm/aarch${BITS}/jsimd_neon.S)
|
||||
endif()
|
||||
|
||||
add_library(simd OBJECT ${SIMD_SOURCES} arm/aarch${BITS}/jsimd.c)
|
||||
|
||||
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
|
||||
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# MIPS (GAS)
|
||||
###############################################################################
|
||||
|
||||
elseif(CPU_TYPE STREQUAL "mips" OR CPU_TYPE STREQUAL "mipsel")
|
||||
|
||||
enable_language(ASM)
|
||||
|
||||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
|
||||
set(EFFECTIVE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CMAKE_ASM_FLAGS_${CMAKE_BUILD_TYPE_UC}}")
|
||||
message(STATUS "CMAKE_ASM_FLAGS = ${EFFECTIVE_ASM_FLAGS}")
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS -mdspr2)
|
||||
|
||||
check_c_source_compiles("
|
||||
#if !(defined(__mips__) && __mips_isa_rev >= 2)
|
||||
#error MIPS DSPr2 is currently only available on MIPS32r2 platforms.
|
||||
#endif
|
||||
int main(void) {
|
||||
int c = 0, a = 0, b = 0;
|
||||
__asm__ __volatile__ (
|
||||
\"precr.qb.ph %[c], %[a], %[b]\"
|
||||
: [c] \"=r\" (c)
|
||||
: [a] \"r\" (a), [b] \"r\" (b)
|
||||
);
|
||||
return c;
|
||||
}" HAVE_DSPR2)
|
||||
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
if(NOT HAVE_DSPR2)
|
||||
simd_fail("SIMD extensions not available for this CPU")
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_library(simd OBJECT mips/jsimd_dspr2.S mips/jsimd.c)
|
||||
|
||||
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
|
||||
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# MIPS64 (Intrinsics)
|
||||
###############################################################################
|
||||
|
||||
elseif(CPU_TYPE STREQUAL "loongson" OR CPU_TYPE MATCHES "^mips64")
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS -Wa,-mloongson-mmi,-mloongson-ext)
|
||||
|
||||
check_c_source_compiles("
|
||||
#if !(defined(__mips__) && __mips_isa_rev < 6)
|
||||
#error Loongson MMI can't work with MIPS Release 6+
|
||||
#endif
|
||||
int main(void) {
|
||||
int c = 0, a = 0, b = 0;
|
||||
asm (
|
||||
\"paddb %0, %1, %2\"
|
||||
: \"=f\" (c)
|
||||
: \"f\" (a), \"f\" (b)
|
||||
);
|
||||
return c;
|
||||
}" HAVE_MMI)
|
||||
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
if(NOT HAVE_MMI)
|
||||
simd_fail("SIMD extensions not available for this CPU")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(SIMD_SOURCES mips64/jccolor-mmi.c mips64/jcgray-mmi.c mips64/jcsample-mmi.c
|
||||
mips64/jdcolor-mmi.c mips64/jdmerge-mmi.c mips64/jdsample-mmi.c
|
||||
mips64/jfdctfst-mmi.c mips64/jfdctint-mmi.c mips64/jidctfst-mmi.c
|
||||
mips64/jidctint-mmi.c mips64/jquanti-mmi.c)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
foreach(file ${SIMD_SOURCES})
|
||||
set_property(SOURCE ${file} APPEND_STRING PROPERTY COMPILE_FLAGS
|
||||
" -fno-strict-aliasing")
|
||||
endforeach()
|
||||
endif()
|
||||
foreach(file ${SIMD_SOURCES})
|
||||
set_property(SOURCE ${file} APPEND_STRING PROPERTY COMPILE_FLAGS
|
||||
" -Wa,-mloongson-mmi,-mloongson-ext")
|
||||
endforeach()
|
||||
|
||||
add_library(simd OBJECT ${SIMD_SOURCES} mips64/jsimd.c)
|
||||
|
||||
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
|
||||
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
###############################################################################
|
||||
# PowerPC (Intrinsics)
|
||||
###############################################################################
|
||||
|
||||
elseif(CPU_TYPE STREQUAL "powerpc")
|
||||
|
||||
set(CMAKE_REQUIRED_FLAGS -maltivec)
|
||||
|
||||
check_c_source_compiles("
|
||||
#include <altivec.h>
|
||||
int main(void) {
|
||||
__vector int vi = { 0, 0, 0, 0 };
|
||||
int i[4];
|
||||
vec_st(vi, 0, i);
|
||||
return i[0];
|
||||
}" HAVE_ALTIVEC)
|
||||
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
|
||||
if(NOT HAVE_ALTIVEC)
|
||||
simd_fail("SIMD extensions not available for this CPU (PowerPC SPE)")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(SIMD_SOURCES powerpc/jccolor-altivec.c powerpc/jcgray-altivec.c
|
||||
powerpc/jcsample-altivec.c powerpc/jdcolor-altivec.c
|
||||
powerpc/jdmerge-altivec.c powerpc/jdsample-altivec.c
|
||||
powerpc/jfdctfst-altivec.c powerpc/jfdctint-altivec.c
|
||||
powerpc/jidctfst-altivec.c powerpc/jidctint-altivec.c
|
||||
powerpc/jquanti-altivec.c)
|
||||
|
||||
set_source_files_properties(${SIMD_SOURCES} PROPERTIES
|
||||
COMPILE_FLAGS -maltivec)
|
||||
|
||||
add_library(simd OBJECT ${SIMD_SOURCES} powerpc/jsimd.c)
|
||||
|
||||
if(CMAKE_POSITION_INDEPENDENT_CODE OR ENABLE_SHARED)
|
||||
set_target_properties(simd PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
||||
endif()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# None
|
||||
###############################################################################
|
||||
|
||||
else()
|
||||
|
||||
simd_fail("SIMD extensions not available for this CPU (${CMAKE_SYSTEM_PROCESSOR})")
|
||||
|
||||
endif() # CPU_TYPE
|
||||
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* jccolext-neon.c - colorspace conversion (32-bit Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* This file is included by jccolor-neon.c */
|
||||
|
||||
|
||||
/* RGB -> YCbCr conversion is defined by the following equations:
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128
|
||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128
|
||||
*
|
||||
* Avoid floating point arithmetic by using shifted integer constants:
|
||||
* 0.29899597 = 19595 * 2^-16
|
||||
* 0.58700561 = 38470 * 2^-16
|
||||
* 0.11399841 = 7471 * 2^-16
|
||||
* 0.16874695 = 11059 * 2^-16
|
||||
* 0.33125305 = 21709 * 2^-16
|
||||
* 0.50000000 = 32768 * 2^-16
|
||||
* 0.41868592 = 27439 * 2^-16
|
||||
* 0.08131409 = 5329 * 2^-16
|
||||
* These constants are defined in jccolor-neon.c
|
||||
*
|
||||
* We add the fixed-point equivalent of 0.5 to Cb and Cr, which effectively
|
||||
* rounds up or down the result via integer truncation.
|
||||
*/
|
||||
|
||||
void jsimd_rgb_ycc_convert_neon(JDIMENSION image_width, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
/* Pointer to RGB(X/A) input data */
|
||||
JSAMPROW inptr;
|
||||
/* Pointers to Y, Cb, and Cr output data */
|
||||
JSAMPROW outptr0, outptr1, outptr2;
|
||||
/* Allocate temporary buffer for final (image_width % 8) pixels in row. */
|
||||
ALIGN(16) uint8_t tmp_buf[8 * RGB_PIXELSIZE];
|
||||
|
||||
/* Set up conversion constants. */
|
||||
#ifdef HAVE_VLD1_U16_X2
|
||||
const uint16x4x2_t consts = vld1_u16_x2(jsimd_rgb_ycc_neon_consts);
|
||||
#else
|
||||
/* GCC does not currently support the intrinsic vld1_<type>_x2(). */
|
||||
const uint16x4_t consts1 = vld1_u16(jsimd_rgb_ycc_neon_consts);
|
||||
const uint16x4_t consts2 = vld1_u16(jsimd_rgb_ycc_neon_consts + 4);
|
||||
const uint16x4x2_t consts = { { consts1, consts2 } };
|
||||
#endif
|
||||
const uint32x4_t scaled_128_5 = vdupq_n_u32((128 << 16) + 32767);
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
|
||||
int cols_remaining = image_width;
|
||||
for (; cols_remaining > 0; cols_remaining -= 8) {
|
||||
|
||||
/* To prevent buffer overread by the vector load instructions, the last
|
||||
* (image_width % 8) columns of data are first memcopied to a temporary
|
||||
* buffer large enough to accommodate the vector load.
|
||||
*/
|
||||
if (cols_remaining < 8) {
|
||||
memcpy(tmp_buf, inptr, cols_remaining * RGB_PIXELSIZE);
|
||||
inptr = tmp_buf;
|
||||
}
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x8x4_t input_pixels = vld4_u8(inptr);
|
||||
#else
|
||||
uint8x8x3_t input_pixels = vld3_u8(inptr);
|
||||
#endif
|
||||
uint16x8_t r = vmovl_u8(input_pixels.val[RGB_RED]);
|
||||
uint16x8_t g = vmovl_u8(input_pixels.val[RGB_GREEN]);
|
||||
uint16x8_t b = vmovl_u8(input_pixels.val[RGB_BLUE]);
|
||||
|
||||
/* Compute Y = 0.29900 * R + 0.58700 * G + 0.11400 * B */
|
||||
uint32x4_t y_low = vmull_lane_u16(vget_low_u16(r), consts.val[0], 0);
|
||||
y_low = vmlal_lane_u16(y_low, vget_low_u16(g), consts.val[0], 1);
|
||||
y_low = vmlal_lane_u16(y_low, vget_low_u16(b), consts.val[0], 2);
|
||||
uint32x4_t y_high = vmull_lane_u16(vget_high_u16(r), consts.val[0], 0);
|
||||
y_high = vmlal_lane_u16(y_high, vget_high_u16(g), consts.val[0], 1);
|
||||
y_high = vmlal_lane_u16(y_high, vget_high_u16(b), consts.val[0], 2);
|
||||
|
||||
/* Compute Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128 */
|
||||
uint32x4_t cb_low = scaled_128_5;
|
||||
cb_low = vmlsl_lane_u16(cb_low, vget_low_u16(r), consts.val[0], 3);
|
||||
cb_low = vmlsl_lane_u16(cb_low, vget_low_u16(g), consts.val[1], 0);
|
||||
cb_low = vmlal_lane_u16(cb_low, vget_low_u16(b), consts.val[1], 1);
|
||||
uint32x4_t cb_high = scaled_128_5;
|
||||
cb_high = vmlsl_lane_u16(cb_high, vget_high_u16(r), consts.val[0], 3);
|
||||
cb_high = vmlsl_lane_u16(cb_high, vget_high_u16(g), consts.val[1], 0);
|
||||
cb_high = vmlal_lane_u16(cb_high, vget_high_u16(b), consts.val[1], 1);
|
||||
|
||||
/* Compute Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128 */
|
||||
uint32x4_t cr_low = scaled_128_5;
|
||||
cr_low = vmlal_lane_u16(cr_low, vget_low_u16(r), consts.val[1], 1);
|
||||
cr_low = vmlsl_lane_u16(cr_low, vget_low_u16(g), consts.val[1], 2);
|
||||
cr_low = vmlsl_lane_u16(cr_low, vget_low_u16(b), consts.val[1], 3);
|
||||
uint32x4_t cr_high = scaled_128_5;
|
||||
cr_high = vmlal_lane_u16(cr_high, vget_high_u16(r), consts.val[1], 1);
|
||||
cr_high = vmlsl_lane_u16(cr_high, vget_high_u16(g), consts.val[1], 2);
|
||||
cr_high = vmlsl_lane_u16(cr_high, vget_high_u16(b), consts.val[1], 3);
|
||||
|
||||
/* Descale Y values (rounding right shift) and narrow to 16-bit. */
|
||||
uint16x8_t y_u16 = vcombine_u16(vrshrn_n_u32(y_low, 16),
|
||||
vrshrn_n_u32(y_high, 16));
|
||||
/* Descale Cb values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cb_u16 = vcombine_u16(vshrn_n_u32(cb_low, 16),
|
||||
vshrn_n_u32(cb_high, 16));
|
||||
/* Descale Cr values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cr_u16 = vcombine_u16(vshrn_n_u32(cr_low, 16),
|
||||
vshrn_n_u32(cr_high, 16));
|
||||
/* Narrow Y, Cb, and Cr values to 8-bit and store to memory. Buffer
|
||||
* overwrite is permitted up to the next multiple of ALIGN_SIZE bytes.
|
||||
*/
|
||||
vst1_u8(outptr0, vmovn_u16(y_u16));
|
||||
vst1_u8(outptr1, vmovn_u16(cb_u16));
|
||||
vst1_u8(outptr2, vmovn_u16(cr_u16));
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr += (8 * RGB_PIXELSIZE);
|
||||
outptr0 += 8;
|
||||
outptr1 += 8;
|
||||
outptr2 += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,335 @@
|
||||
/*
|
||||
* jchuff-neon.c - Huffman entropy encoding (32-bit Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
* NOTE: All referenced figures are from
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../../src/jinclude.h"
|
||||
#include "../../../src/jpeglib.h"
|
||||
#include "../../../src/jsimd.h"
|
||||
#include "../../../src/jdct.h"
|
||||
#include "../../../src/jsimddct.h"
|
||||
#include "../../jsimd.h"
|
||||
#include "../jchuff.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
JOCTET *jsimd_huff_encode_one_block_neon(void *state, JOCTET *buffer,
|
||||
JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl,
|
||||
c_derived_tbl *actbl)
|
||||
{
|
||||
uint8_t block_nbits[DCTSIZE2];
|
||||
uint16_t block_diff[DCTSIZE2];
|
||||
|
||||
/* Load rows of coefficients from DCT block in zig-zag order. */
|
||||
|
||||
/* Compute DC coefficient difference value. (F.1.1.5.1) */
|
||||
int16x8_t row0 = vdupq_n_s16(block[0] - last_dc_val);
|
||||
row0 = vld1q_lane_s16(block + 1, row0, 1);
|
||||
row0 = vld1q_lane_s16(block + 8, row0, 2);
|
||||
row0 = vld1q_lane_s16(block + 16, row0, 3);
|
||||
row0 = vld1q_lane_s16(block + 9, row0, 4);
|
||||
row0 = vld1q_lane_s16(block + 2, row0, 5);
|
||||
row0 = vld1q_lane_s16(block + 3, row0, 6);
|
||||
row0 = vld1q_lane_s16(block + 10, row0, 7);
|
||||
|
||||
int16x8_t row1 = vld1q_dup_s16(block + 17);
|
||||
row1 = vld1q_lane_s16(block + 24, row1, 1);
|
||||
row1 = vld1q_lane_s16(block + 32, row1, 2);
|
||||
row1 = vld1q_lane_s16(block + 25, row1, 3);
|
||||
row1 = vld1q_lane_s16(block + 18, row1, 4);
|
||||
row1 = vld1q_lane_s16(block + 11, row1, 5);
|
||||
row1 = vld1q_lane_s16(block + 4, row1, 6);
|
||||
row1 = vld1q_lane_s16(block + 5, row1, 7);
|
||||
|
||||
int16x8_t row2 = vld1q_dup_s16(block + 12);
|
||||
row2 = vld1q_lane_s16(block + 19, row2, 1);
|
||||
row2 = vld1q_lane_s16(block + 26, row2, 2);
|
||||
row2 = vld1q_lane_s16(block + 33, row2, 3);
|
||||
row2 = vld1q_lane_s16(block + 40, row2, 4);
|
||||
row2 = vld1q_lane_s16(block + 48, row2, 5);
|
||||
row2 = vld1q_lane_s16(block + 41, row2, 6);
|
||||
row2 = vld1q_lane_s16(block + 34, row2, 7);
|
||||
|
||||
int16x8_t row3 = vld1q_dup_s16(block + 27);
|
||||
row3 = vld1q_lane_s16(block + 20, row3, 1);
|
||||
row3 = vld1q_lane_s16(block + 13, row3, 2);
|
||||
row3 = vld1q_lane_s16(block + 6, row3, 3);
|
||||
row3 = vld1q_lane_s16(block + 7, row3, 4);
|
||||
row3 = vld1q_lane_s16(block + 14, row3, 5);
|
||||
row3 = vld1q_lane_s16(block + 21, row3, 6);
|
||||
row3 = vld1q_lane_s16(block + 28, row3, 7);
|
||||
|
||||
int16x8_t abs_row0 = vabsq_s16(row0);
|
||||
int16x8_t abs_row1 = vabsq_s16(row1);
|
||||
int16x8_t abs_row2 = vabsq_s16(row2);
|
||||
int16x8_t abs_row3 = vabsq_s16(row3);
|
||||
|
||||
int16x8_t row0_lz = vclzq_s16(abs_row0);
|
||||
int16x8_t row1_lz = vclzq_s16(abs_row1);
|
||||
int16x8_t row2_lz = vclzq_s16(abs_row2);
|
||||
int16x8_t row3_lz = vclzq_s16(abs_row3);
|
||||
|
||||
/* Compute number of bits required to represent each coefficient. */
|
||||
uint8x8_t row0_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row0_lz)));
|
||||
uint8x8_t row1_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row1_lz)));
|
||||
uint8x8_t row2_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row2_lz)));
|
||||
uint8x8_t row3_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row3_lz)));
|
||||
|
||||
vst1_u8(block_nbits + 0 * DCTSIZE, row0_nbits);
|
||||
vst1_u8(block_nbits + 1 * DCTSIZE, row1_nbits);
|
||||
vst1_u8(block_nbits + 2 * DCTSIZE, row2_nbits);
|
||||
vst1_u8(block_nbits + 3 * DCTSIZE, row3_nbits);
|
||||
|
||||
uint16x8_t row0_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row0, 15)),
|
||||
vnegq_s16(row0_lz));
|
||||
uint16x8_t row1_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row1, 15)),
|
||||
vnegq_s16(row1_lz));
|
||||
uint16x8_t row2_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row2, 15)),
|
||||
vnegq_s16(row2_lz));
|
||||
uint16x8_t row3_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row3, 15)),
|
||||
vnegq_s16(row3_lz));
|
||||
|
||||
uint16x8_t row0_diff = veorq_u16(vreinterpretq_u16_s16(abs_row0), row0_mask);
|
||||
uint16x8_t row1_diff = veorq_u16(vreinterpretq_u16_s16(abs_row1), row1_mask);
|
||||
uint16x8_t row2_diff = veorq_u16(vreinterpretq_u16_s16(abs_row2), row2_mask);
|
||||
uint16x8_t row3_diff = veorq_u16(vreinterpretq_u16_s16(abs_row3), row3_mask);
|
||||
|
||||
/* Store diff values for rows 0, 1, 2, and 3. */
|
||||
vst1q_u16(block_diff + 0 * DCTSIZE, row0_diff);
|
||||
vst1q_u16(block_diff + 1 * DCTSIZE, row1_diff);
|
||||
vst1q_u16(block_diff + 2 * DCTSIZE, row2_diff);
|
||||
vst1q_u16(block_diff + 3 * DCTSIZE, row3_diff);
|
||||
|
||||
/* Load last four rows of coefficients from DCT block in zig-zag order. */
|
||||
int16x8_t row4 = vld1q_dup_s16(block + 35);
|
||||
row4 = vld1q_lane_s16(block + 42, row4, 1);
|
||||
row4 = vld1q_lane_s16(block + 49, row4, 2);
|
||||
row4 = vld1q_lane_s16(block + 56, row4, 3);
|
||||
row4 = vld1q_lane_s16(block + 57, row4, 4);
|
||||
row4 = vld1q_lane_s16(block + 50, row4, 5);
|
||||
row4 = vld1q_lane_s16(block + 43, row4, 6);
|
||||
row4 = vld1q_lane_s16(block + 36, row4, 7);
|
||||
|
||||
int16x8_t row5 = vld1q_dup_s16(block + 29);
|
||||
row5 = vld1q_lane_s16(block + 22, row5, 1);
|
||||
row5 = vld1q_lane_s16(block + 15, row5, 2);
|
||||
row5 = vld1q_lane_s16(block + 23, row5, 3);
|
||||
row5 = vld1q_lane_s16(block + 30, row5, 4);
|
||||
row5 = vld1q_lane_s16(block + 37, row5, 5);
|
||||
row5 = vld1q_lane_s16(block + 44, row5, 6);
|
||||
row5 = vld1q_lane_s16(block + 51, row5, 7);
|
||||
|
||||
int16x8_t row6 = vld1q_dup_s16(block + 58);
|
||||
row6 = vld1q_lane_s16(block + 59, row6, 1);
|
||||
row6 = vld1q_lane_s16(block + 52, row6, 2);
|
||||
row6 = vld1q_lane_s16(block + 45, row6, 3);
|
||||
row6 = vld1q_lane_s16(block + 38, row6, 4);
|
||||
row6 = vld1q_lane_s16(block + 31, row6, 5);
|
||||
row6 = vld1q_lane_s16(block + 39, row6, 6);
|
||||
row6 = vld1q_lane_s16(block + 46, row6, 7);
|
||||
|
||||
int16x8_t row7 = vld1q_dup_s16(block + 53);
|
||||
row7 = vld1q_lane_s16(block + 60, row7, 1);
|
||||
row7 = vld1q_lane_s16(block + 61, row7, 2);
|
||||
row7 = vld1q_lane_s16(block + 54, row7, 3);
|
||||
row7 = vld1q_lane_s16(block + 47, row7, 4);
|
||||
row7 = vld1q_lane_s16(block + 55, row7, 5);
|
||||
row7 = vld1q_lane_s16(block + 62, row7, 6);
|
||||
row7 = vld1q_lane_s16(block + 63, row7, 7);
|
||||
|
||||
int16x8_t abs_row4 = vabsq_s16(row4);
|
||||
int16x8_t abs_row5 = vabsq_s16(row5);
|
||||
int16x8_t abs_row6 = vabsq_s16(row6);
|
||||
int16x8_t abs_row7 = vabsq_s16(row7);
|
||||
|
||||
int16x8_t row4_lz = vclzq_s16(abs_row4);
|
||||
int16x8_t row5_lz = vclzq_s16(abs_row5);
|
||||
int16x8_t row6_lz = vclzq_s16(abs_row6);
|
||||
int16x8_t row7_lz = vclzq_s16(abs_row7);
|
||||
|
||||
/* Compute number of bits required to represent each coefficient. */
|
||||
uint8x8_t row4_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row4_lz)));
|
||||
uint8x8_t row5_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row5_lz)));
|
||||
uint8x8_t row6_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row6_lz)));
|
||||
uint8x8_t row7_nbits = vsub_u8(vdup_n_u8(16),
|
||||
vmovn_u16(vreinterpretq_u16_s16(row7_lz)));
|
||||
|
||||
vst1_u8(block_nbits + 4 * DCTSIZE, row4_nbits);
|
||||
vst1_u8(block_nbits + 5 * DCTSIZE, row5_nbits);
|
||||
vst1_u8(block_nbits + 6 * DCTSIZE, row6_nbits);
|
||||
vst1_u8(block_nbits + 7 * DCTSIZE, row7_nbits);
|
||||
|
||||
uint16x8_t row4_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row4, 15)),
|
||||
vnegq_s16(row4_lz));
|
||||
uint16x8_t row5_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row5, 15)),
|
||||
vnegq_s16(row5_lz));
|
||||
uint16x8_t row6_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row6, 15)),
|
||||
vnegq_s16(row6_lz));
|
||||
uint16x8_t row7_mask =
|
||||
vshlq_u16(vreinterpretq_u16_s16(vshrq_n_s16(row7, 15)),
|
||||
vnegq_s16(row7_lz));
|
||||
|
||||
uint16x8_t row4_diff = veorq_u16(vreinterpretq_u16_s16(abs_row4), row4_mask);
|
||||
uint16x8_t row5_diff = veorq_u16(vreinterpretq_u16_s16(abs_row5), row5_mask);
|
||||
uint16x8_t row6_diff = veorq_u16(vreinterpretq_u16_s16(abs_row6), row6_mask);
|
||||
uint16x8_t row7_diff = veorq_u16(vreinterpretq_u16_s16(abs_row7), row7_mask);
|
||||
|
||||
/* Store diff values for rows 4, 5, 6, and 7. */
|
||||
vst1q_u16(block_diff + 4 * DCTSIZE, row4_diff);
|
||||
vst1q_u16(block_diff + 5 * DCTSIZE, row5_diff);
|
||||
vst1q_u16(block_diff + 6 * DCTSIZE, row6_diff);
|
||||
vst1q_u16(block_diff + 7 * DCTSIZE, row7_diff);
|
||||
|
||||
/* Construct bitmap to accelerate encoding of AC coefficients. A set bit
|
||||
* means that the corresponding coefficient != 0.
|
||||
*/
|
||||
uint8x8_t row0_nbits_gt0 = vcgt_u8(row0_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row1_nbits_gt0 = vcgt_u8(row1_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row2_nbits_gt0 = vcgt_u8(row2_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row3_nbits_gt0 = vcgt_u8(row3_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row4_nbits_gt0 = vcgt_u8(row4_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row5_nbits_gt0 = vcgt_u8(row5_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row6_nbits_gt0 = vcgt_u8(row6_nbits, vdup_n_u8(0));
|
||||
uint8x8_t row7_nbits_gt0 = vcgt_u8(row7_nbits, vdup_n_u8(0));
|
||||
|
||||
/* { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 } */
|
||||
const uint8x8_t bitmap_mask =
|
||||
vreinterpret_u8_u64(vmov_n_u64(0x0102040810204080));
|
||||
|
||||
row0_nbits_gt0 = vand_u8(row0_nbits_gt0, bitmap_mask);
|
||||
row1_nbits_gt0 = vand_u8(row1_nbits_gt0, bitmap_mask);
|
||||
row2_nbits_gt0 = vand_u8(row2_nbits_gt0, bitmap_mask);
|
||||
row3_nbits_gt0 = vand_u8(row3_nbits_gt0, bitmap_mask);
|
||||
row4_nbits_gt0 = vand_u8(row4_nbits_gt0, bitmap_mask);
|
||||
row5_nbits_gt0 = vand_u8(row5_nbits_gt0, bitmap_mask);
|
||||
row6_nbits_gt0 = vand_u8(row6_nbits_gt0, bitmap_mask);
|
||||
row7_nbits_gt0 = vand_u8(row7_nbits_gt0, bitmap_mask);
|
||||
|
||||
uint8x8_t bitmap_rows_10 = vpadd_u8(row1_nbits_gt0, row0_nbits_gt0);
|
||||
uint8x8_t bitmap_rows_32 = vpadd_u8(row3_nbits_gt0, row2_nbits_gt0);
|
||||
uint8x8_t bitmap_rows_54 = vpadd_u8(row5_nbits_gt0, row4_nbits_gt0);
|
||||
uint8x8_t bitmap_rows_76 = vpadd_u8(row7_nbits_gt0, row6_nbits_gt0);
|
||||
uint8x8_t bitmap_rows_3210 = vpadd_u8(bitmap_rows_32, bitmap_rows_10);
|
||||
uint8x8_t bitmap_rows_7654 = vpadd_u8(bitmap_rows_76, bitmap_rows_54);
|
||||
uint8x8_t bitmap = vpadd_u8(bitmap_rows_7654, bitmap_rows_3210);
|
||||
|
||||
/* Shift left to remove DC bit. */
|
||||
bitmap = vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(bitmap), 1));
|
||||
/* Move bitmap to 32-bit scalar registers. */
|
||||
uint32_t bitmap_1_32 = vget_lane_u32(vreinterpret_u32_u8(bitmap), 1);
|
||||
uint32_t bitmap_33_63 = vget_lane_u32(vreinterpret_u32_u8(bitmap), 0);
|
||||
|
||||
/* Set up state and bit buffer for output bitstream. */
|
||||
working_state *state_ptr = (working_state *)state;
|
||||
int free_bits = state_ptr->cur.free_bits;
|
||||
size_t put_buffer = state_ptr->cur.put_buffer;
|
||||
|
||||
/* Encode DC coefficient. */
|
||||
|
||||
unsigned int nbits = block_nbits[0];
|
||||
/* Emit Huffman-coded symbol and additional diff bits. */
|
||||
unsigned int diff = block_diff[0];
|
||||
PUT_CODE(dctbl->ehufco[nbits], dctbl->ehufsi[nbits], diff)
|
||||
|
||||
/* Encode AC coefficients. */
|
||||
|
||||
unsigned int r = 0; /* r = run length of zeros */
|
||||
unsigned int i = 1; /* i = number of coefficients encoded */
|
||||
/* Code and size information for a run length of 16 zero coefficients */
|
||||
const unsigned int code_0xf0 = actbl->ehufco[0xf0];
|
||||
const unsigned int size_0xf0 = actbl->ehufsi[0xf0];
|
||||
|
||||
while (bitmap_1_32 != 0) {
|
||||
r = BUILTIN_CLZ(bitmap_1_32);
|
||||
i += r;
|
||||
bitmap_1_32 <<= r;
|
||||
nbits = block_nbits[i];
|
||||
diff = block_diff[i];
|
||||
while (r > 15) {
|
||||
/* If run length > 15, emit special run-length-16 codes. */
|
||||
PUT_BITS(code_0xf0, size_0xf0)
|
||||
r -= 16;
|
||||
}
|
||||
/* Emit Huffman symbol for run length / number of bits. (F.1.2.2.1) */
|
||||
unsigned int rs = (r << 4) + nbits;
|
||||
PUT_CODE(actbl->ehufco[rs], actbl->ehufsi[rs], diff)
|
||||
i++;
|
||||
bitmap_1_32 <<= 1;
|
||||
}
|
||||
|
||||
r = 33 - i;
|
||||
i = 33;
|
||||
|
||||
while (bitmap_33_63 != 0) {
|
||||
unsigned int leading_zeros = BUILTIN_CLZ(bitmap_33_63);
|
||||
r += leading_zeros;
|
||||
i += leading_zeros;
|
||||
bitmap_33_63 <<= leading_zeros;
|
||||
nbits = block_nbits[i];
|
||||
diff = block_diff[i];
|
||||
while (r > 15) {
|
||||
/* If run length > 15, emit special run-length-16 codes. */
|
||||
PUT_BITS(code_0xf0, size_0xf0)
|
||||
r -= 16;
|
||||
}
|
||||
/* Emit Huffman symbol for run length / number of bits. (F.1.2.2.1) */
|
||||
unsigned int rs = (r << 4) + nbits;
|
||||
PUT_CODE(actbl->ehufco[rs], actbl->ehufsi[rs], diff)
|
||||
r = 0;
|
||||
i++;
|
||||
bitmap_33_63 <<= 1;
|
||||
}
|
||||
|
||||
/* If the last coefficient(s) were zero, emit an end-of-block (EOB) code.
|
||||
* The value of RS for the EOB code is 0.
|
||||
*/
|
||||
if (i != 64) {
|
||||
PUT_BITS(actbl->ehufco[0], actbl->ehufsi[0])
|
||||
}
|
||||
|
||||
state_ptr->cur.put_buffer = put_buffer;
|
||||
state_ptr->cur.free_bits = free_bits;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
+976
@@ -0,0 +1,976 @@
|
||||
/*
|
||||
* jsimd_arm.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011, Nokia Corporation and/or its subsidiary(-ies).
|
||||
* Copyright (C) 2009-2011, 2013-2014, 2016, 2018, 2022, 2024, D. R. Commander.
|
||||
* Copyright (C) 2015-2016, 2018, 2022, Matthieu Darbois.
|
||||
* Copyright (C) 2019, Google LLC.
|
||||
* Copyright (C) 2020, Arm Limited.
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* For conditions of distribution and use, see copyright notice in jsimdext.inc
|
||||
*
|
||||
* This file contains the interface between the "normal" portions
|
||||
* of the library and the SIMD implementations when running on a
|
||||
* 32-bit Arm architecture.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../../src/jinclude.h"
|
||||
#include "../../../src/jpeglib.h"
|
||||
#include "../../../src/jsimd.h"
|
||||
#include "../../../src/jdct.h"
|
||||
#include "../../../src/jsimddct.h"
|
||||
#include "../../jsimd.h"
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
static THREAD_LOCAL unsigned int simd_support = ~0;
|
||||
static THREAD_LOCAL unsigned int simd_huffman = 1;
|
||||
|
||||
#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
|
||||
|
||||
#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
|
||||
|
||||
LOCAL(int)
|
||||
check_feature(char *buffer, char *feature)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (*feature == 0)
|
||||
return 0;
|
||||
if (strncmp(buffer, "Features", 8) != 0)
|
||||
return 0;
|
||||
buffer += 8;
|
||||
while (isspace(*buffer))
|
||||
buffer++;
|
||||
|
||||
/* Check if 'feature' is present in the buffer as a separate word */
|
||||
while ((p = strstr(buffer, feature))) {
|
||||
if (p > buffer && !isspace(*(p - 1))) {
|
||||
buffer++;
|
||||
continue;
|
||||
}
|
||||
p += strlen(feature);
|
||||
if (*p != 0 && !isspace(*p)) {
|
||||
buffer++;
|
||||
continue;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOCAL(int)
|
||||
parse_proc_cpuinfo(int bufsize)
|
||||
{
|
||||
char *buffer = (char *)malloc(bufsize);
|
||||
FILE *fd;
|
||||
|
||||
simd_support = 0;
|
||||
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
fd = fopen("/proc/cpuinfo", "r");
|
||||
if (fd) {
|
||||
while (fgets(buffer, bufsize, fd)) {
|
||||
if (!strchr(buffer, '\n') && !feof(fd)) {
|
||||
/* "impossible" happened - insufficient size of the buffer! */
|
||||
fclose(fd);
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
if (check_feature(buffer, "neon"))
|
||||
simd_support |= JSIMD_NEON;
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check what SIMD accelerations are supported.
|
||||
*/
|
||||
LOCAL(void)
|
||||
init_simd(void)
|
||||
{
|
||||
#ifndef NO_GETENV
|
||||
char env[2] = { 0 };
|
||||
#endif
|
||||
#if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__))
|
||||
int bufsize = 1024; /* an initial guess for the line buffer size limit */
|
||||
#endif
|
||||
|
||||
if (simd_support != ~0U)
|
||||
return;
|
||||
|
||||
simd_support = 0;
|
||||
|
||||
#if defined(__ARM_NEON__)
|
||||
simd_support |= JSIMD_NEON;
|
||||
#elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
|
||||
/* We still have a chance to use Neon regardless of globally used
|
||||
* -mcpu/-mfpu options passed to gcc by performing runtime detection via
|
||||
* /proc/cpuinfo parsing on linux/android */
|
||||
while (!parse_proc_cpuinfo(bufsize)) {
|
||||
bufsize *= 2;
|
||||
if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_GETENV
|
||||
/* Force different settings through environment variables */
|
||||
if (!GETENV_S(env, 2, "JSIMD_FORCENEON") && !strcmp(env, "1"))
|
||||
simd_support = JSIMD_NEON;
|
||||
if (!GETENV_S(env, 2, "JSIMD_FORCENONE") && !strcmp(env, "1"))
|
||||
simd_support = 0;
|
||||
if (!GETENV_S(env, 2, "JSIMD_NOHUFFENC") && !strcmp(env, "1"))
|
||||
simd_huffman = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_rgb_ycc(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_rgb_gray(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
void (*neonfct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
|
||||
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct = jsimd_extrgb_ycc_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct = jsimd_extrgbx_ycc_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct = jsimd_extbgr_ycc_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct = jsimd_extbgrx_ycc_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct = jsimd_extxbgr_ycc_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct = jsimd_extxrgb_ycc_convert_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct = jsimd_extrgb_ycc_convert_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
void (*neonfct) (JDIMENSION, JSAMPARRAY, JSAMPIMAGE, JDIMENSION, int);
|
||||
|
||||
switch (cinfo->in_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct = jsimd_extrgb_gray_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct = jsimd_extrgbx_gray_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct = jsimd_extbgr_gray_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct = jsimd_extbgrx_gray_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct = jsimd_extxbgr_gray_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct = jsimd_extxrgb_gray_convert_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct = jsimd_extrgb_gray_convert_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
neonfct(cinfo->image_width, input_buf, output_buf, output_row, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct = jsimd_ycc_extrgb_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct = jsimd_ycc_extrgbx_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct = jsimd_ycc_extbgr_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct = jsimd_ycc_extbgrx_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct = jsimd_ycc_extxbgr_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct = jsimd_ycc_extxrgb_convert_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct = jsimd_ycc_extrgb_convert_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,
|
||||
output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_downsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
jsimd_h2v2_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,
|
||||
compptr->v_samp_factor, compptr->width_in_blocks,
|
||||
input_data, output_data);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_downsample(j_compress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
jsimd_h2v1_downsample_neon(cinfo->image_width, cinfo->max_v_samp_factor,
|
||||
compptr->v_samp_factor, compptr->width_in_blocks,
|
||||
input_data, output_data);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
jsimd_h2v2_upsample_neon(cinfo->max_v_samp_factor, cinfo->output_width,
|
||||
input_data, output_data_ptr);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
jsimd_h2v1_upsample_neon(cinfo->max_v_samp_factor, cinfo->output_width,
|
||||
input_data, output_data_ptr);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_fancy_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_fancy_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h1v2_fancy_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
jsimd_h2v2_fancy_upsample_neon(cinfo->max_v_samp_factor,
|
||||
compptr->downsampled_width, input_data,
|
||||
output_data_ptr);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
jsimd_h2v1_fancy_upsample_neon(cinfo->max_v_samp_factor,
|
||||
compptr->downsampled_width, input_data,
|
||||
output_data_ptr);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
jsimd_h1v2_fancy_upsample_neon(cinfo->max_v_samp_factor,
|
||||
compptr->downsampled_width, input_data,
|
||||
output_data_ptr);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_merged_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_merged_upsample(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||
{
|
||||
void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct = jsimd_h2v2_extrgb_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct = jsimd_h2v2_extrgbx_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct = jsimd_h2v2_extbgr_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct = jsimd_h2v2_extbgrx_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct = jsimd_h2v2_extxbgr_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct = jsimd_h2v2_extxrgb_merged_upsample_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct = jsimd_h2v2_extrgb_merged_upsample_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
neonfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_merged_upsample(j_decompress_ptr cinfo, JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf)
|
||||
{
|
||||
void (*neonfct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
|
||||
|
||||
switch (cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct = jsimd_h2v1_extrgb_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct = jsimd_h2v1_extrgbx_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct = jsimd_h2v1_extbgr_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct = jsimd_h2v1_extbgrx_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct = jsimd_h2v1_extxbgr_merged_upsample_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct = jsimd_h2v1_extxrgb_merged_upsample_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct = jsimd_h2v1_extrgb_merged_upsample_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
neonfct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(DCTELEM) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp_float(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
DCTELEM *workspace)
|
||||
{
|
||||
jsimd_convsamp_neon(sample_data, start_col, workspace);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
FAST_FLOAT *workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_islow(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(DCTELEM) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_ifast(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(DCTELEM) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_float(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_islow(DCTELEM *data)
|
||||
{
|
||||
jsimd_fdct_islow_neon(data);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_ifast(DCTELEM *data)
|
||||
{
|
||||
jsimd_fdct_ifast_neon(data);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_float(FAST_FLOAT *data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (sizeof(DCTELEM) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize_float(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, DCTELEM *workspace)
|
||||
{
|
||||
jsimd_quantize_neon(coef_block, divisors, workspace);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors,
|
||||
FAST_FLOAT *workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_2x2(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_4x4(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_2x2(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf, output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_4x4(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf, output_col);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_islow(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_ifast(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(IFAST_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
if (IFAST_SCALE_BITS != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_float(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_islow(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_ifast(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_float(j_decompress_ptr cinfo, jpeg_component_info *compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_huff_encode_one_block(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON && simd_huffman)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(JOCTET *)
|
||||
jsimd_huff_encode_one_block(void *state, JOCTET *buffer, JCOEFPTR block,
|
||||
int last_dc_val, c_derived_tbl *dctbl,
|
||||
c_derived_tbl *actbl)
|
||||
{
|
||||
return jsimd_huff_encode_one_block_neon(state, buffer, block, last_dc_val,
|
||||
dctbl, actbl);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_encode_mcu_AC_first_prepare(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_encode_mcu_AC_first_prepare(const JCOEF *block,
|
||||
const int *jpeg_natural_order_start, int Sl,
|
||||
int Al, UJCOEF *values, size_t *zerobits)
|
||||
{
|
||||
jsimd_encode_mcu_AC_first_prepare_neon(block, jpeg_natural_order_start,
|
||||
Sl, Al, values, zerobits);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_encode_mcu_AC_refine_prepare(void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_encode_mcu_AC_refine_prepare(const JCOEF *block,
|
||||
const int *jpeg_natural_order_start, int Sl,
|
||||
int Al, UJCOEF *absvalues, size_t *bits)
|
||||
{
|
||||
return jsimd_encode_mcu_AC_refine_prepare_neon(block,
|
||||
jpeg_natural_order_start, Sl,
|
||||
Al, absvalues, bits);
|
||||
}
|
||||
+1200
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
* jccolext-neon.c - colorspace conversion (64-bit Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* This file is included by jccolor-neon.c */
|
||||
|
||||
|
||||
/* RGB -> YCbCr conversion is defined by the following equations:
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
* Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128
|
||||
* Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128
|
||||
*
|
||||
* Avoid floating point arithmetic by using shifted integer constants:
|
||||
* 0.29899597 = 19595 * 2^-16
|
||||
* 0.58700561 = 38470 * 2^-16
|
||||
* 0.11399841 = 7471 * 2^-16
|
||||
* 0.16874695 = 11059 * 2^-16
|
||||
* 0.33125305 = 21709 * 2^-16
|
||||
* 0.50000000 = 32768 * 2^-16
|
||||
* 0.41868592 = 27439 * 2^-16
|
||||
* 0.08131409 = 5329 * 2^-16
|
||||
* These constants are defined in jccolor-neon.c
|
||||
*
|
||||
* We add the fixed-point equivalent of 0.5 to Cb and Cr, which effectively
|
||||
* rounds up or down the result via integer truncation.
|
||||
*/
|
||||
|
||||
void jsimd_rgb_ycc_convert_neon(JDIMENSION image_width, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
/* Pointer to RGB(X/A) input data */
|
||||
JSAMPROW inptr;
|
||||
/* Pointers to Y, Cb, and Cr output data */
|
||||
JSAMPROW outptr0, outptr1, outptr2;
|
||||
/* Allocate temporary buffer for final (image_width % 16) pixels in row. */
|
||||
ALIGN(16) uint8_t tmp_buf[16 * RGB_PIXELSIZE];
|
||||
|
||||
/* Set up conversion constants. */
|
||||
const uint16x8_t consts = vld1q_u16(jsimd_rgb_ycc_neon_consts);
|
||||
const uint32x4_t scaled_128_5 = vdupq_n_u32((128 << 16) + 32767);
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr0 = output_buf[0][output_row];
|
||||
outptr1 = output_buf[1][output_row];
|
||||
outptr2 = output_buf[2][output_row];
|
||||
output_row++;
|
||||
|
||||
int cols_remaining = image_width;
|
||||
for (; cols_remaining >= 16; cols_remaining -= 16) {
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x16x4_t input_pixels = vld4q_u8(inptr);
|
||||
#else
|
||||
uint8x16x3_t input_pixels = vld3q_u8(inptr);
|
||||
#endif
|
||||
uint16x8_t r_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t g_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t b_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_BLUE]));
|
||||
uint16x8_t r_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t g_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t b_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_BLUE]));
|
||||
|
||||
/* Compute Y = 0.29900 * R + 0.58700 * G + 0.11400 * B */
|
||||
uint32x4_t y_ll = vmull_laneq_u16(vget_low_u16(r_l), consts, 0);
|
||||
y_ll = vmlal_laneq_u16(y_ll, vget_low_u16(g_l), consts, 1);
|
||||
y_ll = vmlal_laneq_u16(y_ll, vget_low_u16(b_l), consts, 2);
|
||||
uint32x4_t y_lh = vmull_laneq_u16(vget_high_u16(r_l), consts, 0);
|
||||
y_lh = vmlal_laneq_u16(y_lh, vget_high_u16(g_l), consts, 1);
|
||||
y_lh = vmlal_laneq_u16(y_lh, vget_high_u16(b_l), consts, 2);
|
||||
uint32x4_t y_hl = vmull_laneq_u16(vget_low_u16(r_h), consts, 0);
|
||||
y_hl = vmlal_laneq_u16(y_hl, vget_low_u16(g_h), consts, 1);
|
||||
y_hl = vmlal_laneq_u16(y_hl, vget_low_u16(b_h), consts, 2);
|
||||
uint32x4_t y_hh = vmull_laneq_u16(vget_high_u16(r_h), consts, 0);
|
||||
y_hh = vmlal_laneq_u16(y_hh, vget_high_u16(g_h), consts, 1);
|
||||
y_hh = vmlal_laneq_u16(y_hh, vget_high_u16(b_h), consts, 2);
|
||||
|
||||
/* Compute Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128 */
|
||||
uint32x4_t cb_ll = scaled_128_5;
|
||||
cb_ll = vmlsl_laneq_u16(cb_ll, vget_low_u16(r_l), consts, 3);
|
||||
cb_ll = vmlsl_laneq_u16(cb_ll, vget_low_u16(g_l), consts, 4);
|
||||
cb_ll = vmlal_laneq_u16(cb_ll, vget_low_u16(b_l), consts, 5);
|
||||
uint32x4_t cb_lh = scaled_128_5;
|
||||
cb_lh = vmlsl_laneq_u16(cb_lh, vget_high_u16(r_l), consts, 3);
|
||||
cb_lh = vmlsl_laneq_u16(cb_lh, vget_high_u16(g_l), consts, 4);
|
||||
cb_lh = vmlal_laneq_u16(cb_lh, vget_high_u16(b_l), consts, 5);
|
||||
uint32x4_t cb_hl = scaled_128_5;
|
||||
cb_hl = vmlsl_laneq_u16(cb_hl, vget_low_u16(r_h), consts, 3);
|
||||
cb_hl = vmlsl_laneq_u16(cb_hl, vget_low_u16(g_h), consts, 4);
|
||||
cb_hl = vmlal_laneq_u16(cb_hl, vget_low_u16(b_h), consts, 5);
|
||||
uint32x4_t cb_hh = scaled_128_5;
|
||||
cb_hh = vmlsl_laneq_u16(cb_hh, vget_high_u16(r_h), consts, 3);
|
||||
cb_hh = vmlsl_laneq_u16(cb_hh, vget_high_u16(g_h), consts, 4);
|
||||
cb_hh = vmlal_laneq_u16(cb_hh, vget_high_u16(b_h), consts, 5);
|
||||
|
||||
/* Compute Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128 */
|
||||
uint32x4_t cr_ll = scaled_128_5;
|
||||
cr_ll = vmlal_laneq_u16(cr_ll, vget_low_u16(r_l), consts, 5);
|
||||
cr_ll = vmlsl_laneq_u16(cr_ll, vget_low_u16(g_l), consts, 6);
|
||||
cr_ll = vmlsl_laneq_u16(cr_ll, vget_low_u16(b_l), consts, 7);
|
||||
uint32x4_t cr_lh = scaled_128_5;
|
||||
cr_lh = vmlal_laneq_u16(cr_lh, vget_high_u16(r_l), consts, 5);
|
||||
cr_lh = vmlsl_laneq_u16(cr_lh, vget_high_u16(g_l), consts, 6);
|
||||
cr_lh = vmlsl_laneq_u16(cr_lh, vget_high_u16(b_l), consts, 7);
|
||||
uint32x4_t cr_hl = scaled_128_5;
|
||||
cr_hl = vmlal_laneq_u16(cr_hl, vget_low_u16(r_h), consts, 5);
|
||||
cr_hl = vmlsl_laneq_u16(cr_hl, vget_low_u16(g_h), consts, 6);
|
||||
cr_hl = vmlsl_laneq_u16(cr_hl, vget_low_u16(b_h), consts, 7);
|
||||
uint32x4_t cr_hh = scaled_128_5;
|
||||
cr_hh = vmlal_laneq_u16(cr_hh, vget_high_u16(r_h), consts, 5);
|
||||
cr_hh = vmlsl_laneq_u16(cr_hh, vget_high_u16(g_h), consts, 6);
|
||||
cr_hh = vmlsl_laneq_u16(cr_hh, vget_high_u16(b_h), consts, 7);
|
||||
|
||||
/* Descale Y values (rounding right shift) and narrow to 16-bit. */
|
||||
uint16x8_t y_l = vcombine_u16(vrshrn_n_u32(y_ll, 16),
|
||||
vrshrn_n_u32(y_lh, 16));
|
||||
uint16x8_t y_h = vcombine_u16(vrshrn_n_u32(y_hl, 16),
|
||||
vrshrn_n_u32(y_hh, 16));
|
||||
/* Descale Cb values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cb_l = vcombine_u16(vshrn_n_u32(cb_ll, 16),
|
||||
vshrn_n_u32(cb_lh, 16));
|
||||
uint16x8_t cb_h = vcombine_u16(vshrn_n_u32(cb_hl, 16),
|
||||
vshrn_n_u32(cb_hh, 16));
|
||||
/* Descale Cr values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cr_l = vcombine_u16(vshrn_n_u32(cr_ll, 16),
|
||||
vshrn_n_u32(cr_lh, 16));
|
||||
uint16x8_t cr_h = vcombine_u16(vshrn_n_u32(cr_hl, 16),
|
||||
vshrn_n_u32(cr_hh, 16));
|
||||
/* Narrow Y, Cb, and Cr values to 8-bit and store to memory. Buffer
|
||||
* overwrite is permitted up to the next multiple of ALIGN_SIZE bytes.
|
||||
*/
|
||||
vst1q_u8(outptr0, vcombine_u8(vmovn_u16(y_l), vmovn_u16(y_h)));
|
||||
vst1q_u8(outptr1, vcombine_u8(vmovn_u16(cb_l), vmovn_u16(cb_h)));
|
||||
vst1q_u8(outptr2, vcombine_u8(vmovn_u16(cr_l), vmovn_u16(cr_h)));
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr += (16 * RGB_PIXELSIZE);
|
||||
outptr0 += 16;
|
||||
outptr1 += 16;
|
||||
outptr2 += 16;
|
||||
}
|
||||
|
||||
if (cols_remaining > 8) {
|
||||
/* To prevent buffer overread by the vector load instructions, the last
|
||||
* (image_width % 16) columns of data are first memcopied to a temporary
|
||||
* buffer large enough to accommodate the vector load.
|
||||
*/
|
||||
memcpy(tmp_buf, inptr, cols_remaining * RGB_PIXELSIZE);
|
||||
inptr = tmp_buf;
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x16x4_t input_pixels = vld4q_u8(inptr);
|
||||
#else
|
||||
uint8x16x3_t input_pixels = vld3q_u8(inptr);
|
||||
#endif
|
||||
uint16x8_t r_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t g_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t b_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_BLUE]));
|
||||
uint16x8_t r_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t g_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t b_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_BLUE]));
|
||||
|
||||
/* Compute Y = 0.29900 * R + 0.58700 * G + 0.11400 * B */
|
||||
uint32x4_t y_ll = vmull_laneq_u16(vget_low_u16(r_l), consts, 0);
|
||||
y_ll = vmlal_laneq_u16(y_ll, vget_low_u16(g_l), consts, 1);
|
||||
y_ll = vmlal_laneq_u16(y_ll, vget_low_u16(b_l), consts, 2);
|
||||
uint32x4_t y_lh = vmull_laneq_u16(vget_high_u16(r_l), consts, 0);
|
||||
y_lh = vmlal_laneq_u16(y_lh, vget_high_u16(g_l), consts, 1);
|
||||
y_lh = vmlal_laneq_u16(y_lh, vget_high_u16(b_l), consts, 2);
|
||||
uint32x4_t y_hl = vmull_laneq_u16(vget_low_u16(r_h), consts, 0);
|
||||
y_hl = vmlal_laneq_u16(y_hl, vget_low_u16(g_h), consts, 1);
|
||||
y_hl = vmlal_laneq_u16(y_hl, vget_low_u16(b_h), consts, 2);
|
||||
uint32x4_t y_hh = vmull_laneq_u16(vget_high_u16(r_h), consts, 0);
|
||||
y_hh = vmlal_laneq_u16(y_hh, vget_high_u16(g_h), consts, 1);
|
||||
y_hh = vmlal_laneq_u16(y_hh, vget_high_u16(b_h), consts, 2);
|
||||
|
||||
/* Compute Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128 */
|
||||
uint32x4_t cb_ll = scaled_128_5;
|
||||
cb_ll = vmlsl_laneq_u16(cb_ll, vget_low_u16(r_l), consts, 3);
|
||||
cb_ll = vmlsl_laneq_u16(cb_ll, vget_low_u16(g_l), consts, 4);
|
||||
cb_ll = vmlal_laneq_u16(cb_ll, vget_low_u16(b_l), consts, 5);
|
||||
uint32x4_t cb_lh = scaled_128_5;
|
||||
cb_lh = vmlsl_laneq_u16(cb_lh, vget_high_u16(r_l), consts, 3);
|
||||
cb_lh = vmlsl_laneq_u16(cb_lh, vget_high_u16(g_l), consts, 4);
|
||||
cb_lh = vmlal_laneq_u16(cb_lh, vget_high_u16(b_l), consts, 5);
|
||||
uint32x4_t cb_hl = scaled_128_5;
|
||||
cb_hl = vmlsl_laneq_u16(cb_hl, vget_low_u16(r_h), consts, 3);
|
||||
cb_hl = vmlsl_laneq_u16(cb_hl, vget_low_u16(g_h), consts, 4);
|
||||
cb_hl = vmlal_laneq_u16(cb_hl, vget_low_u16(b_h), consts, 5);
|
||||
uint32x4_t cb_hh = scaled_128_5;
|
||||
cb_hh = vmlsl_laneq_u16(cb_hh, vget_high_u16(r_h), consts, 3);
|
||||
cb_hh = vmlsl_laneq_u16(cb_hh, vget_high_u16(g_h), consts, 4);
|
||||
cb_hh = vmlal_laneq_u16(cb_hh, vget_high_u16(b_h), consts, 5);
|
||||
|
||||
/* Compute Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128 */
|
||||
uint32x4_t cr_ll = scaled_128_5;
|
||||
cr_ll = vmlal_laneq_u16(cr_ll, vget_low_u16(r_l), consts, 5);
|
||||
cr_ll = vmlsl_laneq_u16(cr_ll, vget_low_u16(g_l), consts, 6);
|
||||
cr_ll = vmlsl_laneq_u16(cr_ll, vget_low_u16(b_l), consts, 7);
|
||||
uint32x4_t cr_lh = scaled_128_5;
|
||||
cr_lh = vmlal_laneq_u16(cr_lh, vget_high_u16(r_l), consts, 5);
|
||||
cr_lh = vmlsl_laneq_u16(cr_lh, vget_high_u16(g_l), consts, 6);
|
||||
cr_lh = vmlsl_laneq_u16(cr_lh, vget_high_u16(b_l), consts, 7);
|
||||
uint32x4_t cr_hl = scaled_128_5;
|
||||
cr_hl = vmlal_laneq_u16(cr_hl, vget_low_u16(r_h), consts, 5);
|
||||
cr_hl = vmlsl_laneq_u16(cr_hl, vget_low_u16(g_h), consts, 6);
|
||||
cr_hl = vmlsl_laneq_u16(cr_hl, vget_low_u16(b_h), consts, 7);
|
||||
uint32x4_t cr_hh = scaled_128_5;
|
||||
cr_hh = vmlal_laneq_u16(cr_hh, vget_high_u16(r_h), consts, 5);
|
||||
cr_hh = vmlsl_laneq_u16(cr_hh, vget_high_u16(g_h), consts, 6);
|
||||
cr_hh = vmlsl_laneq_u16(cr_hh, vget_high_u16(b_h), consts, 7);
|
||||
|
||||
/* Descale Y values (rounding right shift) and narrow to 16-bit. */
|
||||
uint16x8_t y_l = vcombine_u16(vrshrn_n_u32(y_ll, 16),
|
||||
vrshrn_n_u32(y_lh, 16));
|
||||
uint16x8_t y_h = vcombine_u16(vrshrn_n_u32(y_hl, 16),
|
||||
vrshrn_n_u32(y_hh, 16));
|
||||
/* Descale Cb values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cb_l = vcombine_u16(vshrn_n_u32(cb_ll, 16),
|
||||
vshrn_n_u32(cb_lh, 16));
|
||||
uint16x8_t cb_h = vcombine_u16(vshrn_n_u32(cb_hl, 16),
|
||||
vshrn_n_u32(cb_hh, 16));
|
||||
/* Descale Cr values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cr_l = vcombine_u16(vshrn_n_u32(cr_ll, 16),
|
||||
vshrn_n_u32(cr_lh, 16));
|
||||
uint16x8_t cr_h = vcombine_u16(vshrn_n_u32(cr_hl, 16),
|
||||
vshrn_n_u32(cr_hh, 16));
|
||||
/* Narrow Y, Cb, and Cr values to 8-bit and store to memory. Buffer
|
||||
* overwrite is permitted up to the next multiple of ALIGN_SIZE bytes.
|
||||
*/
|
||||
vst1q_u8(outptr0, vcombine_u8(vmovn_u16(y_l), vmovn_u16(y_h)));
|
||||
vst1q_u8(outptr1, vcombine_u8(vmovn_u16(cb_l), vmovn_u16(cb_h)));
|
||||
vst1q_u8(outptr2, vcombine_u8(vmovn_u16(cr_l), vmovn_u16(cr_h)));
|
||||
|
||||
} else if (cols_remaining > 0) {
|
||||
/* To prevent buffer overread by the vector load instructions, the last
|
||||
* (image_width % 8) columns of data are first memcopied to a temporary
|
||||
* buffer large enough to accommodate the vector load.
|
||||
*/
|
||||
memcpy(tmp_buf, inptr, cols_remaining * RGB_PIXELSIZE);
|
||||
inptr = tmp_buf;
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x8x4_t input_pixels = vld4_u8(inptr);
|
||||
#else
|
||||
uint8x8x3_t input_pixels = vld3_u8(inptr);
|
||||
#endif
|
||||
uint16x8_t r = vmovl_u8(input_pixels.val[RGB_RED]);
|
||||
uint16x8_t g = vmovl_u8(input_pixels.val[RGB_GREEN]);
|
||||
uint16x8_t b = vmovl_u8(input_pixels.val[RGB_BLUE]);
|
||||
|
||||
/* Compute Y = 0.29900 * R + 0.58700 * G + 0.11400 * B */
|
||||
uint32x4_t y_l = vmull_laneq_u16(vget_low_u16(r), consts, 0);
|
||||
y_l = vmlal_laneq_u16(y_l, vget_low_u16(g), consts, 1);
|
||||
y_l = vmlal_laneq_u16(y_l, vget_low_u16(b), consts, 2);
|
||||
uint32x4_t y_h = vmull_laneq_u16(vget_high_u16(r), consts, 0);
|
||||
y_h = vmlal_laneq_u16(y_h, vget_high_u16(g), consts, 1);
|
||||
y_h = vmlal_laneq_u16(y_h, vget_high_u16(b), consts, 2);
|
||||
|
||||
/* Compute Cb = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128 */
|
||||
uint32x4_t cb_l = scaled_128_5;
|
||||
cb_l = vmlsl_laneq_u16(cb_l, vget_low_u16(r), consts, 3);
|
||||
cb_l = vmlsl_laneq_u16(cb_l, vget_low_u16(g), consts, 4);
|
||||
cb_l = vmlal_laneq_u16(cb_l, vget_low_u16(b), consts, 5);
|
||||
uint32x4_t cb_h = scaled_128_5;
|
||||
cb_h = vmlsl_laneq_u16(cb_h, vget_high_u16(r), consts, 3);
|
||||
cb_h = vmlsl_laneq_u16(cb_h, vget_high_u16(g), consts, 4);
|
||||
cb_h = vmlal_laneq_u16(cb_h, vget_high_u16(b), consts, 5);
|
||||
|
||||
/* Compute Cr = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128 */
|
||||
uint32x4_t cr_l = scaled_128_5;
|
||||
cr_l = vmlal_laneq_u16(cr_l, vget_low_u16(r), consts, 5);
|
||||
cr_l = vmlsl_laneq_u16(cr_l, vget_low_u16(g), consts, 6);
|
||||
cr_l = vmlsl_laneq_u16(cr_l, vget_low_u16(b), consts, 7);
|
||||
uint32x4_t cr_h = scaled_128_5;
|
||||
cr_h = vmlal_laneq_u16(cr_h, vget_high_u16(r), consts, 5);
|
||||
cr_h = vmlsl_laneq_u16(cr_h, vget_high_u16(g), consts, 6);
|
||||
cr_h = vmlsl_laneq_u16(cr_h, vget_high_u16(b), consts, 7);
|
||||
|
||||
/* Descale Y values (rounding right shift) and narrow to 16-bit. */
|
||||
uint16x8_t y_u16 = vcombine_u16(vrshrn_n_u32(y_l, 16),
|
||||
vrshrn_n_u32(y_h, 16));
|
||||
/* Descale Cb values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cb_u16 = vcombine_u16(vshrn_n_u32(cb_l, 16),
|
||||
vshrn_n_u32(cb_h, 16));
|
||||
/* Descale Cr values (right shift) and narrow to 16-bit. */
|
||||
uint16x8_t cr_u16 = vcombine_u16(vshrn_n_u32(cr_l, 16),
|
||||
vshrn_n_u32(cr_h, 16));
|
||||
/* Narrow Y, Cb, and Cr values to 8-bit and store to memory. Buffer
|
||||
* overwrite is permitted up to the next multiple of ALIGN_SIZE bytes.
|
||||
*/
|
||||
vst1_u8(outptr0, vmovn_u16(y_u16));
|
||||
vst1_u8(outptr1, vmovn_u16(cb_u16));
|
||||
vst1_u8(outptr2, vmovn_u16(cr_u16));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,411 @@
|
||||
/*
|
||||
* jchuff-neon.c - Huffman entropy encoding (64-bit Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, 2022, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*
|
||||
* NOTE: All referenced figures are from
|
||||
* Recommendation ITU-T T.81 (1992) | ISO/IEC 10918-1:1994.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../../src/jinclude.h"
|
||||
#include "../../../src/jpeglib.h"
|
||||
#include "../../../src/jsimd.h"
|
||||
#include "../../../src/jdct.h"
|
||||
#include "../../../src/jsimddct.h"
|
||||
#include "../../jsimd.h"
|
||||
#include "../align.h"
|
||||
#include "../jchuff.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
ALIGN(16) static const uint8_t jsimd_huff_encode_one_block_consts[] = {
|
||||
0, 1, 2, 3, 16, 17, 32, 33,
|
||||
18, 19, 4, 5, 6, 7, 20, 21,
|
||||
34, 35, 48, 49, 255, 255, 50, 51,
|
||||
36, 37, 22, 23, 8, 9, 10, 11,
|
||||
255, 255, 6, 7, 20, 21, 34, 35,
|
||||
48, 49, 255, 255, 50, 51, 36, 37,
|
||||
54, 55, 40, 41, 26, 27, 12, 13,
|
||||
14, 15, 28, 29, 42, 43, 56, 57,
|
||||
6, 7, 20, 21, 34, 35, 48, 49,
|
||||
50, 51, 36, 37, 22, 23, 8, 9,
|
||||
26, 27, 12, 13, 255, 255, 14, 15,
|
||||
28, 29, 42, 43, 56, 57, 255, 255,
|
||||
52, 53, 54, 55, 40, 41, 26, 27,
|
||||
12, 13, 255, 255, 14, 15, 28, 29,
|
||||
26, 27, 40, 41, 42, 43, 28, 29,
|
||||
14, 15, 30, 31, 44, 45, 46, 47
|
||||
};
|
||||
|
||||
/* The AArch64 implementation of the FLUSH() macro triggers a UBSan misaligned
|
||||
* address warning because the macro sometimes writes a 64-bit value to a
|
||||
* non-64-bit-aligned address. That behavior is technically undefined per
|
||||
* the C specification, but it is supported by the AArch64 architecture and
|
||||
* compilers.
|
||||
*/
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(undefined_behavior_sanitizer)
|
||||
__attribute__((no_sanitize("alignment")))
|
||||
#endif
|
||||
#endif
|
||||
JOCTET *jsimd_huff_encode_one_block_neon(void *state, JOCTET *buffer,
|
||||
JCOEFPTR block, int last_dc_val,
|
||||
c_derived_tbl *dctbl,
|
||||
c_derived_tbl *actbl)
|
||||
{
|
||||
uint16_t block_diff[DCTSIZE2];
|
||||
|
||||
/* Load lookup table indices for rows of zig-zag ordering. */
|
||||
#ifdef HAVE_VLD1Q_U8_X4
|
||||
const uint8x16x4_t idx_rows_0123 =
|
||||
vld1q_u8_x4(jsimd_huff_encode_one_block_consts + 0 * DCTSIZE);
|
||||
const uint8x16x4_t idx_rows_4567 =
|
||||
vld1q_u8_x4(jsimd_huff_encode_one_block_consts + 8 * DCTSIZE);
|
||||
#else
|
||||
/* GCC does not currently support intrinsics vl1dq_<type>_x4(). */
|
||||
const uint8x16x4_t idx_rows_0123 = { {
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 0 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 2 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 4 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 6 * DCTSIZE)
|
||||
} };
|
||||
const uint8x16x4_t idx_rows_4567 = { {
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 8 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 10 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 12 * DCTSIZE),
|
||||
vld1q_u8(jsimd_huff_encode_one_block_consts + 14 * DCTSIZE)
|
||||
} };
|
||||
#endif
|
||||
|
||||
/* Load 8x8 block of DCT coefficients. */
|
||||
#ifdef HAVE_VLD1Q_U8_X4
|
||||
const int8x16x4_t tbl_rows_0123 =
|
||||
vld1q_s8_x4((int8_t *)(block + 0 * DCTSIZE));
|
||||
const int8x16x4_t tbl_rows_4567 =
|
||||
vld1q_s8_x4((int8_t *)(block + 4 * DCTSIZE));
|
||||
#else
|
||||
const int8x16x4_t tbl_rows_0123 = { {
|
||||
vld1q_s8((int8_t *)(block + 0 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 1 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 2 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 3 * DCTSIZE))
|
||||
} };
|
||||
const int8x16x4_t tbl_rows_4567 = { {
|
||||
vld1q_s8((int8_t *)(block + 4 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 5 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 6 * DCTSIZE)),
|
||||
vld1q_s8((int8_t *)(block + 7 * DCTSIZE))
|
||||
} };
|
||||
#endif
|
||||
|
||||
/* Initialise extra lookup tables. */
|
||||
const int8x16x4_t tbl_rows_2345 = { {
|
||||
tbl_rows_0123.val[2], tbl_rows_0123.val[3],
|
||||
tbl_rows_4567.val[0], tbl_rows_4567.val[1]
|
||||
} };
|
||||
const int8x16x3_t tbl_rows_567 =
|
||||
{ { tbl_rows_4567.val[1], tbl_rows_4567.val[2], tbl_rows_4567.val[3] } };
|
||||
|
||||
/* Shuffle coefficients into zig-zag order. */
|
||||
int16x8_t row0 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_0123, idx_rows_0123.val[0]));
|
||||
int16x8_t row1 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_0123, idx_rows_0123.val[1]));
|
||||
int16x8_t row2 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_2345, idx_rows_0123.val[2]));
|
||||
int16x8_t row3 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_0123, idx_rows_0123.val[3]));
|
||||
int16x8_t row4 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_4567, idx_rows_4567.val[0]));
|
||||
int16x8_t row5 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_2345, idx_rows_4567.val[1]));
|
||||
int16x8_t row6 =
|
||||
vreinterpretq_s16_s8(vqtbl4q_s8(tbl_rows_4567, idx_rows_4567.val[2]));
|
||||
int16x8_t row7 =
|
||||
vreinterpretq_s16_s8(vqtbl3q_s8(tbl_rows_567, idx_rows_4567.val[3]));
|
||||
|
||||
/* Compute DC coefficient difference value (F.1.1.5.1). */
|
||||
row0 = vsetq_lane_s16(block[0] - last_dc_val, row0, 0);
|
||||
/* Initialize AC coefficient lanes not reachable by lookup tables. */
|
||||
row1 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_4567.val[0]),
|
||||
0), row1, 2);
|
||||
row2 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_0123.val[1]),
|
||||
4), row2, 0);
|
||||
row2 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_4567.val[2]),
|
||||
0), row2, 5);
|
||||
row5 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_0123.val[1]),
|
||||
7), row5, 2);
|
||||
row5 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_4567.val[2]),
|
||||
3), row5, 7);
|
||||
row6 =
|
||||
vsetq_lane_s16(vgetq_lane_s16(vreinterpretq_s16_s8(tbl_rows_0123.val[3]),
|
||||
7), row6, 5);
|
||||
|
||||
/* DCT block is now in zig-zag order; start Huffman encoding process. */
|
||||
|
||||
/* Construct bitmap to accelerate encoding of AC coefficients. A set bit
|
||||
* means that the corresponding coefficient != 0.
|
||||
*/
|
||||
uint16x8_t row0_ne_0 = vtstq_s16(row0, row0);
|
||||
uint16x8_t row1_ne_0 = vtstq_s16(row1, row1);
|
||||
uint16x8_t row2_ne_0 = vtstq_s16(row2, row2);
|
||||
uint16x8_t row3_ne_0 = vtstq_s16(row3, row3);
|
||||
uint16x8_t row4_ne_0 = vtstq_s16(row4, row4);
|
||||
uint16x8_t row5_ne_0 = vtstq_s16(row5, row5);
|
||||
uint16x8_t row6_ne_0 = vtstq_s16(row6, row6);
|
||||
uint16x8_t row7_ne_0 = vtstq_s16(row7, row7);
|
||||
|
||||
uint8x16_t row10_ne_0 = vuzp1q_u8(vreinterpretq_u8_u16(row1_ne_0),
|
||||
vreinterpretq_u8_u16(row0_ne_0));
|
||||
uint8x16_t row32_ne_0 = vuzp1q_u8(vreinterpretq_u8_u16(row3_ne_0),
|
||||
vreinterpretq_u8_u16(row2_ne_0));
|
||||
uint8x16_t row54_ne_0 = vuzp1q_u8(vreinterpretq_u8_u16(row5_ne_0),
|
||||
vreinterpretq_u8_u16(row4_ne_0));
|
||||
uint8x16_t row76_ne_0 = vuzp1q_u8(vreinterpretq_u8_u16(row7_ne_0),
|
||||
vreinterpretq_u8_u16(row6_ne_0));
|
||||
|
||||
/* { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 } */
|
||||
const uint8x16_t bitmap_mask =
|
||||
vreinterpretq_u8_u64(vdupq_n_u64(0x0102040810204080));
|
||||
|
||||
uint8x16_t bitmap_rows_10 = vandq_u8(row10_ne_0, bitmap_mask);
|
||||
uint8x16_t bitmap_rows_32 = vandq_u8(row32_ne_0, bitmap_mask);
|
||||
uint8x16_t bitmap_rows_54 = vandq_u8(row54_ne_0, bitmap_mask);
|
||||
uint8x16_t bitmap_rows_76 = vandq_u8(row76_ne_0, bitmap_mask);
|
||||
|
||||
uint8x16_t bitmap_rows_3210 = vpaddq_u8(bitmap_rows_32, bitmap_rows_10);
|
||||
uint8x16_t bitmap_rows_7654 = vpaddq_u8(bitmap_rows_76, bitmap_rows_54);
|
||||
uint8x16_t bitmap_rows_76543210 = vpaddq_u8(bitmap_rows_7654,
|
||||
bitmap_rows_3210);
|
||||
uint8x8_t bitmap_all = vpadd_u8(vget_low_u8(bitmap_rows_76543210),
|
||||
vget_high_u8(bitmap_rows_76543210));
|
||||
|
||||
/* Shift left to remove DC bit. */
|
||||
bitmap_all =
|
||||
vreinterpret_u8_u64(vshl_n_u64(vreinterpret_u64_u8(bitmap_all), 1));
|
||||
/* Count bits set (number of non-zero coefficients) in bitmap. */
|
||||
unsigned int non_zero_coefficients = vaddv_u8(vcnt_u8(bitmap_all));
|
||||
/* Move bitmap to 64-bit scalar register. */
|
||||
uint64_t bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
|
||||
|
||||
/* Set up state and bit buffer for output bitstream. */
|
||||
working_state *state_ptr = (working_state *)state;
|
||||
int free_bits = state_ptr->cur.free_bits;
|
||||
size_t put_buffer = state_ptr->cur.put_buffer;
|
||||
|
||||
/* Encode DC coefficient. */
|
||||
|
||||
/* For negative coeffs: diff = abs(coeff) -1 = ~abs(coeff) */
|
||||
int16x8_t abs_row0 = vabsq_s16(row0);
|
||||
int16x8_t row0_lz = vclzq_s16(abs_row0);
|
||||
uint16x8_t row0_mask = vshlq_u16(vcltzq_s16(row0), vnegq_s16(row0_lz));
|
||||
uint16x8_t row0_diff = veorq_u16(vreinterpretq_u16_s16(abs_row0), row0_mask);
|
||||
/* Find nbits required to specify sign and amplitude of coefficient. */
|
||||
unsigned int lz = vgetq_lane_u16(vreinterpretq_u16_s16(row0_lz), 0);
|
||||
unsigned int nbits = 16 - lz;
|
||||
/* Emit Huffman-coded symbol and additional diff bits. */
|
||||
unsigned int diff = vgetq_lane_u16(row0_diff, 0);
|
||||
PUT_CODE(dctbl->ehufco[nbits], dctbl->ehufsi[nbits], diff)
|
||||
|
||||
/* Encode AC coefficients. */
|
||||
|
||||
unsigned int r = 0; /* r = run length of zeros */
|
||||
unsigned int i = 1; /* i = number of coefficients encoded */
|
||||
/* Code and size information for a run length of 16 zero coefficients */
|
||||
const unsigned int code_0xf0 = actbl->ehufco[0xf0];
|
||||
const unsigned int size_0xf0 = actbl->ehufsi[0xf0];
|
||||
|
||||
/* The most efficient method of computing nbits and diff depends on the
|
||||
* number of non-zero coefficients. If the bitmap is not too sparse (> 8
|
||||
* non-zero AC coefficients), it is beneficial to do all of the work using
|
||||
* Neon; else we do some of the work using Neon and the rest on demand using
|
||||
* scalar code.
|
||||
*/
|
||||
if (non_zero_coefficients > 8) {
|
||||
uint8_t block_nbits[DCTSIZE2];
|
||||
|
||||
int16x8_t abs_row1 = vabsq_s16(row1);
|
||||
int16x8_t abs_row2 = vabsq_s16(row2);
|
||||
int16x8_t abs_row3 = vabsq_s16(row3);
|
||||
int16x8_t abs_row4 = vabsq_s16(row4);
|
||||
int16x8_t abs_row5 = vabsq_s16(row5);
|
||||
int16x8_t abs_row6 = vabsq_s16(row6);
|
||||
int16x8_t abs_row7 = vabsq_s16(row7);
|
||||
int16x8_t row1_lz = vclzq_s16(abs_row1);
|
||||
int16x8_t row2_lz = vclzq_s16(abs_row2);
|
||||
int16x8_t row3_lz = vclzq_s16(abs_row3);
|
||||
int16x8_t row4_lz = vclzq_s16(abs_row4);
|
||||
int16x8_t row5_lz = vclzq_s16(abs_row5);
|
||||
int16x8_t row6_lz = vclzq_s16(abs_row6);
|
||||
int16x8_t row7_lz = vclzq_s16(abs_row7);
|
||||
/* Narrow leading zero count to 8 bits. */
|
||||
uint8x16_t row01_lz = vuzp1q_u8(vreinterpretq_u8_s16(row0_lz),
|
||||
vreinterpretq_u8_s16(row1_lz));
|
||||
uint8x16_t row23_lz = vuzp1q_u8(vreinterpretq_u8_s16(row2_lz),
|
||||
vreinterpretq_u8_s16(row3_lz));
|
||||
uint8x16_t row45_lz = vuzp1q_u8(vreinterpretq_u8_s16(row4_lz),
|
||||
vreinterpretq_u8_s16(row5_lz));
|
||||
uint8x16_t row67_lz = vuzp1q_u8(vreinterpretq_u8_s16(row6_lz),
|
||||
vreinterpretq_u8_s16(row7_lz));
|
||||
/* Compute nbits needed to specify magnitude of each coefficient. */
|
||||
uint8x16_t row01_nbits = vsubq_u8(vdupq_n_u8(16), row01_lz);
|
||||
uint8x16_t row23_nbits = vsubq_u8(vdupq_n_u8(16), row23_lz);
|
||||
uint8x16_t row45_nbits = vsubq_u8(vdupq_n_u8(16), row45_lz);
|
||||
uint8x16_t row67_nbits = vsubq_u8(vdupq_n_u8(16), row67_lz);
|
||||
/* Store nbits. */
|
||||
vst1q_u8(block_nbits + 0 * DCTSIZE, row01_nbits);
|
||||
vst1q_u8(block_nbits + 2 * DCTSIZE, row23_nbits);
|
||||
vst1q_u8(block_nbits + 4 * DCTSIZE, row45_nbits);
|
||||
vst1q_u8(block_nbits + 6 * DCTSIZE, row67_nbits);
|
||||
/* Mask bits not required to specify sign and amplitude of diff. */
|
||||
uint16x8_t row1_mask = vshlq_u16(vcltzq_s16(row1), vnegq_s16(row1_lz));
|
||||
uint16x8_t row2_mask = vshlq_u16(vcltzq_s16(row2), vnegq_s16(row2_lz));
|
||||
uint16x8_t row3_mask = vshlq_u16(vcltzq_s16(row3), vnegq_s16(row3_lz));
|
||||
uint16x8_t row4_mask = vshlq_u16(vcltzq_s16(row4), vnegq_s16(row4_lz));
|
||||
uint16x8_t row5_mask = vshlq_u16(vcltzq_s16(row5), vnegq_s16(row5_lz));
|
||||
uint16x8_t row6_mask = vshlq_u16(vcltzq_s16(row6), vnegq_s16(row6_lz));
|
||||
uint16x8_t row7_mask = vshlq_u16(vcltzq_s16(row7), vnegq_s16(row7_lz));
|
||||
/* diff = abs(coeff) ^ sign(coeff) [no-op for positive coefficients] */
|
||||
uint16x8_t row1_diff = veorq_u16(vreinterpretq_u16_s16(abs_row1),
|
||||
row1_mask);
|
||||
uint16x8_t row2_diff = veorq_u16(vreinterpretq_u16_s16(abs_row2),
|
||||
row2_mask);
|
||||
uint16x8_t row3_diff = veorq_u16(vreinterpretq_u16_s16(abs_row3),
|
||||
row3_mask);
|
||||
uint16x8_t row4_diff = veorq_u16(vreinterpretq_u16_s16(abs_row4),
|
||||
row4_mask);
|
||||
uint16x8_t row5_diff = veorq_u16(vreinterpretq_u16_s16(abs_row5),
|
||||
row5_mask);
|
||||
uint16x8_t row6_diff = veorq_u16(vreinterpretq_u16_s16(abs_row6),
|
||||
row6_mask);
|
||||
uint16x8_t row7_diff = veorq_u16(vreinterpretq_u16_s16(abs_row7),
|
||||
row7_mask);
|
||||
/* Store diff bits. */
|
||||
vst1q_u16(block_diff + 0 * DCTSIZE, row0_diff);
|
||||
vst1q_u16(block_diff + 1 * DCTSIZE, row1_diff);
|
||||
vst1q_u16(block_diff + 2 * DCTSIZE, row2_diff);
|
||||
vst1q_u16(block_diff + 3 * DCTSIZE, row3_diff);
|
||||
vst1q_u16(block_diff + 4 * DCTSIZE, row4_diff);
|
||||
vst1q_u16(block_diff + 5 * DCTSIZE, row5_diff);
|
||||
vst1q_u16(block_diff + 6 * DCTSIZE, row6_diff);
|
||||
vst1q_u16(block_diff + 7 * DCTSIZE, row7_diff);
|
||||
|
||||
while (bitmap != 0) {
|
||||
r = BUILTIN_CLZLL(bitmap);
|
||||
i += r;
|
||||
bitmap <<= r;
|
||||
nbits = block_nbits[i];
|
||||
diff = block_diff[i];
|
||||
while (r > 15) {
|
||||
/* If run length > 15, emit special run-length-16 codes. */
|
||||
PUT_BITS(code_0xf0, size_0xf0)
|
||||
r -= 16;
|
||||
}
|
||||
/* Emit Huffman symbol for run length / number of bits. (F.1.2.2.1) */
|
||||
unsigned int rs = (r << 4) + nbits;
|
||||
PUT_CODE(actbl->ehufco[rs], actbl->ehufsi[rs], diff)
|
||||
i++;
|
||||
bitmap <<= 1;
|
||||
}
|
||||
} else if (bitmap != 0) {
|
||||
uint16_t block_abs[DCTSIZE2];
|
||||
/* Compute and store absolute value of coefficients. */
|
||||
int16x8_t abs_row1 = vabsq_s16(row1);
|
||||
int16x8_t abs_row2 = vabsq_s16(row2);
|
||||
int16x8_t abs_row3 = vabsq_s16(row3);
|
||||
int16x8_t abs_row4 = vabsq_s16(row4);
|
||||
int16x8_t abs_row5 = vabsq_s16(row5);
|
||||
int16x8_t abs_row6 = vabsq_s16(row6);
|
||||
int16x8_t abs_row7 = vabsq_s16(row7);
|
||||
vst1q_u16(block_abs + 0 * DCTSIZE, vreinterpretq_u16_s16(abs_row0));
|
||||
vst1q_u16(block_abs + 1 * DCTSIZE, vreinterpretq_u16_s16(abs_row1));
|
||||
vst1q_u16(block_abs + 2 * DCTSIZE, vreinterpretq_u16_s16(abs_row2));
|
||||
vst1q_u16(block_abs + 3 * DCTSIZE, vreinterpretq_u16_s16(abs_row3));
|
||||
vst1q_u16(block_abs + 4 * DCTSIZE, vreinterpretq_u16_s16(abs_row4));
|
||||
vst1q_u16(block_abs + 5 * DCTSIZE, vreinterpretq_u16_s16(abs_row5));
|
||||
vst1q_u16(block_abs + 6 * DCTSIZE, vreinterpretq_u16_s16(abs_row6));
|
||||
vst1q_u16(block_abs + 7 * DCTSIZE, vreinterpretq_u16_s16(abs_row7));
|
||||
/* Compute diff bits (without nbits mask) and store. */
|
||||
uint16x8_t row1_diff = veorq_u16(vreinterpretq_u16_s16(abs_row1),
|
||||
vcltzq_s16(row1));
|
||||
uint16x8_t row2_diff = veorq_u16(vreinterpretq_u16_s16(abs_row2),
|
||||
vcltzq_s16(row2));
|
||||
uint16x8_t row3_diff = veorq_u16(vreinterpretq_u16_s16(abs_row3),
|
||||
vcltzq_s16(row3));
|
||||
uint16x8_t row4_diff = veorq_u16(vreinterpretq_u16_s16(abs_row4),
|
||||
vcltzq_s16(row4));
|
||||
uint16x8_t row5_diff = veorq_u16(vreinterpretq_u16_s16(abs_row5),
|
||||
vcltzq_s16(row5));
|
||||
uint16x8_t row6_diff = veorq_u16(vreinterpretq_u16_s16(abs_row6),
|
||||
vcltzq_s16(row6));
|
||||
uint16x8_t row7_diff = veorq_u16(vreinterpretq_u16_s16(abs_row7),
|
||||
vcltzq_s16(row7));
|
||||
vst1q_u16(block_diff + 0 * DCTSIZE, row0_diff);
|
||||
vst1q_u16(block_diff + 1 * DCTSIZE, row1_diff);
|
||||
vst1q_u16(block_diff + 2 * DCTSIZE, row2_diff);
|
||||
vst1q_u16(block_diff + 3 * DCTSIZE, row3_diff);
|
||||
vst1q_u16(block_diff + 4 * DCTSIZE, row4_diff);
|
||||
vst1q_u16(block_diff + 5 * DCTSIZE, row5_diff);
|
||||
vst1q_u16(block_diff + 6 * DCTSIZE, row6_diff);
|
||||
vst1q_u16(block_diff + 7 * DCTSIZE, row7_diff);
|
||||
|
||||
/* Same as above but must mask diff bits and compute nbits on demand. */
|
||||
while (bitmap != 0) {
|
||||
r = BUILTIN_CLZLL(bitmap);
|
||||
i += r;
|
||||
bitmap <<= r;
|
||||
lz = BUILTIN_CLZ(block_abs[i]);
|
||||
nbits = 32 - lz;
|
||||
diff = ((unsigned int)block_diff[i] << lz) >> lz;
|
||||
while (r > 15) {
|
||||
/* If run length > 15, emit special run-length-16 codes. */
|
||||
PUT_BITS(code_0xf0, size_0xf0)
|
||||
r -= 16;
|
||||
}
|
||||
/* Emit Huffman symbol for run length / number of bits. (F.1.2.2.1) */
|
||||
unsigned int rs = (r << 4) + nbits;
|
||||
PUT_CODE(actbl->ehufco[rs], actbl->ehufsi[rs], diff)
|
||||
i++;
|
||||
bitmap <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the last coefficient(s) were zero, emit an end-of-block (EOB) code.
|
||||
* The value of RS for the EOB code is 0.
|
||||
*/
|
||||
if (i != 64) {
|
||||
PUT_BITS(actbl->ehufco[0], actbl->ehufsi[0])
|
||||
}
|
||||
|
||||
state_ptr->cur.put_buffer = put_buffer;
|
||||
state_ptr->cur.free_bits = free_bits;
|
||||
|
||||
return buffer;
|
||||
}
|
||||
+1054
File diff suppressed because it is too large
Load Diff
+2254
File diff suppressed because it is too large
Load Diff
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* How to obtain memory alignment for structures and variables */
|
||||
#if defined(_MSC_VER)
|
||||
#define ALIGN(alignment) __declspec(align(alignment))
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define ALIGN(alignment) __attribute__((aligned(alignment)))
|
||||
#else
|
||||
#error "Unknown compiler"
|
||||
#endif
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* jccolor-neon.c - colorspace conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* RGB -> YCbCr conversion constants */
|
||||
|
||||
#define F_0_298 19595
|
||||
#define F_0_587 38470
|
||||
#define F_0_113 7471
|
||||
#define F_0_168 11059
|
||||
#define F_0_331 21709
|
||||
#define F_0_500 32768
|
||||
#define F_0_418 27439
|
||||
#define F_0_081 5329
|
||||
|
||||
ALIGN(16) static const uint16_t jsimd_rgb_ycc_neon_consts[] = {
|
||||
F_0_298, F_0_587, F_0_113, F_0_168,
|
||||
F_0_331, F_0_500, F_0_418, F_0_081
|
||||
};
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions. */
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extrgb_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extrgbx_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extbgr_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extbgrx_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extxbgr_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define jsimd_rgb_ycc_convert_neon jsimd_extxrgb_ycc_convert_neon
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#include "aarch64/jccolext-neon.c"
|
||||
#else
|
||||
#include "aarch32/jccolext-neon.c"
|
||||
#endif
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_ycc_convert_neon
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* jcgray-neon.c - grayscale colorspace conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* RGB -> Grayscale conversion constants */
|
||||
|
||||
#define F_0_298 19595
|
||||
#define F_0_587 38470
|
||||
#define F_0_113 7471
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions. */
|
||||
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extrgb_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extrgbx_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extbgr_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extbgrx_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extxbgr_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define jsimd_rgb_gray_convert_neon jsimd_extxrgb_gray_convert_neon
|
||||
#include "jcgryext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_rgb_gray_convert_neon
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* jcgryext-neon.c - grayscale colorspace conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* This file is included by jcgray-neon.c */
|
||||
|
||||
|
||||
/* RGB -> Grayscale conversion is defined by the following equation:
|
||||
* Y = 0.29900 * R + 0.58700 * G + 0.11400 * B
|
||||
*
|
||||
* Avoid floating point arithmetic by using shifted integer constants:
|
||||
* 0.29899597 = 19595 * 2^-16
|
||||
* 0.58700561 = 38470 * 2^-16
|
||||
* 0.11399841 = 7471 * 2^-16
|
||||
* These constants are defined in jcgray-neon.c
|
||||
*
|
||||
* This is the same computation as the RGB -> Y portion of RGB -> YCbCr.
|
||||
*/
|
||||
|
||||
void jsimd_rgb_gray_convert_neon(JDIMENSION image_width, JSAMPARRAY input_buf,
|
||||
JSAMPIMAGE output_buf, JDIMENSION output_row,
|
||||
int num_rows)
|
||||
{
|
||||
JSAMPROW inptr;
|
||||
JSAMPROW outptr;
|
||||
/* Allocate temporary buffer for final (image_width % 16) pixels in row. */
|
||||
ALIGN(16) uint8_t tmp_buf[16 * RGB_PIXELSIZE];
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr = *input_buf++;
|
||||
outptr = output_buf[0][output_row];
|
||||
output_row++;
|
||||
|
||||
int cols_remaining = image_width;
|
||||
for (; cols_remaining > 0; cols_remaining -= 16) {
|
||||
|
||||
/* To prevent buffer overread by the vector load instructions, the last
|
||||
* (image_width % 16) columns of data are first memcopied to a temporary
|
||||
* buffer large enough to accommodate the vector load.
|
||||
*/
|
||||
if (cols_remaining < 16) {
|
||||
memcpy(tmp_buf, inptr, cols_remaining * RGB_PIXELSIZE);
|
||||
inptr = tmp_buf;
|
||||
}
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x16x4_t input_pixels = vld4q_u8(inptr);
|
||||
#else
|
||||
uint8x16x3_t input_pixels = vld3q_u8(inptr);
|
||||
#endif
|
||||
uint16x8_t r_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t r_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_RED]));
|
||||
uint16x8_t g_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t g_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_GREEN]));
|
||||
uint16x8_t b_l = vmovl_u8(vget_low_u8(input_pixels.val[RGB_BLUE]));
|
||||
uint16x8_t b_h = vmovl_u8(vget_high_u8(input_pixels.val[RGB_BLUE]));
|
||||
|
||||
/* Compute Y = 0.29900 * R + 0.58700 * G + 0.11400 * B */
|
||||
uint32x4_t y_ll = vmull_n_u16(vget_low_u16(r_l), F_0_298);
|
||||
uint32x4_t y_lh = vmull_n_u16(vget_high_u16(r_l), F_0_298);
|
||||
uint32x4_t y_hl = vmull_n_u16(vget_low_u16(r_h), F_0_298);
|
||||
uint32x4_t y_hh = vmull_n_u16(vget_high_u16(r_h), F_0_298);
|
||||
y_ll = vmlal_n_u16(y_ll, vget_low_u16(g_l), F_0_587);
|
||||
y_lh = vmlal_n_u16(y_lh, vget_high_u16(g_l), F_0_587);
|
||||
y_hl = vmlal_n_u16(y_hl, vget_low_u16(g_h), F_0_587);
|
||||
y_hh = vmlal_n_u16(y_hh, vget_high_u16(g_h), F_0_587);
|
||||
y_ll = vmlal_n_u16(y_ll, vget_low_u16(b_l), F_0_113);
|
||||
y_lh = vmlal_n_u16(y_lh, vget_high_u16(b_l), F_0_113);
|
||||
y_hl = vmlal_n_u16(y_hl, vget_low_u16(b_h), F_0_113);
|
||||
y_hh = vmlal_n_u16(y_hh, vget_high_u16(b_h), F_0_113);
|
||||
|
||||
/* Descale Y values (rounding right shift) and narrow to 16-bit. */
|
||||
uint16x8_t y_l = vcombine_u16(vrshrn_n_u32(y_ll, 16),
|
||||
vrshrn_n_u32(y_lh, 16));
|
||||
uint16x8_t y_h = vcombine_u16(vrshrn_n_u32(y_hl, 16),
|
||||
vrshrn_n_u32(y_hh, 16));
|
||||
|
||||
/* Narrow Y values to 8-bit and store to memory. Buffer overwrite is
|
||||
* permitted up to the next multiple of ALIGN_SIZE bytes.
|
||||
*/
|
||||
vst1q_u8(outptr, vcombine_u8(vmovn_u16(y_l), vmovn_u16(y_h)));
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr += (16 * RGB_PIXELSIZE);
|
||||
outptr += 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* jchuff.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2018, 2021, D. R. Commander.
|
||||
* Copyright (C) 2018, Matthias Räncker.
|
||||
* Copyright (C) 2020-2021, Arm Limited.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*/
|
||||
|
||||
/* Expanded entropy encoder object for Huffman encoding.
|
||||
*
|
||||
* The savable_state subrecord contains fields that change within an MCU,
|
||||
* but must not be updated permanently until we complete the MCU.
|
||||
*/
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
#define BIT_BUF_SIZE 64
|
||||
#else
|
||||
#define BIT_BUF_SIZE 32
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
size_t put_buffer; /* current bit accumulation buffer */
|
||||
int free_bits; /* # of bits available in it */
|
||||
int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
|
||||
} savable_state;
|
||||
|
||||
typedef struct {
|
||||
JOCTET *next_output_byte; /* => next byte to write in buffer */
|
||||
size_t free_in_buffer; /* # of byte spaces remaining in buffer */
|
||||
savable_state cur; /* Current bit buffer & DC state */
|
||||
j_compress_ptr cinfo; /* dump_buffer needs access to this */
|
||||
int simd;
|
||||
} working_state;
|
||||
|
||||
/* Outputting bits to the file */
|
||||
|
||||
/* Output byte b and, speculatively, an additional 0 byte. 0xFF must be encoded
|
||||
* as 0xFF 0x00, so the output buffer pointer is advanced by 2 if the byte is
|
||||
* 0xFF. Otherwise, the output buffer pointer is advanced by 1, and the
|
||||
* speculative 0 byte will be overwritten by the next byte.
|
||||
*/
|
||||
#define EMIT_BYTE(b) { \
|
||||
buffer[0] = (JOCTET)(b); \
|
||||
buffer[1] = 0; \
|
||||
buffer -= -2 + ((JOCTET)(b) < 0xFF); \
|
||||
}
|
||||
|
||||
/* Output the entire bit buffer. If there are no 0xFF bytes in it, then write
|
||||
* directly to the output buffer. Otherwise, use the EMIT_BYTE() macro to
|
||||
* encode 0xFF as 0xFF 0x00.
|
||||
*/
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
|
||||
#define FLUSH() { \
|
||||
if (put_buffer & 0x8080808080808080 & ~(put_buffer + 0x0101010101010101)) { \
|
||||
EMIT_BYTE(put_buffer >> 56) \
|
||||
EMIT_BYTE(put_buffer >> 48) \
|
||||
EMIT_BYTE(put_buffer >> 40) \
|
||||
EMIT_BYTE(put_buffer >> 32) \
|
||||
EMIT_BYTE(put_buffer >> 24) \
|
||||
EMIT_BYTE(put_buffer >> 16) \
|
||||
EMIT_BYTE(put_buffer >> 8) \
|
||||
EMIT_BYTE(put_buffer ) \
|
||||
} else { \
|
||||
*((uint64_t *)buffer) = BUILTIN_BSWAP64(put_buffer); \
|
||||
buffer += 8; \
|
||||
} \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
#define SPLAT() { \
|
||||
buffer[0] = (JOCTET)(put_buffer >> 24); \
|
||||
buffer[1] = (JOCTET)(put_buffer >> 16); \
|
||||
buffer[2] = (JOCTET)(put_buffer >> 8); \
|
||||
buffer[3] = (JOCTET)(put_buffer ); \
|
||||
buffer += 4; \
|
||||
}
|
||||
#else
|
||||
#define SPLAT() { \
|
||||
put_buffer = __builtin_bswap32(put_buffer); \
|
||||
__asm__("str %1, [%0], #4" : "+r" (buffer) : "r" (put_buffer)); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define FLUSH() { \
|
||||
if (put_buffer & 0x80808080 & ~(put_buffer + 0x01010101)) { \
|
||||
EMIT_BYTE(put_buffer >> 24) \
|
||||
EMIT_BYTE(put_buffer >> 16) \
|
||||
EMIT_BYTE(put_buffer >> 8) \
|
||||
EMIT_BYTE(put_buffer ) \
|
||||
} else { \
|
||||
SPLAT(); \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Fill the bit buffer to capacity with the leading bits from code, then output
|
||||
* the bit buffer and put the remaining bits from code into the bit buffer.
|
||||
*/
|
||||
#define PUT_AND_FLUSH(code, size) { \
|
||||
put_buffer = (put_buffer << (size + free_bits)) | (code >> -free_bits); \
|
||||
FLUSH() \
|
||||
free_bits += BIT_BUF_SIZE; \
|
||||
put_buffer = code; \
|
||||
}
|
||||
|
||||
/* Insert code into the bit buffer and output the bit buffer if needed.
|
||||
* NOTE: We can't flush with free_bits == 0, since the left shift in
|
||||
* PUT_AND_FLUSH() would have undefined behavior.
|
||||
*/
|
||||
#define PUT_BITS(code, size) { \
|
||||
free_bits -= size; \
|
||||
if (free_bits < 0) \
|
||||
PUT_AND_FLUSH(code, size) \
|
||||
else \
|
||||
put_buffer = (put_buffer << size) | code; \
|
||||
}
|
||||
|
||||
#define PUT_CODE(code, size, diff) { \
|
||||
diff |= code << nbits; \
|
||||
nbits += size; \
|
||||
PUT_BITS(diff, nbits) \
|
||||
}
|
||||
+623
@@ -0,0 +1,623 @@
|
||||
/*
|
||||
* jcphuff-neon.c - prepare data for progressive Huffman encoding (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020-2021, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2022, Matthieu Darbois. All Rights Reserved.
|
||||
* Copyright (C) 2022, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* Data preparation for encode_mcu_AC_first().
|
||||
*
|
||||
* The equivalent scalar C function (encode_mcu_AC_first_prepare()) can be
|
||||
* found in jcphuff.c.
|
||||
*/
|
||||
|
||||
void jsimd_encode_mcu_AC_first_prepare_neon
|
||||
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||
UJCOEF *values, size_t *zerobits)
|
||||
{
|
||||
UJCOEF *values_ptr = values;
|
||||
UJCOEF *diff_values_ptr = values + DCTSIZE2;
|
||||
|
||||
/* Rows of coefficients to zero (since they haven't been processed) */
|
||||
int i, rows_to_zero = 8;
|
||||
|
||||
for (i = 0; i < Sl / 16; i++) {
|
||||
int16x8_t coefs1 = vld1q_dup_s16(block + jpeg_natural_order_start[0]);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs1, 1);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs1, 2);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs1, 3);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs1, 4);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs1, 5);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs1, 6);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs1, 7);
|
||||
int16x8_t coefs2 = vld1q_dup_s16(block + jpeg_natural_order_start[8]);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[9], coefs2, 1);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[10], coefs2, 2);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[11], coefs2, 3);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[12], coefs2, 4);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[13], coefs2, 5);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[14], coefs2, 6);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[15], coefs2, 7);
|
||||
|
||||
/* Isolate sign of coefficients. */
|
||||
uint16x8_t sign_coefs1 = vreinterpretq_u16_s16(vshrq_n_s16(coefs1, 15));
|
||||
uint16x8_t sign_coefs2 = vreinterpretq_u16_s16(vshrq_n_s16(coefs2, 15));
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs1 = vreinterpretq_u16_s16(vabsq_s16(coefs1));
|
||||
uint16x8_t abs_coefs2 = vreinterpretq_u16_s16(vabsq_s16(coefs2));
|
||||
abs_coefs1 = vshlq_u16(abs_coefs1, vdupq_n_s16(-Al));
|
||||
abs_coefs2 = vshlq_u16(abs_coefs2, vdupq_n_s16(-Al));
|
||||
|
||||
/* Compute diff values. */
|
||||
uint16x8_t diff1 = veorq_u16(abs_coefs1, sign_coefs1);
|
||||
uint16x8_t diff2 = veorq_u16(abs_coefs2, sign_coefs2);
|
||||
|
||||
/* Store transformed coefficients and diff values. */
|
||||
vst1q_u16(values_ptr, abs_coefs1);
|
||||
vst1q_u16(values_ptr + DCTSIZE, abs_coefs2);
|
||||
vst1q_u16(diff_values_ptr, diff1);
|
||||
vst1q_u16(diff_values_ptr + DCTSIZE, diff2);
|
||||
values_ptr += 16;
|
||||
diff_values_ptr += 16;
|
||||
jpeg_natural_order_start += 16;
|
||||
rows_to_zero -= 2;
|
||||
}
|
||||
|
||||
/* Same operation but for remaining partial vector */
|
||||
int remaining_coefs = Sl % 16;
|
||||
if (remaining_coefs > 8) {
|
||||
int16x8_t coefs1 = vld1q_dup_s16(block + jpeg_natural_order_start[0]);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs1, 1);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs1, 2);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs1, 3);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs1, 4);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs1, 5);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs1, 6);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs1, 7);
|
||||
int16x8_t coefs2 = vdupq_n_s16(0);
|
||||
switch (remaining_coefs) {
|
||||
case 15:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[14], coefs2, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[13], coefs2, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[12], coefs2, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[11], coefs2, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[10], coefs2, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[9], coefs2, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[8], coefs2, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Isolate sign of coefficients. */
|
||||
uint16x8_t sign_coefs1 = vreinterpretq_u16_s16(vshrq_n_s16(coefs1, 15));
|
||||
uint16x8_t sign_coefs2 = vreinterpretq_u16_s16(vshrq_n_s16(coefs2, 15));
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs1 = vreinterpretq_u16_s16(vabsq_s16(coefs1));
|
||||
uint16x8_t abs_coefs2 = vreinterpretq_u16_s16(vabsq_s16(coefs2));
|
||||
abs_coefs1 = vshlq_u16(abs_coefs1, vdupq_n_s16(-Al));
|
||||
abs_coefs2 = vshlq_u16(abs_coefs2, vdupq_n_s16(-Al));
|
||||
|
||||
/* Compute diff values. */
|
||||
uint16x8_t diff1 = veorq_u16(abs_coefs1, sign_coefs1);
|
||||
uint16x8_t diff2 = veorq_u16(abs_coefs2, sign_coefs2);
|
||||
|
||||
/* Store transformed coefficients and diff values. */
|
||||
vst1q_u16(values_ptr, abs_coefs1);
|
||||
vst1q_u16(values_ptr + DCTSIZE, abs_coefs2);
|
||||
vst1q_u16(diff_values_ptr, diff1);
|
||||
vst1q_u16(diff_values_ptr + DCTSIZE, diff2);
|
||||
values_ptr += 16;
|
||||
diff_values_ptr += 16;
|
||||
rows_to_zero -= 2;
|
||||
|
||||
} else if (remaining_coefs > 0) {
|
||||
int16x8_t coefs = vdupq_n_s16(0);
|
||||
|
||||
switch (remaining_coefs) {
|
||||
case 8:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs, 7);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 7:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[0], coefs, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Isolate sign of coefficients. */
|
||||
uint16x8_t sign_coefs = vreinterpretq_u16_s16(vshrq_n_s16(coefs, 15));
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs = vreinterpretq_u16_s16(vabsq_s16(coefs));
|
||||
abs_coefs = vshlq_u16(abs_coefs, vdupq_n_s16(-Al));
|
||||
|
||||
/* Compute diff values. */
|
||||
uint16x8_t diff = veorq_u16(abs_coefs, sign_coefs);
|
||||
|
||||
/* Store transformed coefficients and diff values. */
|
||||
vst1q_u16(values_ptr, abs_coefs);
|
||||
vst1q_u16(diff_values_ptr, diff);
|
||||
values_ptr += 8;
|
||||
diff_values_ptr += 8;
|
||||
rows_to_zero--;
|
||||
}
|
||||
|
||||
/* Zero remaining memory in the values and diff_values blocks. */
|
||||
for (i = 0; i < rows_to_zero; i++) {
|
||||
vst1q_u16(values_ptr, vdupq_n_u16(0));
|
||||
vst1q_u16(diff_values_ptr, vdupq_n_u16(0));
|
||||
values_ptr += 8;
|
||||
diff_values_ptr += 8;
|
||||
}
|
||||
|
||||
/* Construct zerobits bitmap. A set bit means that the corresponding
|
||||
* coefficient != 0.
|
||||
*/
|
||||
uint16x8_t row0 = vld1q_u16(values + 0 * DCTSIZE);
|
||||
uint16x8_t row1 = vld1q_u16(values + 1 * DCTSIZE);
|
||||
uint16x8_t row2 = vld1q_u16(values + 2 * DCTSIZE);
|
||||
uint16x8_t row3 = vld1q_u16(values + 3 * DCTSIZE);
|
||||
uint16x8_t row4 = vld1q_u16(values + 4 * DCTSIZE);
|
||||
uint16x8_t row5 = vld1q_u16(values + 5 * DCTSIZE);
|
||||
uint16x8_t row6 = vld1q_u16(values + 6 * DCTSIZE);
|
||||
uint16x8_t row7 = vld1q_u16(values + 7 * DCTSIZE);
|
||||
|
||||
uint8x8_t row0_eq0 = vmovn_u16(vceqq_u16(row0, vdupq_n_u16(0)));
|
||||
uint8x8_t row1_eq0 = vmovn_u16(vceqq_u16(row1, vdupq_n_u16(0)));
|
||||
uint8x8_t row2_eq0 = vmovn_u16(vceqq_u16(row2, vdupq_n_u16(0)));
|
||||
uint8x8_t row3_eq0 = vmovn_u16(vceqq_u16(row3, vdupq_n_u16(0)));
|
||||
uint8x8_t row4_eq0 = vmovn_u16(vceqq_u16(row4, vdupq_n_u16(0)));
|
||||
uint8x8_t row5_eq0 = vmovn_u16(vceqq_u16(row5, vdupq_n_u16(0)));
|
||||
uint8x8_t row6_eq0 = vmovn_u16(vceqq_u16(row6, vdupq_n_u16(0)));
|
||||
uint8x8_t row7_eq0 = vmovn_u16(vceqq_u16(row7, vdupq_n_u16(0)));
|
||||
|
||||
/* { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 } */
|
||||
const uint8x8_t bitmap_mask =
|
||||
vreinterpret_u8_u64(vmov_n_u64(0x8040201008040201));
|
||||
|
||||
row0_eq0 = vand_u8(row0_eq0, bitmap_mask);
|
||||
row1_eq0 = vand_u8(row1_eq0, bitmap_mask);
|
||||
row2_eq0 = vand_u8(row2_eq0, bitmap_mask);
|
||||
row3_eq0 = vand_u8(row3_eq0, bitmap_mask);
|
||||
row4_eq0 = vand_u8(row4_eq0, bitmap_mask);
|
||||
row5_eq0 = vand_u8(row5_eq0, bitmap_mask);
|
||||
row6_eq0 = vand_u8(row6_eq0, bitmap_mask);
|
||||
row7_eq0 = vand_u8(row7_eq0, bitmap_mask);
|
||||
|
||||
uint8x8_t bitmap_rows_01 = vpadd_u8(row0_eq0, row1_eq0);
|
||||
uint8x8_t bitmap_rows_23 = vpadd_u8(row2_eq0, row3_eq0);
|
||||
uint8x8_t bitmap_rows_45 = vpadd_u8(row4_eq0, row5_eq0);
|
||||
uint8x8_t bitmap_rows_67 = vpadd_u8(row6_eq0, row7_eq0);
|
||||
uint8x8_t bitmap_rows_0123 = vpadd_u8(bitmap_rows_01, bitmap_rows_23);
|
||||
uint8x8_t bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
|
||||
uint8x8_t bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Move bitmap to a 64-bit scalar register. */
|
||||
uint64_t bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
|
||||
/* Store zerobits bitmap. */
|
||||
*zerobits = ~bitmap;
|
||||
#else
|
||||
/* Move bitmap to two 32-bit scalar registers. */
|
||||
uint32_t bitmap0 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 0);
|
||||
uint32_t bitmap1 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 1);
|
||||
/* Store zerobits bitmap. */
|
||||
zerobits[0] = ~bitmap0;
|
||||
zerobits[1] = ~bitmap1;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Data preparation for encode_mcu_AC_refine().
|
||||
*
|
||||
* The equivalent scalar C function (encode_mcu_AC_refine_prepare()) can be
|
||||
* found in jcphuff.c.
|
||||
*/
|
||||
|
||||
int jsimd_encode_mcu_AC_refine_prepare_neon
|
||||
(const JCOEF *block, const int *jpeg_natural_order_start, int Sl, int Al,
|
||||
UJCOEF *absvalues, size_t *bits)
|
||||
{
|
||||
/* Temporary storage buffers for data used to compute the signbits bitmap and
|
||||
* the end-of-block (EOB) position
|
||||
*/
|
||||
uint8_t coef_sign_bits[64];
|
||||
uint8_t coef_eq1_bits[64];
|
||||
|
||||
UJCOEF *absvalues_ptr = absvalues;
|
||||
uint8_t *coef_sign_bits_ptr = coef_sign_bits;
|
||||
uint8_t *eq1_bits_ptr = coef_eq1_bits;
|
||||
|
||||
/* Rows of coefficients to zero (since they haven't been processed) */
|
||||
int i, rows_to_zero = 8;
|
||||
|
||||
for (i = 0; i < Sl / 16; i++) {
|
||||
int16x8_t coefs1 = vld1q_dup_s16(block + jpeg_natural_order_start[0]);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs1, 1);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs1, 2);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs1, 3);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs1, 4);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs1, 5);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs1, 6);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs1, 7);
|
||||
int16x8_t coefs2 = vld1q_dup_s16(block + jpeg_natural_order_start[8]);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[9], coefs2, 1);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[10], coefs2, 2);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[11], coefs2, 3);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[12], coefs2, 4);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[13], coefs2, 5);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[14], coefs2, 6);
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[15], coefs2, 7);
|
||||
|
||||
/* Compute and store data for signbits bitmap. */
|
||||
uint8x8_t sign_coefs1 =
|
||||
vmovn_u16(vreinterpretq_u16_s16(vshrq_n_s16(coefs1, 15)));
|
||||
uint8x8_t sign_coefs2 =
|
||||
vmovn_u16(vreinterpretq_u16_s16(vshrq_n_s16(coefs2, 15)));
|
||||
vst1_u8(coef_sign_bits_ptr, sign_coefs1);
|
||||
vst1_u8(coef_sign_bits_ptr + DCTSIZE, sign_coefs2);
|
||||
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs1 = vreinterpretq_u16_s16(vabsq_s16(coefs1));
|
||||
uint16x8_t abs_coefs2 = vreinterpretq_u16_s16(vabsq_s16(coefs2));
|
||||
abs_coefs1 = vshlq_u16(abs_coefs1, vdupq_n_s16(-Al));
|
||||
abs_coefs2 = vshlq_u16(abs_coefs2, vdupq_n_s16(-Al));
|
||||
vst1q_u16(absvalues_ptr, abs_coefs1);
|
||||
vst1q_u16(absvalues_ptr + DCTSIZE, abs_coefs2);
|
||||
|
||||
/* Test whether transformed coefficient values == 1 (used to find EOB
|
||||
* position.)
|
||||
*/
|
||||
uint8x8_t coefs_eq11 = vmovn_u16(vceqq_u16(abs_coefs1, vdupq_n_u16(1)));
|
||||
uint8x8_t coefs_eq12 = vmovn_u16(vceqq_u16(abs_coefs2, vdupq_n_u16(1)));
|
||||
vst1_u8(eq1_bits_ptr, coefs_eq11);
|
||||
vst1_u8(eq1_bits_ptr + DCTSIZE, coefs_eq12);
|
||||
|
||||
absvalues_ptr += 16;
|
||||
coef_sign_bits_ptr += 16;
|
||||
eq1_bits_ptr += 16;
|
||||
jpeg_natural_order_start += 16;
|
||||
rows_to_zero -= 2;
|
||||
}
|
||||
|
||||
/* Same operation but for remaining partial vector */
|
||||
int remaining_coefs = Sl % 16;
|
||||
if (remaining_coefs > 8) {
|
||||
int16x8_t coefs1 = vld1q_dup_s16(block + jpeg_natural_order_start[0]);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs1, 1);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs1, 2);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs1, 3);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs1, 4);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs1, 5);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs1, 6);
|
||||
coefs1 = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs1, 7);
|
||||
int16x8_t coefs2 = vdupq_n_s16(0);
|
||||
switch (remaining_coefs) {
|
||||
case 15:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[14], coefs2, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[13], coefs2, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[12], coefs2, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[11], coefs2, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[10], coefs2, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[9], coefs2, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
coefs2 = vld1q_lane_s16(block + jpeg_natural_order_start[8], coefs2, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Compute and store data for signbits bitmap. */
|
||||
uint8x8_t sign_coefs1 =
|
||||
vmovn_u16(vreinterpretq_u16_s16(vshrq_n_s16(coefs1, 15)));
|
||||
uint8x8_t sign_coefs2 =
|
||||
vmovn_u16(vreinterpretq_u16_s16(vshrq_n_s16(coefs2, 15)));
|
||||
vst1_u8(coef_sign_bits_ptr, sign_coefs1);
|
||||
vst1_u8(coef_sign_bits_ptr + DCTSIZE, sign_coefs2);
|
||||
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs1 = vreinterpretq_u16_s16(vabsq_s16(coefs1));
|
||||
uint16x8_t abs_coefs2 = vreinterpretq_u16_s16(vabsq_s16(coefs2));
|
||||
abs_coefs1 = vshlq_u16(abs_coefs1, vdupq_n_s16(-Al));
|
||||
abs_coefs2 = vshlq_u16(abs_coefs2, vdupq_n_s16(-Al));
|
||||
vst1q_u16(absvalues_ptr, abs_coefs1);
|
||||
vst1q_u16(absvalues_ptr + DCTSIZE, abs_coefs2);
|
||||
|
||||
/* Test whether transformed coefficient values == 1 (used to find EOB
|
||||
* position.)
|
||||
*/
|
||||
uint8x8_t coefs_eq11 = vmovn_u16(vceqq_u16(abs_coefs1, vdupq_n_u16(1)));
|
||||
uint8x8_t coefs_eq12 = vmovn_u16(vceqq_u16(abs_coefs2, vdupq_n_u16(1)));
|
||||
vst1_u8(eq1_bits_ptr, coefs_eq11);
|
||||
vst1_u8(eq1_bits_ptr + DCTSIZE, coefs_eq12);
|
||||
|
||||
absvalues_ptr += 16;
|
||||
coef_sign_bits_ptr += 16;
|
||||
eq1_bits_ptr += 16;
|
||||
jpeg_natural_order_start += 16;
|
||||
rows_to_zero -= 2;
|
||||
|
||||
} else if (remaining_coefs > 0) {
|
||||
int16x8_t coefs = vdupq_n_s16(0);
|
||||
|
||||
switch (remaining_coefs) {
|
||||
case 8:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[7], coefs, 7);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 7:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[6], coefs, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[5], coefs, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[4], coefs, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[3], coefs, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[2], coefs, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[1], coefs, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
coefs = vld1q_lane_s16(block + jpeg_natural_order_start[0], coefs, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Compute and store data for signbits bitmap. */
|
||||
uint8x8_t sign_coefs =
|
||||
vmovn_u16(vreinterpretq_u16_s16(vshrq_n_s16(coefs, 15)));
|
||||
vst1_u8(coef_sign_bits_ptr, sign_coefs);
|
||||
|
||||
/* Compute absolute value of coefficients and apply point transform Al. */
|
||||
uint16x8_t abs_coefs = vreinterpretq_u16_s16(vabsq_s16(coefs));
|
||||
abs_coefs = vshlq_u16(abs_coefs, vdupq_n_s16(-Al));
|
||||
vst1q_u16(absvalues_ptr, abs_coefs);
|
||||
|
||||
/* Test whether transformed coefficient values == 1 (used to find EOB
|
||||
* position.)
|
||||
*/
|
||||
uint8x8_t coefs_eq1 = vmovn_u16(vceqq_u16(abs_coefs, vdupq_n_u16(1)));
|
||||
vst1_u8(eq1_bits_ptr, coefs_eq1);
|
||||
|
||||
absvalues_ptr += 8;
|
||||
coef_sign_bits_ptr += 8;
|
||||
eq1_bits_ptr += 8;
|
||||
rows_to_zero--;
|
||||
}
|
||||
|
||||
/* Zero remaining memory in blocks. */
|
||||
for (i = 0; i < rows_to_zero; i++) {
|
||||
vst1q_u16(absvalues_ptr, vdupq_n_u16(0));
|
||||
vst1_u8(coef_sign_bits_ptr, vdup_n_u8(0));
|
||||
vst1_u8(eq1_bits_ptr, vdup_n_u8(0));
|
||||
absvalues_ptr += 8;
|
||||
coef_sign_bits_ptr += 8;
|
||||
eq1_bits_ptr += 8;
|
||||
}
|
||||
|
||||
/* Construct zerobits bitmap. */
|
||||
uint16x8_t abs_row0 = vld1q_u16(absvalues + 0 * DCTSIZE);
|
||||
uint16x8_t abs_row1 = vld1q_u16(absvalues + 1 * DCTSIZE);
|
||||
uint16x8_t abs_row2 = vld1q_u16(absvalues + 2 * DCTSIZE);
|
||||
uint16x8_t abs_row3 = vld1q_u16(absvalues + 3 * DCTSIZE);
|
||||
uint16x8_t abs_row4 = vld1q_u16(absvalues + 4 * DCTSIZE);
|
||||
uint16x8_t abs_row5 = vld1q_u16(absvalues + 5 * DCTSIZE);
|
||||
uint16x8_t abs_row6 = vld1q_u16(absvalues + 6 * DCTSIZE);
|
||||
uint16x8_t abs_row7 = vld1q_u16(absvalues + 7 * DCTSIZE);
|
||||
|
||||
uint8x8_t abs_row0_eq0 = vmovn_u16(vceqq_u16(abs_row0, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row1_eq0 = vmovn_u16(vceqq_u16(abs_row1, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row2_eq0 = vmovn_u16(vceqq_u16(abs_row2, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row3_eq0 = vmovn_u16(vceqq_u16(abs_row3, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row4_eq0 = vmovn_u16(vceqq_u16(abs_row4, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row5_eq0 = vmovn_u16(vceqq_u16(abs_row5, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row6_eq0 = vmovn_u16(vceqq_u16(abs_row6, vdupq_n_u16(0)));
|
||||
uint8x8_t abs_row7_eq0 = vmovn_u16(vceqq_u16(abs_row7, vdupq_n_u16(0)));
|
||||
|
||||
/* { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 } */
|
||||
const uint8x8_t bitmap_mask =
|
||||
vreinterpret_u8_u64(vmov_n_u64(0x8040201008040201));
|
||||
|
||||
abs_row0_eq0 = vand_u8(abs_row0_eq0, bitmap_mask);
|
||||
abs_row1_eq0 = vand_u8(abs_row1_eq0, bitmap_mask);
|
||||
abs_row2_eq0 = vand_u8(abs_row2_eq0, bitmap_mask);
|
||||
abs_row3_eq0 = vand_u8(abs_row3_eq0, bitmap_mask);
|
||||
abs_row4_eq0 = vand_u8(abs_row4_eq0, bitmap_mask);
|
||||
abs_row5_eq0 = vand_u8(abs_row5_eq0, bitmap_mask);
|
||||
abs_row6_eq0 = vand_u8(abs_row6_eq0, bitmap_mask);
|
||||
abs_row7_eq0 = vand_u8(abs_row7_eq0, bitmap_mask);
|
||||
|
||||
uint8x8_t bitmap_rows_01 = vpadd_u8(abs_row0_eq0, abs_row1_eq0);
|
||||
uint8x8_t bitmap_rows_23 = vpadd_u8(abs_row2_eq0, abs_row3_eq0);
|
||||
uint8x8_t bitmap_rows_45 = vpadd_u8(abs_row4_eq0, abs_row5_eq0);
|
||||
uint8x8_t bitmap_rows_67 = vpadd_u8(abs_row6_eq0, abs_row7_eq0);
|
||||
uint8x8_t bitmap_rows_0123 = vpadd_u8(bitmap_rows_01, bitmap_rows_23);
|
||||
uint8x8_t bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
|
||||
uint8x8_t bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Move bitmap to a 64-bit scalar register. */
|
||||
uint64_t bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
|
||||
/* Store zerobits bitmap. */
|
||||
bits[0] = ~bitmap;
|
||||
#else
|
||||
/* Move bitmap to two 32-bit scalar registers. */
|
||||
uint32_t bitmap0 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 0);
|
||||
uint32_t bitmap1 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 1);
|
||||
/* Store zerobits bitmap. */
|
||||
bits[0] = ~bitmap0;
|
||||
bits[1] = ~bitmap1;
|
||||
#endif
|
||||
|
||||
/* Construct signbits bitmap. */
|
||||
uint8x8_t signbits_row0 = vld1_u8(coef_sign_bits + 0 * DCTSIZE);
|
||||
uint8x8_t signbits_row1 = vld1_u8(coef_sign_bits + 1 * DCTSIZE);
|
||||
uint8x8_t signbits_row2 = vld1_u8(coef_sign_bits + 2 * DCTSIZE);
|
||||
uint8x8_t signbits_row3 = vld1_u8(coef_sign_bits + 3 * DCTSIZE);
|
||||
uint8x8_t signbits_row4 = vld1_u8(coef_sign_bits + 4 * DCTSIZE);
|
||||
uint8x8_t signbits_row5 = vld1_u8(coef_sign_bits + 5 * DCTSIZE);
|
||||
uint8x8_t signbits_row6 = vld1_u8(coef_sign_bits + 6 * DCTSIZE);
|
||||
uint8x8_t signbits_row7 = vld1_u8(coef_sign_bits + 7 * DCTSIZE);
|
||||
|
||||
signbits_row0 = vand_u8(signbits_row0, bitmap_mask);
|
||||
signbits_row1 = vand_u8(signbits_row1, bitmap_mask);
|
||||
signbits_row2 = vand_u8(signbits_row2, bitmap_mask);
|
||||
signbits_row3 = vand_u8(signbits_row3, bitmap_mask);
|
||||
signbits_row4 = vand_u8(signbits_row4, bitmap_mask);
|
||||
signbits_row5 = vand_u8(signbits_row5, bitmap_mask);
|
||||
signbits_row6 = vand_u8(signbits_row6, bitmap_mask);
|
||||
signbits_row7 = vand_u8(signbits_row7, bitmap_mask);
|
||||
|
||||
bitmap_rows_01 = vpadd_u8(signbits_row0, signbits_row1);
|
||||
bitmap_rows_23 = vpadd_u8(signbits_row2, signbits_row3);
|
||||
bitmap_rows_45 = vpadd_u8(signbits_row4, signbits_row5);
|
||||
bitmap_rows_67 = vpadd_u8(signbits_row6, signbits_row7);
|
||||
bitmap_rows_0123 = vpadd_u8(bitmap_rows_01, bitmap_rows_23);
|
||||
bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
|
||||
bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Move bitmap to a 64-bit scalar register. */
|
||||
bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
|
||||
/* Store signbits bitmap. */
|
||||
bits[1] = ~bitmap;
|
||||
#else
|
||||
/* Move bitmap to two 32-bit scalar registers. */
|
||||
bitmap0 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 0);
|
||||
bitmap1 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 1);
|
||||
/* Store signbits bitmap. */
|
||||
bits[2] = ~bitmap0;
|
||||
bits[3] = ~bitmap1;
|
||||
#endif
|
||||
|
||||
/* Construct bitmap to find EOB position (the index of the last coefficient
|
||||
* equal to 1.)
|
||||
*/
|
||||
uint8x8_t row0_eq1 = vld1_u8(coef_eq1_bits + 0 * DCTSIZE);
|
||||
uint8x8_t row1_eq1 = vld1_u8(coef_eq1_bits + 1 * DCTSIZE);
|
||||
uint8x8_t row2_eq1 = vld1_u8(coef_eq1_bits + 2 * DCTSIZE);
|
||||
uint8x8_t row3_eq1 = vld1_u8(coef_eq1_bits + 3 * DCTSIZE);
|
||||
uint8x8_t row4_eq1 = vld1_u8(coef_eq1_bits + 4 * DCTSIZE);
|
||||
uint8x8_t row5_eq1 = vld1_u8(coef_eq1_bits + 5 * DCTSIZE);
|
||||
uint8x8_t row6_eq1 = vld1_u8(coef_eq1_bits + 6 * DCTSIZE);
|
||||
uint8x8_t row7_eq1 = vld1_u8(coef_eq1_bits + 7 * DCTSIZE);
|
||||
|
||||
row0_eq1 = vand_u8(row0_eq1, bitmap_mask);
|
||||
row1_eq1 = vand_u8(row1_eq1, bitmap_mask);
|
||||
row2_eq1 = vand_u8(row2_eq1, bitmap_mask);
|
||||
row3_eq1 = vand_u8(row3_eq1, bitmap_mask);
|
||||
row4_eq1 = vand_u8(row4_eq1, bitmap_mask);
|
||||
row5_eq1 = vand_u8(row5_eq1, bitmap_mask);
|
||||
row6_eq1 = vand_u8(row6_eq1, bitmap_mask);
|
||||
row7_eq1 = vand_u8(row7_eq1, bitmap_mask);
|
||||
|
||||
bitmap_rows_01 = vpadd_u8(row0_eq1, row1_eq1);
|
||||
bitmap_rows_23 = vpadd_u8(row2_eq1, row3_eq1);
|
||||
bitmap_rows_45 = vpadd_u8(row4_eq1, row5_eq1);
|
||||
bitmap_rows_67 = vpadd_u8(row6_eq1, row7_eq1);
|
||||
bitmap_rows_0123 = vpadd_u8(bitmap_rows_01, bitmap_rows_23);
|
||||
bitmap_rows_4567 = vpadd_u8(bitmap_rows_45, bitmap_rows_67);
|
||||
bitmap_all = vpadd_u8(bitmap_rows_0123, bitmap_rows_4567);
|
||||
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Move bitmap to a 64-bit scalar register. */
|
||||
bitmap = vget_lane_u64(vreinterpret_u64_u8(bitmap_all), 0);
|
||||
|
||||
/* Return EOB position. */
|
||||
if (bitmap == 0) {
|
||||
/* EOB position is defined to be 0 if all coefficients != 1. */
|
||||
return 0;
|
||||
} else {
|
||||
return 63 - BUILTIN_CLZLL(bitmap);
|
||||
}
|
||||
#else
|
||||
/* Move bitmap to two 32-bit scalar registers. */
|
||||
bitmap0 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 0);
|
||||
bitmap1 = vget_lane_u32(vreinterpret_u32_u8(bitmap_all), 1);
|
||||
|
||||
/* Return EOB position. */
|
||||
if (bitmap0 == 0 && bitmap1 == 0) {
|
||||
return 0;
|
||||
} else if (bitmap1 != 0) {
|
||||
return 63 - BUILTIN_CLZ(bitmap1);
|
||||
} else {
|
||||
return 31 - BUILTIN_CLZ(bitmap0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
/*
|
||||
* jcsample-neon.c - downsampling (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
ALIGN(16) static const uint8_t jsimd_h2_downsample_consts[] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 0 */
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 1 */
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0E,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 2 */
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0D, 0x0D,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 3 */
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 4 */
|
||||
0x08, 0x09, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 5 */
|
||||
0x08, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 6 */
|
||||
0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 7 */
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* Pad 8 */
|
||||
0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, /* Pad 9 */
|
||||
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, /* Pad 10 */
|
||||
0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, /* Pad 11 */
|
||||
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
|
||||
0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, /* Pad 12 */
|
||||
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03,
|
||||
0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* Pad 13 */
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
|
||||
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, /* Pad 14 */
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Pad 15 */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
|
||||
/* Downsample pixel values of a single component.
|
||||
* This version handles the common case of 2:1 horizontal and 1:1 vertical,
|
||||
* without smoothing.
|
||||
*/
|
||||
|
||||
void jsimd_h2v1_downsample_neon(JDIMENSION image_width, int max_v_samp_factor,
|
||||
JDIMENSION v_samp_factor,
|
||||
JDIMENSION width_in_blocks,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
JSAMPROW inptr, outptr;
|
||||
/* Load expansion mask to pad remaining elements of last DCT block. */
|
||||
const int mask_offset = 16 * ((width_in_blocks * 2 * DCTSIZE) - image_width);
|
||||
const uint8x16_t expand_mask =
|
||||
vld1q_u8(&jsimd_h2_downsample_consts[mask_offset]);
|
||||
/* Load bias pattern (alternating every pixel.) */
|
||||
/* { 0, 1, 0, 1, 0, 1, 0, 1 } */
|
||||
const uint16x8_t bias = vreinterpretq_u16_u32(vdupq_n_u32(0x00010000));
|
||||
unsigned i, outrow;
|
||||
|
||||
for (outrow = 0; outrow < v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr = input_data[outrow];
|
||||
|
||||
/* Downsample all but the last DCT block of pixels. */
|
||||
for (i = 0; i < width_in_blocks - 1; i++) {
|
||||
uint8x16_t pixels = vld1q_u8(inptr + i * 2 * DCTSIZE);
|
||||
/* Add adjacent pixel values, widen to 16-bit, and add bias. */
|
||||
uint16x8_t samples_u16 = vpadalq_u8(bias, pixels);
|
||||
/* Divide total by 2 and narrow to 8-bit. */
|
||||
uint8x8_t samples_u8 = vshrn_n_u16(samples_u16, 1);
|
||||
/* Store samples to memory. */
|
||||
vst1_u8(outptr + i * DCTSIZE, samples_u8);
|
||||
}
|
||||
|
||||
/* Load pixels in last DCT block into a table. */
|
||||
uint8x16_t pixels = vld1q_u8(inptr + (width_in_blocks - 1) * 2 * DCTSIZE);
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Pad the empty elements with the value of the last pixel. */
|
||||
pixels = vqtbl1q_u8(pixels, expand_mask);
|
||||
#else
|
||||
uint8x8x2_t table = { { vget_low_u8(pixels), vget_high_u8(pixels) } };
|
||||
pixels = vcombine_u8(vtbl2_u8(table, vget_low_u8(expand_mask)),
|
||||
vtbl2_u8(table, vget_high_u8(expand_mask)));
|
||||
#endif
|
||||
/* Add adjacent pixel values, widen to 16-bit, and add bias. */
|
||||
uint16x8_t samples_u16 = vpadalq_u8(bias, pixels);
|
||||
/* Divide total by 2, narrow to 8-bit, and store. */
|
||||
uint8x8_t samples_u8 = vshrn_n_u16(samples_u16, 1);
|
||||
vst1_u8(outptr + (width_in_blocks - 1) * DCTSIZE, samples_u8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Downsample pixel values of a single component.
|
||||
* This version handles the standard case of 2:1 horizontal and 2:1 vertical,
|
||||
* without smoothing.
|
||||
*/
|
||||
|
||||
void jsimd_h2v2_downsample_neon(JDIMENSION image_width, int max_v_samp_factor,
|
||||
JDIMENSION v_samp_factor,
|
||||
JDIMENSION width_in_blocks,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
JSAMPROW inptr0, inptr1, outptr;
|
||||
/* Load expansion mask to pad remaining elements of last DCT block. */
|
||||
const int mask_offset = 16 * ((width_in_blocks * 2 * DCTSIZE) - image_width);
|
||||
const uint8x16_t expand_mask =
|
||||
vld1q_u8(&jsimd_h2_downsample_consts[mask_offset]);
|
||||
/* Load bias pattern (alternating every pixel.) */
|
||||
/* { 1, 2, 1, 2, 1, 2, 1, 2 } */
|
||||
const uint16x8_t bias = vreinterpretq_u16_u32(vdupq_n_u32(0x00020001));
|
||||
unsigned i, outrow;
|
||||
|
||||
for (outrow = 0; outrow < v_samp_factor; outrow++) {
|
||||
outptr = output_data[outrow];
|
||||
inptr0 = input_data[outrow];
|
||||
inptr1 = input_data[outrow + 1];
|
||||
|
||||
/* Downsample all but the last DCT block of pixels. */
|
||||
for (i = 0; i < width_in_blocks - 1; i++) {
|
||||
uint8x16_t pixels_r0 = vld1q_u8(inptr0 + i * 2 * DCTSIZE);
|
||||
uint8x16_t pixels_r1 = vld1q_u8(inptr1 + i * 2 * DCTSIZE);
|
||||
/* Add adjacent pixel values in row 0, widen to 16-bit, and add bias. */
|
||||
uint16x8_t samples_u16 = vpadalq_u8(bias, pixels_r0);
|
||||
/* Add adjacent pixel values in row 1, widen to 16-bit, and accumulate.
|
||||
*/
|
||||
samples_u16 = vpadalq_u8(samples_u16, pixels_r1);
|
||||
/* Divide total by 4 and narrow to 8-bit. */
|
||||
uint8x8_t samples_u8 = vshrn_n_u16(samples_u16, 2);
|
||||
/* Store samples to memory and increment pointers. */
|
||||
vst1_u8(outptr + i * DCTSIZE, samples_u8);
|
||||
}
|
||||
|
||||
/* Load pixels in last DCT block into a table. */
|
||||
uint8x16_t pixels_r0 =
|
||||
vld1q_u8(inptr0 + (width_in_blocks - 1) * 2 * DCTSIZE);
|
||||
uint8x16_t pixels_r1 =
|
||||
vld1q_u8(inptr1 + (width_in_blocks - 1) * 2 * DCTSIZE);
|
||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||
/* Pad the empty elements with the value of the last pixel. */
|
||||
pixels_r0 = vqtbl1q_u8(pixels_r0, expand_mask);
|
||||
pixels_r1 = vqtbl1q_u8(pixels_r1, expand_mask);
|
||||
#else
|
||||
uint8x8x2_t table_r0 =
|
||||
{ { vget_low_u8(pixels_r0), vget_high_u8(pixels_r0) } };
|
||||
uint8x8x2_t table_r1 =
|
||||
{ { vget_low_u8(pixels_r1), vget_high_u8(pixels_r1) } };
|
||||
pixels_r0 = vcombine_u8(vtbl2_u8(table_r0, vget_low_u8(expand_mask)),
|
||||
vtbl2_u8(table_r0, vget_high_u8(expand_mask)));
|
||||
pixels_r1 = vcombine_u8(vtbl2_u8(table_r1, vget_low_u8(expand_mask)),
|
||||
vtbl2_u8(table_r1, vget_high_u8(expand_mask)));
|
||||
#endif
|
||||
/* Add adjacent pixel values in row 0, widen to 16-bit, and add bias. */
|
||||
uint16x8_t samples_u16 = vpadalq_u8(bias, pixels_r0);
|
||||
/* Add adjacent pixel values in row 1, widen to 16-bit, and accumulate. */
|
||||
samples_u16 = vpadalq_u8(samples_u16, pixels_r1);
|
||||
/* Divide total by 4, narrow to 8-bit, and store. */
|
||||
uint8x8_t samples_u8 = vshrn_n_u16(samples_u16, 2);
|
||||
vst1_u8(outptr + (width_in_blocks - 1) * DCTSIZE, samples_u8);
|
||||
}
|
||||
}
|
||||
+374
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
* jdcolext-neon.c - colorspace conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* This file is included by jdcolor-neon.c. */
|
||||
|
||||
|
||||
/* YCbCr -> RGB conversion is defined by the following equations:
|
||||
* R = Y + 1.40200 * (Cr - 128)
|
||||
* G = Y - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128)
|
||||
* B = Y + 1.77200 * (Cb - 128)
|
||||
*
|
||||
* Scaled integer constants are used to avoid floating-point arithmetic:
|
||||
* 0.3441467 = 11277 * 2^-15
|
||||
* 0.7141418 = 23401 * 2^-15
|
||||
* 1.4020386 = 22971 * 2^-14
|
||||
* 1.7720337 = 29033 * 2^-14
|
||||
* These constants are defined in jdcolor-neon.c.
|
||||
*
|
||||
* To ensure correct results, rounding is used when descaling.
|
||||
*/
|
||||
|
||||
/* Notes on safe memory access for YCbCr -> RGB conversion routines:
|
||||
*
|
||||
* Input memory buffers can be safely overread up to the next multiple of
|
||||
* ALIGN_SIZE bytes, since they are always allocated by alloc_sarray() in
|
||||
* jmemmgr.c.
|
||||
*
|
||||
* The output buffer cannot safely be written beyond output_width, since
|
||||
* output_buf points to a possibly unpadded row in the decompressed image
|
||||
* buffer allocated by the calling program.
|
||||
*/
|
||||
|
||||
void jsimd_ycc_rgb_convert_neon(JDIMENSION output_width, JSAMPIMAGE input_buf,
|
||||
JDIMENSION input_row, JSAMPARRAY output_buf,
|
||||
int num_rows)
|
||||
{
|
||||
JSAMPROW outptr;
|
||||
/* Pointers to Y, Cb, and Cr data */
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
|
||||
const int16x4_t consts = vld1_s16(jsimd_ycc_rgb_convert_neon_consts);
|
||||
const int16x8_t neg_128 = vdupq_n_s16(-128);
|
||||
|
||||
while (--num_rows >= 0) {
|
||||
inptr0 = input_buf[0][input_row];
|
||||
inptr1 = input_buf[1][input_row];
|
||||
inptr2 = input_buf[2][input_row];
|
||||
input_row++;
|
||||
outptr = *output_buf++;
|
||||
int cols_remaining = output_width;
|
||||
for (; cols_remaining >= 16; cols_remaining -= 16) {
|
||||
uint8x16_t y = vld1q_u8(inptr0);
|
||||
uint8x16_t cb = vld1q_u8(inptr1);
|
||||
uint8x16_t cr = vld1q_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128_l =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128),
|
||||
vget_low_u8(cr)));
|
||||
int16x8_t cr_128_h =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128),
|
||||
vget_high_u8(cr)));
|
||||
int16x8_t cb_128_l =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128),
|
||||
vget_low_u8(cb)));
|
||||
int16x8_t cb_128_h =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128),
|
||||
vget_high_u8(cb)));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_ll = vmull_lane_s16(vget_low_s16(cb_128_l), consts, 0);
|
||||
int32x4_t g_sub_y_lh = vmull_lane_s16(vget_high_s16(cb_128_l),
|
||||
consts, 0);
|
||||
int32x4_t g_sub_y_hl = vmull_lane_s16(vget_low_s16(cb_128_h), consts, 0);
|
||||
int32x4_t g_sub_y_hh = vmull_lane_s16(vget_high_s16(cb_128_h),
|
||||
consts, 0);
|
||||
g_sub_y_ll = vmlsl_lane_s16(g_sub_y_ll, vget_low_s16(cr_128_l),
|
||||
consts, 1);
|
||||
g_sub_y_lh = vmlsl_lane_s16(g_sub_y_lh, vget_high_s16(cr_128_l),
|
||||
consts, 1);
|
||||
g_sub_y_hl = vmlsl_lane_s16(g_sub_y_hl, vget_low_s16(cr_128_h),
|
||||
consts, 1);
|
||||
g_sub_y_hh = vmlsl_lane_s16(g_sub_y_hh, vget_high_s16(cr_128_h),
|
||||
consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y_l = vcombine_s16(vrshrn_n_s32(g_sub_y_ll, 15),
|
||||
vrshrn_n_s32(g_sub_y_lh, 15));
|
||||
int16x8_t g_sub_y_h = vcombine_s16(vrshrn_n_s32(g_sub_y_hl, 15),
|
||||
vrshrn_n_s32(g_sub_y_hh, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y_l = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128_l, 1),
|
||||
consts, 2);
|
||||
int16x8_t r_sub_y_h = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128_h, 1),
|
||||
consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y_l = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128_l, 1),
|
||||
consts, 3);
|
||||
int16x8_t b_sub_y_h = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128_h, 1),
|
||||
consts, 3);
|
||||
/* Add Y. */
|
||||
int16x8_t r_l =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y_l),
|
||||
vget_low_u8(y)));
|
||||
int16x8_t r_h =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y_h),
|
||||
vget_high_u8(y)));
|
||||
int16x8_t b_l =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y_l),
|
||||
vget_low_u8(y)));
|
||||
int16x8_t b_h =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y_h),
|
||||
vget_high_u8(y)));
|
||||
int16x8_t g_l =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y_l),
|
||||
vget_low_u8(y)));
|
||||
int16x8_t g_h =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y_h),
|
||||
vget_high_u8(y)));
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x16x4_t rgba;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgba.val[RGB_RED] = vcombine_u8(vqmovun_s16(r_l), vqmovun_s16(r_h));
|
||||
rgba.val[RGB_GREEN] = vcombine_u8(vqmovun_s16(g_l), vqmovun_s16(g_h));
|
||||
rgba.val[RGB_BLUE] = vcombine_u8(vqmovun_s16(b_l), vqmovun_s16(b_h));
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba.val[RGB_ALPHA] = vdupq_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
vst4q_u8(outptr, rgba);
|
||||
#elif RGB_PIXELSIZE == 3
|
||||
uint8x16x3_t rgb;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgb.val[RGB_RED] = vcombine_u8(vqmovun_s16(r_l), vqmovun_s16(r_h));
|
||||
rgb.val[RGB_GREEN] = vcombine_u8(vqmovun_s16(g_l), vqmovun_s16(g_h));
|
||||
rgb.val[RGB_BLUE] = vcombine_u8(vqmovun_s16(b_l), vqmovun_s16(b_h));
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst3q_u8(outptr, rgb);
|
||||
#else
|
||||
/* Pack R, G, and B values in ratio 5:6:5. */
|
||||
uint16x8_t rgb565_l = vqshluq_n_s16(r_l, 8);
|
||||
rgb565_l = vsriq_n_u16(rgb565_l, vqshluq_n_s16(g_l, 8), 5);
|
||||
rgb565_l = vsriq_n_u16(rgb565_l, vqshluq_n_s16(b_l, 8), 11);
|
||||
uint16x8_t rgb565_h = vqshluq_n_s16(r_h, 8);
|
||||
rgb565_h = vsriq_n_u16(rgb565_h, vqshluq_n_s16(g_h, 8), 5);
|
||||
rgb565_h = vsriq_n_u16(rgb565_h, vqshluq_n_s16(b_h, 8), 11);
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst1q_u16((uint16_t *)outptr, rgb565_l);
|
||||
vst1q_u16(((uint16_t *)outptr) + 8, rgb565_h);
|
||||
#endif
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr0 += 16;
|
||||
inptr1 += 16;
|
||||
inptr2 += 16;
|
||||
outptr += (RGB_PIXELSIZE * 16);
|
||||
}
|
||||
|
||||
if (cols_remaining >= 8) {
|
||||
uint8x8_t y = vld1_u8(inptr0);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1),
|
||||
consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1),
|
||||
consts, 3);
|
||||
/* Add Y. */
|
||||
int16x8_t r =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y), y));
|
||||
int16x8_t b =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y), y));
|
||||
int16x8_t g =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y), y));
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x8x4_t rgba;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgba.val[RGB_RED] = vqmovun_s16(r);
|
||||
rgba.val[RGB_GREEN] = vqmovun_s16(g);
|
||||
rgba.val[RGB_BLUE] = vqmovun_s16(b);
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
vst4_u8(outptr, rgba);
|
||||
#elif RGB_PIXELSIZE == 3
|
||||
uint8x8x3_t rgb;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgb.val[RGB_RED] = vqmovun_s16(r);
|
||||
rgb.val[RGB_GREEN] = vqmovun_s16(g);
|
||||
rgb.val[RGB_BLUE] = vqmovun_s16(b);
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst3_u8(outptr, rgb);
|
||||
#else
|
||||
/* Pack R, G, and B values in ratio 5:6:5. */
|
||||
uint16x8_t rgb565 = vqshluq_n_s16(r, 8);
|
||||
rgb565 = vsriq_n_u16(rgb565, vqshluq_n_s16(g, 8), 5);
|
||||
rgb565 = vsriq_n_u16(rgb565, vqshluq_n_s16(b, 8), 11);
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst1q_u16((uint16_t *)outptr, rgb565);
|
||||
#endif
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr0 += 8;
|
||||
inptr1 += 8;
|
||||
inptr2 += 8;
|
||||
outptr += (RGB_PIXELSIZE * 8);
|
||||
cols_remaining -= 8;
|
||||
}
|
||||
|
||||
/* Handle the tail elements. */
|
||||
if (cols_remaining > 0) {
|
||||
uint8x8_t y = vld1_u8(inptr0);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1),
|
||||
consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1),
|
||||
consts, 3);
|
||||
/* Add Y. */
|
||||
int16x8_t r =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y), y));
|
||||
int16x8_t b =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y), y));
|
||||
int16x8_t g =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y), y));
|
||||
|
||||
#if RGB_PIXELSIZE == 4
|
||||
uint8x8x4_t rgba;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgba.val[RGB_RED] = vqmovun_s16(r);
|
||||
rgba.val[RGB_GREEN] = vqmovun_s16(g);
|
||||
rgba.val[RGB_BLUE] = vqmovun_s16(b);
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 7:
|
||||
vst4_lane_u8(outptr + 6 * RGB_PIXELSIZE, rgba, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst4_lane_u8(outptr + 5 * RGB_PIXELSIZE, rgba, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst4_lane_u8(outptr + 4 * RGB_PIXELSIZE, rgba, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst4_lane_u8(outptr + 3 * RGB_PIXELSIZE, rgba, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst4_lane_u8(outptr + 2 * RGB_PIXELSIZE, rgba, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst4_lane_u8(outptr + RGB_PIXELSIZE, rgba, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst4_lane_u8(outptr, rgba, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#elif RGB_PIXELSIZE == 3
|
||||
uint8x8x3_t rgb;
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255]. */
|
||||
rgb.val[RGB_RED] = vqmovun_s16(r);
|
||||
rgb.val[RGB_GREEN] = vqmovun_s16(g);
|
||||
rgb.val[RGB_BLUE] = vqmovun_s16(b);
|
||||
/* Store RGB pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 7:
|
||||
vst3_lane_u8(outptr + 6 * RGB_PIXELSIZE, rgb, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst3_lane_u8(outptr + 5 * RGB_PIXELSIZE, rgb, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst3_lane_u8(outptr + 4 * RGB_PIXELSIZE, rgb, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst3_lane_u8(outptr + 3 * RGB_PIXELSIZE, rgb, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst3_lane_u8(outptr + 2 * RGB_PIXELSIZE, rgb, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst3_lane_u8(outptr + RGB_PIXELSIZE, rgb, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst3_lane_u8(outptr, rgb, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#else
|
||||
/* Pack R, G, and B values in ratio 5:6:5. */
|
||||
uint16x8_t rgb565 = vqshluq_n_s16(r, 8);
|
||||
rgb565 = vsriq_n_u16(rgb565, vqshluq_n_s16(g, 8), 5);
|
||||
rgb565 = vsriq_n_u16(rgb565, vqshluq_n_s16(b, 8), 11);
|
||||
/* Store RGB565 pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 7:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + 6 * RGB_PIXELSIZE), rgb565, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + 5 * RGB_PIXELSIZE), rgb565, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + 4 * RGB_PIXELSIZE), rgb565, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + 3 * RGB_PIXELSIZE), rgb565, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + 2 * RGB_PIXELSIZE), rgb565, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst1q_lane_u16((uint16_t *)(outptr + RGB_PIXELSIZE), rgb565, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst1q_lane_u16((uint16_t *)outptr, rgb565, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
+143
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* jdcolor-neon.c - colorspace conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* YCbCr -> RGB conversion constants */
|
||||
|
||||
#define F_0_344 11277 /* 0.3441467 = 11277 * 2^-15 */
|
||||
#define F_0_714 23401 /* 0.7141418 = 23401 * 2^-15 */
|
||||
#define F_1_402 22971 /* 1.4020386 = 22971 * 2^-14 */
|
||||
#define F_1_772 29033 /* 1.7720337 = 29033 * 2^-14 */
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_ycc_rgb_convert_neon_consts[] = {
|
||||
-F_0_344, F_0_714, F_1_402, F_1_772
|
||||
};
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions. */
|
||||
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extrgb_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extrgbx_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extbgr_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extbgrx_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extxbgr_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_extxrgb_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
|
||||
/* YCbCr -> RGB565 Conversion */
|
||||
|
||||
#define RGB_PIXELSIZE 2
|
||||
#define jsimd_ycc_rgb_convert_neon jsimd_ycc_rgb565_convert_neon
|
||||
#include "jdcolext-neon.c"
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_ycc_rgb_convert_neon
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* jdmerge-neon.c - merged upsampling/color conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* YCbCr -> RGB conversion constants */
|
||||
|
||||
#define F_0_344 11277 /* 0.3441467 = 11277 * 2^-15 */
|
||||
#define F_0_714 23401 /* 0.7141418 = 23401 * 2^-15 */
|
||||
#define F_1_402 22971 /* 1.4020386 = 22971 * 2^-14 */
|
||||
#define F_1_772 29033 /* 1.7720337 = 29033 * 2^-14 */
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_ycc_rgb_convert_neon_consts[] = {
|
||||
-F_0_344, F_0_714, F_1_402, F_1_772
|
||||
};
|
||||
|
||||
|
||||
/* Include inline routines for colorspace extensions. */
|
||||
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
|
||||
#define RGB_RED EXT_RGB_RED
|
||||
#define RGB_GREEN EXT_RGB_GREEN
|
||||
#define RGB_BLUE EXT_RGB_BLUE
|
||||
#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extrgb_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extrgb_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
#undef jsimd_h2v2_merged_upsample_neon
|
||||
|
||||
#define RGB_RED EXT_RGBX_RED
|
||||
#define RGB_GREEN EXT_RGBX_GREEN
|
||||
#define RGB_BLUE EXT_RGBX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extrgbx_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extrgbx_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
#undef jsimd_h2v2_merged_upsample_neon
|
||||
|
||||
#define RGB_RED EXT_BGR_RED
|
||||
#define RGB_GREEN EXT_BGR_GREEN
|
||||
#define RGB_BLUE EXT_BGR_BLUE
|
||||
#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extbgr_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extbgr_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
#undef jsimd_h2v2_merged_upsample_neon
|
||||
|
||||
#define RGB_RED EXT_BGRX_RED
|
||||
#define RGB_GREEN EXT_BGRX_GREEN
|
||||
#define RGB_BLUE EXT_BGRX_BLUE
|
||||
#define RGB_ALPHA 3
|
||||
#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extbgrx_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extbgrx_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
#undef jsimd_h2v2_merged_upsample_neon
|
||||
|
||||
#define RGB_RED EXT_XBGR_RED
|
||||
#define RGB_GREEN EXT_XBGR_GREEN
|
||||
#define RGB_BLUE EXT_XBGR_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extxbgr_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extxbgr_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
#undef jsimd_h2v2_merged_upsample_neon
|
||||
|
||||
#define RGB_RED EXT_XRGB_RED
|
||||
#define RGB_GREEN EXT_XRGB_GREEN
|
||||
#define RGB_BLUE EXT_XRGB_BLUE
|
||||
#define RGB_ALPHA 0
|
||||
#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE
|
||||
#define jsimd_h2v1_merged_upsample_neon jsimd_h2v1_extxrgb_merged_upsample_neon
|
||||
#define jsimd_h2v2_merged_upsample_neon jsimd_h2v2_extxrgb_merged_upsample_neon
|
||||
#include "jdmrgext-neon.c"
|
||||
#undef RGB_RED
|
||||
#undef RGB_GREEN
|
||||
#undef RGB_BLUE
|
||||
#undef RGB_ALPHA
|
||||
#undef RGB_PIXELSIZE
|
||||
#undef jsimd_h2v1_merged_upsample_neon
|
||||
+723
@@ -0,0 +1,723 @@
|
||||
/*
|
||||
* jdmrgext-neon.c - merged upsampling/color conversion (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
/* This file is included by jdmerge-neon.c. */
|
||||
|
||||
|
||||
/* These routines combine simple (non-fancy, i.e. non-smooth) h2v1 or h2v2
|
||||
* chroma upsampling and YCbCr -> RGB color conversion into a single function.
|
||||
*
|
||||
* As with the standalone functions, YCbCr -> RGB conversion is defined by the
|
||||
* following equations:
|
||||
* R = Y + 1.40200 * (Cr - 128)
|
||||
* G = Y - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128)
|
||||
* B = Y + 1.77200 * (Cb - 128)
|
||||
*
|
||||
* Scaled integer constants are used to avoid floating-point arithmetic:
|
||||
* 0.3441467 = 11277 * 2^-15
|
||||
* 0.7141418 = 23401 * 2^-15
|
||||
* 1.4020386 = 22971 * 2^-14
|
||||
* 1.7720337 = 29033 * 2^-14
|
||||
* These constants are defined in jdmerge-neon.c.
|
||||
*
|
||||
* To ensure correct results, rounding is used when descaling.
|
||||
*/
|
||||
|
||||
/* Notes on safe memory access for merged upsampling/YCbCr -> RGB conversion
|
||||
* routines:
|
||||
*
|
||||
* Input memory buffers can be safely overread up to the next multiple of
|
||||
* ALIGN_SIZE bytes, since they are always allocated by alloc_sarray() in
|
||||
* jmemmgr.c.
|
||||
*
|
||||
* The output buffer cannot safely be written beyond output_width, since
|
||||
* output_buf points to a possibly unpadded row in the decompressed image
|
||||
* buffer allocated by the calling program.
|
||||
*/
|
||||
|
||||
/* Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical.
|
||||
*/
|
||||
|
||||
void jsimd_h2v1_merged_upsample_neon(JDIMENSION output_width,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
JSAMPROW outptr;
|
||||
/* Pointers to Y, Cb, and Cr data */
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
|
||||
const int16x4_t consts = vld1_s16(jsimd_ycc_rgb_convert_neon_consts);
|
||||
const int16x8_t neg_128 = vdupq_n_s16(-128);
|
||||
|
||||
inptr0 = input_buf[0][in_row_group_ctr];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr = output_buf[0];
|
||||
|
||||
int cols_remaining = output_width;
|
||||
for (; cols_remaining >= 16; cols_remaining -= 16) {
|
||||
/* De-interleave Y component values into two separate vectors, one
|
||||
* containing the component values with even-numbered indices and one
|
||||
* containing the component values with odd-numbered indices.
|
||||
*/
|
||||
uint8x8x2_t y = vld2_u8(inptr0);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1), consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1), consts, 3);
|
||||
/* Add the chroma-derived values (G-Y, R-Y, and B-Y) to both the "even" and
|
||||
* "odd" Y component values. This effectively upsamples the chroma
|
||||
* components horizontally.
|
||||
*/
|
||||
int16x8_t g_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t r_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t b_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t g_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y.val[1]));
|
||||
int16x8_t r_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y.val[1]));
|
||||
int16x8_t b_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y.val[1]));
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255].
|
||||
* Re-interleave the "even" and "odd" component values.
|
||||
*/
|
||||
uint8x8x2_t r = vzip_u8(vqmovun_s16(r_even), vqmovun_s16(r_odd));
|
||||
uint8x8x2_t g = vzip_u8(vqmovun_s16(g_even), vqmovun_s16(g_odd));
|
||||
uint8x8x2_t b = vzip_u8(vqmovun_s16(b_even), vqmovun_s16(b_odd));
|
||||
|
||||
#ifdef RGB_ALPHA
|
||||
uint8x16x4_t rgba;
|
||||
rgba.val[RGB_RED] = vcombine_u8(r.val[0], r.val[1]);
|
||||
rgba.val[RGB_GREEN] = vcombine_u8(g.val[0], g.val[1]);
|
||||
rgba.val[RGB_BLUE] = vcombine_u8(b.val[0], b.val[1]);
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba.val[RGB_ALPHA] = vdupq_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
vst4q_u8(outptr, rgba);
|
||||
#else
|
||||
uint8x16x3_t rgb;
|
||||
rgb.val[RGB_RED] = vcombine_u8(r.val[0], r.val[1]);
|
||||
rgb.val[RGB_GREEN] = vcombine_u8(g.val[0], g.val[1]);
|
||||
rgb.val[RGB_BLUE] = vcombine_u8(b.val[0], b.val[1]);
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst3q_u8(outptr, rgb);
|
||||
#endif
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr0 += 16;
|
||||
inptr1 += 8;
|
||||
inptr2 += 8;
|
||||
outptr += (RGB_PIXELSIZE * 16);
|
||||
}
|
||||
|
||||
if (cols_remaining > 0) {
|
||||
/* De-interleave Y component values into two separate vectors, one
|
||||
* containing the component values with even-numbered indices and one
|
||||
* containing the component values with odd-numbered indices.
|
||||
*/
|
||||
uint8x8x2_t y = vld2_u8(inptr0);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1), consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1), consts, 3);
|
||||
/* Add the chroma-derived values (G-Y, R-Y, and B-Y) to both the "even" and
|
||||
* "odd" Y component values. This effectively upsamples the chroma
|
||||
* components horizontally.
|
||||
*/
|
||||
int16x8_t g_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t r_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t b_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y.val[0]));
|
||||
int16x8_t g_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y.val[1]));
|
||||
int16x8_t r_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y.val[1]));
|
||||
int16x8_t b_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y.val[1]));
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255].
|
||||
* Re-interleave the "even" and "odd" component values.
|
||||
*/
|
||||
uint8x8x2_t r = vzip_u8(vqmovun_s16(r_even), vqmovun_s16(r_odd));
|
||||
uint8x8x2_t g = vzip_u8(vqmovun_s16(g_even), vqmovun_s16(g_odd));
|
||||
uint8x8x2_t b = vzip_u8(vqmovun_s16(b_even), vqmovun_s16(b_odd));
|
||||
|
||||
#ifdef RGB_ALPHA
|
||||
uint8x8x4_t rgba_h;
|
||||
rgba_h.val[RGB_RED] = r.val[1];
|
||||
rgba_h.val[RGB_GREEN] = g.val[1];
|
||||
rgba_h.val[RGB_BLUE] = b.val[1];
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba_h.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
uint8x8x4_t rgba_l;
|
||||
rgba_l.val[RGB_RED] = r.val[0];
|
||||
rgba_l.val[RGB_GREEN] = g.val[0];
|
||||
rgba_l.val[RGB_BLUE] = b.val[0];
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba_l.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 15:
|
||||
vst4_lane_u8(outptr + 14 * RGB_PIXELSIZE, rgba_h, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
vst4_lane_u8(outptr + 13 * RGB_PIXELSIZE, rgba_h, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
vst4_lane_u8(outptr + 12 * RGB_PIXELSIZE, rgba_h, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
vst4_lane_u8(outptr + 11 * RGB_PIXELSIZE, rgba_h, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
vst4_lane_u8(outptr + 10 * RGB_PIXELSIZE, rgba_h, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
vst4_lane_u8(outptr + 9 * RGB_PIXELSIZE, rgba_h, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
vst4_lane_u8(outptr + 8 * RGB_PIXELSIZE, rgba_h, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 8:
|
||||
vst4_u8(outptr, rgba_l);
|
||||
break;
|
||||
case 7:
|
||||
vst4_lane_u8(outptr + 6 * RGB_PIXELSIZE, rgba_l, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst4_lane_u8(outptr + 5 * RGB_PIXELSIZE, rgba_l, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst4_lane_u8(outptr + 4 * RGB_PIXELSIZE, rgba_l, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst4_lane_u8(outptr + 3 * RGB_PIXELSIZE, rgba_l, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst4_lane_u8(outptr + 2 * RGB_PIXELSIZE, rgba_l, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst4_lane_u8(outptr + RGB_PIXELSIZE, rgba_l, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst4_lane_u8(outptr, rgba_l, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#else
|
||||
uint8x8x3_t rgb_h;
|
||||
rgb_h.val[RGB_RED] = r.val[1];
|
||||
rgb_h.val[RGB_GREEN] = g.val[1];
|
||||
rgb_h.val[RGB_BLUE] = b.val[1];
|
||||
uint8x8x3_t rgb_l;
|
||||
rgb_l.val[RGB_RED] = r.val[0];
|
||||
rgb_l.val[RGB_GREEN] = g.val[0];
|
||||
rgb_l.val[RGB_BLUE] = b.val[0];
|
||||
/* Store RGB pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 15:
|
||||
vst3_lane_u8(outptr + 14 * RGB_PIXELSIZE, rgb_h, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
vst3_lane_u8(outptr + 13 * RGB_PIXELSIZE, rgb_h, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
vst3_lane_u8(outptr + 12 * RGB_PIXELSIZE, rgb_h, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
vst3_lane_u8(outptr + 11 * RGB_PIXELSIZE, rgb_h, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
vst3_lane_u8(outptr + 10 * RGB_PIXELSIZE, rgb_h, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
vst3_lane_u8(outptr + 9 * RGB_PIXELSIZE, rgb_h, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
vst3_lane_u8(outptr + 8 * RGB_PIXELSIZE, rgb_h, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 8:
|
||||
vst3_u8(outptr, rgb_l);
|
||||
break;
|
||||
case 7:
|
||||
vst3_lane_u8(outptr + 6 * RGB_PIXELSIZE, rgb_l, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst3_lane_u8(outptr + 5 * RGB_PIXELSIZE, rgb_l, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst3_lane_u8(outptr + 4 * RGB_PIXELSIZE, rgb_l, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst3_lane_u8(outptr + 3 * RGB_PIXELSIZE, rgb_l, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst3_lane_u8(outptr + 2 * RGB_PIXELSIZE, rgb_l, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst3_lane_u8(outptr + RGB_PIXELSIZE, rgb_l, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst3_lane_u8(outptr, rgb_l, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical.
|
||||
*
|
||||
* See comments above for details regarding color conversion and safe memory
|
||||
* access.
|
||||
*/
|
||||
|
||||
void jsimd_h2v2_merged_upsample_neon(JDIMENSION output_width,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
JSAMPROW outptr0, outptr1;
|
||||
/* Pointers to Y (both rows), Cb, and Cr data */
|
||||
JSAMPROW inptr0_0, inptr0_1, inptr1, inptr2;
|
||||
|
||||
const int16x4_t consts = vld1_s16(jsimd_ycc_rgb_convert_neon_consts);
|
||||
const int16x8_t neg_128 = vdupq_n_s16(-128);
|
||||
|
||||
inptr0_0 = input_buf[0][in_row_group_ctr * 2];
|
||||
inptr0_1 = input_buf[0][in_row_group_ctr * 2 + 1];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr0 = output_buf[0];
|
||||
outptr1 = output_buf[1];
|
||||
|
||||
int cols_remaining = output_width;
|
||||
for (; cols_remaining >= 16; cols_remaining -= 16) {
|
||||
/* For each row, de-interleave Y component values into two separate
|
||||
* vectors, one containing the component values with even-numbered indices
|
||||
* and one containing the component values with odd-numbered indices.
|
||||
*/
|
||||
uint8x8x2_t y0 = vld2_u8(inptr0_0);
|
||||
uint8x8x2_t y1 = vld2_u8(inptr0_1);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1), consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1), consts, 3);
|
||||
/* For each row, add the chroma-derived values (G-Y, R-Y, and B-Y) to both
|
||||
* the "even" and "odd" Y component values. This effectively upsamples the
|
||||
* chroma components both horizontally and vertically.
|
||||
*/
|
||||
int16x8_t g0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t r0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t b0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t g0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t r0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t b0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t g1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t r1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t b1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t g1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y1.val[1]));
|
||||
int16x8_t r1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y1.val[1]));
|
||||
int16x8_t b1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y1.val[1]));
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255].
|
||||
* Re-interleave the "even" and "odd" component values.
|
||||
*/
|
||||
uint8x8x2_t r0 = vzip_u8(vqmovun_s16(r0_even), vqmovun_s16(r0_odd));
|
||||
uint8x8x2_t r1 = vzip_u8(vqmovun_s16(r1_even), vqmovun_s16(r1_odd));
|
||||
uint8x8x2_t g0 = vzip_u8(vqmovun_s16(g0_even), vqmovun_s16(g0_odd));
|
||||
uint8x8x2_t g1 = vzip_u8(vqmovun_s16(g1_even), vqmovun_s16(g1_odd));
|
||||
uint8x8x2_t b0 = vzip_u8(vqmovun_s16(b0_even), vqmovun_s16(b0_odd));
|
||||
uint8x8x2_t b1 = vzip_u8(vqmovun_s16(b1_even), vqmovun_s16(b1_odd));
|
||||
|
||||
#ifdef RGB_ALPHA
|
||||
uint8x16x4_t rgba0, rgba1;
|
||||
rgba0.val[RGB_RED] = vcombine_u8(r0.val[0], r0.val[1]);
|
||||
rgba1.val[RGB_RED] = vcombine_u8(r1.val[0], r1.val[1]);
|
||||
rgba0.val[RGB_GREEN] = vcombine_u8(g0.val[0], g0.val[1]);
|
||||
rgba1.val[RGB_GREEN] = vcombine_u8(g1.val[0], g1.val[1]);
|
||||
rgba0.val[RGB_BLUE] = vcombine_u8(b0.val[0], b0.val[1]);
|
||||
rgba1.val[RGB_BLUE] = vcombine_u8(b1.val[0], b1.val[1]);
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba0.val[RGB_ALPHA] = vdupq_n_u8(0xFF);
|
||||
rgba1.val[RGB_ALPHA] = vdupq_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
vst4q_u8(outptr0, rgba0);
|
||||
vst4q_u8(outptr1, rgba1);
|
||||
#else
|
||||
uint8x16x3_t rgb0, rgb1;
|
||||
rgb0.val[RGB_RED] = vcombine_u8(r0.val[0], r0.val[1]);
|
||||
rgb1.val[RGB_RED] = vcombine_u8(r1.val[0], r1.val[1]);
|
||||
rgb0.val[RGB_GREEN] = vcombine_u8(g0.val[0], g0.val[1]);
|
||||
rgb1.val[RGB_GREEN] = vcombine_u8(g1.val[0], g1.val[1]);
|
||||
rgb0.val[RGB_BLUE] = vcombine_u8(b0.val[0], b0.val[1]);
|
||||
rgb1.val[RGB_BLUE] = vcombine_u8(b1.val[0], b1.val[1]);
|
||||
/* Store RGB pixel data to memory. */
|
||||
vst3q_u8(outptr0, rgb0);
|
||||
vst3q_u8(outptr1, rgb1);
|
||||
#endif
|
||||
|
||||
/* Increment pointers. */
|
||||
inptr0_0 += 16;
|
||||
inptr0_1 += 16;
|
||||
inptr1 += 8;
|
||||
inptr2 += 8;
|
||||
outptr0 += (RGB_PIXELSIZE * 16);
|
||||
outptr1 += (RGB_PIXELSIZE * 16);
|
||||
}
|
||||
|
||||
if (cols_remaining > 0) {
|
||||
/* For each row, de-interleave Y component values into two separate
|
||||
* vectors, one containing the component values with even-numbered indices
|
||||
* and one containing the component values with odd-numbered indices.
|
||||
*/
|
||||
uint8x8x2_t y0 = vld2_u8(inptr0_0);
|
||||
uint8x8x2_t y1 = vld2_u8(inptr0_1);
|
||||
uint8x8_t cb = vld1_u8(inptr1);
|
||||
uint8x8_t cr = vld1_u8(inptr2);
|
||||
/* Subtract 128 from Cb and Cr. */
|
||||
int16x8_t cr_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cr));
|
||||
int16x8_t cb_128 =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(neg_128), cb));
|
||||
/* Compute G-Y: - 0.34414 * (Cb - 128) - 0.71414 * (Cr - 128) */
|
||||
int32x4_t g_sub_y_l = vmull_lane_s16(vget_low_s16(cb_128), consts, 0);
|
||||
int32x4_t g_sub_y_h = vmull_lane_s16(vget_high_s16(cb_128), consts, 0);
|
||||
g_sub_y_l = vmlsl_lane_s16(g_sub_y_l, vget_low_s16(cr_128), consts, 1);
|
||||
g_sub_y_h = vmlsl_lane_s16(g_sub_y_h, vget_high_s16(cr_128), consts, 1);
|
||||
/* Descale G components: shift right 15, round, and narrow to 16-bit. */
|
||||
int16x8_t g_sub_y = vcombine_s16(vrshrn_n_s32(g_sub_y_l, 15),
|
||||
vrshrn_n_s32(g_sub_y_h, 15));
|
||||
/* Compute R-Y: 1.40200 * (Cr - 128) */
|
||||
int16x8_t r_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cr_128, 1), consts, 2);
|
||||
/* Compute B-Y: 1.77200 * (Cb - 128) */
|
||||
int16x8_t b_sub_y = vqrdmulhq_lane_s16(vshlq_n_s16(cb_128, 1), consts, 3);
|
||||
/* For each row, add the chroma-derived values (G-Y, R-Y, and B-Y) to both
|
||||
* the "even" and "odd" Y component values. This effectively upsamples the
|
||||
* chroma components both horizontally and vertically.
|
||||
*/
|
||||
int16x8_t g0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t r0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t b0_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y0.val[0]));
|
||||
int16x8_t g0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t r0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t b0_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y0.val[1]));
|
||||
int16x8_t g1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t r1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t b1_even =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y1.val[0]));
|
||||
int16x8_t g1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(g_sub_y),
|
||||
y1.val[1]));
|
||||
int16x8_t r1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(r_sub_y),
|
||||
y1.val[1]));
|
||||
int16x8_t b1_odd =
|
||||
vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(b_sub_y),
|
||||
y1.val[1]));
|
||||
/* Convert each component to unsigned and narrow, clamping to [0-255].
|
||||
* Re-interleave the "even" and "odd" component values.
|
||||
*/
|
||||
uint8x8x2_t r0 = vzip_u8(vqmovun_s16(r0_even), vqmovun_s16(r0_odd));
|
||||
uint8x8x2_t r1 = vzip_u8(vqmovun_s16(r1_even), vqmovun_s16(r1_odd));
|
||||
uint8x8x2_t g0 = vzip_u8(vqmovun_s16(g0_even), vqmovun_s16(g0_odd));
|
||||
uint8x8x2_t g1 = vzip_u8(vqmovun_s16(g1_even), vqmovun_s16(g1_odd));
|
||||
uint8x8x2_t b0 = vzip_u8(vqmovun_s16(b0_even), vqmovun_s16(b0_odd));
|
||||
uint8x8x2_t b1 = vzip_u8(vqmovun_s16(b1_even), vqmovun_s16(b1_odd));
|
||||
|
||||
#ifdef RGB_ALPHA
|
||||
uint8x8x4_t rgba0_h, rgba1_h;
|
||||
rgba0_h.val[RGB_RED] = r0.val[1];
|
||||
rgba1_h.val[RGB_RED] = r1.val[1];
|
||||
rgba0_h.val[RGB_GREEN] = g0.val[1];
|
||||
rgba1_h.val[RGB_GREEN] = g1.val[1];
|
||||
rgba0_h.val[RGB_BLUE] = b0.val[1];
|
||||
rgba1_h.val[RGB_BLUE] = b1.val[1];
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba0_h.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
rgba1_h.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
|
||||
uint8x8x4_t rgba0_l, rgba1_l;
|
||||
rgba0_l.val[RGB_RED] = r0.val[0];
|
||||
rgba1_l.val[RGB_RED] = r1.val[0];
|
||||
rgba0_l.val[RGB_GREEN] = g0.val[0];
|
||||
rgba1_l.val[RGB_GREEN] = g1.val[0];
|
||||
rgba0_l.val[RGB_BLUE] = b0.val[0];
|
||||
rgba1_l.val[RGB_BLUE] = b1.val[0];
|
||||
/* Set alpha channel to opaque (0xFF). */
|
||||
rgba0_l.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
rgba1_l.val[RGB_ALPHA] = vdup_n_u8(0xFF);
|
||||
/* Store RGBA pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 15:
|
||||
vst4_lane_u8(outptr0 + 14 * RGB_PIXELSIZE, rgba0_h, 6);
|
||||
vst4_lane_u8(outptr1 + 14 * RGB_PIXELSIZE, rgba1_h, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
vst4_lane_u8(outptr0 + 13 * RGB_PIXELSIZE, rgba0_h, 5);
|
||||
vst4_lane_u8(outptr1 + 13 * RGB_PIXELSIZE, rgba1_h, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
vst4_lane_u8(outptr0 + 12 * RGB_PIXELSIZE, rgba0_h, 4);
|
||||
vst4_lane_u8(outptr1 + 12 * RGB_PIXELSIZE, rgba1_h, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
vst4_lane_u8(outptr0 + 11 * RGB_PIXELSIZE, rgba0_h, 3);
|
||||
vst4_lane_u8(outptr1 + 11 * RGB_PIXELSIZE, rgba1_h, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
vst4_lane_u8(outptr0 + 10 * RGB_PIXELSIZE, rgba0_h, 2);
|
||||
vst4_lane_u8(outptr1 + 10 * RGB_PIXELSIZE, rgba1_h, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
vst4_lane_u8(outptr0 + 9 * RGB_PIXELSIZE, rgba0_h, 1);
|
||||
vst4_lane_u8(outptr1 + 9 * RGB_PIXELSIZE, rgba1_h, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
vst4_lane_u8(outptr0 + 8 * RGB_PIXELSIZE, rgba0_h, 0);
|
||||
vst4_lane_u8(outptr1 + 8 * RGB_PIXELSIZE, rgba1_h, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 8:
|
||||
vst4_u8(outptr0, rgba0_l);
|
||||
vst4_u8(outptr1, rgba1_l);
|
||||
break;
|
||||
case 7:
|
||||
vst4_lane_u8(outptr0 + 6 * RGB_PIXELSIZE, rgba0_l, 6);
|
||||
vst4_lane_u8(outptr1 + 6 * RGB_PIXELSIZE, rgba1_l, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst4_lane_u8(outptr0 + 5 * RGB_PIXELSIZE, rgba0_l, 5);
|
||||
vst4_lane_u8(outptr1 + 5 * RGB_PIXELSIZE, rgba1_l, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst4_lane_u8(outptr0 + 4 * RGB_PIXELSIZE, rgba0_l, 4);
|
||||
vst4_lane_u8(outptr1 + 4 * RGB_PIXELSIZE, rgba1_l, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst4_lane_u8(outptr0 + 3 * RGB_PIXELSIZE, rgba0_l, 3);
|
||||
vst4_lane_u8(outptr1 + 3 * RGB_PIXELSIZE, rgba1_l, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst4_lane_u8(outptr0 + 2 * RGB_PIXELSIZE, rgba0_l, 2);
|
||||
vst4_lane_u8(outptr1 + 2 * RGB_PIXELSIZE, rgba1_l, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst4_lane_u8(outptr0 + 1 * RGB_PIXELSIZE, rgba0_l, 1);
|
||||
vst4_lane_u8(outptr1 + 1 * RGB_PIXELSIZE, rgba1_l, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst4_lane_u8(outptr0, rgba0_l, 0);
|
||||
vst4_lane_u8(outptr1, rgba1_l, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#else
|
||||
uint8x8x3_t rgb0_h, rgb1_h;
|
||||
rgb0_h.val[RGB_RED] = r0.val[1];
|
||||
rgb1_h.val[RGB_RED] = r1.val[1];
|
||||
rgb0_h.val[RGB_GREEN] = g0.val[1];
|
||||
rgb1_h.val[RGB_GREEN] = g1.val[1];
|
||||
rgb0_h.val[RGB_BLUE] = b0.val[1];
|
||||
rgb1_h.val[RGB_BLUE] = b1.val[1];
|
||||
|
||||
uint8x8x3_t rgb0_l, rgb1_l;
|
||||
rgb0_l.val[RGB_RED] = r0.val[0];
|
||||
rgb1_l.val[RGB_RED] = r1.val[0];
|
||||
rgb0_l.val[RGB_GREEN] = g0.val[0];
|
||||
rgb1_l.val[RGB_GREEN] = g1.val[0];
|
||||
rgb0_l.val[RGB_BLUE] = b0.val[0];
|
||||
rgb1_l.val[RGB_BLUE] = b1.val[0];
|
||||
/* Store RGB pixel data to memory. */
|
||||
switch (cols_remaining) {
|
||||
case 15:
|
||||
vst3_lane_u8(outptr0 + 14 * RGB_PIXELSIZE, rgb0_h, 6);
|
||||
vst3_lane_u8(outptr1 + 14 * RGB_PIXELSIZE, rgb1_h, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 14:
|
||||
vst3_lane_u8(outptr0 + 13 * RGB_PIXELSIZE, rgb0_h, 5);
|
||||
vst3_lane_u8(outptr1 + 13 * RGB_PIXELSIZE, rgb1_h, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 13:
|
||||
vst3_lane_u8(outptr0 + 12 * RGB_PIXELSIZE, rgb0_h, 4);
|
||||
vst3_lane_u8(outptr1 + 12 * RGB_PIXELSIZE, rgb1_h, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 12:
|
||||
vst3_lane_u8(outptr0 + 11 * RGB_PIXELSIZE, rgb0_h, 3);
|
||||
vst3_lane_u8(outptr1 + 11 * RGB_PIXELSIZE, rgb1_h, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 11:
|
||||
vst3_lane_u8(outptr0 + 10 * RGB_PIXELSIZE, rgb0_h, 2);
|
||||
vst3_lane_u8(outptr1 + 10 * RGB_PIXELSIZE, rgb1_h, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 10:
|
||||
vst3_lane_u8(outptr0 + 9 * RGB_PIXELSIZE, rgb0_h, 1);
|
||||
vst3_lane_u8(outptr1 + 9 * RGB_PIXELSIZE, rgb1_h, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 9:
|
||||
vst3_lane_u8(outptr0 + 8 * RGB_PIXELSIZE, rgb0_h, 0);
|
||||
vst3_lane_u8(outptr1 + 8 * RGB_PIXELSIZE, rgb1_h, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 8:
|
||||
vst3_u8(outptr0, rgb0_l);
|
||||
vst3_u8(outptr1, rgb1_l);
|
||||
break;
|
||||
case 7:
|
||||
vst3_lane_u8(outptr0 + 6 * RGB_PIXELSIZE, rgb0_l, 6);
|
||||
vst3_lane_u8(outptr1 + 6 * RGB_PIXELSIZE, rgb1_l, 6);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 6:
|
||||
vst3_lane_u8(outptr0 + 5 * RGB_PIXELSIZE, rgb0_l, 5);
|
||||
vst3_lane_u8(outptr1 + 5 * RGB_PIXELSIZE, rgb1_l, 5);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 5:
|
||||
vst3_lane_u8(outptr0 + 4 * RGB_PIXELSIZE, rgb0_l, 4);
|
||||
vst3_lane_u8(outptr1 + 4 * RGB_PIXELSIZE, rgb1_l, 4);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 4:
|
||||
vst3_lane_u8(outptr0 + 3 * RGB_PIXELSIZE, rgb0_l, 3);
|
||||
vst3_lane_u8(outptr1 + 3 * RGB_PIXELSIZE, rgb1_l, 3);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 3:
|
||||
vst3_lane_u8(outptr0 + 2 * RGB_PIXELSIZE, rgb0_l, 2);
|
||||
vst3_lane_u8(outptr1 + 2 * RGB_PIXELSIZE, rgb1_l, 2);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 2:
|
||||
vst3_lane_u8(outptr0 + 1 * RGB_PIXELSIZE, rgb0_l, 1);
|
||||
vst3_lane_u8(outptr1 + 1 * RGB_PIXELSIZE, rgb1_l, 1);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
case 1:
|
||||
vst3_lane_u8(outptr0, rgb0_l, 0);
|
||||
vst3_lane_u8(outptr1, rgb1_l, 0);
|
||||
FALLTHROUGH /*FALLTHROUGH*/
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
+570
@@ -0,0 +1,570 @@
|
||||
/*
|
||||
* jdsample-neon.c - upsampling (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* The diagram below shows a row of samples produced by h2v1 downsampling.
|
||||
*
|
||||
* s0 s1 s2
|
||||
* +---------+---------+---------+
|
||||
* | | | |
|
||||
* | p0 p1 | p2 p3 | p4 p5 |
|
||||
* | | | |
|
||||
* +---------+---------+---------+
|
||||
*
|
||||
* Samples s0-s2 were created by averaging the original pixel component values
|
||||
* centered at positions p0-p5 above. To approximate those original pixel
|
||||
* component values, we proportionally blend the adjacent samples in each row.
|
||||
*
|
||||
* An upsampled pixel component value is computed by blending the sample
|
||||
* containing the pixel center with the nearest neighboring sample, in the
|
||||
* ratio 3:1. For example:
|
||||
* p1(upsampled) = 3/4 * s0 + 1/4 * s1
|
||||
* p2(upsampled) = 3/4 * s1 + 1/4 * s0
|
||||
* When computing the first and last pixel component values in the row, there
|
||||
* is no adjacent sample to blend, so:
|
||||
* p0(upsampled) = s0
|
||||
* p5(upsampled) = s2
|
||||
*/
|
||||
|
||||
void jsimd_h2v1_fancy_upsample_neon(int max_v_samp_factor,
|
||||
JDIMENSION downsampled_width,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr, outptr;
|
||||
int inrow;
|
||||
unsigned colctr;
|
||||
/* Set up constants. */
|
||||
const uint16x8_t one_u16 = vdupq_n_u16(1);
|
||||
const uint8x8_t three_u8 = vdup_n_u8(3);
|
||||
|
||||
for (inrow = 0; inrow < max_v_samp_factor; inrow++) {
|
||||
inptr = input_data[inrow];
|
||||
outptr = output_data[inrow];
|
||||
/* First pixel component value in this row of the original image */
|
||||
*outptr = (JSAMPLE)GETJSAMPLE(*inptr);
|
||||
|
||||
/* 3/4 * containing sample + 1/4 * nearest neighboring sample
|
||||
* For p1: containing sample = s0, nearest neighboring sample = s1
|
||||
* For p2: containing sample = s1, nearest neighboring sample = s0
|
||||
*/
|
||||
uint8x16_t s0 = vld1q_u8(inptr);
|
||||
uint8x16_t s1 = vld1q_u8(inptr + 1);
|
||||
/* Multiplication makes vectors twice as wide. '_l' and '_h' suffixes
|
||||
* denote low half and high half respectively.
|
||||
*/
|
||||
uint16x8_t s1_add_3s0_l =
|
||||
vmlal_u8(vmovl_u8(vget_low_u8(s1)), vget_low_u8(s0), three_u8);
|
||||
uint16x8_t s1_add_3s0_h =
|
||||
vmlal_u8(vmovl_u8(vget_high_u8(s1)), vget_high_u8(s0), three_u8);
|
||||
uint16x8_t s0_add_3s1_l =
|
||||
vmlal_u8(vmovl_u8(vget_low_u8(s0)), vget_low_u8(s1), three_u8);
|
||||
uint16x8_t s0_add_3s1_h =
|
||||
vmlal_u8(vmovl_u8(vget_high_u8(s0)), vget_high_u8(s1), three_u8);
|
||||
/* Add ordered dithering bias to odd pixel values. */
|
||||
s0_add_3s1_l = vaddq_u16(s0_add_3s1_l, one_u16);
|
||||
s0_add_3s1_h = vaddq_u16(s0_add_3s1_h, one_u16);
|
||||
|
||||
/* The offset is initially 1, because the first pixel component has already
|
||||
* been stored. However, in subsequent iterations of the SIMD loop, this
|
||||
* offset is (2 * colctr - 1) to stay within the bounds of the sample
|
||||
* buffers without having to resort to a slow scalar tail case for the last
|
||||
* (downsampled_width % 16) samples. See "Creation of 2-D sample arrays"
|
||||
* in jmemmgr.c for more details.
|
||||
*/
|
||||
unsigned outptr_offset = 1;
|
||||
uint8x16x2_t output_pixels;
|
||||
|
||||
/* We use software pipelining to maximise performance. The code indented
|
||||
* an extra two spaces begins the next iteration of the loop.
|
||||
*/
|
||||
for (colctr = 16; colctr < downsampled_width; colctr += 16) {
|
||||
|
||||
s0 = vld1q_u8(inptr + colctr - 1);
|
||||
s1 = vld1q_u8(inptr + colctr);
|
||||
|
||||
/* Right-shift by 2 (divide by 4), narrow to 8-bit, and combine. */
|
||||
output_pixels.val[0] = vcombine_u8(vrshrn_n_u16(s1_add_3s0_l, 2),
|
||||
vrshrn_n_u16(s1_add_3s0_h, 2));
|
||||
output_pixels.val[1] = vcombine_u8(vshrn_n_u16(s0_add_3s1_l, 2),
|
||||
vshrn_n_u16(s0_add_3s1_h, 2));
|
||||
|
||||
/* Multiplication makes vectors twice as wide. '_l' and '_h' suffixes
|
||||
* denote low half and high half respectively.
|
||||
*/
|
||||
s1_add_3s0_l =
|
||||
vmlal_u8(vmovl_u8(vget_low_u8(s1)), vget_low_u8(s0), three_u8);
|
||||
s1_add_3s0_h =
|
||||
vmlal_u8(vmovl_u8(vget_high_u8(s1)), vget_high_u8(s0), three_u8);
|
||||
s0_add_3s1_l =
|
||||
vmlal_u8(vmovl_u8(vget_low_u8(s0)), vget_low_u8(s1), three_u8);
|
||||
s0_add_3s1_h =
|
||||
vmlal_u8(vmovl_u8(vget_high_u8(s0)), vget_high_u8(s1), three_u8);
|
||||
/* Add ordered dithering bias to odd pixel values. */
|
||||
s0_add_3s1_l = vaddq_u16(s0_add_3s1_l, one_u16);
|
||||
s0_add_3s1_h = vaddq_u16(s0_add_3s1_h, one_u16);
|
||||
|
||||
/* Store pixel component values to memory. */
|
||||
vst2q_u8(outptr + outptr_offset, output_pixels);
|
||||
outptr_offset = 2 * colctr - 1;
|
||||
}
|
||||
|
||||
/* Complete the last iteration of the loop. */
|
||||
|
||||
/* Right-shift by 2 (divide by 4), narrow to 8-bit, and combine. */
|
||||
output_pixels.val[0] = vcombine_u8(vrshrn_n_u16(s1_add_3s0_l, 2),
|
||||
vrshrn_n_u16(s1_add_3s0_h, 2));
|
||||
output_pixels.val[1] = vcombine_u8(vshrn_n_u16(s0_add_3s1_l, 2),
|
||||
vshrn_n_u16(s0_add_3s1_h, 2));
|
||||
/* Store pixel component values to memory. */
|
||||
vst2q_u8(outptr + outptr_offset, output_pixels);
|
||||
|
||||
/* Last pixel component value in this row of the original image */
|
||||
outptr[2 * downsampled_width - 1] =
|
||||
GETJSAMPLE(inptr[downsampled_width - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The diagram below shows an array of samples produced by h2v2 downsampling.
|
||||
*
|
||||
* s0 s1 s2
|
||||
* +---------+---------+---------+
|
||||
* | p0 p1 | p2 p3 | p4 p5 |
|
||||
* sA | | | |
|
||||
* | p6 p7 | p8 p9 | p10 p11|
|
||||
* +---------+---------+---------+
|
||||
* | p12 p13| p14 p15| p16 p17|
|
||||
* sB | | | |
|
||||
* | p18 p19| p20 p21| p22 p23|
|
||||
* +---------+---------+---------+
|
||||
* | p24 p25| p26 p27| p28 p29|
|
||||
* sC | | | |
|
||||
* | p30 p31| p32 p33| p34 p35|
|
||||
* +---------+---------+---------+
|
||||
*
|
||||
* Samples s0A-s2C were created by averaging the original pixel component
|
||||
* values centered at positions p0-p35 above. To approximate one of those
|
||||
* original pixel component values, we proportionally blend the sample
|
||||
* containing the pixel center with the nearest neighboring samples in each
|
||||
* row, column, and diagonal.
|
||||
*
|
||||
* An upsampled pixel component value is computed by first blending the sample
|
||||
* containing the pixel center with the nearest neighboring samples in the
|
||||
* same column, in the ratio 3:1, and then blending each column sum with the
|
||||
* nearest neighboring column sum, in the ratio 3:1. For example:
|
||||
* p14(upsampled) = 3/4 * (3/4 * s1B + 1/4 * s1A) +
|
||||
* 1/4 * (3/4 * s0B + 1/4 * s0A)
|
||||
* = 9/16 * s1B + 3/16 * s1A + 3/16 * s0B + 1/16 * s0A
|
||||
* When computing the first and last pixel component values in the row, there
|
||||
* is no horizontally adjacent sample to blend, so:
|
||||
* p12(upsampled) = 3/4 * s0B + 1/4 * s0A
|
||||
* p23(upsampled) = 3/4 * s2B + 1/4 * s2C
|
||||
* When computing the first and last pixel component values in the column,
|
||||
* there is no vertically adjacent sample to blend, so:
|
||||
* p2(upsampled) = 3/4 * s1A + 1/4 * s0A
|
||||
* p33(upsampled) = 3/4 * s1C + 1/4 * s2C
|
||||
* When computing the corner pixel component values, there is no adjacent
|
||||
* sample to blend, so:
|
||||
* p0(upsampled) = s0A
|
||||
* p35(upsampled) = s2C
|
||||
*/
|
||||
|
||||
void jsimd_h2v2_fancy_upsample_neon(int max_v_samp_factor,
|
||||
JDIMENSION downsampled_width,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2, outptr0, outptr1;
|
||||
int inrow, outrow;
|
||||
unsigned colctr;
|
||||
/* Set up constants. */
|
||||
const uint16x8_t seven_u16 = vdupq_n_u16(7);
|
||||
const uint8x8_t three_u8 = vdup_n_u8(3);
|
||||
const uint16x8_t three_u16 = vdupq_n_u16(3);
|
||||
|
||||
inrow = outrow = 0;
|
||||
while (outrow < max_v_samp_factor) {
|
||||
inptr0 = input_data[inrow - 1];
|
||||
inptr1 = input_data[inrow];
|
||||
inptr2 = input_data[inrow + 1];
|
||||
/* Suffixes 0 and 1 denote the upper and lower rows of output pixels,
|
||||
* respectively.
|
||||
*/
|
||||
outptr0 = output_data[outrow++];
|
||||
outptr1 = output_data[outrow++];
|
||||
|
||||
/* First pixel component value in this row of the original image */
|
||||
int s0colsum0 = GETJSAMPLE(*inptr1) * 3 + GETJSAMPLE(*inptr0);
|
||||
*outptr0 = (JSAMPLE)((s0colsum0 * 4 + 8) >> 4);
|
||||
int s0colsum1 = GETJSAMPLE(*inptr1) * 3 + GETJSAMPLE(*inptr2);
|
||||
*outptr1 = (JSAMPLE)((s0colsum1 * 4 + 8) >> 4);
|
||||
|
||||
/* Step 1: Blend samples vertically in columns s0 and s1.
|
||||
* Leave the divide by 4 until the end, when it can be done for both
|
||||
* dimensions at once, right-shifting by 4.
|
||||
*/
|
||||
|
||||
/* Load and compute s0colsum0 and s0colsum1. */
|
||||
uint8x16_t s0A = vld1q_u8(inptr0);
|
||||
uint8x16_t s0B = vld1q_u8(inptr1);
|
||||
uint8x16_t s0C = vld1q_u8(inptr2);
|
||||
/* Multiplication makes vectors twice as wide. '_l' and '_h' suffixes
|
||||
* denote low half and high half respectively.
|
||||
*/
|
||||
uint16x8_t s0colsum0_l = vmlal_u8(vmovl_u8(vget_low_u8(s0A)),
|
||||
vget_low_u8(s0B), three_u8);
|
||||
uint16x8_t s0colsum0_h = vmlal_u8(vmovl_u8(vget_high_u8(s0A)),
|
||||
vget_high_u8(s0B), three_u8);
|
||||
uint16x8_t s0colsum1_l = vmlal_u8(vmovl_u8(vget_low_u8(s0C)),
|
||||
vget_low_u8(s0B), three_u8);
|
||||
uint16x8_t s0colsum1_h = vmlal_u8(vmovl_u8(vget_high_u8(s0C)),
|
||||
vget_high_u8(s0B), three_u8);
|
||||
/* Load and compute s1colsum0 and s1colsum1. */
|
||||
uint8x16_t s1A = vld1q_u8(inptr0 + 1);
|
||||
uint8x16_t s1B = vld1q_u8(inptr1 + 1);
|
||||
uint8x16_t s1C = vld1q_u8(inptr2 + 1);
|
||||
uint16x8_t s1colsum0_l = vmlal_u8(vmovl_u8(vget_low_u8(s1A)),
|
||||
vget_low_u8(s1B), three_u8);
|
||||
uint16x8_t s1colsum0_h = vmlal_u8(vmovl_u8(vget_high_u8(s1A)),
|
||||
vget_high_u8(s1B), three_u8);
|
||||
uint16x8_t s1colsum1_l = vmlal_u8(vmovl_u8(vget_low_u8(s1C)),
|
||||
vget_low_u8(s1B), three_u8);
|
||||
uint16x8_t s1colsum1_h = vmlal_u8(vmovl_u8(vget_high_u8(s1C)),
|
||||
vget_high_u8(s1B), three_u8);
|
||||
|
||||
/* Step 2: Blend the already-blended columns. */
|
||||
|
||||
uint16x8_t output0_p1_l = vmlaq_u16(s1colsum0_l, s0colsum0_l, three_u16);
|
||||
uint16x8_t output0_p1_h = vmlaq_u16(s1colsum0_h, s0colsum0_h, three_u16);
|
||||
uint16x8_t output0_p2_l = vmlaq_u16(s0colsum0_l, s1colsum0_l, three_u16);
|
||||
uint16x8_t output0_p2_h = vmlaq_u16(s0colsum0_h, s1colsum0_h, three_u16);
|
||||
uint16x8_t output1_p1_l = vmlaq_u16(s1colsum1_l, s0colsum1_l, three_u16);
|
||||
uint16x8_t output1_p1_h = vmlaq_u16(s1colsum1_h, s0colsum1_h, three_u16);
|
||||
uint16x8_t output1_p2_l = vmlaq_u16(s0colsum1_l, s1colsum1_l, three_u16);
|
||||
uint16x8_t output1_p2_h = vmlaq_u16(s0colsum1_h, s1colsum1_h, three_u16);
|
||||
/* Add ordered dithering bias to odd pixel values. */
|
||||
output0_p1_l = vaddq_u16(output0_p1_l, seven_u16);
|
||||
output0_p1_h = vaddq_u16(output0_p1_h, seven_u16);
|
||||
output1_p1_l = vaddq_u16(output1_p1_l, seven_u16);
|
||||
output1_p1_h = vaddq_u16(output1_p1_h, seven_u16);
|
||||
/* Right-shift by 4 (divide by 16), narrow to 8-bit, and combine. */
|
||||
uint8x16x2_t output_pixels0 = { {
|
||||
vcombine_u8(vshrn_n_u16(output0_p1_l, 4), vshrn_n_u16(output0_p1_h, 4)),
|
||||
vcombine_u8(vrshrn_n_u16(output0_p2_l, 4), vrshrn_n_u16(output0_p2_h, 4))
|
||||
} };
|
||||
uint8x16x2_t output_pixels1 = { {
|
||||
vcombine_u8(vshrn_n_u16(output1_p1_l, 4), vshrn_n_u16(output1_p1_h, 4)),
|
||||
vcombine_u8(vrshrn_n_u16(output1_p2_l, 4), vrshrn_n_u16(output1_p2_h, 4))
|
||||
} };
|
||||
|
||||
/* Store pixel component values to memory.
|
||||
* The minimum size of the output buffer for each row is 64 bytes => no
|
||||
* need to worry about buffer overflow here. See "Creation of 2-D sample
|
||||
* arrays" in jmemmgr.c for more details.
|
||||
*/
|
||||
vst2q_u8(outptr0 + 1, output_pixels0);
|
||||
vst2q_u8(outptr1 + 1, output_pixels1);
|
||||
|
||||
/* The first pixel of the image shifted our loads and stores by one byte.
|
||||
* We have to re-align on a 32-byte boundary at some point before the end
|
||||
* of the row (we do it now on the 32/33 pixel boundary) to stay within the
|
||||
* bounds of the sample buffers without having to resort to a slow scalar
|
||||
* tail case for the last (downsampled_width % 16) samples. See "Creation
|
||||
* of 2-D sample arrays" in jmemmgr.c for more details.
|
||||
*/
|
||||
for (colctr = 16; colctr < downsampled_width; colctr += 16) {
|
||||
/* Step 1: Blend samples vertically in columns s0 and s1. */
|
||||
|
||||
/* Load and compute s0colsum0 and s0colsum1. */
|
||||
s0A = vld1q_u8(inptr0 + colctr - 1);
|
||||
s0B = vld1q_u8(inptr1 + colctr - 1);
|
||||
s0C = vld1q_u8(inptr2 + colctr - 1);
|
||||
s0colsum0_l = vmlal_u8(vmovl_u8(vget_low_u8(s0A)), vget_low_u8(s0B),
|
||||
three_u8);
|
||||
s0colsum0_h = vmlal_u8(vmovl_u8(vget_high_u8(s0A)), vget_high_u8(s0B),
|
||||
three_u8);
|
||||
s0colsum1_l = vmlal_u8(vmovl_u8(vget_low_u8(s0C)), vget_low_u8(s0B),
|
||||
three_u8);
|
||||
s0colsum1_h = vmlal_u8(vmovl_u8(vget_high_u8(s0C)), vget_high_u8(s0B),
|
||||
three_u8);
|
||||
/* Load and compute s1colsum0 and s1colsum1. */
|
||||
s1A = vld1q_u8(inptr0 + colctr);
|
||||
s1B = vld1q_u8(inptr1 + colctr);
|
||||
s1C = vld1q_u8(inptr2 + colctr);
|
||||
s1colsum0_l = vmlal_u8(vmovl_u8(vget_low_u8(s1A)), vget_low_u8(s1B),
|
||||
three_u8);
|
||||
s1colsum0_h = vmlal_u8(vmovl_u8(vget_high_u8(s1A)), vget_high_u8(s1B),
|
||||
three_u8);
|
||||
s1colsum1_l = vmlal_u8(vmovl_u8(vget_low_u8(s1C)), vget_low_u8(s1B),
|
||||
three_u8);
|
||||
s1colsum1_h = vmlal_u8(vmovl_u8(vget_high_u8(s1C)), vget_high_u8(s1B),
|
||||
three_u8);
|
||||
|
||||
/* Step 2: Blend the already-blended columns. */
|
||||
|
||||
output0_p1_l = vmlaq_u16(s1colsum0_l, s0colsum0_l, three_u16);
|
||||
output0_p1_h = vmlaq_u16(s1colsum0_h, s0colsum0_h, three_u16);
|
||||
output0_p2_l = vmlaq_u16(s0colsum0_l, s1colsum0_l, three_u16);
|
||||
output0_p2_h = vmlaq_u16(s0colsum0_h, s1colsum0_h, three_u16);
|
||||
output1_p1_l = vmlaq_u16(s1colsum1_l, s0colsum1_l, three_u16);
|
||||
output1_p1_h = vmlaq_u16(s1colsum1_h, s0colsum1_h, three_u16);
|
||||
output1_p2_l = vmlaq_u16(s0colsum1_l, s1colsum1_l, three_u16);
|
||||
output1_p2_h = vmlaq_u16(s0colsum1_h, s1colsum1_h, three_u16);
|
||||
/* Add ordered dithering bias to odd pixel values. */
|
||||
output0_p1_l = vaddq_u16(output0_p1_l, seven_u16);
|
||||
output0_p1_h = vaddq_u16(output0_p1_h, seven_u16);
|
||||
output1_p1_l = vaddq_u16(output1_p1_l, seven_u16);
|
||||
output1_p1_h = vaddq_u16(output1_p1_h, seven_u16);
|
||||
/* Right-shift by 4 (divide by 16), narrow to 8-bit, and combine. */
|
||||
output_pixels0.val[0] = vcombine_u8(vshrn_n_u16(output0_p1_l, 4),
|
||||
vshrn_n_u16(output0_p1_h, 4));
|
||||
output_pixels0.val[1] = vcombine_u8(vrshrn_n_u16(output0_p2_l, 4),
|
||||
vrshrn_n_u16(output0_p2_h, 4));
|
||||
output_pixels1.val[0] = vcombine_u8(vshrn_n_u16(output1_p1_l, 4),
|
||||
vshrn_n_u16(output1_p1_h, 4));
|
||||
output_pixels1.val[1] = vcombine_u8(vrshrn_n_u16(output1_p2_l, 4),
|
||||
vrshrn_n_u16(output1_p2_h, 4));
|
||||
/* Store pixel component values to memory. */
|
||||
vst2q_u8(outptr0 + 2 * colctr - 1, output_pixels0);
|
||||
vst2q_u8(outptr1 + 2 * colctr - 1, output_pixels1);
|
||||
}
|
||||
|
||||
/* Last pixel component value in this row of the original image */
|
||||
int s1colsum0 = GETJSAMPLE(inptr1[downsampled_width - 1]) * 3 +
|
||||
GETJSAMPLE(inptr0[downsampled_width - 1]);
|
||||
outptr0[2 * downsampled_width - 1] = (JSAMPLE)((s1colsum0 * 4 + 7) >> 4);
|
||||
int s1colsum1 = GETJSAMPLE(inptr1[downsampled_width - 1]) * 3 +
|
||||
GETJSAMPLE(inptr2[downsampled_width - 1]);
|
||||
outptr1[2 * downsampled_width - 1] = (JSAMPLE)((s1colsum1 * 4 + 7) >> 4);
|
||||
inrow++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The diagram below shows a column of samples produced by h1v2 downsampling
|
||||
* (or by losslessly rotating or transposing an h2v1-downsampled image.)
|
||||
*
|
||||
* +---------+
|
||||
* | p0 |
|
||||
* sA | |
|
||||
* | p1 |
|
||||
* +---------+
|
||||
* | p2 |
|
||||
* sB | |
|
||||
* | p3 |
|
||||
* +---------+
|
||||
* | p4 |
|
||||
* sC | |
|
||||
* | p5 |
|
||||
* +---------+
|
||||
*
|
||||
* Samples sA-sC were created by averaging the original pixel component values
|
||||
* centered at positions p0-p5 above. To approximate those original pixel
|
||||
* component values, we proportionally blend the adjacent samples in each
|
||||
* column.
|
||||
*
|
||||
* An upsampled pixel component value is computed by blending the sample
|
||||
* containing the pixel center with the nearest neighboring sample, in the
|
||||
* ratio 3:1. For example:
|
||||
* p1(upsampled) = 3/4 * sA + 1/4 * sB
|
||||
* p2(upsampled) = 3/4 * sB + 1/4 * sA
|
||||
* When computing the first and last pixel component values in the column,
|
||||
* there is no adjacent sample to blend, so:
|
||||
* p0(upsampled) = sA
|
||||
* p5(upsampled) = sC
|
||||
*/
|
||||
|
||||
void jsimd_h1v2_fancy_upsample_neon(int max_v_samp_factor,
|
||||
JDIMENSION downsampled_width,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2, outptr0, outptr1;
|
||||
int inrow, outrow;
|
||||
unsigned colctr;
|
||||
/* Set up constants. */
|
||||
const uint16x8_t one_u16 = vdupq_n_u16(1);
|
||||
const uint8x8_t three_u8 = vdup_n_u8(3);
|
||||
|
||||
inrow = outrow = 0;
|
||||
while (outrow < max_v_samp_factor) {
|
||||
inptr0 = input_data[inrow - 1];
|
||||
inptr1 = input_data[inrow];
|
||||
inptr2 = input_data[inrow + 1];
|
||||
/* Suffixes 0 and 1 denote the upper and lower rows of output pixels,
|
||||
* respectively.
|
||||
*/
|
||||
outptr0 = output_data[outrow++];
|
||||
outptr1 = output_data[outrow++];
|
||||
inrow++;
|
||||
|
||||
/* The size of the input and output buffers is always a multiple of 32
|
||||
* bytes => no need to worry about buffer overflow when reading/writing
|
||||
* memory. See "Creation of 2-D sample arrays" in jmemmgr.c for more
|
||||
* details.
|
||||
*/
|
||||
for (colctr = 0; colctr < downsampled_width; colctr += 16) {
|
||||
/* Load samples. */
|
||||
uint8x16_t sA = vld1q_u8(inptr0 + colctr);
|
||||
uint8x16_t sB = vld1q_u8(inptr1 + colctr);
|
||||
uint8x16_t sC = vld1q_u8(inptr2 + colctr);
|
||||
/* Blend samples vertically. */
|
||||
uint16x8_t colsum0_l = vmlal_u8(vmovl_u8(vget_low_u8(sA)),
|
||||
vget_low_u8(sB), three_u8);
|
||||
uint16x8_t colsum0_h = vmlal_u8(vmovl_u8(vget_high_u8(sA)),
|
||||
vget_high_u8(sB), three_u8);
|
||||
uint16x8_t colsum1_l = vmlal_u8(vmovl_u8(vget_low_u8(sC)),
|
||||
vget_low_u8(sB), three_u8);
|
||||
uint16x8_t colsum1_h = vmlal_u8(vmovl_u8(vget_high_u8(sC)),
|
||||
vget_high_u8(sB), three_u8);
|
||||
/* Add ordered dithering bias to pixel values in even output rows. */
|
||||
colsum0_l = vaddq_u16(colsum0_l, one_u16);
|
||||
colsum0_h = vaddq_u16(colsum0_h, one_u16);
|
||||
/* Right-shift by 2 (divide by 4), narrow to 8-bit, and combine. */
|
||||
uint8x16_t output_pixels0 = vcombine_u8(vshrn_n_u16(colsum0_l, 2),
|
||||
vshrn_n_u16(colsum0_h, 2));
|
||||
uint8x16_t output_pixels1 = vcombine_u8(vrshrn_n_u16(colsum1_l, 2),
|
||||
vrshrn_n_u16(colsum1_h, 2));
|
||||
/* Store pixel component values to memory. */
|
||||
vst1q_u8(outptr0 + colctr, output_pixels0);
|
||||
vst1q_u8(outptr1 + colctr, output_pixels1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The diagram below shows a row of samples produced by h2v1 downsampling.
|
||||
*
|
||||
* s0 s1
|
||||
* +---------+---------+
|
||||
* | | |
|
||||
* | p0 p1 | p2 p3 |
|
||||
* | | |
|
||||
* +---------+---------+
|
||||
*
|
||||
* Samples s0 and s1 were created by averaging the original pixel component
|
||||
* values centered at positions p0-p3 above. To approximate those original
|
||||
* pixel component values, we duplicate the samples horizontally:
|
||||
* p0(upsampled) = p1(upsampled) = s0
|
||||
* p2(upsampled) = p3(upsampled) = s1
|
||||
*/
|
||||
|
||||
void jsimd_h2v1_upsample_neon(int max_v_samp_factor, JDIMENSION output_width,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr, outptr;
|
||||
int inrow;
|
||||
unsigned colctr;
|
||||
|
||||
for (inrow = 0; inrow < max_v_samp_factor; inrow++) {
|
||||
inptr = input_data[inrow];
|
||||
outptr = output_data[inrow];
|
||||
for (colctr = 0; 2 * colctr < output_width; colctr += 16) {
|
||||
uint8x16_t samples = vld1q_u8(inptr + colctr);
|
||||
/* Duplicate the samples. The store operation below interleaves them so
|
||||
* that adjacent pixel component values take on the same sample value,
|
||||
* per above.
|
||||
*/
|
||||
uint8x16x2_t output_pixels = { { samples, samples } };
|
||||
/* Store pixel component values to memory.
|
||||
* Due to the way sample buffers are allocated, we don't need to worry
|
||||
* about tail cases when output_width is not a multiple of 32. See
|
||||
* "Creation of 2-D sample arrays" in jmemmgr.c for details.
|
||||
*/
|
||||
vst2q_u8(outptr + 2 * colctr, output_pixels);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* The diagram below shows an array of samples produced by h2v2 downsampling.
|
||||
*
|
||||
* s0 s1
|
||||
* +---------+---------+
|
||||
* | p0 p1 | p2 p3 |
|
||||
* sA | | |
|
||||
* | p4 p5 | p6 p7 |
|
||||
* +---------+---------+
|
||||
* | p8 p9 | p10 p11|
|
||||
* sB | | |
|
||||
* | p12 p13| p14 p15|
|
||||
* +---------+---------+
|
||||
*
|
||||
* Samples s0A-s1B were created by averaging the original pixel component
|
||||
* values centered at positions p0-p15 above. To approximate those original
|
||||
* pixel component values, we duplicate the samples both horizontally and
|
||||
* vertically:
|
||||
* p0(upsampled) = p1(upsampled) = p4(upsampled) = p5(upsampled) = s0A
|
||||
* p2(upsampled) = p3(upsampled) = p6(upsampled) = p7(upsampled) = s1A
|
||||
* p8(upsampled) = p9(upsampled) = p12(upsampled) = p13(upsampled) = s0B
|
||||
* p10(upsampled) = p11(upsampled) = p14(upsampled) = p15(upsampled) = s1B
|
||||
*/
|
||||
|
||||
void jsimd_h2v2_upsample_neon(int max_v_samp_factor, JDIMENSION output_width,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY *output_data_ptr)
|
||||
{
|
||||
JSAMPARRAY output_data = *output_data_ptr;
|
||||
JSAMPROW inptr, outptr0, outptr1;
|
||||
int inrow, outrow;
|
||||
unsigned colctr;
|
||||
|
||||
for (inrow = 0, outrow = 0; outrow < max_v_samp_factor; inrow++) {
|
||||
inptr = input_data[inrow];
|
||||
outptr0 = output_data[outrow++];
|
||||
outptr1 = output_data[outrow++];
|
||||
|
||||
for (colctr = 0; 2 * colctr < output_width; colctr += 16) {
|
||||
uint8x16_t samples = vld1q_u8(inptr + colctr);
|
||||
/* Duplicate the samples. The store operation below interleaves them so
|
||||
* that adjacent pixel component values take on the same sample value,
|
||||
* per above.
|
||||
*/
|
||||
uint8x16x2_t output_pixels = { { samples, samples } };
|
||||
/* Store pixel component values for both output rows to memory.
|
||||
* Due to the way sample buffers are allocated, we don't need to worry
|
||||
* about tail cases when output_width is not a multiple of 32. See
|
||||
* "Creation of 2-D sample arrays" in jmemmgr.c for details.
|
||||
*/
|
||||
vst2q_u8(outptr0 + 2 * colctr, output_pixels);
|
||||
vst2q_u8(outptr1 + 2 * colctr, output_pixels);
|
||||
}
|
||||
}
|
||||
}
|
||||
+216
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* jfdctfst-neon.c - fast integer FDCT (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* jsimd_fdct_ifast_neon() performs a fast, not so accurate forward DCT
|
||||
* (Discrete Cosine Transform) on one block of samples. It uses the same
|
||||
* calculations and produces exactly the same output as IJG's original
|
||||
* jpeg_fdct_ifast() function, which can be found in jfdctfst.c.
|
||||
*
|
||||
* Scaled integer constants are used to avoid floating-point arithmetic:
|
||||
* 0.382683433 = 12544 * 2^-15
|
||||
* 0.541196100 = 17795 * 2^-15
|
||||
* 0.707106781 = 23168 * 2^-15
|
||||
* 0.306562965 = 9984 * 2^-15
|
||||
*
|
||||
* See jfdctfst.c for further details of the DCT algorithm. Where possible,
|
||||
* the variable names and comments here in jsimd_fdct_ifast_neon() match up
|
||||
* with those in jpeg_fdct_ifast().
|
||||
*/
|
||||
|
||||
#define F_0_382 12544
|
||||
#define F_0_541 17792
|
||||
#define F_0_707 23168
|
||||
#define F_0_306 9984
|
||||
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_fdct_ifast_neon_consts[] = {
|
||||
F_0_382, F_0_541, F_0_707, F_0_306
|
||||
};
|
||||
|
||||
void jsimd_fdct_ifast_neon(DCTELEM *data)
|
||||
{
|
||||
/* Load an 8x8 block of samples into Neon registers. De-interleaving loads
|
||||
* are used, followed by vuzp to transpose the block such that we have a
|
||||
* column of samples per vector - allowing all rows to be processed at once.
|
||||
*/
|
||||
int16x8x4_t data1 = vld4q_s16(data);
|
||||
int16x8x4_t data2 = vld4q_s16(data + 4 * DCTSIZE);
|
||||
|
||||
int16x8x2_t cols_04 = vuzpq_s16(data1.val[0], data2.val[0]);
|
||||
int16x8x2_t cols_15 = vuzpq_s16(data1.val[1], data2.val[1]);
|
||||
int16x8x2_t cols_26 = vuzpq_s16(data1.val[2], data2.val[2]);
|
||||
int16x8x2_t cols_37 = vuzpq_s16(data1.val[3], data2.val[3]);
|
||||
|
||||
int16x8_t col0 = cols_04.val[0];
|
||||
int16x8_t col1 = cols_15.val[0];
|
||||
int16x8_t col2 = cols_26.val[0];
|
||||
int16x8_t col3 = cols_37.val[0];
|
||||
int16x8_t col4 = cols_04.val[1];
|
||||
int16x8_t col5 = cols_15.val[1];
|
||||
int16x8_t col6 = cols_26.val[1];
|
||||
int16x8_t col7 = cols_37.val[1];
|
||||
|
||||
/* Pass 1: process rows. */
|
||||
|
||||
/* Load DCT conversion constants. */
|
||||
const int16x4_t consts = vld1_s16(jsimd_fdct_ifast_neon_consts);
|
||||
|
||||
int16x8_t tmp0 = vaddq_s16(col0, col7);
|
||||
int16x8_t tmp7 = vsubq_s16(col0, col7);
|
||||
int16x8_t tmp1 = vaddq_s16(col1, col6);
|
||||
int16x8_t tmp6 = vsubq_s16(col1, col6);
|
||||
int16x8_t tmp2 = vaddq_s16(col2, col5);
|
||||
int16x8_t tmp5 = vsubq_s16(col2, col5);
|
||||
int16x8_t tmp3 = vaddq_s16(col3, col4);
|
||||
int16x8_t tmp4 = vsubq_s16(col3, col4);
|
||||
|
||||
/* Even part */
|
||||
int16x8_t tmp10 = vaddq_s16(tmp0, tmp3); /* phase 2 */
|
||||
int16x8_t tmp13 = vsubq_s16(tmp0, tmp3);
|
||||
int16x8_t tmp11 = vaddq_s16(tmp1, tmp2);
|
||||
int16x8_t tmp12 = vsubq_s16(tmp1, tmp2);
|
||||
|
||||
col0 = vaddq_s16(tmp10, tmp11); /* phase 3 */
|
||||
col4 = vsubq_s16(tmp10, tmp11);
|
||||
|
||||
int16x8_t z1 = vqdmulhq_lane_s16(vaddq_s16(tmp12, tmp13), consts, 2);
|
||||
col2 = vaddq_s16(tmp13, z1); /* phase 5 */
|
||||
col6 = vsubq_s16(tmp13, z1);
|
||||
|
||||
/* Odd part */
|
||||
tmp10 = vaddq_s16(tmp4, tmp5); /* phase 2 */
|
||||
tmp11 = vaddq_s16(tmp5, tmp6);
|
||||
tmp12 = vaddq_s16(tmp6, tmp7);
|
||||
|
||||
int16x8_t z5 = vqdmulhq_lane_s16(vsubq_s16(tmp10, tmp12), consts, 0);
|
||||
int16x8_t z2 = vqdmulhq_lane_s16(tmp10, consts, 1);
|
||||
z2 = vaddq_s16(z2, z5);
|
||||
int16x8_t z4 = vqdmulhq_lane_s16(tmp12, consts, 3);
|
||||
z5 = vaddq_s16(tmp12, z5);
|
||||
z4 = vaddq_s16(z4, z5);
|
||||
int16x8_t z3 = vqdmulhq_lane_s16(tmp11, consts, 2);
|
||||
|
||||
int16x8_t z11 = vaddq_s16(tmp7, z3); /* phase 5 */
|
||||
int16x8_t z13 = vsubq_s16(tmp7, z3);
|
||||
|
||||
col5 = vaddq_s16(z13, z2); /* phase 6 */
|
||||
col3 = vsubq_s16(z13, z2);
|
||||
col1 = vaddq_s16(z11, z4);
|
||||
col7 = vsubq_s16(z11, z4);
|
||||
|
||||
/* Transpose to work on columns in pass 2. */
|
||||
int16x8x2_t cols_01 = vtrnq_s16(col0, col1);
|
||||
int16x8x2_t cols_23 = vtrnq_s16(col2, col3);
|
||||
int16x8x2_t cols_45 = vtrnq_s16(col4, col5);
|
||||
int16x8x2_t cols_67 = vtrnq_s16(col6, col7);
|
||||
|
||||
int32x4x2_t cols_0145_l = vtrnq_s32(vreinterpretq_s32_s16(cols_01.val[0]),
|
||||
vreinterpretq_s32_s16(cols_45.val[0]));
|
||||
int32x4x2_t cols_0145_h = vtrnq_s32(vreinterpretq_s32_s16(cols_01.val[1]),
|
||||
vreinterpretq_s32_s16(cols_45.val[1]));
|
||||
int32x4x2_t cols_2367_l = vtrnq_s32(vreinterpretq_s32_s16(cols_23.val[0]),
|
||||
vreinterpretq_s32_s16(cols_67.val[0]));
|
||||
int32x4x2_t cols_2367_h = vtrnq_s32(vreinterpretq_s32_s16(cols_23.val[1]),
|
||||
vreinterpretq_s32_s16(cols_67.val[1]));
|
||||
|
||||
int32x4x2_t rows_04 = vzipq_s32(cols_0145_l.val[0], cols_2367_l.val[0]);
|
||||
int32x4x2_t rows_15 = vzipq_s32(cols_0145_h.val[0], cols_2367_h.val[0]);
|
||||
int32x4x2_t rows_26 = vzipq_s32(cols_0145_l.val[1], cols_2367_l.val[1]);
|
||||
int32x4x2_t rows_37 = vzipq_s32(cols_0145_h.val[1], cols_2367_h.val[1]);
|
||||
|
||||
int16x8_t row0 = vreinterpretq_s16_s32(rows_04.val[0]);
|
||||
int16x8_t row1 = vreinterpretq_s16_s32(rows_15.val[0]);
|
||||
int16x8_t row2 = vreinterpretq_s16_s32(rows_26.val[0]);
|
||||
int16x8_t row3 = vreinterpretq_s16_s32(rows_37.val[0]);
|
||||
int16x8_t row4 = vreinterpretq_s16_s32(rows_04.val[1]);
|
||||
int16x8_t row5 = vreinterpretq_s16_s32(rows_15.val[1]);
|
||||
int16x8_t row6 = vreinterpretq_s16_s32(rows_26.val[1]);
|
||||
int16x8_t row7 = vreinterpretq_s16_s32(rows_37.val[1]);
|
||||
|
||||
/* Pass 2: process columns. */
|
||||
|
||||
tmp0 = vaddq_s16(row0, row7);
|
||||
tmp7 = vsubq_s16(row0, row7);
|
||||
tmp1 = vaddq_s16(row1, row6);
|
||||
tmp6 = vsubq_s16(row1, row6);
|
||||
tmp2 = vaddq_s16(row2, row5);
|
||||
tmp5 = vsubq_s16(row2, row5);
|
||||
tmp3 = vaddq_s16(row3, row4);
|
||||
tmp4 = vsubq_s16(row3, row4);
|
||||
|
||||
/* Even part */
|
||||
tmp10 = vaddq_s16(tmp0, tmp3); /* phase 2 */
|
||||
tmp13 = vsubq_s16(tmp0, tmp3);
|
||||
tmp11 = vaddq_s16(tmp1, tmp2);
|
||||
tmp12 = vsubq_s16(tmp1, tmp2);
|
||||
|
||||
row0 = vaddq_s16(tmp10, tmp11); /* phase 3 */
|
||||
row4 = vsubq_s16(tmp10, tmp11);
|
||||
|
||||
z1 = vqdmulhq_lane_s16(vaddq_s16(tmp12, tmp13), consts, 2);
|
||||
row2 = vaddq_s16(tmp13, z1); /* phase 5 */
|
||||
row6 = vsubq_s16(tmp13, z1);
|
||||
|
||||
/* Odd part */
|
||||
tmp10 = vaddq_s16(tmp4, tmp5); /* phase 2 */
|
||||
tmp11 = vaddq_s16(tmp5, tmp6);
|
||||
tmp12 = vaddq_s16(tmp6, tmp7);
|
||||
|
||||
z5 = vqdmulhq_lane_s16(vsubq_s16(tmp10, tmp12), consts, 0);
|
||||
z2 = vqdmulhq_lane_s16(tmp10, consts, 1);
|
||||
z2 = vaddq_s16(z2, z5);
|
||||
z4 = vqdmulhq_lane_s16(tmp12, consts, 3);
|
||||
z5 = vaddq_s16(tmp12, z5);
|
||||
z4 = vaddq_s16(z4, z5);
|
||||
z3 = vqdmulhq_lane_s16(tmp11, consts, 2);
|
||||
|
||||
z11 = vaddq_s16(tmp7, z3); /* phase 5 */
|
||||
z13 = vsubq_s16(tmp7, z3);
|
||||
|
||||
row5 = vaddq_s16(z13, z2); /* phase 6 */
|
||||
row3 = vsubq_s16(z13, z2);
|
||||
row1 = vaddq_s16(z11, z4);
|
||||
row7 = vsubq_s16(z11, z4);
|
||||
|
||||
vst1q_s16(data + 0 * DCTSIZE, row0);
|
||||
vst1q_s16(data + 1 * DCTSIZE, row1);
|
||||
vst1q_s16(data + 2 * DCTSIZE, row2);
|
||||
vst1q_s16(data + 3 * DCTSIZE, row3);
|
||||
vst1q_s16(data + 4 * DCTSIZE, row4);
|
||||
vst1q_s16(data + 5 * DCTSIZE, row5);
|
||||
vst1q_s16(data + 6 * DCTSIZE, row6);
|
||||
vst1q_s16(data + 7 * DCTSIZE, row7);
|
||||
}
|
||||
+376
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
* jfdctint-neon.c - accurate integer FDCT (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* jsimd_fdct_islow_neon() performs a slower but more accurate forward DCT
|
||||
* (Discrete Cosine Transform) on one block of samples. It uses the same
|
||||
* calculations and produces exactly the same output as IJG's original
|
||||
* jpeg_fdct_islow() function, which can be found in jfdctint.c.
|
||||
*
|
||||
* Scaled integer constants are used to avoid floating-point arithmetic:
|
||||
* 0.298631336 = 2446 * 2^-13
|
||||
* 0.390180644 = 3196 * 2^-13
|
||||
* 0.541196100 = 4433 * 2^-13
|
||||
* 0.765366865 = 6270 * 2^-13
|
||||
* 0.899976223 = 7373 * 2^-13
|
||||
* 1.175875602 = 9633 * 2^-13
|
||||
* 1.501321110 = 12299 * 2^-13
|
||||
* 1.847759065 = 15137 * 2^-13
|
||||
* 1.961570560 = 16069 * 2^-13
|
||||
* 2.053119869 = 16819 * 2^-13
|
||||
* 2.562915447 = 20995 * 2^-13
|
||||
* 3.072711026 = 25172 * 2^-13
|
||||
*
|
||||
* See jfdctint.c for further details of the DCT algorithm. Where possible,
|
||||
* the variable names and comments here in jsimd_fdct_islow_neon() match up
|
||||
* with those in jpeg_fdct_islow().
|
||||
*/
|
||||
|
||||
#define CONST_BITS 13
|
||||
#define PASS1_BITS 2
|
||||
|
||||
#define DESCALE_P1 (CONST_BITS - PASS1_BITS)
|
||||
#define DESCALE_P2 (CONST_BITS + PASS1_BITS)
|
||||
|
||||
#define F_0_298 2446
|
||||
#define F_0_390 3196
|
||||
#define F_0_541 4433
|
||||
#define F_0_765 6270
|
||||
#define F_0_899 7373
|
||||
#define F_1_175 9633
|
||||
#define F_1_501 12299
|
||||
#define F_1_847 15137
|
||||
#define F_1_961 16069
|
||||
#define F_2_053 16819
|
||||
#define F_2_562 20995
|
||||
#define F_3_072 25172
|
||||
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_fdct_islow_neon_consts[] = {
|
||||
F_0_298, -F_0_390, F_0_541, F_0_765,
|
||||
-F_0_899, F_1_175, F_1_501, -F_1_847,
|
||||
-F_1_961, F_2_053, -F_2_562, F_3_072
|
||||
};
|
||||
|
||||
void jsimd_fdct_islow_neon(DCTELEM *data)
|
||||
{
|
||||
/* Load DCT constants. */
|
||||
#ifdef HAVE_VLD1_S16_X3
|
||||
const int16x4x3_t consts = vld1_s16_x3(jsimd_fdct_islow_neon_consts);
|
||||
#else
|
||||
/* GCC does not currently support the intrinsic vld1_<type>_x3(). */
|
||||
const int16x4_t consts1 = vld1_s16(jsimd_fdct_islow_neon_consts);
|
||||
const int16x4_t consts2 = vld1_s16(jsimd_fdct_islow_neon_consts + 4);
|
||||
const int16x4_t consts3 = vld1_s16(jsimd_fdct_islow_neon_consts + 8);
|
||||
const int16x4x3_t consts = { { consts1, consts2, consts3 } };
|
||||
#endif
|
||||
|
||||
/* Load an 8x8 block of samples into Neon registers. De-interleaving loads
|
||||
* are used, followed by vuzp to transpose the block such that we have a
|
||||
* column of samples per vector - allowing all rows to be processed at once.
|
||||
*/
|
||||
int16x8x4_t s_rows_0123 = vld4q_s16(data);
|
||||
int16x8x4_t s_rows_4567 = vld4q_s16(data + 4 * DCTSIZE);
|
||||
|
||||
int16x8x2_t cols_04 = vuzpq_s16(s_rows_0123.val[0], s_rows_4567.val[0]);
|
||||
int16x8x2_t cols_15 = vuzpq_s16(s_rows_0123.val[1], s_rows_4567.val[1]);
|
||||
int16x8x2_t cols_26 = vuzpq_s16(s_rows_0123.val[2], s_rows_4567.val[2]);
|
||||
int16x8x2_t cols_37 = vuzpq_s16(s_rows_0123.val[3], s_rows_4567.val[3]);
|
||||
|
||||
int16x8_t col0 = cols_04.val[0];
|
||||
int16x8_t col1 = cols_15.val[0];
|
||||
int16x8_t col2 = cols_26.val[0];
|
||||
int16x8_t col3 = cols_37.val[0];
|
||||
int16x8_t col4 = cols_04.val[1];
|
||||
int16x8_t col5 = cols_15.val[1];
|
||||
int16x8_t col6 = cols_26.val[1];
|
||||
int16x8_t col7 = cols_37.val[1];
|
||||
|
||||
/* Pass 1: process rows. */
|
||||
|
||||
int16x8_t tmp0 = vaddq_s16(col0, col7);
|
||||
int16x8_t tmp7 = vsubq_s16(col0, col7);
|
||||
int16x8_t tmp1 = vaddq_s16(col1, col6);
|
||||
int16x8_t tmp6 = vsubq_s16(col1, col6);
|
||||
int16x8_t tmp2 = vaddq_s16(col2, col5);
|
||||
int16x8_t tmp5 = vsubq_s16(col2, col5);
|
||||
int16x8_t tmp3 = vaddq_s16(col3, col4);
|
||||
int16x8_t tmp4 = vsubq_s16(col3, col4);
|
||||
|
||||
/* Even part */
|
||||
int16x8_t tmp10 = vaddq_s16(tmp0, tmp3);
|
||||
int16x8_t tmp13 = vsubq_s16(tmp0, tmp3);
|
||||
int16x8_t tmp11 = vaddq_s16(tmp1, tmp2);
|
||||
int16x8_t tmp12 = vsubq_s16(tmp1, tmp2);
|
||||
|
||||
col0 = vshlq_n_s16(vaddq_s16(tmp10, tmp11), PASS1_BITS);
|
||||
col4 = vshlq_n_s16(vsubq_s16(tmp10, tmp11), PASS1_BITS);
|
||||
|
||||
int16x8_t tmp12_add_tmp13 = vaddq_s16(tmp12, tmp13);
|
||||
int32x4_t z1_l =
|
||||
vmull_lane_s16(vget_low_s16(tmp12_add_tmp13), consts.val[0], 2);
|
||||
int32x4_t z1_h =
|
||||
vmull_lane_s16(vget_high_s16(tmp12_add_tmp13), consts.val[0], 2);
|
||||
|
||||
int32x4_t col2_scaled_l =
|
||||
vmlal_lane_s16(z1_l, vget_low_s16(tmp13), consts.val[0], 3);
|
||||
int32x4_t col2_scaled_h =
|
||||
vmlal_lane_s16(z1_h, vget_high_s16(tmp13), consts.val[0], 3);
|
||||
col2 = vcombine_s16(vrshrn_n_s32(col2_scaled_l, DESCALE_P1),
|
||||
vrshrn_n_s32(col2_scaled_h, DESCALE_P1));
|
||||
|
||||
int32x4_t col6_scaled_l =
|
||||
vmlal_lane_s16(z1_l, vget_low_s16(tmp12), consts.val[1], 3);
|
||||
int32x4_t col6_scaled_h =
|
||||
vmlal_lane_s16(z1_h, vget_high_s16(tmp12), consts.val[1], 3);
|
||||
col6 = vcombine_s16(vrshrn_n_s32(col6_scaled_l, DESCALE_P1),
|
||||
vrshrn_n_s32(col6_scaled_h, DESCALE_P1));
|
||||
|
||||
/* Odd part */
|
||||
int16x8_t z1 = vaddq_s16(tmp4, tmp7);
|
||||
int16x8_t z2 = vaddq_s16(tmp5, tmp6);
|
||||
int16x8_t z3 = vaddq_s16(tmp4, tmp6);
|
||||
int16x8_t z4 = vaddq_s16(tmp5, tmp7);
|
||||
/* sqrt(2) * c3 */
|
||||
int32x4_t z5_l = vmull_lane_s16(vget_low_s16(z3), consts.val[1], 1);
|
||||
int32x4_t z5_h = vmull_lane_s16(vget_high_s16(z3), consts.val[1], 1);
|
||||
z5_l = vmlal_lane_s16(z5_l, vget_low_s16(z4), consts.val[1], 1);
|
||||
z5_h = vmlal_lane_s16(z5_h, vget_high_s16(z4), consts.val[1], 1);
|
||||
|
||||
/* sqrt(2) * (-c1+c3+c5-c7) */
|
||||
int32x4_t tmp4_l = vmull_lane_s16(vget_low_s16(tmp4), consts.val[0], 0);
|
||||
int32x4_t tmp4_h = vmull_lane_s16(vget_high_s16(tmp4), consts.val[0], 0);
|
||||
/* sqrt(2) * ( c1+c3-c5+c7) */
|
||||
int32x4_t tmp5_l = vmull_lane_s16(vget_low_s16(tmp5), consts.val[2], 1);
|
||||
int32x4_t tmp5_h = vmull_lane_s16(vget_high_s16(tmp5), consts.val[2], 1);
|
||||
/* sqrt(2) * ( c1+c3+c5-c7) */
|
||||
int32x4_t tmp6_l = vmull_lane_s16(vget_low_s16(tmp6), consts.val[2], 3);
|
||||
int32x4_t tmp6_h = vmull_lane_s16(vget_high_s16(tmp6), consts.val[2], 3);
|
||||
/* sqrt(2) * ( c1+c3-c5-c7) */
|
||||
int32x4_t tmp7_l = vmull_lane_s16(vget_low_s16(tmp7), consts.val[1], 2);
|
||||
int32x4_t tmp7_h = vmull_lane_s16(vget_high_s16(tmp7), consts.val[1], 2);
|
||||
|
||||
/* sqrt(2) * (c7-c3) */
|
||||
z1_l = vmull_lane_s16(vget_low_s16(z1), consts.val[1], 0);
|
||||
z1_h = vmull_lane_s16(vget_high_s16(z1), consts.val[1], 0);
|
||||
/* sqrt(2) * (-c1-c3) */
|
||||
int32x4_t z2_l = vmull_lane_s16(vget_low_s16(z2), consts.val[2], 2);
|
||||
int32x4_t z2_h = vmull_lane_s16(vget_high_s16(z2), consts.val[2], 2);
|
||||
/* sqrt(2) * (-c3-c5) */
|
||||
int32x4_t z3_l = vmull_lane_s16(vget_low_s16(z3), consts.val[2], 0);
|
||||
int32x4_t z3_h = vmull_lane_s16(vget_high_s16(z3), consts.val[2], 0);
|
||||
/* sqrt(2) * (c5-c3) */
|
||||
int32x4_t z4_l = vmull_lane_s16(vget_low_s16(z4), consts.val[0], 1);
|
||||
int32x4_t z4_h = vmull_lane_s16(vget_high_s16(z4), consts.val[0], 1);
|
||||
|
||||
z3_l = vaddq_s32(z3_l, z5_l);
|
||||
z3_h = vaddq_s32(z3_h, z5_h);
|
||||
z4_l = vaddq_s32(z4_l, z5_l);
|
||||
z4_h = vaddq_s32(z4_h, z5_h);
|
||||
|
||||
tmp4_l = vaddq_s32(tmp4_l, z1_l);
|
||||
tmp4_h = vaddq_s32(tmp4_h, z1_h);
|
||||
tmp4_l = vaddq_s32(tmp4_l, z3_l);
|
||||
tmp4_h = vaddq_s32(tmp4_h, z3_h);
|
||||
col7 = vcombine_s16(vrshrn_n_s32(tmp4_l, DESCALE_P1),
|
||||
vrshrn_n_s32(tmp4_h, DESCALE_P1));
|
||||
|
||||
tmp5_l = vaddq_s32(tmp5_l, z2_l);
|
||||
tmp5_h = vaddq_s32(tmp5_h, z2_h);
|
||||
tmp5_l = vaddq_s32(tmp5_l, z4_l);
|
||||
tmp5_h = vaddq_s32(tmp5_h, z4_h);
|
||||
col5 = vcombine_s16(vrshrn_n_s32(tmp5_l, DESCALE_P1),
|
||||
vrshrn_n_s32(tmp5_h, DESCALE_P1));
|
||||
|
||||
tmp6_l = vaddq_s32(tmp6_l, z2_l);
|
||||
tmp6_h = vaddq_s32(tmp6_h, z2_h);
|
||||
tmp6_l = vaddq_s32(tmp6_l, z3_l);
|
||||
tmp6_h = vaddq_s32(tmp6_h, z3_h);
|
||||
col3 = vcombine_s16(vrshrn_n_s32(tmp6_l, DESCALE_P1),
|
||||
vrshrn_n_s32(tmp6_h, DESCALE_P1));
|
||||
|
||||
tmp7_l = vaddq_s32(tmp7_l, z1_l);
|
||||
tmp7_h = vaddq_s32(tmp7_h, z1_h);
|
||||
tmp7_l = vaddq_s32(tmp7_l, z4_l);
|
||||
tmp7_h = vaddq_s32(tmp7_h, z4_h);
|
||||
col1 = vcombine_s16(vrshrn_n_s32(tmp7_l, DESCALE_P1),
|
||||
vrshrn_n_s32(tmp7_h, DESCALE_P1));
|
||||
|
||||
/* Transpose to work on columns in pass 2. */
|
||||
int16x8x2_t cols_01 = vtrnq_s16(col0, col1);
|
||||
int16x8x2_t cols_23 = vtrnq_s16(col2, col3);
|
||||
int16x8x2_t cols_45 = vtrnq_s16(col4, col5);
|
||||
int16x8x2_t cols_67 = vtrnq_s16(col6, col7);
|
||||
|
||||
int32x4x2_t cols_0145_l = vtrnq_s32(vreinterpretq_s32_s16(cols_01.val[0]),
|
||||
vreinterpretq_s32_s16(cols_45.val[0]));
|
||||
int32x4x2_t cols_0145_h = vtrnq_s32(vreinterpretq_s32_s16(cols_01.val[1]),
|
||||
vreinterpretq_s32_s16(cols_45.val[1]));
|
||||
int32x4x2_t cols_2367_l = vtrnq_s32(vreinterpretq_s32_s16(cols_23.val[0]),
|
||||
vreinterpretq_s32_s16(cols_67.val[0]));
|
||||
int32x4x2_t cols_2367_h = vtrnq_s32(vreinterpretq_s32_s16(cols_23.val[1]),
|
||||
vreinterpretq_s32_s16(cols_67.val[1]));
|
||||
|
||||
int32x4x2_t rows_04 = vzipq_s32(cols_0145_l.val[0], cols_2367_l.val[0]);
|
||||
int32x4x2_t rows_15 = vzipq_s32(cols_0145_h.val[0], cols_2367_h.val[0]);
|
||||
int32x4x2_t rows_26 = vzipq_s32(cols_0145_l.val[1], cols_2367_l.val[1]);
|
||||
int32x4x2_t rows_37 = vzipq_s32(cols_0145_h.val[1], cols_2367_h.val[1]);
|
||||
|
||||
int16x8_t row0 = vreinterpretq_s16_s32(rows_04.val[0]);
|
||||
int16x8_t row1 = vreinterpretq_s16_s32(rows_15.val[0]);
|
||||
int16x8_t row2 = vreinterpretq_s16_s32(rows_26.val[0]);
|
||||
int16x8_t row3 = vreinterpretq_s16_s32(rows_37.val[0]);
|
||||
int16x8_t row4 = vreinterpretq_s16_s32(rows_04.val[1]);
|
||||
int16x8_t row5 = vreinterpretq_s16_s32(rows_15.val[1]);
|
||||
int16x8_t row6 = vreinterpretq_s16_s32(rows_26.val[1]);
|
||||
int16x8_t row7 = vreinterpretq_s16_s32(rows_37.val[1]);
|
||||
|
||||
/* Pass 2: process columns. */
|
||||
|
||||
tmp0 = vaddq_s16(row0, row7);
|
||||
tmp7 = vsubq_s16(row0, row7);
|
||||
tmp1 = vaddq_s16(row1, row6);
|
||||
tmp6 = vsubq_s16(row1, row6);
|
||||
tmp2 = vaddq_s16(row2, row5);
|
||||
tmp5 = vsubq_s16(row2, row5);
|
||||
tmp3 = vaddq_s16(row3, row4);
|
||||
tmp4 = vsubq_s16(row3, row4);
|
||||
|
||||
/* Even part */
|
||||
tmp10 = vaddq_s16(tmp0, tmp3);
|
||||
tmp13 = vsubq_s16(tmp0, tmp3);
|
||||
tmp11 = vaddq_s16(tmp1, tmp2);
|
||||
tmp12 = vsubq_s16(tmp1, tmp2);
|
||||
|
||||
row0 = vrshrq_n_s16(vaddq_s16(tmp10, tmp11), PASS1_BITS);
|
||||
row4 = vrshrq_n_s16(vsubq_s16(tmp10, tmp11), PASS1_BITS);
|
||||
|
||||
tmp12_add_tmp13 = vaddq_s16(tmp12, tmp13);
|
||||
z1_l = vmull_lane_s16(vget_low_s16(tmp12_add_tmp13), consts.val[0], 2);
|
||||
z1_h = vmull_lane_s16(vget_high_s16(tmp12_add_tmp13), consts.val[0], 2);
|
||||
|
||||
int32x4_t row2_scaled_l =
|
||||
vmlal_lane_s16(z1_l, vget_low_s16(tmp13), consts.val[0], 3);
|
||||
int32x4_t row2_scaled_h =
|
||||
vmlal_lane_s16(z1_h, vget_high_s16(tmp13), consts.val[0], 3);
|
||||
row2 = vcombine_s16(vrshrn_n_s32(row2_scaled_l, DESCALE_P2),
|
||||
vrshrn_n_s32(row2_scaled_h, DESCALE_P2));
|
||||
|
||||
int32x4_t row6_scaled_l =
|
||||
vmlal_lane_s16(z1_l, vget_low_s16(tmp12), consts.val[1], 3);
|
||||
int32x4_t row6_scaled_h =
|
||||
vmlal_lane_s16(z1_h, vget_high_s16(tmp12), consts.val[1], 3);
|
||||
row6 = vcombine_s16(vrshrn_n_s32(row6_scaled_l, DESCALE_P2),
|
||||
vrshrn_n_s32(row6_scaled_h, DESCALE_P2));
|
||||
|
||||
/* Odd part */
|
||||
z1 = vaddq_s16(tmp4, tmp7);
|
||||
z2 = vaddq_s16(tmp5, tmp6);
|
||||
z3 = vaddq_s16(tmp4, tmp6);
|
||||
z4 = vaddq_s16(tmp5, tmp7);
|
||||
/* sqrt(2) * c3 */
|
||||
z5_l = vmull_lane_s16(vget_low_s16(z3), consts.val[1], 1);
|
||||
z5_h = vmull_lane_s16(vget_high_s16(z3), consts.val[1], 1);
|
||||
z5_l = vmlal_lane_s16(z5_l, vget_low_s16(z4), consts.val[1], 1);
|
||||
z5_h = vmlal_lane_s16(z5_h, vget_high_s16(z4), consts.val[1], 1);
|
||||
|
||||
/* sqrt(2) * (-c1+c3+c5-c7) */
|
||||
tmp4_l = vmull_lane_s16(vget_low_s16(tmp4), consts.val[0], 0);
|
||||
tmp4_h = vmull_lane_s16(vget_high_s16(tmp4), consts.val[0], 0);
|
||||
/* sqrt(2) * ( c1+c3-c5+c7) */
|
||||
tmp5_l = vmull_lane_s16(vget_low_s16(tmp5), consts.val[2], 1);
|
||||
tmp5_h = vmull_lane_s16(vget_high_s16(tmp5), consts.val[2], 1);
|
||||
/* sqrt(2) * ( c1+c3+c5-c7) */
|
||||
tmp6_l = vmull_lane_s16(vget_low_s16(tmp6), consts.val[2], 3);
|
||||
tmp6_h = vmull_lane_s16(vget_high_s16(tmp6), consts.val[2], 3);
|
||||
/* sqrt(2) * ( c1+c3-c5-c7) */
|
||||
tmp7_l = vmull_lane_s16(vget_low_s16(tmp7), consts.val[1], 2);
|
||||
tmp7_h = vmull_lane_s16(vget_high_s16(tmp7), consts.val[1], 2);
|
||||
|
||||
/* sqrt(2) * (c7-c3) */
|
||||
z1_l = vmull_lane_s16(vget_low_s16(z1), consts.val[1], 0);
|
||||
z1_h = vmull_lane_s16(vget_high_s16(z1), consts.val[1], 0);
|
||||
/* sqrt(2) * (-c1-c3) */
|
||||
z2_l = vmull_lane_s16(vget_low_s16(z2), consts.val[2], 2);
|
||||
z2_h = vmull_lane_s16(vget_high_s16(z2), consts.val[2], 2);
|
||||
/* sqrt(2) * (-c3-c5) */
|
||||
z3_l = vmull_lane_s16(vget_low_s16(z3), consts.val[2], 0);
|
||||
z3_h = vmull_lane_s16(vget_high_s16(z3), consts.val[2], 0);
|
||||
/* sqrt(2) * (c5-c3) */
|
||||
z4_l = vmull_lane_s16(vget_low_s16(z4), consts.val[0], 1);
|
||||
z4_h = vmull_lane_s16(vget_high_s16(z4), consts.val[0], 1);
|
||||
|
||||
z3_l = vaddq_s32(z3_l, z5_l);
|
||||
z3_h = vaddq_s32(z3_h, z5_h);
|
||||
z4_l = vaddq_s32(z4_l, z5_l);
|
||||
z4_h = vaddq_s32(z4_h, z5_h);
|
||||
|
||||
tmp4_l = vaddq_s32(tmp4_l, z1_l);
|
||||
tmp4_h = vaddq_s32(tmp4_h, z1_h);
|
||||
tmp4_l = vaddq_s32(tmp4_l, z3_l);
|
||||
tmp4_h = vaddq_s32(tmp4_h, z3_h);
|
||||
row7 = vcombine_s16(vrshrn_n_s32(tmp4_l, DESCALE_P2),
|
||||
vrshrn_n_s32(tmp4_h, DESCALE_P2));
|
||||
|
||||
tmp5_l = vaddq_s32(tmp5_l, z2_l);
|
||||
tmp5_h = vaddq_s32(tmp5_h, z2_h);
|
||||
tmp5_l = vaddq_s32(tmp5_l, z4_l);
|
||||
tmp5_h = vaddq_s32(tmp5_h, z4_h);
|
||||
row5 = vcombine_s16(vrshrn_n_s32(tmp5_l, DESCALE_P2),
|
||||
vrshrn_n_s32(tmp5_h, DESCALE_P2));
|
||||
|
||||
tmp6_l = vaddq_s32(tmp6_l, z2_l);
|
||||
tmp6_h = vaddq_s32(tmp6_h, z2_h);
|
||||
tmp6_l = vaddq_s32(tmp6_l, z3_l);
|
||||
tmp6_h = vaddq_s32(tmp6_h, z3_h);
|
||||
row3 = vcombine_s16(vrshrn_n_s32(tmp6_l, DESCALE_P2),
|
||||
vrshrn_n_s32(tmp6_h, DESCALE_P2));
|
||||
|
||||
tmp7_l = vaddq_s32(tmp7_l, z1_l);
|
||||
tmp7_h = vaddq_s32(tmp7_h, z1_h);
|
||||
tmp7_l = vaddq_s32(tmp7_l, z4_l);
|
||||
tmp7_h = vaddq_s32(tmp7_h, z4_h);
|
||||
row1 = vcombine_s16(vrshrn_n_s32(tmp7_l, DESCALE_P2),
|
||||
vrshrn_n_s32(tmp7_h, DESCALE_P2));
|
||||
|
||||
vst1q_s16(data + 0 * DCTSIZE, row0);
|
||||
vst1q_s16(data + 1 * DCTSIZE, row1);
|
||||
vst1q_s16(data + 2 * DCTSIZE, row2);
|
||||
vst1q_s16(data + 3 * DCTSIZE, row3);
|
||||
vst1q_s16(data + 4 * DCTSIZE, row4);
|
||||
vst1q_s16(data + 5 * DCTSIZE, row5);
|
||||
vst1q_s16(data + 6 * DCTSIZE, row6);
|
||||
vst1q_s16(data + 7 * DCTSIZE, row7);
|
||||
}
|
||||
+474
@@ -0,0 +1,474 @@
|
||||
/*
|
||||
* jidctfst-neon.c - fast integer IDCT (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
/* jsimd_idct_ifast_neon() performs dequantization and a fast, not so accurate
|
||||
* inverse DCT (Discrete Cosine Transform) on one block of coefficients. It
|
||||
* uses the same calculations and produces exactly the same output as IJG's
|
||||
* original jpeg_idct_ifast() function, which can be found in jidctfst.c.
|
||||
*
|
||||
* Scaled integer constants are used to avoid floating-point arithmetic:
|
||||
* 0.082392200 = 2688 * 2^-15
|
||||
* 0.414213562 = 13568 * 2^-15
|
||||
* 0.847759065 = 27776 * 2^-15
|
||||
* 0.613125930 = 20096 * 2^-15
|
||||
*
|
||||
* See jidctfst.c for further details of the IDCT algorithm. Where possible,
|
||||
* the variable names and comments here in jsimd_idct_ifast_neon() match up
|
||||
* with those in jpeg_idct_ifast().
|
||||
*/
|
||||
|
||||
#define PASS1_BITS 2
|
||||
|
||||
#define F_0_082 2688
|
||||
#define F_0_414 13568
|
||||
#define F_0_847 27776
|
||||
#define F_0_613 20096
|
||||
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_idct_ifast_neon_consts[] = {
|
||||
F_0_082, F_0_414, F_0_847, F_0_613
|
||||
};
|
||||
|
||||
void jsimd_idct_ifast_neon(void *dct_table, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
||||
{
|
||||
IFAST_MULT_TYPE *quantptr = dct_table;
|
||||
|
||||
/* Load DCT coefficients. */
|
||||
int16x8_t row0 = vld1q_s16(coef_block + 0 * DCTSIZE);
|
||||
int16x8_t row1 = vld1q_s16(coef_block + 1 * DCTSIZE);
|
||||
int16x8_t row2 = vld1q_s16(coef_block + 2 * DCTSIZE);
|
||||
int16x8_t row3 = vld1q_s16(coef_block + 3 * DCTSIZE);
|
||||
int16x8_t row4 = vld1q_s16(coef_block + 4 * DCTSIZE);
|
||||
int16x8_t row5 = vld1q_s16(coef_block + 5 * DCTSIZE);
|
||||
int16x8_t row6 = vld1q_s16(coef_block + 6 * DCTSIZE);
|
||||
int16x8_t row7 = vld1q_s16(coef_block + 7 * DCTSIZE);
|
||||
|
||||
/* Load quantization table values for DC coefficients. */
|
||||
int16x8_t quant_row0 = vld1q_s16(quantptr + 0 * DCTSIZE);
|
||||
/* Dequantize DC coefficients. */
|
||||
row0 = vmulq_s16(row0, quant_row0);
|
||||
|
||||
/* Construct bitmap to test if all AC coefficients are 0. */
|
||||
int16x8_t bitmap = vorrq_s16(row1, row2);
|
||||
bitmap = vorrq_s16(bitmap, row3);
|
||||
bitmap = vorrq_s16(bitmap, row4);
|
||||
bitmap = vorrq_s16(bitmap, row5);
|
||||
bitmap = vorrq_s16(bitmap, row6);
|
||||
bitmap = vorrq_s16(bitmap, row7);
|
||||
|
||||
int64_t left_ac_bitmap = vgetq_lane_s64(vreinterpretq_s64_s16(bitmap), 0);
|
||||
int64_t right_ac_bitmap = vgetq_lane_s64(vreinterpretq_s64_s16(bitmap), 1);
|
||||
|
||||
/* Load IDCT conversion constants. */
|
||||
const int16x4_t consts = vld1_s16(jsimd_idct_ifast_neon_consts);
|
||||
|
||||
if (left_ac_bitmap == 0 && right_ac_bitmap == 0) {
|
||||
/* All AC coefficients are zero.
|
||||
* Compute DC values and duplicate into vectors.
|
||||
*/
|
||||
int16x8_t dcval = row0;
|
||||
row1 = dcval;
|
||||
row2 = dcval;
|
||||
row3 = dcval;
|
||||
row4 = dcval;
|
||||
row5 = dcval;
|
||||
row6 = dcval;
|
||||
row7 = dcval;
|
||||
} else if (left_ac_bitmap == 0) {
|
||||
/* AC coefficients are zero for columns 0, 1, 2, and 3.
|
||||
* Use DC values for these columns.
|
||||
*/
|
||||
int16x4_t dcval = vget_low_s16(row0);
|
||||
|
||||
/* Commence regular fast IDCT computation for columns 4, 5, 6, and 7. */
|
||||
|
||||
/* Load quantization table. */
|
||||
int16x4_t quant_row1 = vld1_s16(quantptr + 1 * DCTSIZE + 4);
|
||||
int16x4_t quant_row2 = vld1_s16(quantptr + 2 * DCTSIZE + 4);
|
||||
int16x4_t quant_row3 = vld1_s16(quantptr + 3 * DCTSIZE + 4);
|
||||
int16x4_t quant_row4 = vld1_s16(quantptr + 4 * DCTSIZE + 4);
|
||||
int16x4_t quant_row5 = vld1_s16(quantptr + 5 * DCTSIZE + 4);
|
||||
int16x4_t quant_row6 = vld1_s16(quantptr + 6 * DCTSIZE + 4);
|
||||
int16x4_t quant_row7 = vld1_s16(quantptr + 7 * DCTSIZE + 4);
|
||||
|
||||
/* Even part: dequantize DCT coefficients. */
|
||||
int16x4_t tmp0 = vget_high_s16(row0);
|
||||
int16x4_t tmp1 = vmul_s16(vget_high_s16(row2), quant_row2);
|
||||
int16x4_t tmp2 = vmul_s16(vget_high_s16(row4), quant_row4);
|
||||
int16x4_t tmp3 = vmul_s16(vget_high_s16(row6), quant_row6);
|
||||
|
||||
int16x4_t tmp10 = vadd_s16(tmp0, tmp2); /* phase 3 */
|
||||
int16x4_t tmp11 = vsub_s16(tmp0, tmp2);
|
||||
|
||||
int16x4_t tmp13 = vadd_s16(tmp1, tmp3); /* phases 5-3 */
|
||||
int16x4_t tmp1_sub_tmp3 = vsub_s16(tmp1, tmp3);
|
||||
int16x4_t tmp12 = vqdmulh_lane_s16(tmp1_sub_tmp3, consts, 1);
|
||||
tmp12 = vadd_s16(tmp12, tmp1_sub_tmp3);
|
||||
tmp12 = vsub_s16(tmp12, tmp13);
|
||||
|
||||
tmp0 = vadd_s16(tmp10, tmp13); /* phase 2 */
|
||||
tmp3 = vsub_s16(tmp10, tmp13);
|
||||
tmp1 = vadd_s16(tmp11, tmp12);
|
||||
tmp2 = vsub_s16(tmp11, tmp12);
|
||||
|
||||
/* Odd part: dequantize DCT coefficients. */
|
||||
int16x4_t tmp4 = vmul_s16(vget_high_s16(row1), quant_row1);
|
||||
int16x4_t tmp5 = vmul_s16(vget_high_s16(row3), quant_row3);
|
||||
int16x4_t tmp6 = vmul_s16(vget_high_s16(row5), quant_row5);
|
||||
int16x4_t tmp7 = vmul_s16(vget_high_s16(row7), quant_row7);
|
||||
|
||||
int16x4_t z13 = vadd_s16(tmp6, tmp5); /* phase 6 */
|
||||
int16x4_t neg_z10 = vsub_s16(tmp5, tmp6);
|
||||
int16x4_t z11 = vadd_s16(tmp4, tmp7);
|
||||
int16x4_t z12 = vsub_s16(tmp4, tmp7);
|
||||
|
||||
tmp7 = vadd_s16(z11, z13); /* phase 5 */
|
||||
int16x4_t z11_sub_z13 = vsub_s16(z11, z13);
|
||||
tmp11 = vqdmulh_lane_s16(z11_sub_z13, consts, 1);
|
||||
tmp11 = vadd_s16(tmp11, z11_sub_z13);
|
||||
|
||||
int16x4_t z10_add_z12 = vsub_s16(z12, neg_z10);
|
||||
int16x4_t z5 = vqdmulh_lane_s16(z10_add_z12, consts, 2);
|
||||
z5 = vadd_s16(z5, z10_add_z12);
|
||||
tmp10 = vqdmulh_lane_s16(z12, consts, 0);
|
||||
tmp10 = vadd_s16(tmp10, z12);
|
||||
tmp10 = vsub_s16(tmp10, z5);
|
||||
tmp12 = vqdmulh_lane_s16(neg_z10, consts, 3);
|
||||
tmp12 = vadd_s16(tmp12, vadd_s16(neg_z10, neg_z10));
|
||||
tmp12 = vadd_s16(tmp12, z5);
|
||||
|
||||
tmp6 = vsub_s16(tmp12, tmp7); /* phase 2 */
|
||||
tmp5 = vsub_s16(tmp11, tmp6);
|
||||
tmp4 = vadd_s16(tmp10, tmp5);
|
||||
|
||||
row0 = vcombine_s16(dcval, vadd_s16(tmp0, tmp7));
|
||||
row7 = vcombine_s16(dcval, vsub_s16(tmp0, tmp7));
|
||||
row1 = vcombine_s16(dcval, vadd_s16(tmp1, tmp6));
|
||||
row6 = vcombine_s16(dcval, vsub_s16(tmp1, tmp6));
|
||||
row2 = vcombine_s16(dcval, vadd_s16(tmp2, tmp5));
|
||||
row5 = vcombine_s16(dcval, vsub_s16(tmp2, tmp5));
|
||||
row4 = vcombine_s16(dcval, vadd_s16(tmp3, tmp4));
|
||||
row3 = vcombine_s16(dcval, vsub_s16(tmp3, tmp4));
|
||||
} else if (right_ac_bitmap == 0) {
|
||||
/* AC coefficients are zero for columns 4, 5, 6, and 7.
|
||||
* Use DC values for these columns.
|
||||
*/
|
||||
int16x4_t dcval = vget_high_s16(row0);
|
||||
|
||||
/* Commence regular fast IDCT computation for columns 0, 1, 2, and 3. */
|
||||
|
||||
/* Load quantization table. */
|
||||
int16x4_t quant_row1 = vld1_s16(quantptr + 1 * DCTSIZE);
|
||||
int16x4_t quant_row2 = vld1_s16(quantptr + 2 * DCTSIZE);
|
||||
int16x4_t quant_row3 = vld1_s16(quantptr + 3 * DCTSIZE);
|
||||
int16x4_t quant_row4 = vld1_s16(quantptr + 4 * DCTSIZE);
|
||||
int16x4_t quant_row5 = vld1_s16(quantptr + 5 * DCTSIZE);
|
||||
int16x4_t quant_row6 = vld1_s16(quantptr + 6 * DCTSIZE);
|
||||
int16x4_t quant_row7 = vld1_s16(quantptr + 7 * DCTSIZE);
|
||||
|
||||
/* Even part: dequantize DCT coefficients. */
|
||||
int16x4_t tmp0 = vget_low_s16(row0);
|
||||
int16x4_t tmp1 = vmul_s16(vget_low_s16(row2), quant_row2);
|
||||
int16x4_t tmp2 = vmul_s16(vget_low_s16(row4), quant_row4);
|
||||
int16x4_t tmp3 = vmul_s16(vget_low_s16(row6), quant_row6);
|
||||
|
||||
int16x4_t tmp10 = vadd_s16(tmp0, tmp2); /* phase 3 */
|
||||
int16x4_t tmp11 = vsub_s16(tmp0, tmp2);
|
||||
|
||||
int16x4_t tmp13 = vadd_s16(tmp1, tmp3); /* phases 5-3 */
|
||||
int16x4_t tmp1_sub_tmp3 = vsub_s16(tmp1, tmp3);
|
||||
int16x4_t tmp12 = vqdmulh_lane_s16(tmp1_sub_tmp3, consts, 1);
|
||||
tmp12 = vadd_s16(tmp12, tmp1_sub_tmp3);
|
||||
tmp12 = vsub_s16(tmp12, tmp13);
|
||||
|
||||
tmp0 = vadd_s16(tmp10, tmp13); /* phase 2 */
|
||||
tmp3 = vsub_s16(tmp10, tmp13);
|
||||
tmp1 = vadd_s16(tmp11, tmp12);
|
||||
tmp2 = vsub_s16(tmp11, tmp12);
|
||||
|
||||
/* Odd part: dequantize DCT coefficients. */
|
||||
int16x4_t tmp4 = vmul_s16(vget_low_s16(row1), quant_row1);
|
||||
int16x4_t tmp5 = vmul_s16(vget_low_s16(row3), quant_row3);
|
||||
int16x4_t tmp6 = vmul_s16(vget_low_s16(row5), quant_row5);
|
||||
int16x4_t tmp7 = vmul_s16(vget_low_s16(row7), quant_row7);
|
||||
|
||||
int16x4_t z13 = vadd_s16(tmp6, tmp5); /* phase 6 */
|
||||
int16x4_t neg_z10 = vsub_s16(tmp5, tmp6);
|
||||
int16x4_t z11 = vadd_s16(tmp4, tmp7);
|
||||
int16x4_t z12 = vsub_s16(tmp4, tmp7);
|
||||
|
||||
tmp7 = vadd_s16(z11, z13); /* phase 5 */
|
||||
int16x4_t z11_sub_z13 = vsub_s16(z11, z13);
|
||||
tmp11 = vqdmulh_lane_s16(z11_sub_z13, consts, 1);
|
||||
tmp11 = vadd_s16(tmp11, z11_sub_z13);
|
||||
|
||||
int16x4_t z10_add_z12 = vsub_s16(z12, neg_z10);
|
||||
int16x4_t z5 = vqdmulh_lane_s16(z10_add_z12, consts, 2);
|
||||
z5 = vadd_s16(z5, z10_add_z12);
|
||||
tmp10 = vqdmulh_lane_s16(z12, consts, 0);
|
||||
tmp10 = vadd_s16(tmp10, z12);
|
||||
tmp10 = vsub_s16(tmp10, z5);
|
||||
tmp12 = vqdmulh_lane_s16(neg_z10, consts, 3);
|
||||
tmp12 = vadd_s16(tmp12, vadd_s16(neg_z10, neg_z10));
|
||||
tmp12 = vadd_s16(tmp12, z5);
|
||||
|
||||
tmp6 = vsub_s16(tmp12, tmp7); /* phase 2 */
|
||||
tmp5 = vsub_s16(tmp11, tmp6);
|
||||
tmp4 = vadd_s16(tmp10, tmp5);
|
||||
|
||||
row0 = vcombine_s16(vadd_s16(tmp0, tmp7), dcval);
|
||||
row7 = vcombine_s16(vsub_s16(tmp0, tmp7), dcval);
|
||||
row1 = vcombine_s16(vadd_s16(tmp1, tmp6), dcval);
|
||||
row6 = vcombine_s16(vsub_s16(tmp1, tmp6), dcval);
|
||||
row2 = vcombine_s16(vadd_s16(tmp2, tmp5), dcval);
|
||||
row5 = vcombine_s16(vsub_s16(tmp2, tmp5), dcval);
|
||||
row4 = vcombine_s16(vadd_s16(tmp3, tmp4), dcval);
|
||||
row3 = vcombine_s16(vsub_s16(tmp3, tmp4), dcval);
|
||||
} else {
|
||||
/* Some AC coefficients are non-zero; full IDCT calculation required. */
|
||||
|
||||
/* Load quantization table. */
|
||||
int16x8_t quant_row1 = vld1q_s16(quantptr + 1 * DCTSIZE);
|
||||
int16x8_t quant_row2 = vld1q_s16(quantptr + 2 * DCTSIZE);
|
||||
int16x8_t quant_row3 = vld1q_s16(quantptr + 3 * DCTSIZE);
|
||||
int16x8_t quant_row4 = vld1q_s16(quantptr + 4 * DCTSIZE);
|
||||
int16x8_t quant_row5 = vld1q_s16(quantptr + 5 * DCTSIZE);
|
||||
int16x8_t quant_row6 = vld1q_s16(quantptr + 6 * DCTSIZE);
|
||||
int16x8_t quant_row7 = vld1q_s16(quantptr + 7 * DCTSIZE);
|
||||
|
||||
/* Even part: dequantize DCT coefficients. */
|
||||
int16x8_t tmp0 = row0;
|
||||
int16x8_t tmp1 = vmulq_s16(row2, quant_row2);
|
||||
int16x8_t tmp2 = vmulq_s16(row4, quant_row4);
|
||||
int16x8_t tmp3 = vmulq_s16(row6, quant_row6);
|
||||
|
||||
int16x8_t tmp10 = vaddq_s16(tmp0, tmp2); /* phase 3 */
|
||||
int16x8_t tmp11 = vsubq_s16(tmp0, tmp2);
|
||||
|
||||
int16x8_t tmp13 = vaddq_s16(tmp1, tmp3); /* phases 5-3 */
|
||||
int16x8_t tmp1_sub_tmp3 = vsubq_s16(tmp1, tmp3);
|
||||
int16x8_t tmp12 = vqdmulhq_lane_s16(tmp1_sub_tmp3, consts, 1);
|
||||
tmp12 = vaddq_s16(tmp12, tmp1_sub_tmp3);
|
||||
tmp12 = vsubq_s16(tmp12, tmp13);
|
||||
|
||||
tmp0 = vaddq_s16(tmp10, tmp13); /* phase 2 */
|
||||
tmp3 = vsubq_s16(tmp10, tmp13);
|
||||
tmp1 = vaddq_s16(tmp11, tmp12);
|
||||
tmp2 = vsubq_s16(tmp11, tmp12);
|
||||
|
||||
/* Odd part: dequantize DCT coefficients. */
|
||||
int16x8_t tmp4 = vmulq_s16(row1, quant_row1);
|
||||
int16x8_t tmp5 = vmulq_s16(row3, quant_row3);
|
||||
int16x8_t tmp6 = vmulq_s16(row5, quant_row5);
|
||||
int16x8_t tmp7 = vmulq_s16(row7, quant_row7);
|
||||
|
||||
int16x8_t z13 = vaddq_s16(tmp6, tmp5); /* phase 6 */
|
||||
int16x8_t neg_z10 = vsubq_s16(tmp5, tmp6);
|
||||
int16x8_t z11 = vaddq_s16(tmp4, tmp7);
|
||||
int16x8_t z12 = vsubq_s16(tmp4, tmp7);
|
||||
|
||||
tmp7 = vaddq_s16(z11, z13); /* phase 5 */
|
||||
int16x8_t z11_sub_z13 = vsubq_s16(z11, z13);
|
||||
tmp11 = vqdmulhq_lane_s16(z11_sub_z13, consts, 1);
|
||||
tmp11 = vaddq_s16(tmp11, z11_sub_z13);
|
||||
|
||||
int16x8_t z10_add_z12 = vsubq_s16(z12, neg_z10);
|
||||
int16x8_t z5 = vqdmulhq_lane_s16(z10_add_z12, consts, 2);
|
||||
z5 = vaddq_s16(z5, z10_add_z12);
|
||||
tmp10 = vqdmulhq_lane_s16(z12, consts, 0);
|
||||
tmp10 = vaddq_s16(tmp10, z12);
|
||||
tmp10 = vsubq_s16(tmp10, z5);
|
||||
tmp12 = vqdmulhq_lane_s16(neg_z10, consts, 3);
|
||||
tmp12 = vaddq_s16(tmp12, vaddq_s16(neg_z10, neg_z10));
|
||||
tmp12 = vaddq_s16(tmp12, z5);
|
||||
|
||||
tmp6 = vsubq_s16(tmp12, tmp7); /* phase 2 */
|
||||
tmp5 = vsubq_s16(tmp11, tmp6);
|
||||
tmp4 = vaddq_s16(tmp10, tmp5);
|
||||
|
||||
row0 = vaddq_s16(tmp0, tmp7);
|
||||
row7 = vsubq_s16(tmp0, tmp7);
|
||||
row1 = vaddq_s16(tmp1, tmp6);
|
||||
row6 = vsubq_s16(tmp1, tmp6);
|
||||
row2 = vaddq_s16(tmp2, tmp5);
|
||||
row5 = vsubq_s16(tmp2, tmp5);
|
||||
row4 = vaddq_s16(tmp3, tmp4);
|
||||
row3 = vsubq_s16(tmp3, tmp4);
|
||||
}
|
||||
|
||||
/* Transpose rows to work on columns in pass 2. */
|
||||
int16x8x2_t rows_01 = vtrnq_s16(row0, row1);
|
||||
int16x8x2_t rows_23 = vtrnq_s16(row2, row3);
|
||||
int16x8x2_t rows_45 = vtrnq_s16(row4, row5);
|
||||
int16x8x2_t rows_67 = vtrnq_s16(row6, row7);
|
||||
|
||||
int32x4x2_t rows_0145_l = vtrnq_s32(vreinterpretq_s32_s16(rows_01.val[0]),
|
||||
vreinterpretq_s32_s16(rows_45.val[0]));
|
||||
int32x4x2_t rows_0145_h = vtrnq_s32(vreinterpretq_s32_s16(rows_01.val[1]),
|
||||
vreinterpretq_s32_s16(rows_45.val[1]));
|
||||
int32x4x2_t rows_2367_l = vtrnq_s32(vreinterpretq_s32_s16(rows_23.val[0]),
|
||||
vreinterpretq_s32_s16(rows_67.val[0]));
|
||||
int32x4x2_t rows_2367_h = vtrnq_s32(vreinterpretq_s32_s16(rows_23.val[1]),
|
||||
vreinterpretq_s32_s16(rows_67.val[1]));
|
||||
|
||||
int32x4x2_t cols_04 = vzipq_s32(rows_0145_l.val[0], rows_2367_l.val[0]);
|
||||
int32x4x2_t cols_15 = vzipq_s32(rows_0145_h.val[0], rows_2367_h.val[0]);
|
||||
int32x4x2_t cols_26 = vzipq_s32(rows_0145_l.val[1], rows_2367_l.val[1]);
|
||||
int32x4x2_t cols_37 = vzipq_s32(rows_0145_h.val[1], rows_2367_h.val[1]);
|
||||
|
||||
int16x8_t col0 = vreinterpretq_s16_s32(cols_04.val[0]);
|
||||
int16x8_t col1 = vreinterpretq_s16_s32(cols_15.val[0]);
|
||||
int16x8_t col2 = vreinterpretq_s16_s32(cols_26.val[0]);
|
||||
int16x8_t col3 = vreinterpretq_s16_s32(cols_37.val[0]);
|
||||
int16x8_t col4 = vreinterpretq_s16_s32(cols_04.val[1]);
|
||||
int16x8_t col5 = vreinterpretq_s16_s32(cols_15.val[1]);
|
||||
int16x8_t col6 = vreinterpretq_s16_s32(cols_26.val[1]);
|
||||
int16x8_t col7 = vreinterpretq_s16_s32(cols_37.val[1]);
|
||||
|
||||
/* 1-D IDCT, pass 2 */
|
||||
|
||||
/* Even part */
|
||||
int16x8_t tmp10 = vaddq_s16(col0, col4);
|
||||
int16x8_t tmp11 = vsubq_s16(col0, col4);
|
||||
|
||||
int16x8_t tmp13 = vaddq_s16(col2, col6);
|
||||
int16x8_t col2_sub_col6 = vsubq_s16(col2, col6);
|
||||
int16x8_t tmp12 = vqdmulhq_lane_s16(col2_sub_col6, consts, 1);
|
||||
tmp12 = vaddq_s16(tmp12, col2_sub_col6);
|
||||
tmp12 = vsubq_s16(tmp12, tmp13);
|
||||
|
||||
int16x8_t tmp0 = vaddq_s16(tmp10, tmp13);
|
||||
int16x8_t tmp3 = vsubq_s16(tmp10, tmp13);
|
||||
int16x8_t tmp1 = vaddq_s16(tmp11, tmp12);
|
||||
int16x8_t tmp2 = vsubq_s16(tmp11, tmp12);
|
||||
|
||||
/* Odd part */
|
||||
int16x8_t z13 = vaddq_s16(col5, col3);
|
||||
int16x8_t neg_z10 = vsubq_s16(col3, col5);
|
||||
int16x8_t z11 = vaddq_s16(col1, col7);
|
||||
int16x8_t z12 = vsubq_s16(col1, col7);
|
||||
|
||||
int16x8_t tmp7 = vaddq_s16(z11, z13); /* phase 5 */
|
||||
int16x8_t z11_sub_z13 = vsubq_s16(z11, z13);
|
||||
tmp11 = vqdmulhq_lane_s16(z11_sub_z13, consts, 1);
|
||||
tmp11 = vaddq_s16(tmp11, z11_sub_z13);
|
||||
|
||||
int16x8_t z10_add_z12 = vsubq_s16(z12, neg_z10);
|
||||
int16x8_t z5 = vqdmulhq_lane_s16(z10_add_z12, consts, 2);
|
||||
z5 = vaddq_s16(z5, z10_add_z12);
|
||||
tmp10 = vqdmulhq_lane_s16(z12, consts, 0);
|
||||
tmp10 = vaddq_s16(tmp10, z12);
|
||||
tmp10 = vsubq_s16(tmp10, z5);
|
||||
tmp12 = vqdmulhq_lane_s16(neg_z10, consts, 3);
|
||||
tmp12 = vaddq_s16(tmp12, vaddq_s16(neg_z10, neg_z10));
|
||||
tmp12 = vaddq_s16(tmp12, z5);
|
||||
|
||||
int16x8_t tmp6 = vsubq_s16(tmp12, tmp7); /* phase 2 */
|
||||
int16x8_t tmp5 = vsubq_s16(tmp11, tmp6);
|
||||
int16x8_t tmp4 = vaddq_s16(tmp10, tmp5);
|
||||
|
||||
col0 = vaddq_s16(tmp0, tmp7);
|
||||
col7 = vsubq_s16(tmp0, tmp7);
|
||||
col1 = vaddq_s16(tmp1, tmp6);
|
||||
col6 = vsubq_s16(tmp1, tmp6);
|
||||
col2 = vaddq_s16(tmp2, tmp5);
|
||||
col5 = vsubq_s16(tmp2, tmp5);
|
||||
col4 = vaddq_s16(tmp3, tmp4);
|
||||
col3 = vsubq_s16(tmp3, tmp4);
|
||||
|
||||
/* Scale down by a factor of 8, narrowing to 8-bit. */
|
||||
int8x16_t cols_01_s8 = vcombine_s8(vqshrn_n_s16(col0, PASS1_BITS + 3),
|
||||
vqshrn_n_s16(col1, PASS1_BITS + 3));
|
||||
int8x16_t cols_45_s8 = vcombine_s8(vqshrn_n_s16(col4, PASS1_BITS + 3),
|
||||
vqshrn_n_s16(col5, PASS1_BITS + 3));
|
||||
int8x16_t cols_23_s8 = vcombine_s8(vqshrn_n_s16(col2, PASS1_BITS + 3),
|
||||
vqshrn_n_s16(col3, PASS1_BITS + 3));
|
||||
int8x16_t cols_67_s8 = vcombine_s8(vqshrn_n_s16(col6, PASS1_BITS + 3),
|
||||
vqshrn_n_s16(col7, PASS1_BITS + 3));
|
||||
/* Clamp to range [0-255]. */
|
||||
uint8x16_t cols_01 =
|
||||
vreinterpretq_u8_s8
|
||||
(vaddq_s8(cols_01_s8, vreinterpretq_s8_u8(vdupq_n_u8(CENTERJSAMPLE))));
|
||||
uint8x16_t cols_45 =
|
||||
vreinterpretq_u8_s8
|
||||
(vaddq_s8(cols_45_s8, vreinterpretq_s8_u8(vdupq_n_u8(CENTERJSAMPLE))));
|
||||
uint8x16_t cols_23 =
|
||||
vreinterpretq_u8_s8
|
||||
(vaddq_s8(cols_23_s8, vreinterpretq_s8_u8(vdupq_n_u8(CENTERJSAMPLE))));
|
||||
uint8x16_t cols_67 =
|
||||
vreinterpretq_u8_s8
|
||||
(vaddq_s8(cols_67_s8, vreinterpretq_s8_u8(vdupq_n_u8(CENTERJSAMPLE))));
|
||||
|
||||
/* Transpose block to prepare for store. */
|
||||
uint32x4x2_t cols_0415 = vzipq_u32(vreinterpretq_u32_u8(cols_01),
|
||||
vreinterpretq_u32_u8(cols_45));
|
||||
uint32x4x2_t cols_2637 = vzipq_u32(vreinterpretq_u32_u8(cols_23),
|
||||
vreinterpretq_u32_u8(cols_67));
|
||||
|
||||
uint8x16x2_t cols_0145 = vtrnq_u8(vreinterpretq_u8_u32(cols_0415.val[0]),
|
||||
vreinterpretq_u8_u32(cols_0415.val[1]));
|
||||
uint8x16x2_t cols_2367 = vtrnq_u8(vreinterpretq_u8_u32(cols_2637.val[0]),
|
||||
vreinterpretq_u8_u32(cols_2637.val[1]));
|
||||
uint16x8x2_t rows_0426 = vtrnq_u16(vreinterpretq_u16_u8(cols_0145.val[0]),
|
||||
vreinterpretq_u16_u8(cols_2367.val[0]));
|
||||
uint16x8x2_t rows_1537 = vtrnq_u16(vreinterpretq_u16_u8(cols_0145.val[1]),
|
||||
vreinterpretq_u16_u8(cols_2367.val[1]));
|
||||
|
||||
uint8x16_t rows_04 = vreinterpretq_u8_u16(rows_0426.val[0]);
|
||||
uint8x16_t rows_15 = vreinterpretq_u8_u16(rows_1537.val[0]);
|
||||
uint8x16_t rows_26 = vreinterpretq_u8_u16(rows_0426.val[1]);
|
||||
uint8x16_t rows_37 = vreinterpretq_u8_u16(rows_1537.val[1]);
|
||||
|
||||
JSAMPROW outptr0 = output_buf[0] + output_col;
|
||||
JSAMPROW outptr1 = output_buf[1] + output_col;
|
||||
JSAMPROW outptr2 = output_buf[2] + output_col;
|
||||
JSAMPROW outptr3 = output_buf[3] + output_col;
|
||||
JSAMPROW outptr4 = output_buf[4] + output_col;
|
||||
JSAMPROW outptr5 = output_buf[5] + output_col;
|
||||
JSAMPROW outptr6 = output_buf[6] + output_col;
|
||||
JSAMPROW outptr7 = output_buf[7] + output_col;
|
||||
|
||||
/* Store DCT block to memory. */
|
||||
vst1q_lane_u64((uint64_t *)outptr0, vreinterpretq_u64_u8(rows_04), 0);
|
||||
vst1q_lane_u64((uint64_t *)outptr1, vreinterpretq_u64_u8(rows_15), 0);
|
||||
vst1q_lane_u64((uint64_t *)outptr2, vreinterpretq_u64_u8(rows_26), 0);
|
||||
vst1q_lane_u64((uint64_t *)outptr3, vreinterpretq_u64_u8(rows_37), 0);
|
||||
vst1q_lane_u64((uint64_t *)outptr4, vreinterpretq_u64_u8(rows_04), 1);
|
||||
vst1q_lane_u64((uint64_t *)outptr5, vreinterpretq_u64_u8(rows_15), 1);
|
||||
vst1q_lane_u64((uint64_t *)outptr6, vreinterpretq_u64_u8(rows_26), 1);
|
||||
vst1q_lane_u64((uint64_t *)outptr7, vreinterpretq_u64_u8(rows_37), 1);
|
||||
}
|
||||
+801
@@ -0,0 +1,801 @@
|
||||
/*
|
||||
* jidctint-neon.c - accurate integer IDCT (Arm Neon)
|
||||
*
|
||||
* Copyright (C) 2020, Arm Limited. All Rights Reserved.
|
||||
* Copyright (C) 2020, 2024, D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../../src/jinclude.h"
|
||||
#include "../../src/jpeglib.h"
|
||||
#include "../../src/jsimd.h"
|
||||
#include "../../src/jdct.h"
|
||||
#include "../../src/jsimddct.h"
|
||||
#include "../jsimd.h"
|
||||
#include "align.h"
|
||||
#include "neon-compat.h"
|
||||
|
||||
#include <arm_neon.h>
|
||||
|
||||
|
||||
#define CONST_BITS 13
|
||||
#define PASS1_BITS 2
|
||||
|
||||
#define DESCALE_P1 (CONST_BITS - PASS1_BITS)
|
||||
#define DESCALE_P2 (CONST_BITS + PASS1_BITS + 3)
|
||||
|
||||
/* The computation of the inverse DCT requires the use of constants known at
|
||||
* compile time. Scaled integer constants are used to avoid floating-point
|
||||
* arithmetic:
|
||||
* 0.298631336 = 2446 * 2^-13
|
||||
* 0.390180644 = 3196 * 2^-13
|
||||
* 0.541196100 = 4433 * 2^-13
|
||||
* 0.765366865 = 6270 * 2^-13
|
||||
* 0.899976223 = 7373 * 2^-13
|
||||
* 1.175875602 = 9633 * 2^-13
|
||||
* 1.501321110 = 12299 * 2^-13
|
||||
* 1.847759065 = 15137 * 2^-13
|
||||
* 1.961570560 = 16069 * 2^-13
|
||||
* 2.053119869 = 16819 * 2^-13
|
||||
* 2.562915447 = 20995 * 2^-13
|
||||
* 3.072711026 = 25172 * 2^-13
|
||||
*/
|
||||
|
||||
#define F_0_298 2446
|
||||
#define F_0_390 3196
|
||||
#define F_0_541 4433
|
||||
#define F_0_765 6270
|
||||
#define F_0_899 7373
|
||||
#define F_1_175 9633
|
||||
#define F_1_501 12299
|
||||
#define F_1_847 15137
|
||||
#define F_1_961 16069
|
||||
#define F_2_053 16819
|
||||
#define F_2_562 20995
|
||||
#define F_3_072 25172
|
||||
|
||||
#define F_1_175_MINUS_1_961 (F_1_175 - F_1_961)
|
||||
#define F_1_175_MINUS_0_390 (F_1_175 - F_0_390)
|
||||
#define F_0_541_MINUS_1_847 (F_0_541 - F_1_847)
|
||||
#define F_3_072_MINUS_2_562 (F_3_072 - F_2_562)
|
||||
#define F_0_298_MINUS_0_899 (F_0_298 - F_0_899)
|
||||
#define F_1_501_MINUS_0_899 (F_1_501 - F_0_899)
|
||||
#define F_2_053_MINUS_2_562 (F_2_053 - F_2_562)
|
||||
#define F_0_541_PLUS_0_765 (F_0_541 + F_0_765)
|
||||
|
||||
|
||||
ALIGN(16) static const int16_t jsimd_idct_islow_neon_consts[] = {
|
||||
F_0_899, F_0_541,
|
||||
F_2_562, F_0_298_MINUS_0_899,
|
||||
F_1_501_MINUS_0_899, F_2_053_MINUS_2_562,
|
||||
F_0_541_PLUS_0_765, F_1_175,
|
||||
F_1_175_MINUS_0_390, F_0_541_MINUS_1_847,
|
||||
F_3_072_MINUS_2_562, F_1_175_MINUS_1_961,
|
||||
0, 0, 0, 0
|
||||
};
|
||||
|
||||
|
||||
/* Forward declaration of regular and sparse IDCT helper functions */
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass1_regular(int16x4_t row0,
|
||||
int16x4_t row1,
|
||||
int16x4_t row2,
|
||||
int16x4_t row3,
|
||||
int16x4_t row4,
|
||||
int16x4_t row5,
|
||||
int16x4_t row6,
|
||||
int16x4_t row7,
|
||||
int16x4_t quant_row0,
|
||||
int16x4_t quant_row1,
|
||||
int16x4_t quant_row2,
|
||||
int16x4_t quant_row3,
|
||||
int16x4_t quant_row4,
|
||||
int16x4_t quant_row5,
|
||||
int16x4_t quant_row6,
|
||||
int16x4_t quant_row7,
|
||||
int16_t *workspace_1,
|
||||
int16_t *workspace_2);
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass1_sparse(int16x4_t row0,
|
||||
int16x4_t row1,
|
||||
int16x4_t row2,
|
||||
int16x4_t row3,
|
||||
int16x4_t quant_row0,
|
||||
int16x4_t quant_row1,
|
||||
int16x4_t quant_row2,
|
||||
int16x4_t quant_row3,
|
||||
int16_t *workspace_1,
|
||||
int16_t *workspace_2);
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass2_regular(int16_t *workspace,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col,
|
||||
unsigned buf_offset);
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass2_sparse(int16_t *workspace,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col,
|
||||
unsigned buf_offset);
|
||||
|
||||
|
||||
/* Perform dequantization and inverse DCT on one block of coefficients. For
|
||||
* reference, the C implementation (jpeg_idct_slow()) can be found in
|
||||
* jidctint.c.
|
||||
*
|
||||
* Optimization techniques used for fast data access:
|
||||
*
|
||||
* In each pass, the inverse DCT is computed for the left and right 4x8 halves
|
||||
* of the DCT block. This avoids spilling due to register pressure, and the
|
||||
* increased granularity allows for an optimized calculation depending on the
|
||||
* values of the DCT coefficients. Between passes, intermediate data is stored
|
||||
* in 4x8 workspace buffers.
|
||||
*
|
||||
* Transposing the 8x8 DCT block after each pass can be achieved by transposing
|
||||
* each of the four 4x4 quadrants and swapping quadrants 1 and 2 (refer to the
|
||||
* diagram below.) Swapping quadrants is cheap, since the second pass can just
|
||||
* swap the workspace buffer pointers.
|
||||
*
|
||||
* +-------+-------+ +-------+-------+
|
||||
* | | | | | |
|
||||
* | 0 | 1 | | 0 | 2 |
|
||||
* | | | transpose | | |
|
||||
* +-------+-------+ ------> +-------+-------+
|
||||
* | | | | | |
|
||||
* | 2 | 3 | | 1 | 3 |
|
||||
* | | | | | |
|
||||
* +-------+-------+ +-------+-------+
|
||||
*
|
||||
* Optimization techniques used to accelerate the inverse DCT calculation:
|
||||
*
|
||||
* In a DCT coefficient block, the coefficients are increasingly likely to be 0
|
||||
* as you move diagonally from top left to bottom right. If whole rows of
|
||||
* coefficients are 0, then the inverse DCT calculation can be simplified. On
|
||||
* the first pass of the inverse DCT, we test for three special cases before
|
||||
* defaulting to a full "regular" inverse DCT:
|
||||
*
|
||||
* 1) Coefficients in rows 4-7 are all zero. In this case, we perform a
|
||||
* "sparse" simplified inverse DCT on rows 0-3.
|
||||
* 2) AC coefficients (rows 1-7) are all zero. In this case, the inverse DCT
|
||||
* result is equal to the dequantized DC coefficients.
|
||||
* 3) AC and DC coefficients are all zero. In this case, the inverse DCT
|
||||
* result is all zero. For the left 4x8 half, this is handled identically
|
||||
* to Case 2 above. For the right 4x8 half, we do no work and signal that
|
||||
* the "sparse" algorithm is required for the second pass.
|
||||
*
|
||||
* In the second pass, only a single special case is tested: whether the AC and
|
||||
* DC coefficients were all zero in the right 4x8 block during the first pass
|
||||
* (refer to Case 3 above.) If this is the case, then a "sparse" variant of
|
||||
* the second pass is performed for both the left and right halves of the DCT
|
||||
* block. (The transposition after the first pass means that the right 4x8
|
||||
* block during the first pass becomes rows 4-7 during the second pass.)
|
||||
*/
|
||||
|
||||
void jsimd_idct_islow_neon(void *dct_table, JCOEFPTR coef_block,
|
||||
JSAMPARRAY output_buf, JDIMENSION output_col)
|
||||
{
|
||||
ISLOW_MULT_TYPE *quantptr = dct_table;
|
||||
|
||||
int16_t workspace_l[8 * DCTSIZE / 2];
|
||||
int16_t workspace_r[8 * DCTSIZE / 2];
|
||||
|
||||
/* Compute IDCT first pass on left 4x8 coefficient block. */
|
||||
|
||||
/* Load DCT coefficients in left 4x8 block. */
|
||||
int16x4_t row0 = vld1_s16(coef_block + 0 * DCTSIZE);
|
||||
int16x4_t row1 = vld1_s16(coef_block + 1 * DCTSIZE);
|
||||
int16x4_t row2 = vld1_s16(coef_block + 2 * DCTSIZE);
|
||||
int16x4_t row3 = vld1_s16(coef_block + 3 * DCTSIZE);
|
||||
int16x4_t row4 = vld1_s16(coef_block + 4 * DCTSIZE);
|
||||
int16x4_t row5 = vld1_s16(coef_block + 5 * DCTSIZE);
|
||||
int16x4_t row6 = vld1_s16(coef_block + 6 * DCTSIZE);
|
||||
int16x4_t row7 = vld1_s16(coef_block + 7 * DCTSIZE);
|
||||
|
||||
/* Load quantization table for left 4x8 block. */
|
||||
int16x4_t quant_row0 = vld1_s16(quantptr + 0 * DCTSIZE);
|
||||
int16x4_t quant_row1 = vld1_s16(quantptr + 1 * DCTSIZE);
|
||||
int16x4_t quant_row2 = vld1_s16(quantptr + 2 * DCTSIZE);
|
||||
int16x4_t quant_row3 = vld1_s16(quantptr + 3 * DCTSIZE);
|
||||
int16x4_t quant_row4 = vld1_s16(quantptr + 4 * DCTSIZE);
|
||||
int16x4_t quant_row5 = vld1_s16(quantptr + 5 * DCTSIZE);
|
||||
int16x4_t quant_row6 = vld1_s16(quantptr + 6 * DCTSIZE);
|
||||
int16x4_t quant_row7 = vld1_s16(quantptr + 7 * DCTSIZE);
|
||||
|
||||
/* Construct bitmap to test if DCT coefficients in left 4x8 block are 0. */
|
||||
int16x4_t bitmap = vorr_s16(row7, row6);
|
||||
bitmap = vorr_s16(bitmap, row5);
|
||||
bitmap = vorr_s16(bitmap, row4);
|
||||
int64_t bitmap_rows_4567 = vget_lane_s64(vreinterpret_s64_s16(bitmap), 0);
|
||||
|
||||
if (bitmap_rows_4567 == 0) {
|
||||
bitmap = vorr_s16(bitmap, row3);
|
||||
bitmap = vorr_s16(bitmap, row2);
|
||||
bitmap = vorr_s16(bitmap, row1);
|
||||
int64_t left_ac_bitmap = vget_lane_s64(vreinterpret_s64_s16(bitmap), 0);
|
||||
|
||||
if (left_ac_bitmap == 0) {
|
||||
int16x4_t dcval = vshl_n_s16(vmul_s16(row0, quant_row0), PASS1_BITS);
|
||||
int16x4x4_t quadrant = { { dcval, dcval, dcval, dcval } };
|
||||
/* Store 4x4 blocks to workspace, transposing in the process. */
|
||||
vst4_s16(workspace_l, quadrant);
|
||||
vst4_s16(workspace_r, quadrant);
|
||||
} else {
|
||||
jsimd_idct_islow_pass1_sparse(row0, row1, row2, row3, quant_row0,
|
||||
quant_row1, quant_row2, quant_row3,
|
||||
workspace_l, workspace_r);
|
||||
}
|
||||
} else {
|
||||
jsimd_idct_islow_pass1_regular(row0, row1, row2, row3, row4, row5,
|
||||
row6, row7, quant_row0, quant_row1,
|
||||
quant_row2, quant_row3, quant_row4,
|
||||
quant_row5, quant_row6, quant_row7,
|
||||
workspace_l, workspace_r);
|
||||
}
|
||||
|
||||
/* Compute IDCT first pass on right 4x8 coefficient block. */
|
||||
|
||||
/* Load DCT coefficients in right 4x8 block. */
|
||||
row0 = vld1_s16(coef_block + 0 * DCTSIZE + 4);
|
||||
row1 = vld1_s16(coef_block + 1 * DCTSIZE + 4);
|
||||
row2 = vld1_s16(coef_block + 2 * DCTSIZE + 4);
|
||||
row3 = vld1_s16(coef_block + 3 * DCTSIZE + 4);
|
||||
row4 = vld1_s16(coef_block + 4 * DCTSIZE + 4);
|
||||
row5 = vld1_s16(coef_block + 5 * DCTSIZE + 4);
|
||||
row6 = vld1_s16(coef_block + 6 * DCTSIZE + 4);
|
||||
row7 = vld1_s16(coef_block + 7 * DCTSIZE + 4);
|
||||
|
||||
/* Load quantization table for right 4x8 block. */
|
||||
quant_row0 = vld1_s16(quantptr + 0 * DCTSIZE + 4);
|
||||
quant_row1 = vld1_s16(quantptr + 1 * DCTSIZE + 4);
|
||||
quant_row2 = vld1_s16(quantptr + 2 * DCTSIZE + 4);
|
||||
quant_row3 = vld1_s16(quantptr + 3 * DCTSIZE + 4);
|
||||
quant_row4 = vld1_s16(quantptr + 4 * DCTSIZE + 4);
|
||||
quant_row5 = vld1_s16(quantptr + 5 * DCTSIZE + 4);
|
||||
quant_row6 = vld1_s16(quantptr + 6 * DCTSIZE + 4);
|
||||
quant_row7 = vld1_s16(quantptr + 7 * DCTSIZE + 4);
|
||||
|
||||
/* Construct bitmap to test if DCT coefficients in right 4x8 block are 0. */
|
||||
bitmap = vorr_s16(row7, row6);
|
||||
bitmap = vorr_s16(bitmap, row5);
|
||||
bitmap = vorr_s16(bitmap, row4);
|
||||
bitmap_rows_4567 = vget_lane_s64(vreinterpret_s64_s16(bitmap), 0);
|
||||
bitmap = vorr_s16(bitmap, row3);
|
||||
bitmap = vorr_s16(bitmap, row2);
|
||||
bitmap = vorr_s16(bitmap, row1);
|
||||
int64_t right_ac_bitmap = vget_lane_s64(vreinterpret_s64_s16(bitmap), 0);
|
||||
|
||||
/* If this remains non-zero, a "regular" second pass will be performed. */
|
||||
int64_t right_ac_dc_bitmap = 1;
|
||||
|
||||
if (right_ac_bitmap == 0) {
|
||||
bitmap = vorr_s16(bitmap, row0);
|
||||
right_ac_dc_bitmap = vget_lane_s64(vreinterpret_s64_s16(bitmap), 0);
|
||||
|
||||
if (right_ac_dc_bitmap != 0) {
|
||||
int16x4_t dcval = vshl_n_s16(vmul_s16(row0, quant_row0), PASS1_BITS);
|
||||
int16x4x4_t quadrant = { { dcval, dcval, dcval, dcval } };
|
||||
/* Store 4x4 blocks to workspace, transposing in the process. */
|
||||
vst4_s16(workspace_l + 4 * DCTSIZE / 2, quadrant);
|
||||
vst4_s16(workspace_r + 4 * DCTSIZE / 2, quadrant);
|
||||
}
|
||||
} else {
|
||||
if (bitmap_rows_4567 == 0) {
|
||||
jsimd_idct_islow_pass1_sparse(row0, row1, row2, row3, quant_row0,
|
||||
quant_row1, quant_row2, quant_row3,
|
||||
workspace_l + 4 * DCTSIZE / 2,
|
||||
workspace_r + 4 * DCTSIZE / 2);
|
||||
} else {
|
||||
jsimd_idct_islow_pass1_regular(row0, row1, row2, row3, row4, row5,
|
||||
row6, row7, quant_row0, quant_row1,
|
||||
quant_row2, quant_row3, quant_row4,
|
||||
quant_row5, quant_row6, quant_row7,
|
||||
workspace_l + 4 * DCTSIZE / 2,
|
||||
workspace_r + 4 * DCTSIZE / 2);
|
||||
}
|
||||
}
|
||||
|
||||
/* Second pass: compute IDCT on rows in workspace. */
|
||||
|
||||
/* If all coefficients in right 4x8 block are 0, use "sparse" second pass. */
|
||||
if (right_ac_dc_bitmap == 0) {
|
||||
jsimd_idct_islow_pass2_sparse(workspace_l, output_buf, output_col, 0);
|
||||
jsimd_idct_islow_pass2_sparse(workspace_r, output_buf, output_col, 4);
|
||||
} else {
|
||||
jsimd_idct_islow_pass2_regular(workspace_l, output_buf, output_col, 0);
|
||||
jsimd_idct_islow_pass2_regular(workspace_r, output_buf, output_col, 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Perform dequantization and the first pass of the accurate inverse DCT on a
|
||||
* 4x8 block of coefficients. (To process the full 8x8 DCT block, this
|
||||
* function-- or some other optimized variant-- needs to be called for both the
|
||||
* left and right 4x8 blocks.)
|
||||
*
|
||||
* This "regular" version assumes that no optimization can be made to the IDCT
|
||||
* calculation, since no useful set of AC coefficients is all 0.
|
||||
*
|
||||
* The original C implementation of the accurate IDCT (jpeg_idct_slow()) can be
|
||||
* found in jidctint.c. Algorithmic changes made here are documented inline.
|
||||
*/
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass1_regular(int16x4_t row0,
|
||||
int16x4_t row1,
|
||||
int16x4_t row2,
|
||||
int16x4_t row3,
|
||||
int16x4_t row4,
|
||||
int16x4_t row5,
|
||||
int16x4_t row6,
|
||||
int16x4_t row7,
|
||||
int16x4_t quant_row0,
|
||||
int16x4_t quant_row1,
|
||||
int16x4_t quant_row2,
|
||||
int16x4_t quant_row3,
|
||||
int16x4_t quant_row4,
|
||||
int16x4_t quant_row5,
|
||||
int16x4_t quant_row6,
|
||||
int16x4_t quant_row7,
|
||||
int16_t *workspace_1,
|
||||
int16_t *workspace_2)
|
||||
{
|
||||
/* Load constants for IDCT computation. */
|
||||
#ifdef HAVE_VLD1_S16_X3
|
||||
const int16x4x3_t consts = vld1_s16_x3(jsimd_idct_islow_neon_consts);
|
||||
#else
|
||||
const int16x4_t consts1 = vld1_s16(jsimd_idct_islow_neon_consts);
|
||||
const int16x4_t consts2 = vld1_s16(jsimd_idct_islow_neon_consts + 4);
|
||||
const int16x4_t consts3 = vld1_s16(jsimd_idct_islow_neon_consts + 8);
|
||||
const int16x4x3_t consts = { { consts1, consts2, consts3 } };
|
||||
#endif
|
||||
|
||||
/* Even part */
|
||||
int16x4_t z2_s16 = vmul_s16(row2, quant_row2);
|
||||
int16x4_t z3_s16 = vmul_s16(row6, quant_row6);
|
||||
|
||||
int32x4_t tmp2 = vmull_lane_s16(z2_s16, consts.val[0], 1);
|
||||
int32x4_t tmp3 = vmull_lane_s16(z2_s16, consts.val[1], 2);
|
||||
tmp2 = vmlal_lane_s16(tmp2, z3_s16, consts.val[2], 1);
|
||||
tmp3 = vmlal_lane_s16(tmp3, z3_s16, consts.val[0], 1);
|
||||
|
||||
z2_s16 = vmul_s16(row0, quant_row0);
|
||||
z3_s16 = vmul_s16(row4, quant_row4);
|
||||
|
||||
int32x4_t tmp0 = vshll_n_s16(vadd_s16(z2_s16, z3_s16), CONST_BITS);
|
||||
int32x4_t tmp1 = vshll_n_s16(vsub_s16(z2_s16, z3_s16), CONST_BITS);
|
||||
|
||||
int32x4_t tmp10 = vaddq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp13 = vsubq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp11 = vaddq_s32(tmp1, tmp2);
|
||||
int32x4_t tmp12 = vsubq_s32(tmp1, tmp2);
|
||||
|
||||
/* Odd part */
|
||||
int16x4_t tmp0_s16 = vmul_s16(row7, quant_row7);
|
||||
int16x4_t tmp1_s16 = vmul_s16(row5, quant_row5);
|
||||
int16x4_t tmp2_s16 = vmul_s16(row3, quant_row3);
|
||||
int16x4_t tmp3_s16 = vmul_s16(row1, quant_row1);
|
||||
|
||||
z3_s16 = vadd_s16(tmp0_s16, tmp2_s16);
|
||||
int16x4_t z4_s16 = vadd_s16(tmp1_s16, tmp3_s16);
|
||||
|
||||
/* Implementation as per jpeg_idct_islow() in jidctint.c:
|
||||
* z5 = (z3 + z4) * 1.175875602;
|
||||
* z3 = z3 * -1.961570560; z4 = z4 * -0.390180644;
|
||||
* z3 += z5; z4 += z5;
|
||||
*
|
||||
* This implementation:
|
||||
* z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;
|
||||
* z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);
|
||||
*/
|
||||
|
||||
int32x4_t z3 = vmull_lane_s16(z3_s16, consts.val[2], 3);
|
||||
int32x4_t z4 = vmull_lane_s16(z3_s16, consts.val[1], 3);
|
||||
z3 = vmlal_lane_s16(z3, z4_s16, consts.val[1], 3);
|
||||
z4 = vmlal_lane_s16(z4, z4_s16, consts.val[2], 0);
|
||||
|
||||
/* Implementation as per jpeg_idct_islow() in jidctint.c:
|
||||
* z1 = tmp0 + tmp3; z2 = tmp1 + tmp2;
|
||||
* tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869;
|
||||
* tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110;
|
||||
* z1 = z1 * -0.899976223; z2 = z2 * -2.562915447;
|
||||
* tmp0 += z1 + z3; tmp1 += z2 + z4;
|
||||
* tmp2 += z2 + z3; tmp3 += z1 + z4;
|
||||
*
|
||||
* This implementation:
|
||||
* tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;
|
||||
* tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;
|
||||
* tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);
|
||||
* tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);
|
||||
* tmp0 += z3; tmp1 += z4;
|
||||
* tmp2 += z3; tmp3 += z4;
|
||||
*/
|
||||
|
||||
tmp0 = vmull_lane_s16(tmp0_s16, consts.val[0], 3);
|
||||
tmp1 = vmull_lane_s16(tmp1_s16, consts.val[1], 1);
|
||||
tmp2 = vmull_lane_s16(tmp2_s16, consts.val[2], 2);
|
||||
tmp3 = vmull_lane_s16(tmp3_s16, consts.val[1], 0);
|
||||
|
||||
tmp0 = vmlsl_lane_s16(tmp0, tmp3_s16, consts.val[0], 0);
|
||||
tmp1 = vmlsl_lane_s16(tmp1, tmp2_s16, consts.val[0], 2);
|
||||
tmp2 = vmlsl_lane_s16(tmp2, tmp1_s16, consts.val[0], 2);
|
||||
tmp3 = vmlsl_lane_s16(tmp3, tmp0_s16, consts.val[0], 0);
|
||||
|
||||
tmp0 = vaddq_s32(tmp0, z3);
|
||||
tmp1 = vaddq_s32(tmp1, z4);
|
||||
tmp2 = vaddq_s32(tmp2, z3);
|
||||
tmp3 = vaddq_s32(tmp3, z4);
|
||||
|
||||
/* Final output stage: descale and narrow to 16-bit. */
|
||||
int16x4x4_t rows_0123 = { {
|
||||
vrshrn_n_s32(vaddq_s32(tmp10, tmp3), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp11, tmp2), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp12, tmp1), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp13, tmp0), DESCALE_P1)
|
||||
} };
|
||||
int16x4x4_t rows_4567 = { {
|
||||
vrshrn_n_s32(vsubq_s32(tmp13, tmp0), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp12, tmp1), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp11, tmp2), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp10, tmp3), DESCALE_P1)
|
||||
} };
|
||||
|
||||
/* Store 4x4 blocks to the intermediate workspace, ready for the second pass.
|
||||
* (VST4 transposes the blocks. We need to operate on rows in the next
|
||||
* pass.)
|
||||
*/
|
||||
vst4_s16(workspace_1, rows_0123);
|
||||
vst4_s16(workspace_2, rows_4567);
|
||||
}
|
||||
|
||||
|
||||
/* Perform dequantization and the first pass of the accurate inverse DCT on a
|
||||
* 4x8 block of coefficients.
|
||||
*
|
||||
* This "sparse" version assumes that the AC coefficients in rows 4-7 are all
|
||||
* 0. This simplifies the IDCT calculation, accelerating overall performance.
|
||||
*/
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass1_sparse(int16x4_t row0,
|
||||
int16x4_t row1,
|
||||
int16x4_t row2,
|
||||
int16x4_t row3,
|
||||
int16x4_t quant_row0,
|
||||
int16x4_t quant_row1,
|
||||
int16x4_t quant_row2,
|
||||
int16x4_t quant_row3,
|
||||
int16_t *workspace_1,
|
||||
int16_t *workspace_2)
|
||||
{
|
||||
/* Load constants for IDCT computation. */
|
||||
#ifdef HAVE_VLD1_S16_X3
|
||||
const int16x4x3_t consts = vld1_s16_x3(jsimd_idct_islow_neon_consts);
|
||||
#else
|
||||
const int16x4_t consts1 = vld1_s16(jsimd_idct_islow_neon_consts);
|
||||
const int16x4_t consts2 = vld1_s16(jsimd_idct_islow_neon_consts + 4);
|
||||
const int16x4_t consts3 = vld1_s16(jsimd_idct_islow_neon_consts + 8);
|
||||
const int16x4x3_t consts = { { consts1, consts2, consts3 } };
|
||||
#endif
|
||||
|
||||
/* Even part (z3 is all 0) */
|
||||
int16x4_t z2_s16 = vmul_s16(row2, quant_row2);
|
||||
|
||||
int32x4_t tmp2 = vmull_lane_s16(z2_s16, consts.val[0], 1);
|
||||
int32x4_t tmp3 = vmull_lane_s16(z2_s16, consts.val[1], 2);
|
||||
|
||||
z2_s16 = vmul_s16(row0, quant_row0);
|
||||
int32x4_t tmp0 = vshll_n_s16(z2_s16, CONST_BITS);
|
||||
int32x4_t tmp1 = vshll_n_s16(z2_s16, CONST_BITS);
|
||||
|
||||
int32x4_t tmp10 = vaddq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp13 = vsubq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp11 = vaddq_s32(tmp1, tmp2);
|
||||
int32x4_t tmp12 = vsubq_s32(tmp1, tmp2);
|
||||
|
||||
/* Odd part (tmp0 and tmp1 are both all 0) */
|
||||
int16x4_t tmp2_s16 = vmul_s16(row3, quant_row3);
|
||||
int16x4_t tmp3_s16 = vmul_s16(row1, quant_row1);
|
||||
|
||||
int16x4_t z3_s16 = tmp2_s16;
|
||||
int16x4_t z4_s16 = tmp3_s16;
|
||||
|
||||
int32x4_t z3 = vmull_lane_s16(z3_s16, consts.val[2], 3);
|
||||
int32x4_t z4 = vmull_lane_s16(z3_s16, consts.val[1], 3);
|
||||
z3 = vmlal_lane_s16(z3, z4_s16, consts.val[1], 3);
|
||||
z4 = vmlal_lane_s16(z4, z4_s16, consts.val[2], 0);
|
||||
|
||||
tmp0 = vmlsl_lane_s16(z3, tmp3_s16, consts.val[0], 0);
|
||||
tmp1 = vmlsl_lane_s16(z4, tmp2_s16, consts.val[0], 2);
|
||||
tmp2 = vmlal_lane_s16(z3, tmp2_s16, consts.val[2], 2);
|
||||
tmp3 = vmlal_lane_s16(z4, tmp3_s16, consts.val[1], 0);
|
||||
|
||||
/* Final output stage: descale and narrow to 16-bit. */
|
||||
int16x4x4_t rows_0123 = { {
|
||||
vrshrn_n_s32(vaddq_s32(tmp10, tmp3), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp11, tmp2), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp12, tmp1), DESCALE_P1),
|
||||
vrshrn_n_s32(vaddq_s32(tmp13, tmp0), DESCALE_P1)
|
||||
} };
|
||||
int16x4x4_t rows_4567 = { {
|
||||
vrshrn_n_s32(vsubq_s32(tmp13, tmp0), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp12, tmp1), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp11, tmp2), DESCALE_P1),
|
||||
vrshrn_n_s32(vsubq_s32(tmp10, tmp3), DESCALE_P1)
|
||||
} };
|
||||
|
||||
/* Store 4x4 blocks to the intermediate workspace, ready for the second pass.
|
||||
* (VST4 transposes the blocks. We need to operate on rows in the next
|
||||
* pass.)
|
||||
*/
|
||||
vst4_s16(workspace_1, rows_0123);
|
||||
vst4_s16(workspace_2, rows_4567);
|
||||
}
|
||||
|
||||
|
||||
/* Perform the second pass of the accurate inverse DCT on a 4x8 block of
|
||||
* coefficients. (To process the full 8x8 DCT block, this function-- or some
|
||||
* other optimized variant-- needs to be called for both the right and left 4x8
|
||||
* blocks.)
|
||||
*
|
||||
* This "regular" version assumes that no optimization can be made to the IDCT
|
||||
* calculation, since no useful set of coefficient values are all 0 after the
|
||||
* first pass.
|
||||
*
|
||||
* Again, the original C implementation of the accurate IDCT (jpeg_idct_slow())
|
||||
* can be found in jidctint.c. Algorithmic changes made here are documented
|
||||
* inline.
|
||||
*/
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass2_regular(int16_t *workspace,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col,
|
||||
unsigned buf_offset)
|
||||
{
|
||||
/* Load constants for IDCT computation. */
|
||||
#ifdef HAVE_VLD1_S16_X3
|
||||
const int16x4x3_t consts = vld1_s16_x3(jsimd_idct_islow_neon_consts);
|
||||
#else
|
||||
const int16x4_t consts1 = vld1_s16(jsimd_idct_islow_neon_consts);
|
||||
const int16x4_t consts2 = vld1_s16(jsimd_idct_islow_neon_consts + 4);
|
||||
const int16x4_t consts3 = vld1_s16(jsimd_idct_islow_neon_consts + 8);
|
||||
const int16x4x3_t consts = { { consts1, consts2, consts3 } };
|
||||
#endif
|
||||
|
||||
/* Even part */
|
||||
int16x4_t z2_s16 = vld1_s16(workspace + 2 * DCTSIZE / 2);
|
||||
int16x4_t z3_s16 = vld1_s16(workspace + 6 * DCTSIZE / 2);
|
||||
|
||||
int32x4_t tmp2 = vmull_lane_s16(z2_s16, consts.val[0], 1);
|
||||
int32x4_t tmp3 = vmull_lane_s16(z2_s16, consts.val[1], 2);
|
||||
tmp2 = vmlal_lane_s16(tmp2, z3_s16, consts.val[2], 1);
|
||||
tmp3 = vmlal_lane_s16(tmp3, z3_s16, consts.val[0], 1);
|
||||
|
||||
z2_s16 = vld1_s16(workspace + 0 * DCTSIZE / 2);
|
||||
z3_s16 = vld1_s16(workspace + 4 * DCTSIZE / 2);
|
||||
|
||||
int32x4_t tmp0 = vshll_n_s16(vadd_s16(z2_s16, z3_s16), CONST_BITS);
|
||||
int32x4_t tmp1 = vshll_n_s16(vsub_s16(z2_s16, z3_s16), CONST_BITS);
|
||||
|
||||
int32x4_t tmp10 = vaddq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp13 = vsubq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp11 = vaddq_s32(tmp1, tmp2);
|
||||
int32x4_t tmp12 = vsubq_s32(tmp1, tmp2);
|
||||
|
||||
/* Odd part */
|
||||
int16x4_t tmp0_s16 = vld1_s16(workspace + 7 * DCTSIZE / 2);
|
||||
int16x4_t tmp1_s16 = vld1_s16(workspace + 5 * DCTSIZE / 2);
|
||||
int16x4_t tmp2_s16 = vld1_s16(workspace + 3 * DCTSIZE / 2);
|
||||
int16x4_t tmp3_s16 = vld1_s16(workspace + 1 * DCTSIZE / 2);
|
||||
|
||||
z3_s16 = vadd_s16(tmp0_s16, tmp2_s16);
|
||||
int16x4_t z4_s16 = vadd_s16(tmp1_s16, tmp3_s16);
|
||||
|
||||
/* Implementation as per jpeg_idct_islow() in jidctint.c:
|
||||
* z5 = (z3 + z4) * 1.175875602;
|
||||
* z3 = z3 * -1.961570560; z4 = z4 * -0.390180644;
|
||||
* z3 += z5; z4 += z5;
|
||||
*
|
||||
* This implementation:
|
||||
* z3 = z3 * (1.175875602 - 1.961570560) + z4 * 1.175875602;
|
||||
* z4 = z3 * 1.175875602 + z4 * (1.175875602 - 0.390180644);
|
||||
*/
|
||||
|
||||
int32x4_t z3 = vmull_lane_s16(z3_s16, consts.val[2], 3);
|
||||
int32x4_t z4 = vmull_lane_s16(z3_s16, consts.val[1], 3);
|
||||
z3 = vmlal_lane_s16(z3, z4_s16, consts.val[1], 3);
|
||||
z4 = vmlal_lane_s16(z4, z4_s16, consts.val[2], 0);
|
||||
|
||||
/* Implementation as per jpeg_idct_islow() in jidctint.c:
|
||||
* z1 = tmp0 + tmp3; z2 = tmp1 + tmp2;
|
||||
* tmp0 = tmp0 * 0.298631336; tmp1 = tmp1 * 2.053119869;
|
||||
* tmp2 = tmp2 * 3.072711026; tmp3 = tmp3 * 1.501321110;
|
||||
* z1 = z1 * -0.899976223; z2 = z2 * -2.562915447;
|
||||
* tmp0 += z1 + z3; tmp1 += z2 + z4;
|
||||
* tmp2 += z2 + z3; tmp3 += z1 + z4;
|
||||
*
|
||||
* This implementation:
|
||||
* tmp0 = tmp0 * (0.298631336 - 0.899976223) + tmp3 * -0.899976223;
|
||||
* tmp1 = tmp1 * (2.053119869 - 2.562915447) + tmp2 * -2.562915447;
|
||||
* tmp2 = tmp1 * -2.562915447 + tmp2 * (3.072711026 - 2.562915447);
|
||||
* tmp3 = tmp0 * -0.899976223 + tmp3 * (1.501321110 - 0.899976223);
|
||||
* tmp0 += z3; tmp1 += z4;
|
||||
* tmp2 += z3; tmp3 += z4;
|
||||
*/
|
||||
|
||||
tmp0 = vmull_lane_s16(tmp0_s16, consts.val[0], 3);
|
||||
tmp1 = vmull_lane_s16(tmp1_s16, consts.val[1], 1);
|
||||
tmp2 = vmull_lane_s16(tmp2_s16, consts.val[2], 2);
|
||||
tmp3 = vmull_lane_s16(tmp3_s16, consts.val[1], 0);
|
||||
|
||||
tmp0 = vmlsl_lane_s16(tmp0, tmp3_s16, consts.val[0], 0);
|
||||
tmp1 = vmlsl_lane_s16(tmp1, tmp2_s16, consts.val[0], 2);
|
||||
tmp2 = vmlsl_lane_s16(tmp2, tmp1_s16, consts.val[0], 2);
|
||||
tmp3 = vmlsl_lane_s16(tmp3, tmp0_s16, consts.val[0], 0);
|
||||
|
||||
tmp0 = vaddq_s32(tmp0, z3);
|
||||
tmp1 = vaddq_s32(tmp1, z4);
|
||||
tmp2 = vaddq_s32(tmp2, z3);
|
||||
tmp3 = vaddq_s32(tmp3, z4);
|
||||
|
||||
/* Final output stage: descale and narrow to 16-bit. */
|
||||
int16x8_t cols_02_s16 = vcombine_s16(vaddhn_s32(tmp10, tmp3),
|
||||
vaddhn_s32(tmp12, tmp1));
|
||||
int16x8_t cols_13_s16 = vcombine_s16(vaddhn_s32(tmp11, tmp2),
|
||||
vaddhn_s32(tmp13, tmp0));
|
||||
int16x8_t cols_46_s16 = vcombine_s16(vsubhn_s32(tmp13, tmp0),
|
||||
vsubhn_s32(tmp11, tmp2));
|
||||
int16x8_t cols_57_s16 = vcombine_s16(vsubhn_s32(tmp12, tmp1),
|
||||
vsubhn_s32(tmp10, tmp3));
|
||||
/* Descale and narrow to 8-bit. */
|
||||
int8x8_t cols_02_s8 = vqrshrn_n_s16(cols_02_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_13_s8 = vqrshrn_n_s16(cols_13_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_46_s8 = vqrshrn_n_s16(cols_46_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_57_s8 = vqrshrn_n_s16(cols_57_s16, DESCALE_P2 - 16);
|
||||
/* Clamp to range [0-255]. */
|
||||
uint8x8_t cols_02_u8 = vadd_u8(vreinterpret_u8_s8(cols_02_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_13_u8 = vadd_u8(vreinterpret_u8_s8(cols_13_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_46_u8 = vadd_u8(vreinterpret_u8_s8(cols_46_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_57_u8 = vadd_u8(vreinterpret_u8_s8(cols_57_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
|
||||
/* Transpose 4x8 block and store to memory. (Zipping adjacent columns
|
||||
* together allows us to store 16-bit elements.)
|
||||
*/
|
||||
uint8x8x2_t cols_01_23 = vzip_u8(cols_02_u8, cols_13_u8);
|
||||
uint8x8x2_t cols_45_67 = vzip_u8(cols_46_u8, cols_57_u8);
|
||||
uint16x4x4_t cols_01_23_45_67 = { {
|
||||
vreinterpret_u16_u8(cols_01_23.val[0]),
|
||||
vreinterpret_u16_u8(cols_01_23.val[1]),
|
||||
vreinterpret_u16_u8(cols_45_67.val[0]),
|
||||
vreinterpret_u16_u8(cols_45_67.val[1])
|
||||
} };
|
||||
|
||||
JSAMPROW outptr0 = output_buf[buf_offset + 0] + output_col;
|
||||
JSAMPROW outptr1 = output_buf[buf_offset + 1] + output_col;
|
||||
JSAMPROW outptr2 = output_buf[buf_offset + 2] + output_col;
|
||||
JSAMPROW outptr3 = output_buf[buf_offset + 3] + output_col;
|
||||
/* VST4 of 16-bit elements completes the transpose. */
|
||||
vst4_lane_u16((uint16_t *)outptr0, cols_01_23_45_67, 0);
|
||||
vst4_lane_u16((uint16_t *)outptr1, cols_01_23_45_67, 1);
|
||||
vst4_lane_u16((uint16_t *)outptr2, cols_01_23_45_67, 2);
|
||||
vst4_lane_u16((uint16_t *)outptr3, cols_01_23_45_67, 3);
|
||||
}
|
||||
|
||||
|
||||
/* Performs the second pass of the accurate inverse DCT on a 4x8 block
|
||||
* of coefficients.
|
||||
*
|
||||
* This "sparse" version assumes that the coefficient values (after the first
|
||||
* pass) in rows 4-7 are all 0. This simplifies the IDCT calculation,
|
||||
* accelerating overall performance.
|
||||
*/
|
||||
|
||||
static INLINE void jsimd_idct_islow_pass2_sparse(int16_t *workspace,
|
||||
JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col,
|
||||
unsigned buf_offset)
|
||||
{
|
||||
/* Load constants for IDCT computation. */
|
||||
#ifdef HAVE_VLD1_S16_X3
|
||||
const int16x4x3_t consts = vld1_s16_x3(jsimd_idct_islow_neon_consts);
|
||||
#else
|
||||
const int16x4_t consts1 = vld1_s16(jsimd_idct_islow_neon_consts);
|
||||
const int16x4_t consts2 = vld1_s16(jsimd_idct_islow_neon_consts + 4);
|
||||
const int16x4_t consts3 = vld1_s16(jsimd_idct_islow_neon_consts + 8);
|
||||
const int16x4x3_t consts = { { consts1, consts2, consts3 } };
|
||||
#endif
|
||||
|
||||
/* Even part (z3 is all 0) */
|
||||
int16x4_t z2_s16 = vld1_s16(workspace + 2 * DCTSIZE / 2);
|
||||
|
||||
int32x4_t tmp2 = vmull_lane_s16(z2_s16, consts.val[0], 1);
|
||||
int32x4_t tmp3 = vmull_lane_s16(z2_s16, consts.val[1], 2);
|
||||
|
||||
z2_s16 = vld1_s16(workspace + 0 * DCTSIZE / 2);
|
||||
int32x4_t tmp0 = vshll_n_s16(z2_s16, CONST_BITS);
|
||||
int32x4_t tmp1 = vshll_n_s16(z2_s16, CONST_BITS);
|
||||
|
||||
int32x4_t tmp10 = vaddq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp13 = vsubq_s32(tmp0, tmp3);
|
||||
int32x4_t tmp11 = vaddq_s32(tmp1, tmp2);
|
||||
int32x4_t tmp12 = vsubq_s32(tmp1, tmp2);
|
||||
|
||||
/* Odd part (tmp0 and tmp1 are both all 0) */
|
||||
int16x4_t tmp2_s16 = vld1_s16(workspace + 3 * DCTSIZE / 2);
|
||||
int16x4_t tmp3_s16 = vld1_s16(workspace + 1 * DCTSIZE / 2);
|
||||
|
||||
int16x4_t z3_s16 = tmp2_s16;
|
||||
int16x4_t z4_s16 = tmp3_s16;
|
||||
|
||||
int32x4_t z3 = vmull_lane_s16(z3_s16, consts.val[2], 3);
|
||||
z3 = vmlal_lane_s16(z3, z4_s16, consts.val[1], 3);
|
||||
int32x4_t z4 = vmull_lane_s16(z3_s16, consts.val[1], 3);
|
||||
z4 = vmlal_lane_s16(z4, z4_s16, consts.val[2], 0);
|
||||
|
||||
tmp0 = vmlsl_lane_s16(z3, tmp3_s16, consts.val[0], 0);
|
||||
tmp1 = vmlsl_lane_s16(z4, tmp2_s16, consts.val[0], 2);
|
||||
tmp2 = vmlal_lane_s16(z3, tmp2_s16, consts.val[2], 2);
|
||||
tmp3 = vmlal_lane_s16(z4, tmp3_s16, consts.val[1], 0);
|
||||
|
||||
/* Final output stage: descale and narrow to 16-bit. */
|
||||
int16x8_t cols_02_s16 = vcombine_s16(vaddhn_s32(tmp10, tmp3),
|
||||
vaddhn_s32(tmp12, tmp1));
|
||||
int16x8_t cols_13_s16 = vcombine_s16(vaddhn_s32(tmp11, tmp2),
|
||||
vaddhn_s32(tmp13, tmp0));
|
||||
int16x8_t cols_46_s16 = vcombine_s16(vsubhn_s32(tmp13, tmp0),
|
||||
vsubhn_s32(tmp11, tmp2));
|
||||
int16x8_t cols_57_s16 = vcombine_s16(vsubhn_s32(tmp12, tmp1),
|
||||
vsubhn_s32(tmp10, tmp3));
|
||||
/* Descale and narrow to 8-bit. */
|
||||
int8x8_t cols_02_s8 = vqrshrn_n_s16(cols_02_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_13_s8 = vqrshrn_n_s16(cols_13_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_46_s8 = vqrshrn_n_s16(cols_46_s16, DESCALE_P2 - 16);
|
||||
int8x8_t cols_57_s8 = vqrshrn_n_s16(cols_57_s16, DESCALE_P2 - 16);
|
||||
/* Clamp to range [0-255]. */
|
||||
uint8x8_t cols_02_u8 = vadd_u8(vreinterpret_u8_s8(cols_02_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_13_u8 = vadd_u8(vreinterpret_u8_s8(cols_13_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_46_u8 = vadd_u8(vreinterpret_u8_s8(cols_46_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
uint8x8_t cols_57_u8 = vadd_u8(vreinterpret_u8_s8(cols_57_s8),
|
||||
vdup_n_u8(CENTERJSAMPLE));
|
||||
|
||||
/* Transpose 4x8 block and store to memory. (Zipping adjacent columns
|
||||
* together allows us to store 16-bit elements.)
|
||||
*/
|
||||
uint8x8x2_t cols_01_23 = vzip_u8(cols_02_u8, cols_13_u8);
|
||||
uint8x8x2_t cols_45_67 = vzip_u8(cols_46_u8, cols_57_u8);
|
||||
uint16x4x4_t cols_01_23_45_67 = { {
|
||||
vreinterpret_u16_u8(cols_01_23.val[0]),
|
||||
vreinterpret_u16_u8(cols_01_23.val[1]),
|
||||
vreinterpret_u16_u8(cols_45_67.val[0]),
|
||||
vreinterpret_u16_u8(cols_45_67.val[1])
|
||||
} };
|
||||
|
||||
JSAMPROW outptr0 = output_buf[buf_offset + 0] + output_col;
|
||||
JSAMPROW outptr1 = output_buf[buf_offset + 1] + output_col;
|
||||
JSAMPROW outptr2 = output_buf[buf_offset + 2] + output_col;
|
||||
JSAMPROW outptr3 = output_buf[buf_offset + 3] + output_col;
|
||||
/* VST4 of 16-bit elements completes the transpose. */
|
||||
vst4_lane_u16((uint16_t *)outptr0, cols_01_23_45_67, 0);
|
||||
vst4_lane_u16((uint16_t *)outptr1, cols_01_23_45_67, 1);
|
||||
vst4_lane_u16((uint16_t *)outptr2, cols_01_23_45_67, 2);
|
||||
vst4_lane_u16((uint16_t *)outptr3, cols_01_23_45_67, 3);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user