Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
606394eb6f | ||
|
|
b2ed287077 | ||
|
|
55888dbd69 | ||
|
|
04c52e7371 | ||
|
|
c33a00625a | ||
|
|
783b654273 | ||
|
|
c07a0f1ee6 | ||
|
|
d684e45828 | ||
|
|
1dd2da169c | ||
|
|
a3ea48ac99 | ||
|
|
2d87209886 | ||
|
|
13c2b46686 | ||
|
|
c7ba227885 | ||
|
|
d2ccc0b5ce | ||
|
|
36ff0968de | ||
|
|
6f099ab35d | ||
|
|
4838d0e0dc | ||
|
|
c949d3aded | ||
|
|
a1cf86438f | ||
|
|
47213f2acd | ||
|
|
0c28bc31fe | ||
|
|
e198e44cea | ||
|
|
4aa1b60925 | ||
|
|
3a4214aa73 | ||
|
|
96fc617cf2 | ||
|
|
19241b90a8 | ||
|
|
c5ce57d2f7 | ||
|
|
6494bbc701 | ||
|
|
020fced558 | ||
|
|
f498987dc4 | ||
|
|
54aa30299c | ||
|
|
6820342930 | ||
|
|
3f6e92b28e | ||
|
|
148400460f | ||
|
|
d9de1caaa6 | ||
|
|
8ce07f00fd | ||
|
|
b216124e53 | ||
|
|
592a1eecf6 | ||
|
|
d66348eaa3 | ||
|
|
9ae8905b00 | ||
|
|
b78496b324 | ||
|
|
d4c767c86b | ||
|
|
492edbfcad | ||
|
|
4eaf1a9f34 | ||
|
|
1d5882b07a | ||
|
|
d7d4158694 | ||
|
|
71bcf5cf44 | ||
|
|
545c9a782e | ||
|
|
7f3ffb87e5 | ||
|
|
1ac9a7b02e | ||
|
|
bc7fc07c2d | ||
|
|
3794a165d3 | ||
|
|
808e2eb25e | ||
|
|
c064306b7e | ||
|
|
176c97870c | ||
|
|
0565c021ae | ||
|
|
5d799be5fa | ||
|
|
316993443b | ||
|
|
b25f9dc9af | ||
|
|
0e0f026f92 | ||
|
|
accb48b2bc | ||
|
|
c89008ed31 | ||
|
|
0b04579431 | ||
|
|
2433938030 | ||
|
|
e9133442dd | ||
|
|
304d9b8c2f | ||
|
|
fb638dd072 | ||
|
|
e17068d5c2 | ||
|
|
18ceae7022 | ||
|
|
7f688f9be6 | ||
|
|
1ec850ffe7 | ||
|
|
d3771f3060 | ||
|
|
f19c77355a | ||
|
|
d6b0c4f86b | ||
|
|
4fa887d369 | ||
|
|
bd61413c02 | ||
|
|
b2f301c1cc | ||
|
|
3a99dd9ba1 | ||
|
|
d00a3b1bd6 | ||
|
|
cadf06b7c9 | ||
|
|
c9519c7ca0 | ||
|
|
0a227f54c8 | ||
|
|
023879c908 | ||
|
|
252feab755 | ||
|
|
99d87b4b8d | ||
|
|
427929c0fc | ||
|
|
15fa71c3b4 | ||
|
|
f448690ec2 | ||
|
|
227656e52b | ||
|
|
830bfb594a | ||
|
|
b3ea75380e | ||
|
|
94b319d833 | ||
|
|
e87d0f2c6e | ||
|
|
13fd621bd8 | ||
|
|
e866821a9d | ||
|
|
b8f9f69ea1 | ||
|
|
03dbf06c43 | ||
|
|
db3a5f24c7 | ||
|
|
5d6e875345 | ||
|
|
e175bcce36 | ||
|
|
db5ed9076b | ||
|
|
736a335343 | ||
|
|
1e878d0ed2 | ||
|
|
b428ba5096 | ||
|
|
f21cb810ef | ||
|
|
ef7a66fdbe | ||
|
|
cac70aedd2 | ||
|
|
15b620b523 | ||
|
|
662ec14f47 | ||
|
|
1c4f77e9b6 | ||
|
|
2ec8eb91ea | ||
|
|
75d17f3099 | ||
|
|
d62b62f512 | ||
|
|
8c7de3eb93 | ||
|
|
6721442a8d | ||
|
|
dddb282795 | ||
|
|
8d5415a6fa | ||
|
|
ca2e5137d2 | ||
|
|
df534c6691 | ||
|
|
fd6bbaae66 | ||
|
|
0592ee539f | ||
|
|
21eaa33bcb | ||
|
|
48e5f65a7d | ||
|
|
1bd1988a46 | ||
|
|
53cfa8329f | ||
|
|
d03989fefc | ||
|
|
e4a63b444d | ||
|
|
574289d367 | ||
|
|
76e6496764 | ||
|
|
635c511e5f | ||
|
|
c13e0e1320 | ||
|
|
d45080e2ab | ||
|
|
090780124a | ||
|
|
fc2bceec77 | ||
|
|
5d8f79207f | ||
|
|
5ab3dc3b97 | ||
|
|
416fecf712 | ||
|
|
aaaa7b2858 | ||
|
|
55cd8175a4 | ||
|
|
44bf86508f | ||
|
|
cdefd56f21 | ||
|
|
dce587f227 | ||
|
|
15fd269f7e | ||
|
|
33e7891b5a | ||
|
|
f69e110548 | ||
|
|
ee4aed01d2 | ||
|
|
cd34d0a85a | ||
|
|
97d256e80a | ||
|
|
df735baa13 | ||
|
|
ac1d629b2c | ||
|
|
1e4009f62e | ||
|
|
3ad9b29430 | ||
|
|
fd6e4007ed | ||
|
|
ec93548aed | ||
|
|
7a26f439ce | ||
|
|
1d07ddd467 | ||
|
|
8b4d73f666 | ||
|
|
7c31424f9e | ||
|
|
e464a33cc5 | ||
|
|
f5beec2bd8 | ||
|
|
2c19a5a662 | ||
|
|
7820b7e1b9 | ||
|
|
088859fb61 | ||
|
|
30345db729 | ||
|
|
05472e737f | ||
|
|
97e1870f06 | ||
|
|
f72a3aecef | ||
|
|
c48f23ce68 | ||
|
|
6155271859 | ||
|
|
3df0122142 | ||
|
|
622f2ae19a | ||
|
|
2e32c6b3c6 | ||
|
|
c6bacff999 | ||
|
|
178deca15c | ||
|
|
cf9bf84dc3 | ||
|
|
7567d41783 | ||
|
|
ab06a5d3ae | ||
|
|
6926c63f71 | ||
|
|
0a29a413ae | ||
|
|
8371547b51 | ||
|
|
6ba3cdeb30 | ||
|
|
37a6525861 | ||
|
|
54dd6d7ee8 | ||
|
|
145adbf72d | ||
|
|
3978976a04 | ||
|
|
69aa24a5b9 | ||
|
|
b19cfec2cf | ||
|
|
50ea61bd4d | ||
|
|
d1656ddcb7 | ||
|
|
5c00e3c53b | ||
|
|
a52d9d4c88 | ||
|
|
b9f3ff66f6 | ||
|
|
a8715ccb85 | ||
|
|
e2606e83c1 | ||
|
|
dfc48db6b1 | ||
|
|
4a96cc9719 | ||
|
|
ffe973df81 | ||
|
|
40574855b6 | ||
|
|
3b4cd1a0a4 | ||
|
|
5667a27321 | ||
|
|
9299a8258b | ||
|
|
132febd604 | ||
|
|
4cec5c8a21 | ||
|
|
c501616626 | ||
|
|
632e46623a | ||
|
|
764eddca85 | ||
|
|
8ee7514964 | ||
|
|
ff22ba3a79 | ||
|
|
04b2b48ba5 | ||
|
|
347befa0d7 | ||
|
|
103e6db730 | ||
|
|
9507e51812 | ||
|
|
2c5339b8f3 | ||
|
|
dbc48c1d33 | ||
|
|
63da162693 | ||
|
|
2f1fe194d9 | ||
|
|
3ce27a96d5 | ||
|
|
d30edbd7ac | ||
|
|
8344966940 | ||
|
|
bbfe5abae8 | ||
|
|
79b6d76e98 | ||
|
|
feeb02a8af | ||
|
|
a40749ccd0 | ||
|
|
0792264bd4 | ||
|
|
c962ec1b19 | ||
|
|
5f572b7097 | ||
|
|
36320e1f76 | ||
|
|
166bc4832c | ||
|
|
b9aeccb009 | ||
|
|
f38a3aa1ab | ||
|
|
95db42db40 | ||
|
|
1d0175d47d | ||
|
|
153e4a8d4d | ||
|
|
88c89f1fca | ||
|
|
e6888288b8 | ||
|
|
79d6f1faf7 | ||
|
|
709327d814 | ||
|
|
6a5c21d31d | ||
|
|
6d19304586 | ||
|
|
3b89eb795e | ||
|
|
fdc4363bff | ||
|
|
5afcb90d42 | ||
|
|
29f6cf8c07 | ||
|
|
03cf6784be | ||
|
|
6420127889 | ||
|
|
c037f53988 | ||
|
|
59289ebbcb | ||
|
|
6297537ab1 | ||
|
|
90b6738109 | ||
|
|
533cc8e582 | ||
|
|
745f247679 | ||
|
|
681d8ebf2a | ||
|
|
9f56263075 | ||
|
|
9dcee460be | ||
|
|
91900eeee1 | ||
|
|
d71348cc17 | ||
|
|
921b213235 | ||
|
|
0ebd86ccad | ||
|
|
b39ea96af0 | ||
|
|
f1241c226b | ||
|
|
22383cfa7d | ||
|
|
a8896d3e79 | ||
|
|
09238bb9c5 | ||
|
|
0f5836b4a0 | ||
|
|
25d154ee87 | ||
|
|
57aaf213ef | ||
|
|
6f343f9f3b | ||
|
|
e1a1c91771 | ||
|
|
2b2f1ad6cf | ||
|
|
60a57e26fd | ||
|
|
497d02ba1a | ||
|
|
e1d2d2d1db | ||
|
|
a369e7c1a3 | ||
|
|
580cdbf796 | ||
|
|
f454bbb182 | ||
|
|
c74a1e4253 | ||
|
|
eb0b058ff9 | ||
|
|
2904cc847c | ||
|
|
72aa3e78ac | ||
|
|
556e056bb6 | ||
|
|
16edd7b212 | ||
|
|
fffdcf2f07 | ||
|
|
60b986fb34 | ||
|
|
9762558b37 | ||
|
|
b3a19903db | ||
|
|
fd657e8a41 | ||
|
|
37ccf5c710 | ||
|
|
3ef13a8433 | ||
|
|
c13cc7128d | ||
|
|
9fb611aef6 | ||
|
|
e531b2cab3 | ||
|
|
c43a73f22c | ||
|
|
932c3fb0a2 | ||
|
|
9550627354 | ||
|
|
4994b291b8 | ||
|
|
5bd9a67e04 | ||
|
|
b893bda1ab | ||
|
|
f91e1581f4 | ||
|
|
3e63acd6b1 | ||
|
|
4dd4305f88 | ||
|
|
40cbd96d92 | ||
|
|
9fcb1b0abb | ||
|
|
32760d4944 | ||
|
|
da818d1550 | ||
|
|
76f3410aca | ||
|
|
da32c659b5 | ||
|
|
637b0718b2 | ||
|
|
d3f8a8ef41 | ||
|
|
ced50a0842 | ||
|
|
ac3d491262 | ||
|
|
7d04f3c752 | ||
|
|
e8e0b99fdd | ||
|
|
69aaa6c48b | ||
|
|
0afe0a28e3 | ||
|
|
290efa730c | ||
|
|
de5023549e | ||
|
|
8c2e0f375e | ||
|
|
ed0160fa39 | ||
|
|
346ff61938 | ||
|
|
ef6ba3b133 | ||
|
|
c00f6aa521 | ||
|
|
fe176989fe | ||
|
|
b99325f1f1 | ||
|
|
9dd63df87b | ||
|
|
81711da788 | ||
|
|
52c8e3a06d | ||
|
|
d160a8f543 | ||
|
|
30500b1319 | ||
|
|
f1acb9da52 | ||
|
|
5c69285235 | ||
|
|
fd6a33f18d | ||
|
|
45ee12752f | ||
|
|
d8a59968fe | ||
|
|
30d2c46eb7 | ||
|
|
9a34956d86 | ||
|
|
1acd251c26 | ||
|
|
85ed7a429b | ||
|
|
9bf37a31cd | ||
|
|
ca971c4260 | ||
|
|
75e917abcc | ||
|
|
ef8cfd2afe | ||
|
|
d0e2e53bdd | ||
|
|
b8392c850e | ||
|
|
50ba96b1db | ||
|
|
b66d0f275b | ||
|
|
1d5bb79d3b | ||
|
|
a729f91072 | ||
|
|
80b2c94d1c | ||
|
|
5a39521804 | ||
|
|
39b9d241cd | ||
|
|
310e3bd3ec | ||
|
|
d5b059dbf0 | ||
|
|
3f1d975557 | ||
|
|
44ac2309e9 | ||
|
|
5a675d69d3 | ||
|
|
1e1ca4a145 | ||
|
|
75b70c6cba | ||
|
|
0b83825919 | ||
|
|
44bf398506 | ||
|
|
4ddc29ca9a | ||
|
|
783c6f4c6b | ||
|
|
a002f35dc8 | ||
|
|
474dd65dde | ||
|
|
279644cb38 | ||
|
|
b3371beee2 | ||
|
|
7e32b483ee | ||
|
|
6756f28700 | ||
|
|
6cb7d97b20 | ||
|
|
09af4189dd | ||
|
|
848f84ae75 | ||
|
|
07521cb022 | ||
|
|
4077187e0a | ||
|
|
df162955c6 | ||
|
|
97f857131e | ||
|
|
1982b6fe97 | ||
|
|
2df7802a64 | ||
|
|
22d562c0cc | ||
|
|
928f9a4dd7 | ||
|
|
7044bc9925 | ||
|
|
2d94a3cc7c | ||
|
|
3144463fc4 | ||
|
|
1217b57366 | ||
|
|
91156c3b9c | ||
|
|
f7a6cb4e7a | ||
|
|
d8c96a061f | ||
|
|
949ae1b364 | ||
|
|
26927897b2 | ||
|
|
3ce6c2b85d | ||
|
|
66158f8363 | ||
|
|
8bc3faebc6 | ||
|
|
ad85f1a267 | ||
|
|
22cbb7966f | ||
|
|
a8dc4f9acf | ||
|
|
82391c9cf5 | ||
|
|
a3390757ff | ||
|
|
81a8b3182b | ||
|
|
52348078a3 | ||
|
|
89fd37e4d2 | ||
|
|
867ce30da1 | ||
|
|
c35a49244a | ||
|
|
39010bff70 | ||
|
|
a4a03cebc6 | ||
|
|
506c298c9a | ||
|
|
fe40612593 | ||
|
|
0e3d6dc030 | ||
|
|
b51239d32c | ||
|
|
a393987aba | ||
|
|
f7e4e2c98f | ||
|
|
c302e2db2f | ||
|
|
36bb865035 | ||
|
|
e54d61b5ca | ||
|
|
d964419dde | ||
|
|
2ac93daa8f | ||
|
|
c0b592dbda | ||
|
|
16a6ac439b | ||
|
|
1a5f8da030 | ||
|
|
f00ba78ed5 | ||
|
|
5ce329ca79 | ||
|
|
6fc0c63a14 | ||
|
|
366eeb12e3 | ||
|
|
cd0ac53e19 | ||
|
|
f9f7edccad | ||
|
|
b6fc6eccf9 | ||
|
|
4332f5e902 | ||
|
|
74e8710ae1 | ||
|
|
a82cee1b2c | ||
|
|
7bd85a2ce2 | ||
|
|
bfbb035873 | ||
|
|
101d7b0cd6 | ||
|
|
74a0f59390 | ||
|
|
48e99c8570 | ||
|
|
3d34ea047d | ||
|
|
867eaefe55 | ||
|
|
18526a6a42 | ||
|
|
859b36a5ff | ||
|
|
528044b64d | ||
|
|
1cd4bf6b94 | ||
|
|
26fc443839 | ||
|
|
937a0e7598 | ||
|
|
014392c707 | ||
|
|
c41984b956 | ||
|
|
72b173b007 | ||
|
|
74ab4287d1 | ||
|
|
f1f2438e86 | ||
|
|
2b6e0609d1 | ||
|
|
03a4718194 | ||
|
|
d689a3a838 | ||
|
|
0a0bb45952 | ||
|
|
8d52f35c1b | ||
|
|
43efc618c3 | ||
|
|
72e9c3df8d | ||
|
|
3e64e7d977 | ||
|
|
3ebc6ed20c | ||
|
|
80c69c9437 | ||
|
|
b2d815602e | ||
|
|
c7d03a85df | ||
|
|
6245d6ec6e | ||
|
|
210900cc32 | ||
|
|
43d39b49ad | ||
|
|
cfc6427ef6 | ||
|
|
821c1fc148 | ||
|
|
6a46ae88e1 | ||
|
|
8d141c5db5 | ||
|
|
541dc150ae | ||
|
|
cf14304cca | ||
|
|
25c2d775f8 | ||
|
|
8b0caea88b | ||
|
|
176ec27c8a | ||
|
|
a5d5f1b75b | ||
|
|
04cc126643 | ||
|
|
04a91b79ed | ||
|
|
76c932a856 | ||
|
|
8f76f50435 | ||
|
|
c7c75e0624 | ||
|
|
90704f2988 | ||
|
|
97e2d29538 | ||
|
|
ff200905e5 | ||
|
|
75da6b8098 | ||
|
|
dbdedb1231 | ||
|
|
1273f5c78d | ||
|
|
852e0e19f5 | ||
|
|
693a7e4492 | ||
|
|
7dc2e20eb7 | ||
|
|
7ac02da91d | ||
|
|
6966fcf76d | ||
|
|
f715341b3c | ||
|
|
9f7c2bef74 | ||
|
|
19361b7f0d | ||
|
|
2bca92f3a4 | ||
|
|
93b93ea27f | ||
|
|
1dd3466fa8 | ||
|
|
95d8447f97 | ||
|
|
8c7563efa3 | ||
|
|
7fc13ebe63 | ||
|
|
0517be80cd | ||
|
|
d097f7bbcc | ||
|
|
8b829c9f68 | ||
|
|
9a3a4ab103 | ||
|
|
d8ef05eb69 | ||
|
|
fb369b676c | ||
|
|
431633ab0c | ||
|
|
2cbed13136 | ||
|
|
2cae20dfac | ||
|
|
56d6b2f2c4 | ||
|
|
4072e8021a | ||
|
|
a2827bf065 | ||
|
|
1f860abc05 | ||
|
|
1a9d840201 | ||
|
|
6284ed1331 | ||
|
|
8ff2fea2a2 | ||
|
|
064d7a695d | ||
|
|
56bfb1c0ed | ||
|
|
20ad624cb6 | ||
|
|
974ed87cb1 | ||
|
|
ff08cb52fd | ||
|
|
8445b0f611 | ||
|
|
f6990cd1f6 | ||
|
|
4edae36c3f | ||
|
|
2136a12328 | ||
|
|
e115444b69 | ||
|
|
c4df79caa8 | ||
|
|
6cee1f89f1 | ||
|
|
45d61cf750 | ||
|
|
585fba3c89 | ||
|
|
e71cf825f1 | ||
|
|
183689c2b1 | ||
|
|
c9f585a846 | ||
|
|
48a65cd799 | ||
|
|
7e0da7f5b7 | ||
|
|
6fdcad4a66 | ||
|
|
dc99c56e5f | ||
|
|
de8194872c | ||
|
|
0315f0e617 | ||
|
|
36d4b649b8 | ||
|
|
83dbddebe9 | ||
|
|
f07333d2f4 | ||
|
|
65c8ef6b22 | ||
|
|
91709fd6f6 | ||
|
|
4113c85fa6 | ||
|
|
1c699b6a3a | ||
|
|
6c0403f586 | ||
|
|
2ccc2fc418 | ||
|
|
c381ee0eda | ||
|
|
9343c90cbc | ||
|
|
20bba90739 | ||
|
|
993d684215 | ||
|
|
e4e6cf2eb6 | ||
|
|
f1ac5fc91c | ||
|
|
f323762060 | ||
|
|
fe3b536cca | ||
|
|
c3e212e9c7 | ||
|
|
6b9b287fd1 | ||
|
|
5e35d02a9d | ||
|
|
9638cf555a | ||
|
|
cc8eaeaba1 | ||
|
|
7e4e3eb24e | ||
|
|
81e18d3f21 | ||
|
|
939594faab | ||
|
|
2775703de2 | ||
|
|
89013cee3b | ||
|
|
e27486a330 | ||
|
|
84d7d52e17 | ||
|
|
be14297325 | ||
|
|
de81234564 | ||
|
|
8a00d295ed | ||
|
|
9efc6e4dbb | ||
|
|
9965ef42b2 | ||
|
|
56325bac73 | ||
|
|
c8a74d9ac9 | ||
|
|
d6be66e4d6 | ||
|
|
11860ba3af | ||
|
|
46b59d7844 | ||
|
|
c767181a72 | ||
|
|
4b3bcf3138 | ||
|
|
da9aac0c62 | ||
|
|
e27b907590 | ||
|
|
f48ed3046d | ||
|
|
5d6096f019 | ||
|
|
f15bb90c7a | ||
|
|
faf697fd86 | ||
|
|
8169016e5c | ||
|
|
cef97397c4 | ||
|
|
04b10543ad | ||
|
|
370db28358 | ||
|
|
ef52af0387 | ||
|
|
37594c2103 | ||
|
|
810e4567a9 | ||
|
|
e89466bf0a | ||
|
|
da3f4494cd | ||
|
|
7de2958171 | ||
|
|
5f9bee0d77 | ||
|
|
1b2b78858d | ||
|
|
694606da25 | ||
|
|
421f1b4d2a | ||
|
|
1a28088c89 | ||
|
|
cfcf99e1a8 | ||
|
|
94bf6ca43c | ||
|
|
031978a255 | ||
|
|
aed82c1484 | ||
|
|
e7f1099440 | ||
|
|
f38fb9d2c8 | ||
|
|
5b034db00a | ||
|
|
67614ffdc1 | ||
|
|
d669510fda | ||
|
|
9aa1484719 | ||
|
|
da6b169cf0 | ||
|
|
4bc6077fa6 | ||
|
|
7a31cd5953 | ||
|
|
6c12cc1577 | ||
|
|
063149e8e2 | ||
|
|
0084673f97 | ||
|
|
cf1e57c01e | ||
|
|
133012a29e | ||
|
|
f7d33c4e56 | ||
|
|
7682c03774 | ||
|
|
509a227b9f | ||
|
|
e39ec0c817 | ||
|
|
9d3e061a0b | ||
|
|
ddd116bb0b | ||
|
|
076c8324c5 | ||
|
|
0e92e7d40b | ||
|
|
c28c320c11 | ||
|
|
272e4b356d | ||
|
|
3c9e34a372 | ||
|
|
bfbdccb482 | ||
|
|
9fa6984f22 | ||
|
|
7aa89e1d09 | ||
|
|
d822c79707 | ||
|
|
d623158e7d | ||
|
|
00a11d8c36 | ||
|
|
7b1556baaa | ||
|
|
5f18d4854d | ||
|
|
84f58b85ae | ||
|
|
915cb814ca | ||
|
|
01e9f18f0b | ||
|
|
ada8e4e43d | ||
|
|
d261527005 | ||
|
|
40c2237e8e | ||
|
|
1719d067dc | ||
|
|
c60c0ebde3 | ||
|
|
f0da5b700d | ||
|
|
82d027505b | ||
|
|
502b246ce1 | ||
|
|
b057235dcb | ||
|
|
c27ea89334 | ||
|
|
bea5cca8fb | ||
|
|
ad9d698035 | ||
|
|
f2a71f71b7 | ||
|
|
4e37911922 | ||
|
|
2a579fd392 | ||
|
|
60898ada40 | ||
|
|
b7e936c60b | ||
|
|
44488f1fc0 | ||
|
|
9c6c12f097 | ||
|
|
403740625b | ||
|
|
d37e681a65 | ||
|
|
23902642b9 | ||
|
|
37122bb8d4 | ||
|
|
35bf5cdaff | ||
|
|
5fe60f9448 | ||
|
|
32de807ca6 | ||
|
|
222bc3d449 | ||
|
|
68470dd26b | ||
|
|
6905396791 | ||
|
|
a6668bc136 | ||
|
|
c7eadcb442 | ||
|
|
e60db963bc | ||
|
|
ca27a212d6 | ||
|
|
c8276f7f1f | ||
|
|
b56b9b0672 | ||
|
|
bc0fe433fe | ||
|
|
28c935b3c2 | ||
|
|
08f5e69cd5 | ||
|
|
a3fe0eb813 | ||
|
|
47f7cd2127 | ||
|
|
46944c3a87 | ||
|
|
8743203dfc | ||
|
|
95031106a8 | ||
|
|
745681ca2d | ||
|
|
bafa35e16b | ||
|
|
f113a8f4ad | ||
|
|
cb94fe1dfc | ||
|
|
ce7d59f270 | ||
|
|
ae1dde6646 | ||
|
|
d0cae91e8f | ||
|
|
e571107f1e | ||
|
|
86d0fb0985 | ||
|
|
6258740337 | ||
|
|
d65a626cba | ||
|
|
1cac626750 | ||
|
|
e9400ca0ed | ||
|
|
defea17b76 | ||
|
|
831d967aba | ||
|
|
9be75dc78f | ||
|
|
231d0e96ef | ||
|
|
fca936a964 | ||
|
|
de791a50ca | ||
|
|
4de528df6c | ||
|
|
cc94a1949d | ||
|
|
a3b46d5cd9 | ||
|
|
159e57120d | ||
|
|
3893e34a12 | ||
|
|
7c5c3126da | ||
|
|
dc50388ada | ||
|
|
99d0737b01 | ||
|
|
7273a3936a | ||
|
|
3fbb532bb2 | ||
|
|
9a7235462b | ||
|
|
d537f40cd5 | ||
|
|
af911099ab | ||
|
|
71d1bc1b4d | ||
|
|
1b12960b46 | ||
|
|
dfb1b9ad00 | ||
|
|
3c6560a354 | ||
|
|
f355c3b304 | ||
|
|
afd7492d2e | ||
|
|
a66776f96d | ||
|
|
4e9d5ecc22 | ||
|
|
1ee0ffec3a | ||
|
|
9a0cf1f1c8 | ||
|
|
ef9b27c91b | ||
|
|
28d90d919c | ||
|
|
b8aef3e690 | ||
|
|
aa66972fd1 | ||
|
|
0c17c283fa | ||
|
|
df91c16103 | ||
|
|
cd854af9f7 | ||
|
|
acdbda98d1 |
@@ -0,0 +1,12 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
common --enable_platform_specific_config
|
||||
|
||||
# Enable modern C++ features
|
||||
build:linux --cxxopt=-std=c++17
|
||||
build:linux --host_cxxopt=-std=c++17
|
||||
build:macos --cxxopt=-std=c++17
|
||||
build:macos --host_cxxopt=-std=c++17
|
||||
build:windows --cxxopt=/std:c++17
|
||||
build:windows --host_cxxopt=/std:c++17
|
||||
+1
-1
@@ -1 +1 @@
|
||||
6.3.2
|
||||
9.0.0
|
||||
|
||||
@@ -6,3 +6,5 @@
|
||||
|
||||
# initial clang-format run
|
||||
2a24ae77ab94f4c06b102eba73feb52e2f90cb46
|
||||
# clang-format run 17-Mar-2024
|
||||
84f58b85aef7a7844f0d3bfb1301e778eb22e42c
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
version: 2
|
||||
|
||||
updates:
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
exclude-paths:
|
||||
- ".github/workflows/ci_workflow_old.yml"
|
||||
groups:
|
||||
codeql:
|
||||
patterns:
|
||||
- "github/codeql-action/*"
|
||||
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/website"
|
||||
schedule:
|
||||
day: "monday"
|
||||
interval: "weekly"
|
||||
# Hashed lockfile is regenerated locally with pip-compile; do not let
|
||||
# Dependabot rewrite it (transitive bumps belong in requirements.txt or
|
||||
# a deliberate lock regen, not automated lock-only PRs).
|
||||
exclude-paths:
|
||||
- "website/requirements-lock.txt"
|
||||
- "website/requirements.txt.lock"
|
||||
|
||||
- package-ecosystem: "gitsubmodule"
|
||||
directory: "/"
|
||||
schedule:
|
||||
day: "monday"
|
||||
interval: "weekly"
|
||||
|
||||
- package-ecosystem: "bazel"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
@@ -22,24 +22,20 @@ jobs:
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
linux_sonarcloud:
|
||||
name: 'SonarCloud Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
name: 'SonarCloud Linux CentOS 7 VFX CY2024 <GCC 11.2.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
image: aswf/ci-openexr:2026
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
steps:
|
||||
# TODO: Remove this workaround following resolution of:
|
||||
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
@@ -51,7 +47,7 @@ jobs:
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
|
||||
-DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
|
||||
-DCMAKE_C_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \
|
||||
@@ -86,20 +82,20 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: sonar-scanner -X -Dsonar.login=$SONAR_TOKEN
|
||||
run: sonar-scanner -X
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Valgrind memcheck test
|
||||
# ------------------------------------------------------------------------------
|
||||
linux_valgrind:
|
||||
name: 'Valgrind Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
name: 'Valgrind Linux CentOS 7 VFX CY2024 <GCC 11.2.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
image: aswf/ci-openexr:2024
|
||||
env:
|
||||
CXX: g++
|
||||
CC: gcc
|
||||
@@ -109,7 +105,7 @@ jobs:
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
@@ -126,7 +122,7 @@ jobs:
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS='OFF' \
|
||||
-DOPENEXR_BUILD_TOOLS='ON' \
|
||||
@@ -157,14 +153,14 @@ jobs:
|
||||
# Fuzz test
|
||||
# ------------------------------------------------------------------------------
|
||||
linux_fuzz:
|
||||
name: 'Fuzz Test ${{ matrix.build-descrip }} Linux CentOS 7 VFX CY2022 <GCC 9.3.1>'
|
||||
name: 'Fuzz Test ${{ matrix.build-descrip }} Linux CentOS 7 VFX CY2024 <GCC 11.2.1>'
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:2022
|
||||
image: aswf/ci-openexr:2024
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2]
|
||||
@@ -188,7 +184,7 @@ jobs:
|
||||
- name: Setup container
|
||||
run: sudo rm -rf /usr/local/lib64/cmake/glew
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 50
|
||||
- name: Create build directories
|
||||
@@ -201,7 +197,7 @@ jobs:
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_CXX_STANDARD=14 \
|
||||
-DCMAKE_CXX_STANDARD=17 \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS='OFF' \
|
||||
-DOPENEXR_BUILD_TOOLS='ON' \
|
||||
|
||||
@@ -12,82 +12,78 @@ name: Bazel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/bazel_build.yml'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/bazel_build.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_and_test_ubuntu:
|
||||
name: Linux Ubuntu 22.04 Bazel build <GCC 11.4.0>
|
||||
runs-on: ubuntu-22.04
|
||||
name: Linux Ubuntu 24.04 Bazel build <GCC 13.3.0>
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-ubuntu-22
|
||||
key: bazel-ubuntu-24
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
bazel build //...
|
||||
bazel test --test_output=errors //...
|
||||
|
||||
build_and_test_windows:
|
||||
name: Windows Server 2022 build <Visual Studio 2022>
|
||||
runs-on: windows-2022
|
||||
name: Windows Server 2025 build <Visual Studio 2022>
|
||||
runs-on: windows-2025
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-windows-2022
|
||||
key: bazel-windows-2025
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
bazel build //...
|
||||
bazel test --test_output=errors //...
|
||||
|
||||
build_and_test_macos:
|
||||
name: macOS 13 Bazel build <Apple Clang14>
|
||||
runs-on: macos-13
|
||||
name: macOS 15 Bazel build <Apple Clang14>
|
||||
runs-on: macos-15
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Mount Bazel cache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: "/home/runner/.cache/bazel"
|
||||
key: bazel-macos-13
|
||||
key: bazel-macos-15
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazelisk build //...
|
||||
bazelisk test //...
|
||||
bazel build //...
|
||||
bazel test --test_output=errors //...
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# Build and test on FreeBSD using a community VM action.
|
||||
# GitHub does not provide native FreeBSD runners; this uses vmactions/freebsd-vm.
|
||||
# Validates the pthread fallback in internal_thread.h (issue #2299).
|
||||
|
||||
name: CI (FreeBSD)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_freebsd.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_freebsd.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
freebsd:
|
||||
name: FreeBSD
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Build and test on FreeBSD
|
||||
uses: vmactions/freebsd-vm@5a72679103d223925653750faa878a143340fbd0 # v1.5.0
|
||||
with:
|
||||
release: '15.0'
|
||||
envs: GITHUB_REPOSITORY GITHUB_REF GITHUB_SHA
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install -y cmake ninja git
|
||||
run: |
|
||||
set -e
|
||||
git clone --depth 1 "https://github.com/${GITHUB_REPOSITORY}.git" src
|
||||
cd src
|
||||
# shallow clone, only the commit that triggered the run, i.e. GITHUB_SHA
|
||||
git fetch --depth 1 origin "${GITHUB_SHA}"
|
||||
git checkout "${GITHUB_SHA}"
|
||||
cmake -B _build -S . -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DOPENEXR_FORCE_INTERNAL_IMATH=ON \
|
||||
-DOPENEXR_FORCE_INTERNAL_DEFLATE=ON \
|
||||
-DOPENEXR_FORCE_INTERNAL_OPENJPH=ON \
|
||||
-DBUILD_TESTING=ON
|
||||
cmake --build _build
|
||||
ctest --test-dir _build --output-on-failure
|
||||
@@ -0,0 +1,474 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# These are the steps for all CI jobs. Linux, macOS, and Windows all
|
||||
# share a common set of configure/build/validate steps. The input
|
||||
# variables control all variations of the jobs.
|
||||
#
|
||||
# Each job validates that the proper files are installed by comparing
|
||||
# the install_manifest.txt to a reference for that job. This requires
|
||||
# that each job have a corresponding reference, and that thes
|
||||
# references are updated when any change is made to the installation
|
||||
# headers/libraries/cmake/etc.
|
||||
|
||||
name: CI Steps
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# This inputs receive values via the "with:" section in ci_workflow.yml
|
||||
inputs:
|
||||
build:
|
||||
type: string
|
||||
os:
|
||||
type: string
|
||||
container:
|
||||
type: string
|
||||
cmake:
|
||||
type: string
|
||||
cxx-standard:
|
||||
type: string
|
||||
cxx-compiler:
|
||||
type: string
|
||||
cc-compiler:
|
||||
type: string
|
||||
build-type:
|
||||
type: string
|
||||
msystem:
|
||||
type: string
|
||||
BUILD_SHARED_LIBS:
|
||||
type: string
|
||||
OPENEXR_ENABLE_THREADING:
|
||||
type: string
|
||||
OPENEXR_INSTALL_PKG_CONFIG:
|
||||
type: string
|
||||
OPENEXR_INSTALL_DOCS:
|
||||
type: string
|
||||
OPENEXR_BUILD_EXAMPLES:
|
||||
type: string
|
||||
OPENEXR_BUILD_TOOLS:
|
||||
type: string
|
||||
OPENEXR_FORCE_INTERNAL_IMATH:
|
||||
type: string
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE:
|
||||
type: string
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH:
|
||||
type: string
|
||||
CMAKE_OSX_ARCHITECTURES:
|
||||
type: string
|
||||
BUILD_TESTING:
|
||||
type: string
|
||||
RUN_TESTING:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
validate_install:
|
||||
type: string
|
||||
configure_install_prefix:
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
steps:
|
||||
runs-on: ${{ inputs.os }}
|
||||
|
||||
permissions:
|
||||
contents: write # required for actions/upload-artifact
|
||||
|
||||
container:
|
||||
image: ${{ inputs.container }}
|
||||
|
||||
env:
|
||||
CXX: ${{ inputs.cxx-compiler }}
|
||||
CC: ${{ inputs.cc-compiler }}
|
||||
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Set Up Directories & Environment
|
||||
run: |
|
||||
set -x
|
||||
|
||||
# Be careful to use consistent paths between Windows and
|
||||
# Linux. Convert backslashed Windows paths to Linux style via cygpath,
|
||||
# i.e. convert D:\a\Imath\Imath to /d/a/Imath/Imath.
|
||||
|
||||
# WORKSPACE is the root of the project directory
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
WORKSPACE=$(cygpath -u "$GITHUB_WORKSPACE")
|
||||
|
||||
# remember the install location for Imath, libdeflate, openjph
|
||||
PROGRAM_FILES=$(cygpath -u "C:/Program Files (x86)")
|
||||
echo "PROGRAM_FILES=$PROGRAM_FILES" >> $GITHUB_ENV
|
||||
else
|
||||
WORKSPACE=$GITHUB_WORKSPACE
|
||||
fi
|
||||
echo "WORKSPACE=$WORKSPACE" >> $GITHUB_ENV
|
||||
|
||||
# BUILD_DIR is the CMake build directory
|
||||
BUILD_DIR=$WORKSPACE/_build
|
||||
echo "BUILD_DIR=$BUILD_DIR" >> $GITHUB_ENV
|
||||
|
||||
# INSTALL_DIR is the CMake install directory
|
||||
INSTALL_DIR=$WORKSPACE/_install
|
||||
echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_ENV
|
||||
|
||||
# Initialize the PATH necessary for the tests on Windows
|
||||
echo "OPENEXR_PATH=$INSTALL_DIR/bin:$INSTALL_DIR/lib" >> $GITHUB_ENV
|
||||
|
||||
# Install gcc for macOS if necessary
|
||||
if [[ "${{ inputs.cc-compiler }}" == "gcc" && "$RUNNER_OS" == "macOS" ]]; then
|
||||
brew install gcc
|
||||
fi
|
||||
|
||||
shell: bash
|
||||
|
||||
- name: Report C Runtime Version
|
||||
run: |
|
||||
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
||||
ldd --version 2>&1 | head -1 || true
|
||||
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||
echo "macOS SDK: $(xcrun --show-sdk-version 2>/dev/null || echo 'unknown')"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Install Build Dependencies (Fedora)
|
||||
if: startsWith(inputs.container, 'fedora:')
|
||||
run: |
|
||||
dnf install -y gcc gcc-c++ cmake make git wget libdeflate-devel
|
||||
shell: bash
|
||||
|
||||
- name: Determine MSYS2 Packages
|
||||
if: inputs.msystem != ''
|
||||
run: |
|
||||
PACKAGES="cc:p cmake:p"
|
||||
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "OFF" ]; then
|
||||
PACKAGES="$PACKAGES imath:p"
|
||||
fi
|
||||
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}" == "OFF" ]; then
|
||||
PACKAGES="$PACKAGES libdeflate:p"
|
||||
fi
|
||||
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}" == "OFF" && "${{ inputs.msystem }}" != "MINGW32" ]; then
|
||||
PACKAGES="$PACKAGES openjph:p"
|
||||
fi
|
||||
echo "PACBOY_PACKAGES=$PACKAGES" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install MSYS2 ${{ inputs.msystem }}
|
||||
if: inputs.msystem != ''
|
||||
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
||||
with:
|
||||
msystem: ${{ inputs.msystem }}
|
||||
update: true
|
||||
install: git
|
||||
pacboy: ${{ env.PACBOY_PACKAGES }}
|
||||
|
||||
- name: Set Up CMake
|
||||
# CMakeLists.txt specifies a minimum cmake version of 3.14 for
|
||||
# the OpenEXR project, so use that for the CI by default. But
|
||||
# install a specific version to test with if a different one
|
||||
# is specified.
|
||||
run: |
|
||||
set -ex
|
||||
CMAKE=cmake
|
||||
CTEST=ctest
|
||||
if [[ "${{ inputs.cmake }}" != "" && "$RUNNER_OS" == "Linux" ]]; then
|
||||
CMAKE_VERSION=${{ inputs.cmake }}
|
||||
CURRENT_CMAKE_VERSION=$(cmake --version | head -n 1 | cut -f3 -d' ')
|
||||
if [ "$CMAKE_VERSION" != "$CURRENT_CMAKE_VERSION" ]; then
|
||||
wget https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
|
||||
tar -xzf cmake-$CMAKE_VERSION-Linux-x86_64.tar.gz
|
||||
CMAKE=$(find "$PWD" -type f -path "*/bin/cmake" | head -n 1)
|
||||
CTEST=$(find "$PWD" -type f -path "*/bin/ctest" | head -n 1)
|
||||
fi
|
||||
fi
|
||||
echo CMAKE="$CMAKE" >> $GITHUB_ENV
|
||||
echo CTEST="$CTEST" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install Imath
|
||||
# Pre-install Imath so the builds validate that find_package sees the external installation
|
||||
if: inputs.OPENEXR_FORCE_INTERNAL_IMATH == 'OFF' && inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
share/ci/scripts/install_imath.sh main
|
||||
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/Imath/bin:$PROGRAM_FILES/Imath/lib" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install libdeflate
|
||||
# Pre-install libdeflate so the builds validate that find_package sees the external installation
|
||||
if: inputs.OPENEXR_FORCE_INTERNAL_DEFLATE == 'OFF' && inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
share/ci/scripts/install_libdeflate.sh master
|
||||
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/libdeflate/bin:$PROGRAM_FILES/libdeflate/lib" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install OpenJPH
|
||||
# Pre-install OpenJPH so the builds validate finding the external installation
|
||||
if: inputs.OPENEXR_FORCE_INTERNAL_OPENJPH == 'OFF' && inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
share/ci/scripts/install_openjph.sh 0.22.0
|
||||
echo "OPENEXR_PATH=$OPENEXR_PATH:$PROGRAM_FILES/openjph/bin:$PROGRAM_FILES/openjph/lib" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Install help2man
|
||||
# TODO: this could go in the ASWF Linux docker
|
||||
# container. Also, it doesn't currently work for Windows, so
|
||||
# the windows builds have docs disabled.
|
||||
if: inputs.OPENEXR_INSTALL_DOCS == 'ON'
|
||||
run: share/ci/scripts/install_help2man.sh
|
||||
shell: bash
|
||||
|
||||
- name: Construct CMake command
|
||||
run: |
|
||||
# Construct the cmake command as a variable, so the
|
||||
# Configure step below can execute it, but also so we can store
|
||||
# in in the install_manifest as a debugging reference
|
||||
# Configure/build with a .tmp install prefix, so we can
|
||||
# validate the install properly overrides it.
|
||||
cmake_args=("-B" "$BUILD_DIR" -S "$WORKSPACE")
|
||||
cmake_args+=("-DCMAKE_INSTALL_PREFIX=$INSTALL_DIR${{ inputs.configure_install_prefix}}")
|
||||
cmake_args+=("-DCMAKE_BUILD_TYPE=${{ inputs.build-type }}")
|
||||
cmake_args+=("-DOPENEXR_CXX_STANDARD=${{ inputs.cxx-standard }}")
|
||||
cmake_args+=("-DBUILD_SHARED_LIBS=${{ inputs.BUILD_SHARED_LIBS }}")
|
||||
cmake_args+=("-DOPENEXR_ENABLE_THREADING=${{ inputs.OPENEXR_ENABLE_THREADING }}")
|
||||
cmake_args+=("-DOPENEXR_INSTALL_PKG_CONFIG=${{ inputs.OPENEXR_INSTALL_PKG_CONFIG }}")
|
||||
cmake_args+=("-DOPENEXR_INSTALL_DOCS=${{ inputs.OPENEXR_INSTALL_DOCS }}")
|
||||
cmake_args+=("-DOPENEXR_BUILD_EXAMPLES=${{ inputs.OPENEXR_BUILD_EXAMPLES }}")
|
||||
cmake_args+=("-DOPENEXR_BUILD_TOOLS=${{ inputs.OPENEXR_BUILD_TOOLS }}")
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_IMATH=${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}")
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}")
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_OPENJPH=${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}")
|
||||
cmake_args+=("-DBUILD_TESTING=${{ inputs.BUILD_TESTING }}")
|
||||
cmake_args+=("-DOPENEXR_RUN_FUZZ_TESTS=OFF")
|
||||
cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
|
||||
if [ -n "${{ inputs.namespace }}" ]; then
|
||||
cmake_args+=("-DOPENEXR_IMF_NAMESPACE=${{ inputs.namespace }}")
|
||||
cmake_args+=("-DILMTHREAD_NAMESPACE=${{ inputs.namespace }}")
|
||||
cmake_args+=("-DIEX_NAMESPACE=${{ inputs.namespace }}")
|
||||
fi
|
||||
if [ "${{ inputs.msystem }}" == "MINGW32" ]; then
|
||||
cmake_args+=("-DCMAKE_C_FLAGS=-msse2 -mfpmath=sse")
|
||||
cmake_args+=("-DCMAKE_CXX_FLAGS=-msse2 -mfpmath=sse")
|
||||
fi
|
||||
if [ -n "${{ inputs.CMAKE_OSX_ARCHITECTURES }}" ]; then
|
||||
cmake_args+=("CMAKE_OSX_ARCHITECTURES='${{ inputs.CMAKE_OSX_ARCHITECTURES }}'")
|
||||
fi
|
||||
|
||||
quoted_args=$(printf '%q ' "${cmake_args[@]}")
|
||||
echo "CMAKE_ARGS=$quoted_args" >> "$GITHUB_ENV"
|
||||
|
||||
# Set the install manifest name to include the os and build number.
|
||||
# e.g. install_manifest.macos.1.txt. Note that $RUNNER_OS is "Linux",
|
||||
# while input.os is "ubuntu".
|
||||
os_name=$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]') # linux, macos, windows
|
||||
build="${{ inputs.build }}"
|
||||
echo INSTALL_MANIFEST_FILENAME="install_manifest.${os_name}.${build}.txt" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Configure, Build, Install
|
||||
if: inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
"$CMAKE" --version
|
||||
"$CMAKE" ${{ env.CMAKE_ARGS }}
|
||||
# Reconfigure in the same build dir to catch Imath include-path
|
||||
# regressions on CMake reconfigure (see #2441).
|
||||
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "ON" ]; then
|
||||
"$CMAKE" ${{ env.CMAKE_ARGS }}
|
||||
fi
|
||||
if [ -n "${{ inputs.configure_install_prefix }}" ]; then
|
||||
"$CMAKE" --build "$BUILD_DIR" --config ${{ inputs.build-type }}
|
||||
"$CMAKE" --install "$BUILD_DIR" --prefix "$INSTALL_DIR" --config ${{ inputs.build-type }}
|
||||
else
|
||||
"$CMAKE" --build "$BUILD_DIR" --target install --config ${{ inputs.build-type }}
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Configure, Build, Install (msys2) # requires msys2 shell
|
||||
if: inputs.msystem != ''
|
||||
run: |
|
||||
set -x
|
||||
"$CMAKE" --version
|
||||
"$CMAKE" ${{ env.CMAKE_ARGS }}
|
||||
# Reconfigure in the same build dir to catch Imath include-path
|
||||
# regressions on CMake reconfigure (see #2441).
|
||||
if [ "${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}" == "ON" ]; then
|
||||
"$CMAKE" ${{ env.CMAKE_ARGS }}
|
||||
fi
|
||||
if [ -n "${{ inputs.configure_install_prefix }}" ]; then
|
||||
"$CMAKE" --build "$BUILD_DIR" --config ${{ inputs.build-type }}
|
||||
"$CMAKE" --install "$BUILD_DIR" --prefix "$INSTALL_DIR" --config ${{ inputs.build-type }}
|
||||
else
|
||||
"$CMAKE" --build "$BUILD_DIR" --target install --config ${{ inputs.build-type }}
|
||||
fi
|
||||
shell: msys2 {0}
|
||||
|
||||
- name: Test OpenEXR.pc
|
||||
# Validate that OpenEXR.pc works by compiling/linking the test program
|
||||
if: runner.os == 'Linux' && inputs.OPENEXR_INSTALL_PKG_CONFIG == 'ON'
|
||||
run: |
|
||||
set -x
|
||||
if [ "${{ inputs.BUILD_SHARED_LIBS }}" == "OFF" ]; then
|
||||
ARGS="-static"
|
||||
fi
|
||||
share/ci/scripts/validate_pkgconfig.sh $INSTALL_DIR website/src/exrwriter/exrwriter.cpp $ARGS
|
||||
shell: bash
|
||||
|
||||
- name: Prepare install_manifest
|
||||
# Store the cmake command as the first line of the manifest,
|
||||
# and remove the path prefix, so the manifest contains only
|
||||
# the local filenames.
|
||||
run: |
|
||||
set -x
|
||||
INSTALL_MANIFEST_PATH="$BUILD_DIR/$INSTALL_MANIFEST_FILENAME"
|
||||
echo "# SPDX-License-Identifier: BSD-3-Clause" > $INSTALL_MANIFEST_PATH
|
||||
echo "# Copyright (c) Contributors to the OpenEXR Project." >> $INSTALL_MANIFEST_PATH
|
||||
echo "# cmake ${{ env.CMAKE_ARGS }}" >> $INSTALL_MANIFEST_PATH
|
||||
sort $BUILD_DIR/install_manifest.txt | sed -e "s:^.*/_install/::" >> $INSTALL_MANIFEST_PATH
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
# upload-artifact expects a windows-style path
|
||||
INSTALL_MANIFEST_PATH=$(cygpath -w $INSTALL_MANIFEST_PATH)
|
||||
fi
|
||||
echo INSTALL_MANIFEST_PATH=$INSTALL_MANIFEST_PATH >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Upload install_manifest.txt
|
||||
# Upload the manifest to make it possible to download for inspection and debugging
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: ${{ env.INSTALL_MANIFEST_FILENAME }}
|
||||
path: ${{ env.INSTALL_MANIFEST_PATH }}
|
||||
|
||||
- name: Validate install
|
||||
if: inputs.validate_install == 'ON'
|
||||
# Validate that the build has installed the proper files by
|
||||
# comparing against the appropriate reference manifest
|
||||
run: |
|
||||
set -x
|
||||
|
||||
# Extract "#define VAR VALUE" statements from OpenEXRConfig.h
|
||||
# and set corresponding env vars, which validate_install.py
|
||||
# substitutes in the manifest files. This confirms that the
|
||||
# manifests have the proper version strings in the library filenames.
|
||||
OpenEXRConfig=$INSTALL_DIR/include/OpenEXR/OpenEXRConfig.h
|
||||
for var in \
|
||||
OPENEXR_VERSION_MAJOR \
|
||||
OPENEXR_VERSION_MINOR \
|
||||
OPENEXR_VERSION_PATCH \
|
||||
OPENEXR_SOVERSION \
|
||||
OPENEXR_IMATH_VERSION_MAJOR \
|
||||
OPENEXR_IMATH_VERSION_MINOR \
|
||||
OPENEXR_IMATH_VERSION_PATCH \
|
||||
OPENEXR_IMATH_SOVERSION \
|
||||
OPENEXR_OPENJPH_VERSION_MAJOR \
|
||||
OPENEXR_OPENJPH_VERSION_MINOR \
|
||||
OPENEXR_OPENJPH_VERSION_PATCH; do
|
||||
export "$var"=$(grep -E "^#define[[:space:]]+$var" "$OpenEXRConfig" | awk '{print $3}')
|
||||
done
|
||||
|
||||
share/ci/scripts/validate_install.py "$INSTALL_MANIFEST_PATH" "share/ci/install_manifest/$INSTALL_MANIFEST_FILENAME"
|
||||
shell: bash
|
||||
|
||||
- name: Test
|
||||
if: inputs.BUILD_TESTING == 'ON' && inputs.RUN_TESTING == 'ON' && inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
export PATH="$OPENEXR_PATH:$PATH"
|
||||
fi
|
||||
"$CTEST" -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
|
||||
shell: bash
|
||||
|
||||
- name: Test (msys2) # requires msys2 shell
|
||||
if: inputs.BUILD_TESTING == 'ON' && inputs.RUN_TESTING == 'ON' && inputs.msystem != ''
|
||||
run: |
|
||||
set -x
|
||||
export PATH="$OPENEXR_PATH:$PATH"
|
||||
"$CTEST" -T Test -C ${{ inputs.build-type }} --test-dir $BUILD_DIR --timeout 7200 --output-on-failure -VV
|
||||
shell: msys2 {0}
|
||||
|
||||
- name: Test website examples
|
||||
# Build the "hello, world" exrwriter example program from the
|
||||
# website, both to confirm it builds and as an example of an
|
||||
# application building against the just-installed openexr
|
||||
# libary, to validate the cmake configuration for downstream
|
||||
# applications.
|
||||
if: inputs.namespace == '' && inputs.msystem == '' && inputs.OPENEXR_BUILD_EXAMPLES != ''
|
||||
run: |
|
||||
set -x
|
||||
EXRWRITER_BUILD_DIR=$WORKSPACE/_build.exrwriter
|
||||
"$CMAKE" -S website/src/exrwriter -B $EXRWRITER_BUILD_DIR \
|
||||
-DCMAKE_PREFIX_PATH=$INSTALL_DIR \
|
||||
-DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
"$CMAKE" --build $EXRWRITER_BUILD_DIR --config ${{ inputs.build-type }}
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
export PATH="$OPENEXR_PATH:$PATH"
|
||||
EXRWRITER=$EXRWRITER_BUILD_DIR/${{ inputs.build-type }}/exrwriter.exe
|
||||
EXRINFO=$INSTALL_DIR/bin/exrinfo.exe
|
||||
else
|
||||
EXRWRITER=$EXRWRITER_BUILD_DIR/exrwriter
|
||||
EXRINFO=$INSTALL_DIR/bin/exrinfo
|
||||
fi
|
||||
"$EXRWRITER"
|
||||
# Validate that the image is as expected
|
||||
if [ -x "$EXRINFO" ]; then
|
||||
expected_output=$(<website/src/exrwriter/stripes.exrinfo.txt)
|
||||
actual_output=$("$EXRINFO" stripes.exr)
|
||||
if [[ "$actual_output" != "$expected_output" ]]; then
|
||||
echo "error: exrwriter produced incorrect results:"
|
||||
echo $actual_output
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "skipping exrinfo, no tool found."
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- name: Test add_subdirectory
|
||||
# Build the "hello, world" exrwriter example program from the
|
||||
# src/test/add_subdirectory folder, which is the same program as
|
||||
# above but configured via add_subdirectory(ext/openexr).
|
||||
# Create ext/openexr as a symlink to the repo root. This
|
||||
# confirms that downstream applications can use openexr in
|
||||
# that way.
|
||||
if: inputs.msystem == ''
|
||||
run: |
|
||||
set -x
|
||||
"$CMAKE" --version
|
||||
SRC="$RUNNER_TEMP/add_subdirectory"
|
||||
cp -r "$WORKSPACE/src/test/add_subdirectory" "$SRC"
|
||||
cp "$WORKSPACE/website/src/exrwriter/exrwriter.cpp" "$SRC"
|
||||
mkdir -p "$SRC/ext"
|
||||
ln -s "$WORKSPACE" "$SRC/ext/openexr"
|
||||
ADD_SUBDIRECTORY_BUILD_DIR=$WORKSPACE/_build.add_subdirectory
|
||||
cmake_args=("-B" "$ADD_SUBDIRECTORY_BUILD_DIR" -S "$SRC")
|
||||
cmake_args+=("-DCMAKE_POLICY_VERSION_MINIMUM=3.26")
|
||||
cmake_args+=("-DCMAKE_VERBOSE_MAKEFILE=ON")
|
||||
if [ -n "${{ inputs.namespace }}" ]; then
|
||||
cmake_args+=("-DOPENEXR_IMF_NAMESPACE=${{ inputs.namespace }}")
|
||||
fi
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_IMATH=${{ inputs.OPENEXR_FORCE_INTERNAL_IMATH }}")
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_DEFLATE=${{ inputs.OPENEXR_FORCE_INTERNAL_DEFLATE }}")
|
||||
cmake_args+=("-DOPENEXR_FORCE_INTERNAL_OPENJPH=${{ inputs.OPENEXR_FORCE_INTERNAL_OPENJPH }}")
|
||||
cmake_args+=("-DOPENEXR_BUILD_EXAMPLES=OFF")
|
||||
cmake_args+=("-DOPENEXR_BUILD_TOOLS=OFF")
|
||||
quoted_args=$(printf '%q ' "${cmake_args[@]}")
|
||||
"$CMAKE" $quoted_args
|
||||
"$CMAKE" --build $ADD_SUBDIRECTORY_BUILD_DIR --config ${{ inputs.build-type }}
|
||||
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/exrwriter
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
export PATH="$OPENEXR_PATH:$PATH"
|
||||
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/${{ inputs.build-type }}/exrwriter.exe
|
||||
else
|
||||
EXRWRITER=$ADD_SUBDIRECTORY_BUILD_DIR/exrwriter
|
||||
fi
|
||||
$EXRWRITER
|
||||
shell: bash
|
||||
+280
-482
@@ -1,552 +1,350 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
|
||||
# The CI workflow uses steps defined in ci_steps.yml, via the "uses:"
|
||||
# directive. Linux, macOS, and Windows all share a common set of
|
||||
# configure/build/validate steps.
|
||||
|
||||
name: CI
|
||||
|
||||
# Skip the run on *.md changes and on changes to the website, *except*
|
||||
# for "website/src", since that code needs validation. There's a
|
||||
# separate workflow for with website. Also, no need to run on changes
|
||||
# to the bazel setup.
|
||||
# Run on all changes except:
|
||||
# - markdown/doc changes
|
||||
# - changes to the website, *except* for "website/src", since that
|
||||
# code needs validation. The website has a separate workflow
|
||||
# - changes to the bazel config (it has its own workflow
|
||||
# - changes to the python bindings (they have their own workflow)
|
||||
# - changes to workflows other than this one
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_workflow.yml'
|
||||
- '.github/workflows/ci_steps.yml'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_workflow.yml'
|
||||
- '.github/workflows/ci_steps.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
# NOTE: All jobs have a "build" number that appears in the "jobs"
|
||||
# listing on the GitHub actions page. This build number also
|
||||
# identifies the reference install manifest in
|
||||
# share/ci/install_manifest. The validate_install.py script compares
|
||||
# the job's generated install_manifest.txt to the reference file to
|
||||
# validate that the proper files have been installed.
|
||||
#
|
||||
# If you add jobs, you must add a corresponding
|
||||
# share/ci/install_manifest file.
|
||||
|
||||
jobs:
|
||||
# Linux jobs run in Docker containers, so the latest OS version is OK. macOS
|
||||
# and Windows jobs need to be locked to specific virtual environment
|
||||
# versions to mitigate issues from OS updates, and will require maintenance
|
||||
# as OS versions are retired.
|
||||
#
|
||||
# GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS
|
||||
# jobs. This workflow tries to utilize (but not exceed) that budget to
|
||||
# promote timely CI.
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Linux
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Add ARM build. Add sanitize build.
|
||||
|
||||
linux:
|
||||
name: 'Linux ${{ matrix.label }}VFXP-${{ matrix.vfx-cy }} centos7
|
||||
<${{ matrix.compiler-desc }},
|
||||
C++${{ matrix.cxx-standard }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
name: 'Linux.${{ matrix.build}}: ${{ matrix.label }}'
|
||||
permissions:
|
||||
contents: write # required by ci_steps (upload-artifact)
|
||||
uses: ./.github/workflows/ci_steps.yml
|
||||
with:
|
||||
# Set values for the "inputs:" as defined in ci_steps.yml
|
||||
# Note the defaults provided here for the builds that don't specify
|
||||
# values.
|
||||
os: ubuntu-latest
|
||||
build: ${{ matrix.build }}
|
||||
# DockerHub: https://hub.docker.com/u/aswf
|
||||
# Source: https://github.com/AcademySoftwareFoundation/aswf-docker
|
||||
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
|
||||
container: ${{ matrix.container || format('aswf/ci-openexr:{0}', matrix.vfx-cy || '2024') }}
|
||||
cmake: ${{ matrix.cmake || '3.14.7' }}
|
||||
cxx-standard: ${{ matrix.cxx-standard || '17' }}
|
||||
cxx-compiler: ${{ matrix.cxx-compiler || 'g++' }}
|
||||
cc-compiler: ${{ matrix.cc-compiler || 'gcc' }}
|
||||
build-type: ${{ matrix.build-type || 'Release' }}
|
||||
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
|
||||
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
|
||||
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
|
||||
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'ON' }}
|
||||
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
|
||||
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
|
||||
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
|
||||
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
|
||||
namespace: ${{ matrix.namespace }}
|
||||
validate_install: ${{ matrix.validate_install || 'ON' }}
|
||||
configure_install_prefix: ${{ matrix.configure_install_prefix }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
include:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - GCC
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
label: Release
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'OFF'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Shared, Debug
|
||||
- build: 3
|
||||
label: Debug
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# Static, Release
|
||||
- build: 3
|
||||
label: static
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
label: threads=OFF
|
||||
OPENEXR_ENABLE_THREADING: 'OFF'
|
||||
|
||||
# Shared, Release, C++14
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc11.2.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal deflate
|
||||
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
|
||||
OPENEXR_INSTALL_DOCS: 'OFF'
|
||||
OPENEXR_BUILD_EXAMPLES: 'OFF'
|
||||
OPENEXR_BUILD_TOOLS: 'OFF'
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
|
||||
BUILD_TESTING: 'OFF'
|
||||
configure_install_prefix: '.tmp'
|
||||
cmake: 3.15.7
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - Clang 15.0
|
||||
# -------------------------------------------------------------------
|
||||
# Release
|
||||
- build: 6
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: clang15.0
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
label: custom namespace
|
||||
namespace: 'TEST_NAMESPACE'
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - Clang 14.0
|
||||
# -------------------------------------------------------------------
|
||||
# Release
|
||||
- build: 7
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
label: clang
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
compiler-desc: clang14.0
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2023
|
||||
exclude-tests:
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 8
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc9.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2022
|
||||
exclude-tests:
|
||||
label: vfx2023
|
||||
vfx-cy: 2023
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2021 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 9
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 17
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc9.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2021
|
||||
exclude-tests:
|
||||
label: cmake 4
|
||||
cmake: 4.0.3
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2020 - GCC, Release
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 10
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
cxx-standard: 14
|
||||
cxx-compiler: g++
|
||||
cc-compiler: gcc
|
||||
compiler-desc: gcc6.3.1
|
||||
label:
|
||||
threads-enabled: 'ON'
|
||||
vfx-cy: 2020
|
||||
exclude-tests:
|
||||
label: clang c++20
|
||||
cxx-compiler: clang++
|
||||
cc-compiler: clang
|
||||
cxx-standard: 20
|
||||
RUN_TESTING: OFF
|
||||
validate_install: OFF
|
||||
|
||||
env:
|
||||
CXX: ${{ matrix.cxx-compiler }}
|
||||
CC: ${{ matrix.cc-compiler }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
- name: Install help2man
|
||||
run: yum install -y help2man
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='ON' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF' \
|
||||
-DOPENEXR_ENABLE_THREADING=${{ matrix.threads-enabled }}
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Validate
|
||||
run: |
|
||||
share/ci/scripts/linux/validate_openexr_libs.sh _install
|
||||
- name: Examples
|
||||
run: |
|
||||
# Make sure we can build the examples when configured as a
|
||||
# standalone application linking against the just-installed
|
||||
# OpenEXR library.
|
||||
cmake ../src/examples \
|
||||
-DCMAKE_PREFIX_PATH=../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
# Confirm the examples program runs
|
||||
./bin/OpenEXRExamples
|
||||
working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{ matrix.exclude-tests }} \
|
||||
-C ${{ matrix.build-type }} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
- build: 11
|
||||
label: gcc c++20
|
||||
cxx-standard: 20
|
||||
RUN_TESTING: OFF
|
||||
validate_install: OFF
|
||||
|
||||
- build: 12
|
||||
label: Fedora Rawhide
|
||||
container: fedora:rawhide
|
||||
cmake: '3.31.6'
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: 'OFF'
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
|
||||
OPENEXR_INSTALL_DOCS: 'OFF'
|
||||
validate_install: 'OFF'
|
||||
|
||||
- build: 13
|
||||
label: STATIC w/vendored OpenJPH
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
RUN_TESTING: OFF
|
||||
|
||||
macOS:
|
||||
name: 'macOS.${{ matrix.build}}: ${{ matrix.label }}'
|
||||
permissions:
|
||||
contents: write # required by ci_steps (upload-artifact)
|
||||
uses: ./.github/workflows/ci_steps.yml
|
||||
with:
|
||||
# Set values for the "inputs:" as defined in ci_steps.yml
|
||||
# Note the defaults provided here for the builds that don't specify
|
||||
# values.
|
||||
os: ${{ matrix.os || 'macos-15' }}
|
||||
build: ${{ matrix.build }}
|
||||
cc-compiler: ${{ matrix.cc-compiler || 'clang' }}
|
||||
cxx-compiler: ${{ matrix.cxx-compiler || 'clang++' }}
|
||||
cxx-standard: ${{ matrix.cxx-standard || '17' }}
|
||||
build-type: ${{ matrix.build-type || 'Release' }}
|
||||
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
|
||||
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
|
||||
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
|
||||
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'ON' }}
|
||||
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
|
||||
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
|
||||
CMAKE_OSX_ARCHITECTURES: ${{ matrix.CMAKE_OSX_ARCHITECTURES }}
|
||||
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
|
||||
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
|
||||
validate_install: ${{ matrix.validate_install || 'ON' }}
|
||||
configure_install_prefix: ${{ matrix.configure_install_prefix }}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# macOS
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Add ARM64/x86_64 (universal 2) build
|
||||
|
||||
macos:
|
||||
name: 'Mac VFXP-${{ matrix.vfx-cy }} macos-${{ matrix.osver }}
|
||||
<${{ matrix.compiler-desc }},
|
||||
C++${{ matrix.cxx-standard }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
runs-on: macos-${{ matrix.osver }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - MacOS 11.0
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
label: Release
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'OFF'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# Static, Release
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# Shared, Debug
|
||||
- build: 4
|
||||
label: Debug
|
||||
build-type: Debug
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 11.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - MacOS 12
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: AppleClang11.0
|
||||
cxx-standard: 17
|
||||
osver: 12.0
|
||||
exclude-tests:
|
||||
vfx-cy: 23
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='OFF' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
working-directory: _build
|
||||
- name: Examples
|
||||
run: |
|
||||
# Make sure we can build the examples when configured as a
|
||||
# standalone application linking against the just-installed
|
||||
# OpenEXR library.
|
||||
cmake ../src/examples \
|
||||
-DCMAKE_PREFIX_PATH=../../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
cmake --build . \
|
||||
--config ${{ matrix.build-type }}
|
||||
# Confirm the examples program runs
|
||||
./bin/OpenEXRExamples
|
||||
working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{matrix.exclude-tests }} \
|
||||
-C ${{matrix.build-type}} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Windows
|
||||
# ---------------------------------------------------------------------------
|
||||
# TODO: Debug mode is catatonically slow under windows
|
||||
windows:
|
||||
name: 'Windows VFXP-${{ matrix.vfx-cy }}
|
||||
<${{ matrix.compiler-desc }},
|
||||
config=${{ matrix.build-type }},
|
||||
shared=${{ matrix.build-shared }},
|
||||
cxx=${{ matrix.cxx-standard }},
|
||||
threads=${{ matrix.threads-enabled }}>'
|
||||
runs-on: windows-${{ matrix.osver }}
|
||||
strategy:
|
||||
matrix:
|
||||
build: [1, 2, 3, 4, 5]
|
||||
include:
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2023 - C++17 - Windows 2022 runner - MSVC 2022 (17.5)
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 1
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
|
||||
# Shared, Release, Threads OFF
|
||||
- build: 2
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'OFF'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
|
||||
# Static, Release
|
||||
- build: 3
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc17.5
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2023
|
||||
exclude-tests: ''
|
||||
osver: 2022
|
||||
label: static
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
|
||||
# -------------------------------------------------------------------
|
||||
# VFX CY2022 - C++17 - Windows 2019 runner - MSVC 2019 (16.11)
|
||||
# -------------------------------------------------------------------
|
||||
# Shared, Release
|
||||
- build: 4
|
||||
build-type: Release
|
||||
build-shared: 'ON'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc16.11
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2022
|
||||
exclude-tests: ''
|
||||
osver: 2019
|
||||
label: threads=OFF
|
||||
OPENEXR_ENABLE_THREADING: 'OFF'
|
||||
|
||||
# Static, Release
|
||||
- build: 5
|
||||
build-type: Release
|
||||
build-shared: 'OFF'
|
||||
threads-enabled: 'ON'
|
||||
compiler-desc: msvc16.11
|
||||
cxx-standard: 17
|
||||
vfx-cy: 2022
|
||||
exclude-tests: ''
|
||||
osver: 2019
|
||||
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
|
||||
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
|
||||
OPENEXR_INSTALL_DOCS: 'OFF'
|
||||
OPENEXR_BUILD_EXAMPLES: 'OFF'
|
||||
OPENEXR_BUILD_TOOLS: 'OFF'
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
|
||||
BUILD_TESTING: 'OFF'
|
||||
configure_install_prefix: '.tmp'
|
||||
cmake: 3.15.7
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
mkdir _examples
|
||||
shell: bash
|
||||
## - name: Install Dependences
|
||||
## run: |
|
||||
## share/ci/scripts/windows/install_python.ps1 ${{ matrix.python-version }} $HOME
|
||||
## share/ci/scripts/windows/install_boost.ps1 ${{ matrix.boost-version }} $HOME 3.8
|
||||
## share/ci/scripts/windows/install_zlib.ps1 ${{ matrix.zlib-version }} $HOME
|
||||
## shell: powershell
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=../_install \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
|
||||
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
|
||||
-DOPENEXR_INSTALL_TOOLS='ON' \
|
||||
-DOPENEXR_INSTALL_DOCS='OFF' \
|
||||
-DOPENEXR_RUN_FUZZ_TESTS='OFF'
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target install \
|
||||
--config ${{ matrix.build-type }}
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
## - name: Examples
|
||||
## run: |
|
||||
## # Make sure we can build the examples when configured as a
|
||||
## # standalone application linking against the just-installed
|
||||
## # OpenEXR library.
|
||||
## cmake ../src/examples \
|
||||
## -DCMAKE_PREFIX_PATH=../../_install \
|
||||
## -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
|
||||
## -DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
|
||||
## -DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }}
|
||||
## cmake --build . \
|
||||
## --config ${{ matrix.build-type }}
|
||||
## # Confirm the examples program runs
|
||||
## ./bin/OpenEXRExamples
|
||||
## shell: bash
|
||||
## working-directory: _examples
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test ${{ matrix.exclude-tests }} \
|
||||
-C ${{ matrix.build-type }} \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
shell: bash
|
||||
working-directory: _build
|
||||
- build: 6
|
||||
label: macos-15-intel
|
||||
os: macos-15-intel
|
||||
|
||||
- build: 7
|
||||
label: macos-14
|
||||
os: macos-14
|
||||
|
||||
- build: 8
|
||||
label: universal2
|
||||
CMAKE_OSX_ARCHITECTURES: "x86_64;arm64"
|
||||
|
||||
- build: 9
|
||||
label: clang c++20
|
||||
cxx-standard: 20
|
||||
RUN_TESTING: OFF
|
||||
validate_install: OFF
|
||||
|
||||
- build: 10
|
||||
label: gcc c++20
|
||||
cc-compiler: gcc
|
||||
cxx-compiler: g++
|
||||
cxx-standard: 20
|
||||
RUN_TESTING: OFF
|
||||
validate_install: OFF
|
||||
|
||||
windows:
|
||||
name: 'Windows.${{ matrix.build}}: ${{ matrix.label }}'
|
||||
permissions:
|
||||
contents: write # required by ci_steps (upload-artifact)
|
||||
uses: ./.github/workflows/ci_steps.yml
|
||||
with:
|
||||
# Set values for the "inputs:" as defined in ci_steps.yml
|
||||
# Note the defaults provided here for the builds that don't specify
|
||||
# values.
|
||||
os: ${{ matrix.os || 'windows-2022' }}
|
||||
build: ${{ matrix.build }}
|
||||
cxx-standard: ${{ matrix.cxx-standard || '17' }}
|
||||
build-type: ${{ matrix.build-type || 'Release' }}
|
||||
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
|
||||
OPENEXR_ENABLE_THREADING: ${{ matrix.OPENEXR_ENABLE_THREADING || 'ON' }}
|
||||
OPENEXR_INSTALL_PKG_CONFIG: ${{ matrix.OPENEXR_INSTALL_PKG_CONFIG || 'ON' }}
|
||||
OPENEXR_INSTALL_DOCS: ${{ matrix.OPENEXR_INSTALL_DOCS || 'OFF' }}
|
||||
OPENEXR_BUILD_EXAMPLES: ${{ matrix.OPENEXR_BUILD_EXAMPLES || 'ON' }}
|
||||
OPENEXR_BUILD_TOOLS: ${{ matrix.OPENEXR_BUILD_TOOLS || 'ON' }}
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: ${{ matrix.OPENEXR_FORCE_INTERNAL_IMATH || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: ${{ matrix.OPENEXR_FORCE_INTERNAL_DEFLATE || 'OFF' }}
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: ${{ matrix.OPENEXR_FORCE_INTERNAL_OPENJPH || 'OFF' }}
|
||||
msystem: ${{ matrix.msystem }}
|
||||
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
|
||||
RUN_TESTING: ${{ matrix.RUN_TESTING || 'ON' }}
|
||||
validate_install: ${{ matrix.validate_install || 'ON' }}
|
||||
configure_install_prefix: ${{ matrix.configure_install_prefix }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- build: 1
|
||||
label: Release
|
||||
|
||||
- build: 2
|
||||
label: Debug
|
||||
build-type: Debug
|
||||
|
||||
- build: 3
|
||||
label: static
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
|
||||
- build: 4
|
||||
label: threads=OFF
|
||||
# TODO: this currently fails to compile; switch to OFF once the fix is in.
|
||||
OPENEXR_ENABLE_THREADING: 'ON'
|
||||
|
||||
- build: 5
|
||||
label: pkgconfig=OFF, examples=OFF, tools=OFF, docs=OFF, internal imath+deflate
|
||||
OPENEXR_INSTALL_PKG_CONFIG: 'OFF'
|
||||
OPENEXR_INSTALL_DOCS: 'OFF'
|
||||
OPENEXR_BUILD_EXAMPLES: 'OFF'
|
||||
OPENEXR_BUILD_TOOLS: 'OFF'
|
||||
OPENEXR_FORCE_INTERNAL_IMATH: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_DEFLATE: 'ON'
|
||||
OPENEXR_FORCE_INTERNAL_OPENJPH: 'ON'
|
||||
BUILD_TESTING: 'OFF'
|
||||
configure_install_prefix: '.tmp'
|
||||
cmake: 3.15.7
|
||||
|
||||
- build: 6
|
||||
label: vfx2023
|
||||
os: windows-2022
|
||||
|
||||
# Build w/msys2, mingw32 and ucrt64, shared and static.
|
||||
|
||||
- build: 7
|
||||
label: msys2-mingw32
|
||||
msystem: MINGW32
|
||||
|
||||
- build: 8
|
||||
label: msys2-mingw32, static
|
||||
msystem: MINGW32
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
|
||||
- build: 9
|
||||
label: msys2-ucrt64
|
||||
msystem: UCRT64
|
||||
|
||||
- build: 10
|
||||
label: msys2-ucrt64, static
|
||||
msystem: UCRT64
|
||||
BUILD_SHARED_LIBS: 'OFF'
|
||||
|
||||
- build: 11
|
||||
label: c++20
|
||||
cxx-standard: 20
|
||||
RUN_TESTING: OFF
|
||||
validate_install: OFF
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: CI-old
|
||||
|
||||
# Build for VFX reference platform prior to 2023, which requires a
|
||||
# workaround to run an old version of glibc required by the ASWF Docker
|
||||
# images.
|
||||
#
|
||||
# This doesn't easily integrate with the existing CI workflow, and it
|
||||
# can be depreciated entirely once we've moved beyond support for the
|
||||
# old CentOS-based VFX reference platform years.
|
||||
#
|
||||
# See this discussion for details:
|
||||
# https://academysoftwarefdn.slack.com/archives/C0169RX7MMK/p1732574400981949
|
||||
|
||||
|
||||
# Run on all changes except:
|
||||
# - doc file changes
|
||||
# - changes to the website, *except* for "website/src", since that
|
||||
# code needs validation. The website has a separate workflow
|
||||
# - changes to the bazel config, since it has its own workflow
|
||||
# - changes to the python bindings
|
||||
# - changes to workflows other than this one
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!share/ci/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_workflow_old.yml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!share/ci/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ci_workflow_old.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
linux:
|
||||
name: 'Linux vfx${{ matrix.vfx-cy }}'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: aswf/ci-openexr:${{ matrix.vfx-cy }}
|
||||
volumes:
|
||||
- /node20217:/node20217:rw,rshared
|
||||
- /node20217:/__e/node20:ro,rshared
|
||||
|
||||
env:
|
||||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
|
||||
- build: 2022
|
||||
vfx-cy: 2022
|
||||
|
||||
- build: 2021
|
||||
vfx-cy: 2021
|
||||
|
||||
steps:
|
||||
- name: install nodejs20glibc2.17
|
||||
run: |
|
||||
curl --silent https://unofficial-builds.nodejs.org/download/release/v20.18.1/node-v20.18.1-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 -f -
|
||||
- name: Checkout
|
||||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
||||
- name: Create build directories
|
||||
run: |
|
||||
mkdir _install
|
||||
mkdir _build
|
||||
- name: Configure
|
||||
run: |
|
||||
cmake -B _build -S . \
|
||||
-DCMAKE_INSTALL_PREFIX=_install \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL='ON'
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build _build \
|
||||
--target install \
|
||||
--config Release
|
||||
- name: Test
|
||||
run: |
|
||||
ctest -T Test \
|
||||
-C Release \
|
||||
--timeout 7200 \
|
||||
--output-on-failure \
|
||||
-VV
|
||||
working-directory: _build
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "**/**" ]
|
||||
pull_request:
|
||||
branches: [ "main", "**/**" ]
|
||||
schedule:
|
||||
- cron: '37 10 * * 0'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze (${{ matrix.language }})
|
||||
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
||||
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
||||
# - https://gh.io/supported-runners-and-hardware-resources
|
||||
# - https://gh.io/using-larger-runners (GitHub.com only)
|
||||
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
# required for all workflows
|
||||
security-events: write
|
||||
|
||||
# only required for workflows in private repositories
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- language: c-cpp
|
||||
build-mode: autobuild
|
||||
- language: python
|
||||
build-mode: none
|
||||
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
||||
# Use `c-cpp` to analyze code written in C, C++ or both
|
||||
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
||||
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
||||
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
||||
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
||||
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
# cary: Pin the version to the SHA for 2.18.0, since there appears to
|
||||
# be a problem with 2.18.1 leading to a "No space left on
|
||||
# device" failure
|
||||
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
||||
with:
|
||||
# cary: the "linked" setting is necessary to force the run to pick up
|
||||
# the version specified in the action.
|
||||
tools: linked
|
||||
languages: ${{ matrix.language }}
|
||||
build-mode: ${{ matrix.build-mode }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
# If the analyze step fails for one of the languages you are analyzing with
|
||||
# "We were unable to automatically build your code", modify the matrix above
|
||||
# to set the build mode to "manual" for that language. Then modify this step
|
||||
# to build your code.
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
- if: matrix.build-mode == 'manual'
|
||||
run: |
|
||||
echo 'If you are using a "manual" build mode for one or more of the' \
|
||||
'languages you are analyzing, replace this with the commands to build' \
|
||||
'your code, for example:'
|
||||
echo ' make bootstrap'
|
||||
echo ' make release'
|
||||
exit 1
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
# Pin the version to the SHA for 2.18.0
|
||||
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
# For pull_request, upload against refs/pull/<n>/head + head SHA so the Code
|
||||
# Scanning API does not require refs/heads/<branch> (e.g. Dependabot branches
|
||||
# can trigger "ref ... not found"). Ignored for fork PRs by the action.
|
||||
ref: ${{ github.event_name == 'pull_request' && format('refs/pull/{0}/head', github.event.pull_request.number) || github.ref }}
|
||||
sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
@@ -8,27 +8,23 @@ name: OSS-Fuzz
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ossfuzz_workflow.yml'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- '!bazel/**'
|
||||
- '!src/wrappers/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/ossfuzz_workflow.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -39,20 +35,20 @@ jobs:
|
||||
steps:
|
||||
- name: Build Fuzzers
|
||||
id: build
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openexr'
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Run Fuzzers
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@32f1d4deadc82279ec9001a837f2424e185c69a2 # master
|
||||
with:
|
||||
oss-fuzz-project-name: 'openexr'
|
||||
fuzz-seconds: 300
|
||||
dry-run: false
|
||||
language: c++
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
name: Publish python distribution 📦 to TestPyPI
|
||||
|
||||
on:
|
||||
|
||||
# Publish python wheels to test.pypi when a release candidate is tagged,
|
||||
# e.g. v3.4.5-rc, v3.4.5-rc6, etc.
|
||||
|
||||
push:
|
||||
tags:
|
||||
- v3.[0-9]+.[0-9]+-rc*
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: testpypi-publish-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
guard:
|
||||
name: Verify RB-* release ref
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Verify RB-* release ref
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$REF_NAME" != RB-* ]]; then
|
||||
echo "::error::workflow_dispatch must use an RB-* branch (not $REF_NAME)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git fetch origin '+refs/heads/RB-*:refs/remotes/origin/RB-*' || git fetch origin
|
||||
|
||||
if ! git branch -r --contains HEAD | grep -E -q 'origin/RB-'; then
|
||||
echo "::error::Ref must be on an RB-* release branch (not main)."
|
||||
git branch -r --contains HEAD || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build:
|
||||
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
|
||||
needs: guard
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
arch: x64
|
||||
- os: ubuntu-24.04-arm
|
||||
arch: arm64
|
||||
- os: macos-15-intel
|
||||
arch: x64
|
||||
cibw_archs_macos: x86_64 universal2
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
cibw_archs_macos: arm64
|
||||
- os: windows-latest
|
||||
arch: x64
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Install Python
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Create sdist
|
||||
# Only create it once.
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
env:
|
||||
OPENEXR_RELEASE_CANDIDATE_TAG: ${{ github.ref_name }}
|
||||
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
|
||||
|
||||
- name: Build wheel
|
||||
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
|
||||
with:
|
||||
output-dir: wheelhouse
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||
# Split macOS arches across runners so artifact merge does not collide on filenames.
|
||||
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
|
||||
# Build Python 3.9 through 3.13.
|
||||
# Skip 32-bit wheels builds on Windows
|
||||
# Also skip the PyPy builds, since they fail the unit tests
|
||||
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
|
||||
CIBW_SKIP: "*-win32 *_i686"
|
||||
CIBW_ENVIRONMENT: OPENEXR_RELEASE_CANDIDATE_TAG="${{ github.ref_name }}"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: |
|
||||
./wheelhouse/*.whl
|
||||
./wheelhouse/*.tar.gz
|
||||
|
||||
publish-to-testpypi:
|
||||
name: Publish Python 🐍 distribution 📦 to TestPyPI
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
environment:
|
||||
name: testpypi
|
||||
url: https://test.pypi.org/p/openexr
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Download wheel artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: wheels-*
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
|
||||
- name: Publish distribution 📦 to TestPyPI
|
||||
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
||||
with:
|
||||
repository-url: https://test.pypi.org/legacy/
|
||||
@@ -0,0 +1,135 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
name: Publish python distribution 📦 to PyPI
|
||||
|
||||
on:
|
||||
# Publish wheels to pypi on release
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: pypi-publish-${{ github.event.release.tag_name || github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
guard:
|
||||
name: Verify RB-* release ref
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event_name == 'release' && github.event.release.tag_name || github.ref }}
|
||||
|
||||
- name: Verify RB-* release ref
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
REF_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "$EVENT_NAME" == "workflow_dispatch" && "$REF_NAME" != RB-* ]]; then
|
||||
echo "::error::workflow_dispatch must use an RB-* branch (not $REF_NAME)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git fetch origin '+refs/heads/RB-*:refs/remotes/origin/RB-*' || git fetch origin
|
||||
|
||||
if ! git branch -r --contains HEAD | grep -E -q 'origin/RB-'; then
|
||||
echo "::error::Ref must be on an RB-* release branch (not main)."
|
||||
git branch -r --contains HEAD || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build:
|
||||
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
|
||||
needs: guard
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
arch: x64
|
||||
- os: ubuntu-24.04-arm
|
||||
arch: arm64
|
||||
- os: macos-15-intel
|
||||
arch: x64
|
||||
cibw_archs_macos: x86_64 universal2
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
cibw_archs_macos: arm64
|
||||
- os: windows-latest
|
||||
arch: x64
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- name: Install Python
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Create sdist
|
||||
# Only create it once.
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
|
||||
|
||||
- name: Build wheel
|
||||
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
|
||||
with:
|
||||
output-dir: wheelhouse
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.15
|
||||
# Split macOS arches across runners so artifact merge does not collide on filenames.
|
||||
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
|
||||
# Build Python 3.9 through 3.13
|
||||
# Skip 32-bit wheels builds on Windows
|
||||
# Also skip the PyPy builds, since they fail the unit tests
|
||||
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
|
||||
CIBW_SKIP: "*-win32 *_i686"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: |
|
||||
./wheelhouse/*.whl
|
||||
./wheelhouse/*.tar.gz
|
||||
|
||||
publish-to-pypi:
|
||||
name: Publish Python 🐍 distribution 📦 to PyPI
|
||||
needs:
|
||||
- build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/openexr
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Download wheel artifacts
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: wheels-*
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
|
||||
- name: Publish distribution 📦 to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
||||
@@ -1,82 +1,154 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
|
||||
name: Python wheels
|
||||
name: Python Wheels
|
||||
|
||||
on:
|
||||
|
||||
# Run on all changes (PR and push) to the python binding
|
||||
# source/configuration files, except on the release branches, which
|
||||
# have their own workflow, which also publish to pypi/test.pypi.
|
||||
# Note that changes to the core libraries will *not*
|
||||
# trigger building the wheels. However, the main ci workflow does
|
||||
# build and test the bindings (for a single python version on a
|
||||
# single arch)
|
||||
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- 'cmake/**'
|
||||
- 'src/lib/**'
|
||||
- 'src/wrappers/python/**'
|
||||
- 'pyproject.toml'
|
||||
- '!share/ci/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/python-wheels.yml'
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-2.*
|
||||
tags-ignore:
|
||||
- v1.*
|
||||
- v2.*
|
||||
paths:
|
||||
- '**'
|
||||
- '!**.md'
|
||||
- '!website/**'
|
||||
- 'website/src/**'
|
||||
- '!bazel/**'
|
||||
- 'cmake/**'
|
||||
- 'src/lib/**'
|
||||
- 'src/wrappers/python/**'
|
||||
- 'pyproject.toml'
|
||||
- '!share/ci/**'
|
||||
- '!.github/workflows/**'
|
||||
- '.github/workflows/python-wheels.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build_wheels:
|
||||
name: Build Python wheels
|
||||
name: Python Wheels - ${{ matrix.os }}-${{ matrix.arch }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, windows-latest, macOS-latest]
|
||||
env:
|
||||
# Skip 32-bit wheels builds.
|
||||
# Also skip the PyPy builds, since they fail the unittests
|
||||
CIBW_SKIP: "*-win32 *_i686 pp*"
|
||||
CIBW_BEFORE_BUILD: >
|
||||
echo "Installing OpenEXR..." &&
|
||||
cd openexr.build &&
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../openexr.install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_PREFIX_PATH=../openexr.install -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF -DOPENEXR_INSTALL_EXAMPLES=OFF -DOPENEXR_BUILD_TOOLS=OFF -DBUILD_SHARED_LIBS=OFF -DOPENEXR_FORCE_INTERNAL_DEFLATE=ON -DOPENEXR_FORCE_INTERNAL_IMATH=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON ../ &&
|
||||
cmake --build ./ --config Release --clean-first &&
|
||||
cmake --install ./ --config Release &&
|
||||
cd ..
|
||||
CIBW_TEST_REQUIRES: pytest
|
||||
CIBW_TEST_COMMAND: pytest {project}/src/wrappers/python/tests/
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
arch: x64
|
||||
- os: ubuntu-24.04-arm
|
||||
arch: arm64
|
||||
- os: macos-15-intel
|
||||
arch: x64
|
||||
cibw_archs_macos: x86_64 universal2
|
||||
- os: macos-latest
|
||||
arch: arm64
|
||||
cibw_archs_macos: arm64
|
||||
- os: windows-latest
|
||||
arch: x64
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
# Used to host cibuildwheel
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Install Python
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
||||
with:
|
||||
python-version: '3.x'
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install cibuildwheel
|
||||
run: python -m pip install cibuildwheel==2.8.1
|
||||
- name: Create sdist
|
||||
# Only create it once.
|
||||
if: ${{ matrix.os == 'ubuntu-latest' }}
|
||||
run: pipx run build==1.2.2.post1 --sdist . --outdir wheelhouse
|
||||
|
||||
- name: Create setup.py
|
||||
run: |
|
||||
mv ${{github.workspace}}/src/wrappers/python/setup.py ${{github.workspace}}/setup.py
|
||||
mv ${{github.workspace}}/src/wrappers/python/Imath.py ${{github.workspace}}/Imath.py
|
||||
mv ${{github.workspace}}/src/wrappers/python/OpenEXR.cpp ${{github.workspace}}/OpenEXR.cpp
|
||||
|
||||
- name: Create folders
|
||||
run: |
|
||||
mkdir -p ${{github.workspace}}/openexr.build
|
||||
mkdir -p ${{github.workspace}}/openexr.install
|
||||
|
||||
- name: Build wheels
|
||||
run: python -m cibuildwheel --output-dir wheelhouse
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- name: Build wheel
|
||||
uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0
|
||||
with:
|
||||
name: "Python wheels"
|
||||
path: ./wheelhouse/*.whl
|
||||
output-dir: wheelhouse
|
||||
env:
|
||||
# Split macOS arches across runners so artifact merge does not collide on filenames.
|
||||
CIBW_ARCHS_MACOS: ${{ matrix.cibw_archs_macos }}
|
||||
# Build Python 3.9 through 3.13
|
||||
# Skip 32-bit wheels builds on Windows
|
||||
# Also skip the PyPy builds, since they fail the unit tests
|
||||
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*"
|
||||
CIBW_SKIP: "*-win32 *_i686"
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: |
|
||||
./wheelhouse/*.whl
|
||||
./wheelhouse/*.tar.gz
|
||||
|
||||
verify_publish_artifacts:
|
||||
name: Verify merged wheel artifacts
|
||||
needs: build_wheels
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
steps:
|
||||
- name: Download wheel artifacts separately
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: wheels-*
|
||||
path: artifacts
|
||||
|
||||
- name: Detect duplicate distribution filenames
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
mapfile -t dupes < <(
|
||||
find artifacts -type f \( -name '*.whl' -o -name '*.tar.gz' \) -exec basename {} \; \
|
||||
| sort \
|
||||
| uniq -d
|
||||
)
|
||||
|
||||
if ((${#dupes[@]} > 0)); then
|
||||
echo "::error::Duplicate distribution filenames across build artifacts:"
|
||||
printf ' %s\n' "${dupes[@]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Download wheel artifacts (as publish does)
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
pattern: wheels-*
|
||||
merge-multiple: true
|
||||
path: dist
|
||||
|
||||
- name: Verify wheel ZIP integrity
|
||||
run: |
|
||||
set -euo pipefail
|
||||
shopt -s nullglob
|
||||
|
||||
wheels=(dist/*.whl)
|
||||
if ((${#wheels[@]} == 0)); then
|
||||
echo "::error::No wheels found in dist/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for wheel in "${wheels[@]}"; do
|
||||
echo "Checking $wheel"
|
||||
python3 -m zipfile -t "$wheel"
|
||||
done
|
||||
|
||||
- name: Validate distribution metadata
|
||||
run: pipx run twine==6.1.0 check dist/*
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
name: Publish Release Notice to ASWF Slack
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
# published should cover both 'released' and 'prereleased'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
|
||||
steps:
|
||||
- name: 'Notify Slack #release-announcements'
|
||||
id: slack1
|
||||
with:
|
||||
project_name: "OpenEXR"
|
||||
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
slack_channel: "#release-announcements"
|
||||
project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png"
|
||||
uses: jmertic/slack-release-notifier@9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a # main
|
||||
|
||||
- name: 'Notify Slack #openexr'
|
||||
id: slack2
|
||||
with:
|
||||
project_name: "OpenEXR"
|
||||
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
slack_channel: "#openexr"
|
||||
project_logo: "https://artwork.aswf.io/projects/openexr/icon/color/openexr-icon-color.png"
|
||||
uses: jmertic/slack-release-notifier@9d7d3a84563d2ebc8f7b2271be6c9568fedd7f3a # main
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
#
|
||||
# Releases are signed via https://github.com/sigstore/sigstore-python.
|
||||
# See https://docs.sigstore.dev for information about sigstore.
|
||||
#
|
||||
# This action creates a .tar.gz of the complete OpenEXR source tree at
|
||||
# the given release tag, signs it via sigstore, and uploads the
|
||||
# .tar.gz and the associated .tar.gz.sigstore credential bundle.
|
||||
#
|
||||
# To verify a downloaded release at a given tag:
|
||||
#
|
||||
# % pip install sigstore
|
||||
# % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/openexr/.github/workflows/release-sign.yml@refs/tags/<tag> openexr-<tag>.tar.gz
|
||||
#
|
||||
# To sign an existing release after publish (e.g. workflow fix): Actions →
|
||||
# Sign Release → Run workflow → enter the release tag (e.g. v3.2.8).
|
||||
|
||||
name: Sign Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Release tag to sign (e.g. v3.2.8)"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Sign & upload release artifacts
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }}
|
||||
permissions:
|
||||
contents: write # required for gh release upload (attach assets)
|
||||
id-token: write # required for sigstore OIDC signing
|
||||
steps:
|
||||
|
||||
- name: Set Prefix
|
||||
# The tag name begins with a 'v', e.g. "v3.2.4", but the prefix
|
||||
# should omit the 'v', so the tarball "openexr-3.2.4.tar.gz"
|
||||
# extracts files into "openexr-v3.2.4/...". This matches
|
||||
# the GitHub release page autogenerated artifact conventions.
|
||||
run: |
|
||||
echo OPENEXR_PREFIX=openexr-${TAG//v}/ >> $GITHUB_ENV
|
||||
echo OPENEXR_TARBALL=openexr-${TAG//v}.tar.gz >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
||||
|
||||
- name: Create archive
|
||||
run: git archive --format=tar.gz -o ${OPENEXR_TARBALL} --prefix ${OPENEXR_PREFIX} ${TAG}
|
||||
|
||||
- name: Sign archive with Sigstore
|
||||
uses: sigstore/gh-action-sigstore-python@5b79a39c381910c090341a2c9b0bf022c8b387e1 # v3.4.0
|
||||
with:
|
||||
inputs: ${{ env.OPENEXR_TARBALL }}
|
||||
upload-signing-artifacts: false
|
||||
release-signing-artifacts: false
|
||||
|
||||
- name: Upload release archive
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: gh release upload ${TAG} ${OPENEXR_TARBALL} ${OPENEXR_TARBALL}.sigstore.json
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
name: Scorecard supply-chain security
|
||||
on:
|
||||
# For Branch-Protection check. Only the default branch is supported. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
|
||||
branch_protection_rule:
|
||||
# To guarantee Maintained check is occasionally updated. See
|
||||
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
|
||||
schedule:
|
||||
- cron: '32 3 * * 1'
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional)
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
name: Snyk Scan Code
|
||||
|
||||
on:
|
||||
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
|
||||
schedule:
|
||||
- cron: "0 4 * * 0"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
snyk-scan-pr:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'AcademySoftwareFoundation/openexr'
|
||||
steps:
|
||||
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
|
||||
- uses: snyk/actions/setup@9adf32b1121593767fc3c057af55b55db032dc04 # v1.0.0
|
||||
id: snyk
|
||||
|
||||
- name: Snyk version
|
||||
run: echo "${{ steps.snyk.outputs.version }}"
|
||||
|
||||
- name: Snyk Auth
|
||||
run: snyk auth ${{ secrets.SNYK_TOKEN }}
|
||||
|
||||
- name: Snyk Scan Code
|
||||
# Scan the C/C++ code for vulnerabilities using the Snyk CLI with the unmanaged flag
|
||||
# https://docs.snyk.io/scan-using-snyk/supported-languages-and-frameworks/c-c++ for options
|
||||
run: snyk test --unmanaged --print-dep-paths --org=${{ secrets.SNYK_ORG }}
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
continue-on-error: true # optional
|
||||
|
||||
- name: Monitor for Vulnerabilities
|
||||
# To import the test results (issues and dependencies) in the Snyk CLI, run the snyk monitor --unmanaged command:
|
||||
run: snyk monitor --unmanaged --org=${{ secrets.SNYK_ORG }}
|
||||
env:
|
||||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||
continue-on-error: true # optional
|
||||
@@ -0,0 +1,77 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Website
|
||||
|
||||
# Run only on changes in the "website" directory or workflow file.
|
||||
# Skip the release branches, since the website is built from main.
|
||||
#
|
||||
# Readthedocs builds the website on ubuntu-20.04, so technically
|
||||
# that's the only system that requires the website to build properly,
|
||||
# but developers contributing to the website may work on Windows or
|
||||
# macOS, so this confirms that it builds properly there, too.
|
||||
#
|
||||
# Note that this does not build the OpenEXR libraries, it only runs
|
||||
# doxygen and sphinx to generate the website html.
|
||||
#
|
||||
|
||||
on:
|
||||
|
||||
push:
|
||||
branches-ignore:
|
||||
- RB-*
|
||||
paths:
|
||||
- 'website/**'
|
||||
- '.github/workflows/website.yml'
|
||||
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- RB-*
|
||||
paths:
|
||||
- 'website/**'
|
||||
- '.github/workflows/website.yml'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
Website:
|
||||
|
||||
name: "Website"
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
env:
|
||||
# doxygen 1.10 causes sphinx to fail, so pin to 1.9 for now.
|
||||
DOXYGEN_VERSION: 1.9.1
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
||||
- name: Create build directory
|
||||
run: mkdir _build
|
||||
- name: Install doxygen
|
||||
run: ./website/scripts/install_doxygen.sh ${DOXYGEN_VERSION}
|
||||
shell: bash
|
||||
- name: Install sphinx requirements
|
||||
run: |
|
||||
python3 -m venv _venv
|
||||
source _venv/*/activate
|
||||
pip3 install --require-hashes -r ../website/requirements-lock.txt
|
||||
cmake .. -DBUILD_WEBSITE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DSPHINX_OPTS=""
|
||||
working-directory: _build
|
||||
shell: bash
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . --target website --config Release
|
||||
working-directory: _build
|
||||
shell: bash
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# GitHub Actions workflow file
|
||||
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
||||
|
||||
name: Website
|
||||
|
||||
# Run only on changes in the "website" directory.
|
||||
# Skip the release branches, since the website is built from main.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:-ignore:
|
||||
- RB-2.*
|
||||
- RB-3.*
|
||||
paths:
|
||||
- 'website/**'
|
||||
|
||||
pull_request:
|
||||
branches:-ignore:
|
||||
- RB-2.*
|
||||
- RB-3.*
|
||||
paths:
|
||||
- 'website/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
Website:
|
||||
|
||||
# Build the website, using a process that mimics the readthedoc build.
|
||||
#
|
||||
# Note that this job does not actually build OpenEXR libraries or
|
||||
# programs, it just runs doxygen, sphinx, and the
|
||||
# website/script/test_images.py script to generate the "Test Images"
|
||||
# page.
|
||||
|
||||
name: 'Website'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Create build directory
|
||||
run: mkdir _build
|
||||
- name: Install doxygen & imagemagick
|
||||
# Need imagemagick for convert, to convert "Test Image" exrs to jpgs
|
||||
# Need openexr for exrheader
|
||||
run: sudo apt-get install -y doxygen imagemagick openexr
|
||||
- name: Install sphinx requirements
|
||||
run: pip3 install -r website/requirements.txt
|
||||
- name: Configure
|
||||
run: cmake .. -DBUILD_WEBSITE='ON'
|
||||
working-directory: _build
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build . \
|
||||
--target website \
|
||||
--config Release
|
||||
working-directory: _build
|
||||
|
||||
@@ -48,12 +48,20 @@ Contrib/DtexToExr/DtexToExr
|
||||
*.cproject
|
||||
.DS_Store
|
||||
abi_check
|
||||
_build/
|
||||
build/
|
||||
build-win/
|
||||
build-nuget/
|
||||
*~
|
||||
.vscode
|
||||
docs/_test_images/
|
||||
dist/*
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.swp
|
||||
|
||||
# Ignore Bazel generated files
|
||||
bazel-*
|
||||
MODULE.bazel.lock
|
||||
*.vsidx
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
#
|
||||
# This file establishes email equivalences so we can resolve what look like
|
||||
# multiple authors, but actually are the same author who has used multiple
|
||||
# emails over the course of their involvement with the project.
|
||||
#
|
||||
# The format is any of the following:
|
||||
# <CANONICAL-EMAIL> <alternate-email>
|
||||
# CANONICAL-NAME <CANONICAL-EMAIL> <alternate-email>
|
||||
# CANONICAL-NAME <CANONICAL-EMAIL> alternate-name <alternate-email>
|
||||
#
|
||||
# You can check for duplicates with this command:
|
||||
# git shortlog -sne --all
|
||||
# That command (and others) will use this file to collapse the duplicates.
|
||||
#
|
||||
# If you see any duplicates we don't account for here, or if you look at your
|
||||
# own entry here and want a different name or email to be your canonical one
|
||||
# (we may not have guessed correctly and matched your preferences), please
|
||||
# file a PR with the edits to this file.
|
||||
|
||||
Aaron Demolder <aaron.demolder@gmail.com>
|
||||
Abe Fettig <abe@fettig.net>
|
||||
Aloys Baillet <aloys.baillet+github@gmail.com> aloysb <aloysb@al.com.au>
|
||||
Andrew Kunz <akunz@ilm.com>
|
||||
Anton Dukhovnikov <antond@wetafx.co.nz> Anton Dukhovnikov <131838425+antond-weta@users.noreply.github.com>
|
||||
Antonio Rojas <arojas@archlinux.org>
|
||||
Aras Pranckevičius <nearaz@gmail.com> Aras Pranckevičius <aras@nesnausk.org>
|
||||
Aras Pranckevičius <nearaz@gmail.com> Aras Pranckevičius <aras@unity3d.com>
|
||||
Arkady Shapkin <arkady.shapkin@gmail.com>
|
||||
Arkell Rasiah <arkellrasiah@gmail.com> Arkell Rasiah <arasiah@ilm.com>
|
||||
Arkell Rasiah <arkellrasiah@gmail.com> Arkell Rasiah <arasiah@pixsystem.com>
|
||||
Axel Waggershauser <awagger@gmail.com>
|
||||
axxel <awagger@gmail.com>
|
||||
Balázs Oroszi <ignus2@users.noreply.github.com>
|
||||
Barnaby Robson <brobson@ilm.com> Barnaby Robson <mail@barnaby.org>
|
||||
Ben Grimes <72311676+MrGlobby@users.noreply.github.com>
|
||||
Bernd <waebbl-gentoo@posteo.net>
|
||||
Brendan Bolles <brendan@fnordware.com>
|
||||
CAHEK7 <ghosts.in.a.box@gmail.com>
|
||||
Cary Phillips <cary@ilm.com> cary-ilm <cary@ilm.com>
|
||||
Cary Phillips <cary@ilm.com> Cary Phillips <cary@rnd-build7-sf-38.lucasfilm.com>
|
||||
Cary Phillips <cary@ilm.com> seabeepea <seabeepea@gmail.com>
|
||||
Catherine <catyeo18@users.noreply.github.com>
|
||||
Chris Leu <cdleu430@gmail.com> cdleu430 <cdleu430@gmail.com>
|
||||
Christina Tempelaar-Lietz <xlietz@gmail.com> ¨Christina Tempelaar-Lietz¨ <xlietz@gmail.com>
|
||||
Christina Tempelaar-Lietz <xlietz@gmail.com> xlietz <31363633+xlietz@users.noreply.github.com>
|
||||
Christopher Horvath <blackencino+git@gmail.com>
|
||||
Christopher Kulla <fpsunflower@users.noreply.github.com>
|
||||
Christoph Gohlke <cgohlke@cgohlke.com>
|
||||
cia-rana <kiwamura0314@gmail.com>
|
||||
Cristian Martínez <cfuga@cfuga.mx>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Daniel Kaneider <danielkaneider@users.sf.net>
|
||||
Darby Johnston <darbyjohnston@yahoo.com>
|
||||
Dave Sawyer <kingsawyer@gmail.com>
|
||||
David Korczynski <david@adalogics.com>
|
||||
Developer-Ecosystem-Engineering <65677710+Developer-Ecosystem-Engineering@users.noreply.github.com>
|
||||
dgmzc <dorian.gmz@hotmail.com>
|
||||
Diogo Teles Sant'Anna <diogoteles@google.com>
|
||||
Dirk Lemstra <dirk@lemstra.org> dirk <dirk@git.imagemagick.org>
|
||||
dracwyrm <j.scruggs@gmail.com>
|
||||
Drew Hess <dhess@ilm.com>
|
||||
Ed Hanway <ehanway@ilm.com> Ed Hanway <ehanway-ilm@users.noreply.github.com>
|
||||
Edward Kmett <ekmett@gmail.com>
|
||||
Eric Sommerlade <es0m@users.noreply.github.com>
|
||||
Eric Wimmer <ewimmer@ilm.com>
|
||||
E Sommerlade <es0m@users.noreply.github.com>
|
||||
fgc <fgc>
|
||||
Florian Kainz <kainz@ilm.com>
|
||||
Grant Kim <6302240+enpinion@users.noreply.github.com>
|
||||
Gregorio Litenstein <g.litenstein@gmail.com>
|
||||
Gyula Gubacsi <gyula.gubacsi@foundry.com>
|
||||
Halfdan Ingvarsson <halfdan@sidefx.com>
|
||||
Harry Mallon <hjmallon@gmail.com>
|
||||
Huibean Luo <huibean.luo@gmail.com>
|
||||
ianianda <wyking1030@gmail.com>
|
||||
Ibraheem Alhashim <ibraheem.alhashim@gmail.com>
|
||||
Jack Kingsman <jack.kingsman@gmail.com>
|
||||
Jamie Kenyon <jamie.kenyon@thefoundry.co.uk>
|
||||
Jan Tojnar <jtojnar@gmail.com>
|
||||
jbradley <jbradley@dreamworks.com>
|
||||
Jean-Francois Panisset <32653482+jfpanisset@users.noreply.github.com>
|
||||
Jens Lindgren <lindgren_jens@hotmail.com>
|
||||
Ji Hun Yu <jihun@ilm.com>
|
||||
Johannes Vollmer <32042925+johannesvollmer@users.noreply.github.com>
|
||||
John Loy <jloy@pixar.com>
|
||||
John Mertic <jmertic@linuxfoundation.org>
|
||||
Jonathan Stone <stonej@github.com>
|
||||
Jose Luis Cercos-Pita <jlcercos@gmail.com> Jose Luis Cercós Pita <lacigarracomunista@gmail.com>
|
||||
Joseph Goldstone <joseph.goldstone@mac.com> Joseph Goldstone <jgoldstone@arri.com>
|
||||
Juha Reunanen <juha.reunanen@tomaattinen.com>
|
||||
Julian Amann <julian.amann@tum.de>
|
||||
Juri Abramov <openexr@dr-abramov.de> Juri Abramov <gabramov@nvidia.com>
|
||||
Juri Abramov <openexr@dr-abramov.de> JuriAbramov <openexr@dr-abramov.de>
|
||||
Karl Hendrikse <karlhendrikse@gmail.com> karlhendrikse <karlhendrikse@gmail.com>
|
||||
Karl Rasche <karl.rasche@dreamworks.com> Karl Rasche <karlrasche@users.noreply.github.com>
|
||||
Kevin Wheatley <kevin.wheatley@framestore.com>
|
||||
Kimball Thurston <kdt3rd@gmail.com>
|
||||
kwizart <kwizart@gmail.com>
|
||||
Larry Gritz <lg@larrygritz.com>
|
||||
Laurens Voerman <l.voerman@rug.nl>
|
||||
L. E. Segovia <amy@amyspark.me>
|
||||
Liam Fernandez <liam@utexas.edu>
|
||||
lilinjie <lilinjie@uniontech.com>
|
||||
Lucy Wilkes <lucywilkes@users.noreply.github.com>
|
||||
luzpaz <luzpaz@users.noreply.github.com>
|
||||
mancoast <RobertPancoast77@gmail.com>
|
||||
mandree <mandree@users.noreply.github.com>
|
||||
Mark Reid <mindmark@gmail.com>
|
||||
Mark Sisson <5761292+marksisson@users.noreply.github.com>
|
||||
Martin Aumüller <aumuell@reserv.at>
|
||||
Martin Husemann <martin@NetBSD.org>
|
||||
Matthäus G. Chajdas <Anteru@users.noreply.github.com>
|
||||
Matthias C. M. Troffaes <matthias.troffaes@gmail.com>
|
||||
Matt Pharr <matt@pharr.org>
|
||||
Md Sadman Chowdhury <61442059+SpicyCatGames@users.noreply.github.com>
|
||||
Michael Thomas (malinka) <malinka@entropy-development.com>
|
||||
Nicholas Yue <yue.nicholas@gmail.com>
|
||||
Nick Porcino <meshula@hotmail.com> meshula <nick.porcino@gmail.com>
|
||||
Nick Porcino <meshula@hotmail.com> Nick Porcino <nick.porcino@oculus.com>
|
||||
Nick Porcino <meshula@hotmail.com> Nick Porcino <nporcino@pixar.com>
|
||||
Nick Porcino <meshula@hotmail.com> nporcino-pixar <78001580+nporcino-pixar@users.noreply.github.com>
|
||||
Nick Rasmussen <nick@ilm.com> Nick Rasmussen <nick@jive.org>
|
||||
Nick Rasmussen <nick@ilm.com> Nick Rasmussen <nick.rasmussen@gmail.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Niklas Hambüchen <mail@nh2.me>
|
||||
OgreTransporter <OgreTransporter@users.noreply.github.com>
|
||||
oleksii.vorobiov <oleksii.vorobiov@globallogic.com>
|
||||
Owen Thompson <oxt3479@rit.edu>
|
||||
patlefort <northon_patrick3@yahoo.ca>
|
||||
Paul Schneider <pauls@ilm.com>
|
||||
Peter Hillman <peterh@wetafx.co.nz> peterhillman <peterh@wetafx.co.nz>
|
||||
Peter Hillman <peterh@wetafx.co.nz> peterhillman <peter@peterhillman.org.uk>
|
||||
Peter Steneteg <peter@steneteg.se>
|
||||
Peter Urbanec <peterurbanec@users.noreply.github.com>
|
||||
Phyrexian <jarko.paska@gmail.com>
|
||||
Piotr Stanczyk <piotr.stanczyk@gmail.com> Piotr <pstanczyk@ilm.com>
|
||||
Piotr Stanczyk <piotr.stanczyk@gmail.com> Piotr Stanczyk <pstanczyk@ilm.com>
|
||||
Piotr Stanczyk <piotr.stanczyk@gmail.com> pstanczyk <pstanczyk@ilm.com>
|
||||
Ralph Potter <r.potter@bath.ac.uk>
|
||||
r-a-sattarov <r.a.sattarov@yandex.ru>
|
||||
Rémi Achard <remiachard@gmail.com>
|
||||
Reto Kromer <retokromer@users.noreply.github.com>
|
||||
Richard Goedeken <Richard@fascinationsoftware.com>
|
||||
Sergey Fedorov <vital.had@gmail.com>
|
||||
Shawn Walker-Salas <shawn.walker@oracle.com>
|
||||
Simon Boorer <sboorer@ilm.com>
|
||||
Simon Otter <skurmedel@gmail.com>
|
||||
Srinath Ravichandran <srinath.pop@gmail.com>
|
||||
Thanh Ha <thanh.ha@linuxfoundation.org>
|
||||
Thomas Debesse <dev@illwieckz.net>
|
||||
Thorsten Kaufmann <thorsten.kaufmann@mackevision.de>
|
||||
Timothy Lyanguzov <theta682@gmail.com>
|
||||
Transporter <ogre.transporter@gmail.com>
|
||||
Vertexwahn <julian.amann@tum.de>
|
||||
Wenzel Jakob <wenzel@inf.ethz.ch>
|
||||
Wojciech Jarosz <wkjarosz@users.noreply.github.com> wjarosz <wjarosz>
|
||||
Xo Wang <xow@google.com>
|
||||
Yaakov Selkowitz <yselkowi@redhat.com>
|
||||
Yining Karl Li <betajippity@gmail.com>
|
||||
Yujie Shu <yshu@ilm.com> Yujie Shu (Intern) <yshu@ilm.com>
|
||||
zengwei2000 <102871671+zengwei2000@users.noreply.github.com>
|
||||
+2
-8
@@ -11,14 +11,8 @@ version: 2
|
||||
build:
|
||||
os: "ubuntu-22.04"
|
||||
tools:
|
||||
python: "3.9"
|
||||
apt_packages:
|
||||
- wget # for test images
|
||||
- imagemagick # for convert, for test images
|
||||
- openexr # for exrheader, for test images
|
||||
jobs:
|
||||
pre_build:
|
||||
- python website/scripts/test_images.py
|
||||
# urllib3>=2.7 (website/requirements.txt) requires Python >=3.10
|
||||
python: "3.11"
|
||||
|
||||
sphinx:
|
||||
configuration: website/conf.py
|
||||
|
||||
+55
-20
@@ -2,6 +2,9 @@
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
||||
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
|
||||
load("@rules_cc//cc:cc_test.bzl", "cc_test")
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
config_setting(
|
||||
name = "windows",
|
||||
@@ -12,7 +15,7 @@ expand_template(
|
||||
name = "IexConfig",
|
||||
out = "src/lib/Iex/IexConfig.h",
|
||||
substitutions = {
|
||||
"@IEX_INTERNAL_NAMESPACE@": "Iex_3_2",
|
||||
"@IEX_INTERNAL_NAMESPACE@": "Iex_3_4",
|
||||
"@IEX_NAMESPACE_CUSTOM@": "0",
|
||||
"@IEX_NAMESPACE@": "Iex",
|
||||
},
|
||||
@@ -34,11 +37,12 @@ expand_template(
|
||||
name = "IlmThreadConfig",
|
||||
out = "src/lib/IlmThread/IlmThreadConfig.h",
|
||||
substitutions = {
|
||||
"@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_2",
|
||||
"@ILMTHREAD_INTERNAL_NAMESPACE@": "IlmThread_3_4",
|
||||
"@ILMTHREAD_NAMESPACE_CUSTOM@": "0",
|
||||
"@ILMTHREAD_NAMESPACE@": "IlmThread",
|
||||
"#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES": "#define ILMTHREAD_HAVE_POSIX_SEMAPHORES 0",
|
||||
"#cmakedefine01 ILMTHREAD_THREADING_ENABLED": "#define ILMTHREAD_THREADING_ENABLED 1",
|
||||
"#cmakedefine01 ILMTHREAD_USE_TBB": "#define ILMTHREAD_USE_TBB 0",
|
||||
},
|
||||
template = "cmake/IlmThreadConfig.h.in",
|
||||
)
|
||||
@@ -48,13 +52,17 @@ expand_template(
|
||||
out = "src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
substitutions = {
|
||||
"@OPENEXR_IMF_NAMESPACE@": "Imf",
|
||||
"@OPENEXR_INTERNAL_IMF_NAMESPACE@": "Imf_3_2",
|
||||
"@OPENEXR_LIB_VERSION@": "3.2.0",
|
||||
"@OPENEXR_NAMESPACE_CUSTOM@": "3.2.0",
|
||||
"@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.2.0",
|
||||
"@OPENEXR_INTERNAL_IMF_NAMESPACE@": "Imf_3_4",
|
||||
"@OPENEXR_LIB_VERSION@": "3.4.0",
|
||||
"@OPENEXR_NAMESPACE_CUSTOM@": "3.4.0",
|
||||
"@OPENEXR_PACKAGE_NAME@": "OpenEXR 3.4.0",
|
||||
"@OPENEXR_VERSION_EXTRA@": "",
|
||||
"@OPENEXR_VERSION@": "3.2.0",
|
||||
"@OPENEXR_VERSION@": "3.4.0",
|
||||
"@OPENEXR_VERSION_MAJOR@": "3",
|
||||
"@OPENEXR_VERSION_MINOR@": "4",
|
||||
"@OPENEXR_VERSION_PATCH@": "0",
|
||||
"#cmakedefine OPENEXR_ENABLE_API_VISIBILITY": "#define OPENEXR_ENABLE_API_VISIBILITY",
|
||||
"#cmakedefine OPENEXR_CORE_FUNCTIONS_EMBEDDED": "/* #undef OPENEXR_CORE_FUNCTIONS_EMBEDDED */",
|
||||
"#cmakedefine OPENEXR_HAVE_LARGE_STACK 1": "/* #undef OPENEXR_HAVE_LARGE_STACK */",
|
||||
},
|
||||
template = "cmake/OpenEXRConfig.h.in",
|
||||
@@ -64,6 +72,7 @@ expand_template(
|
||||
name = "OpenEXRConfigInternal",
|
||||
out = "src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
substitutions = {
|
||||
"#cmakedefine OPENEXR_USE_INTERNAL_DEFLATE 1": "#define OPENEXR_USE_INTERNAL_DEFLATE 0",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1": "#define OPENEXR_IMF_HAVE_COMPLETE_IOMANIP 1",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_DARWIN 1": "/* #undef OPENEXR_IMF_HAVE_DARWIN */",
|
||||
"#cmakedefine OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX 1": "/* #undef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX */",
|
||||
@@ -105,6 +114,7 @@ cc_library(
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"src/lib",
|
||||
"src/lib/Iex",
|
||||
"src/lib/OpenEXR",
|
||||
"src/lib/OpenEXRCore",
|
||||
@@ -131,6 +141,7 @@ cc_library(
|
||||
"src/lib/IlmThread/IlmThreadMutex.h",
|
||||
"src/lib/IlmThread/IlmThreadNamespace.h",
|
||||
"src/lib/IlmThread/IlmThreadPool.h",
|
||||
"src/lib/IlmThread/IlmThreadProcessGroup.h",
|
||||
"src/lib/IlmThread/IlmThreadSemaphore.h",
|
||||
],
|
||||
features = select({
|
||||
@@ -138,6 +149,7 @@ cc_library(
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = [
|
||||
"src/lib",
|
||||
"src/lib/IlmThread",
|
||||
"src/lib/OpenEXRCore",
|
||||
],
|
||||
@@ -150,10 +162,10 @@ cc_library(
|
||||
"src/lib/IlmThread/IlmThreadConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
"src/lib/OpenEXR/dwaLookups.h",
|
||||
"src/lib/OpenEXRCore/attributes.c",
|
||||
"src/lib/OpenEXRCore/backward_compatibility.h",
|
||||
"src/lib/OpenEXRCore/base.c",
|
||||
"src/lib/OpenEXRCore/bytes.c",
|
||||
"src/lib/OpenEXRCore/channel_list.c",
|
||||
"src/lib/OpenEXRCore/chunk.c",
|
||||
"src/lib/OpenEXRCore/coding.c",
|
||||
@@ -166,6 +178,8 @@ cc_library(
|
||||
"src/lib/OpenEXRCore/internal_attr.h",
|
||||
"src/lib/OpenEXRCore/internal_b44.c",
|
||||
"src/lib/OpenEXRCore/internal_b44_table.c",
|
||||
"src/lib/OpenEXRCore/internal_b44_table_init.c",
|
||||
"src/lib/OpenEXRCore/internal_bytes.h",
|
||||
"src/lib/OpenEXRCore/internal_channel_list.h",
|
||||
"src/lib/OpenEXRCore/internal_coding.h",
|
||||
"src/lib/OpenEXRCore/internal_compress.h",
|
||||
@@ -180,8 +194,13 @@ cc_library(
|
||||
"src/lib/OpenEXRCore/internal_dwa_encoder.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_helpers.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_simd.h",
|
||||
"src/lib/OpenEXRCore/internal_dwa_table.c",
|
||||
"src/lib/OpenEXRCore/internal_dwa_table_init.c",
|
||||
"src/lib/OpenEXRCore/internal_file.h",
|
||||
"src/lib/OpenEXRCore/internal_float_vector.h",
|
||||
"src/lib/OpenEXRCore/internal_ht.cpp",
|
||||
"src/lib/OpenEXRCore/internal_ht_common.cpp",
|
||||
"src/lib/OpenEXRCore/internal_ht_common.h",
|
||||
"src/lib/OpenEXRCore/internal_huf.c",
|
||||
"src/lib/OpenEXRCore/internal_huf.h",
|
||||
"src/lib/OpenEXRCore/internal_memory.h",
|
||||
@@ -195,6 +214,7 @@ cc_library(
|
||||
"src/lib/OpenEXRCore/internal_string_vector.h",
|
||||
"src/lib/OpenEXRCore/internal_structs.c",
|
||||
"src/lib/OpenEXRCore/internal_structs.h",
|
||||
"src/lib/OpenEXRCore/internal_thread.h",
|
||||
"src/lib/OpenEXRCore/internal_util.h",
|
||||
"src/lib/OpenEXRCore/internal_win32_file_impl.h",
|
||||
"src/lib/OpenEXRCore/internal_xdr.h",
|
||||
@@ -254,8 +274,9 @@ cc_library(
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"@Imath",
|
||||
"@imath",
|
||||
"@libdeflate//:deflate",
|
||||
"@openjph",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -266,14 +287,18 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfB44Compressor.cpp",
|
||||
"src/lib/OpenEXR/ImfBoxAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfBytesAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCRgbaFile.cpp",
|
||||
"src/lib/OpenEXR/ImfChannelList.cpp",
|
||||
"src/lib/OpenEXR/ImfChannelListAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfChromaticities.cpp",
|
||||
"src/lib/OpenEXR/ImfChromaticitiesAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCompositeDeepScanLine.cpp",
|
||||
"src/lib/OpenEXR/ImfCompression.cpp",
|
||||
"src/lib/OpenEXR/ImfCompressionAttribute.cpp",
|
||||
"src/lib/OpenEXR/ImfCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfContext.cpp",
|
||||
"src/lib/OpenEXR/ImfContextInit.cpp",
|
||||
"src/lib/OpenEXR/ImfConvert.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepCompositing.cpp",
|
||||
"src/lib/OpenEXR/ImfDeepFrameBuffer.cpp",
|
||||
@@ -297,6 +322,7 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfFramesPerSecond.cpp",
|
||||
"src/lib/OpenEXR/ImfGenericInputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfGenericOutputFile.cpp",
|
||||
"src/lib/OpenEXR/ImfHTCompressor.cpp",
|
||||
"src/lib/OpenEXR/ImfHeader.cpp",
|
||||
"src/lib/OpenEXR/ImfHuf.cpp",
|
||||
"src/lib/OpenEXR/ImfIDManifest.cpp",
|
||||
@@ -353,8 +379,6 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfWav.cpp",
|
||||
"src/lib/OpenEXR/ImfZip.cpp",
|
||||
"src/lib/OpenEXR/ImfZipCompressor.cpp",
|
||||
"src/lib/OpenEXR/b44ExpLogTable.h",
|
||||
"src/lib/OpenEXR/dwaLookups.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/lib/Iex/IexConfig.h",
|
||||
@@ -366,6 +390,7 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfAutoArray.h",
|
||||
"src/lib/OpenEXR/ImfB44Compressor.h",
|
||||
"src/lib/OpenEXR/ImfBoxAttribute.h",
|
||||
"src/lib/OpenEXR/ImfBytesAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCRgbaFile.h",
|
||||
"src/lib/OpenEXR/ImfChannelList.h",
|
||||
"src/lib/OpenEXR/ImfChannelListAttribute.h",
|
||||
@@ -376,6 +401,8 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfCompression.h",
|
||||
"src/lib/OpenEXR/ImfCompressionAttribute.h",
|
||||
"src/lib/OpenEXR/ImfCompressor.h",
|
||||
"src/lib/OpenEXR/ImfContext.h",
|
||||
"src/lib/OpenEXR/ImfContextInit.h",
|
||||
"src/lib/OpenEXR/ImfConvert.h",
|
||||
"src/lib/OpenEXR/ImfDeepCompositing.h",
|
||||
"src/lib/OpenEXR/ImfDeepFrameBuffer.h",
|
||||
@@ -391,7 +418,6 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfDeepTiledOutputPart.h",
|
||||
"src/lib/OpenEXR/ImfDoubleAttribute.h",
|
||||
"src/lib/OpenEXR/ImfDwaCompressor.h",
|
||||
"src/lib/OpenEXR/ImfDwaCompressorSimd.h",
|
||||
"src/lib/OpenEXR/ImfEnvmap.h",
|
||||
"src/lib/OpenEXR/ImfEnvmapAttribute.h",
|
||||
"src/lib/OpenEXR/ImfExport.h",
|
||||
@@ -403,6 +429,7 @@ cc_library(
|
||||
"src/lib/OpenEXR/ImfFramesPerSecond.h",
|
||||
"src/lib/OpenEXR/ImfGenericInputFile.h",
|
||||
"src/lib/OpenEXR/ImfGenericOutputFile.h",
|
||||
"src/lib/OpenEXR/ImfHTCompressor.h",
|
||||
"src/lib/OpenEXR/ImfHeader.h",
|
||||
"src/lib/OpenEXR/ImfHuf.h",
|
||||
"src/lib/OpenEXR/ImfIDManifest.h",
|
||||
@@ -475,17 +502,14 @@ cc_library(
|
||||
"src/lib/OpenEXR/OpenEXRConfig.h",
|
||||
"src/lib/OpenEXR/OpenEXRConfigInternal.h",
|
||||
],
|
||||
copts = select({
|
||||
":windows": [],
|
||||
"//conditions:default": [
|
||||
"-Wno-error",
|
||||
],
|
||||
}),
|
||||
features = select({
|
||||
":windows": ["windows_export_all_symbols"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
includes = ["src/lib/OpenEXR"],
|
||||
includes = [
|
||||
"src/lib",
|
||||
"src/lib/OpenEXR",
|
||||
],
|
||||
linkopts =
|
||||
select({
|
||||
":windows": [],
|
||||
@@ -497,7 +521,8 @@ cc_library(
|
||||
deps = [
|
||||
":IlmThread",
|
||||
":OpenEXRCore",
|
||||
"@Imath",
|
||||
"@imath",
|
||||
"@openjph",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -505,8 +530,12 @@ cc_test(
|
||||
name = "IexTest",
|
||||
srcs = [
|
||||
"src/test/IexTest/main.cpp",
|
||||
"src/test/IexTest/mathFuncs.cpp",
|
||||
"src/test/IexTest/mathFuncs.h",
|
||||
"src/test/IexTest/testBaseExc.cpp",
|
||||
"src/test/IexTest/testBaseExc.h",
|
||||
"src/test/IexTest/testMathExc.cpp",
|
||||
"src/test/IexTest/testMathExc.h",
|
||||
],
|
||||
includes = ["src/test/IexTest"],
|
||||
tags = ["manual"], # This test is not build and executed in the CI
|
||||
@@ -557,3 +586,9 @@ cc_binary(
|
||||
":OpenEXR",
|
||||
],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "openexr",
|
||||
actual = ":OpenEXR",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
+2606
-422
File diff suppressed because it is too large
Load Diff
+31
-22
@@ -2,7 +2,7 @@
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
# We require this to get object library link library support
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
if(POLICY CMP0074)
|
||||
# enable find_package(<Package>) to use <Package>_ROOT as a hint
|
||||
@@ -21,13 +21,13 @@ endif()
|
||||
|
||||
file(READ "src/lib/OpenEXRCore/openexr_version.h" VERSION_H)
|
||||
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${VERSION_H})
|
||||
set(VER_MAJ ${CMAKE_MATCH_1})
|
||||
set(OPENEXR_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${VERSION_H})
|
||||
set(VER_MIN ${CMAKE_MATCH_1})
|
||||
set(OPENEXR_VERSION_MINOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "VERSION_PATCH ([0-9]*)" _ ${VERSION_H})
|
||||
set(VER_PCH ${CMAKE_MATCH_1})
|
||||
set(OPENEXR_VERSION_PATCH ${CMAKE_MATCH_1})
|
||||
|
||||
project(OpenEXR VERSION ${VER_MAJ}.${VER_MIN}.${VER_PCH} LANGUAGES C CXX)
|
||||
project(OpenEXR VERSION ${OPENEXR_VERSION_MAJOR}.${OPENEXR_VERSION_MINOR}.${OPENEXR_VERSION_PATCH} LANGUAGES C CXX)
|
||||
|
||||
set(OPENEXR_VERSION_RELEASE_TYPE "-dev" CACHE STRING "Extra version tag string for OpenEXR build, such as -dev, -beta1, etc.")
|
||||
|
||||
@@ -43,13 +43,19 @@ set(OPENEXR_VERSION_API "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}")
|
||||
# For example, in "libOpenEXR.so.31.3.2.0", "libOpenEXR.so.31" is the SONAME
|
||||
# and ".3.2.0" identifies the corresponding library release.
|
||||
|
||||
set(OPENEXR_LIB_SOVERSION 31)
|
||||
set(OPENEXR_LIB_SOVERSION 99)
|
||||
set(OPENEXR_LIB_VERSION "${OPENEXR_LIB_SOVERSION}.${OPENEXR_VERSION}") # e.g. "31.3.2.0"
|
||||
|
||||
option(OPENEXR_INSTALL "Install OpenEXR libraries" ON)
|
||||
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
|
||||
if(OPENEXR_INSTALL_TOOLS AND NOT OPENEXR_INSTALL)
|
||||
message(SEND_ERROR "OPENEXR_INSTALL_TOOLS requires OPENEXR_INSTALL")
|
||||
if(OPENEXR_INSTALL OR OPENEXR_INSTALL_TOOLS OR OPENEXR_INSTALL_DEVELOPER_TOOLS)
|
||||
# uninstall target
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(cmake/LibraryDefine.cmake)
|
||||
@@ -73,18 +79,22 @@ if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
endif()
|
||||
|
||||
# Include these two modules without enable/disable options
|
||||
add_subdirectory(src/lib)
|
||||
add_subdirectory(src/bin)
|
||||
if (OPENEXR_BUILD_LIBS)
|
||||
add_subdirectory(src/lib)
|
||||
endif()
|
||||
|
||||
# Tell CMake where to find the OpenEXRConfig.cmake file. Makes it possible to call
|
||||
if(OPENEXR_BUILD_TOOLS AND OPENEXR_BUILD_LIBS)
|
||||
add_subdirectory(src/bin)
|
||||
endif()
|
||||
|
||||
# Tell CMake where to find the OpenEXRConfig.cmake file. Makes it possible to call
|
||||
# find_package(OpenEXR) in downstream projects
|
||||
set(OpenEXR_DIR "${CMAKE_CURRENT_BINARY_DIR}/cmake" CACHE PATH "" FORCE)
|
||||
# Add an empty OpenEXRTargets.cmake file for the config to use.
|
||||
# Add an empty OpenEXRTargets.cmake file for the config to use.
|
||||
# Can be empty since we already defined the targets in add_subdirectory
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/cmake/OpenEXRTargets.cmake" "# Dummy file")
|
||||
|
||||
option(OPENEXR_INSTALL_EXAMPLES "Install OpenEXR examples" ON)
|
||||
if(OPENEXR_INSTALL_EXAMPLES)
|
||||
if(OPENEXR_BUILD_EXAMPLES AND OPENEXR_BUILD_LIBS)
|
||||
add_subdirectory( src/examples )
|
||||
endif()
|
||||
|
||||
@@ -92,7 +102,7 @@ endif()
|
||||
# upload the results, cmake has builtin support for
|
||||
# submitting to CDash, or any server who speaks the
|
||||
# same protocol
|
||||
#
|
||||
#
|
||||
# These settings will need to be set for your environment,
|
||||
# and then a script such as the example in
|
||||
#
|
||||
@@ -103,7 +113,7 @@ endif()
|
||||
# cmake -S cmake/SampleCTestScript.cmake
|
||||
#
|
||||
# [or whatever you name the file you edit]
|
||||
#
|
||||
#
|
||||
#set(CTEST_PROJECT_NAME "OpenEXR")
|
||||
#set(CTEST_NIGHTLY_START_TIME "01:01:01 UTC")
|
||||
#set(CTEST_DROP_METHOD "http") # there are others...
|
||||
@@ -112,7 +122,7 @@ endif()
|
||||
#set(CTEST_DROP_SITE_CDASH TRUE)
|
||||
include(CTest)
|
||||
|
||||
if(BUILD_TESTING AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
if(BUILD_TESTING AND OPENEXR_BUILD_LIBS AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(src/test)
|
||||
endif()
|
||||
|
||||
@@ -132,12 +142,11 @@ if (BUILD_WEBSITE AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(website)
|
||||
endif()
|
||||
|
||||
if (NOT OPENEXR_IS_SUBPROJECT)
|
||||
if (OPENEXR_BUILD_LIBS AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
# Even if not building the website, still make sure the website example code compiles.
|
||||
add_subdirectory(website/src)
|
||||
endif()
|
||||
|
||||
option(OPENEXR_BUILD_PYTHON "Set ON to build python bindings")
|
||||
if (OPENEXR_BUILD_PYTHON AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
if (OPENEXR_BUILD_PYTHON AND OPENEXR_BUILD_LIBS AND NOT OPENEXR_IS_SUBPROJECT)
|
||||
add_subdirectory(src/wrappers/python)
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"version": 3,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 15,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "oss_fuzz",
|
||||
"cacheVariables": {
|
||||
"CMAKE_VERBOSE_MAKEFILE": "ON",
|
||||
"BUILD_SHARED_LIBS": "OFF",
|
||||
"OPENEXR_FORCE_INTERNAL_IMATH": "ON",
|
||||
"OPENEXR_FORCE_INTERNAL_DEFLATE": "ON",
|
||||
"OPENEXR_FORCE_INTERNAL_OPENJPH": "ON",
|
||||
"OPENEXR_BUILD_TOOLS": "OFF",
|
||||
"OPENEXR_BUILD_EXAMPLES": "OFF",
|
||||
"OPENEXR_BUILD_DOCS": "OFF",
|
||||
"OPENEXR_BUILD_OSS_FUZZ": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"displayName": "Release (Unix Makefiles)",
|
||||
"description": "Release build with Unix Makefiles",
|
||||
"generator": "Unix Makefiles",
|
||||
"binaryDir": "${sourceDir}/_build/release",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"OPENEXR_BUILD_TOOLS": "ON",
|
||||
"OPENEXR_BUILD_EXAMPLES": "ON",
|
||||
"OPENEXR_BUILD_PYTHON": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "debug",
|
||||
"displayName": "Debug (Unix Makefiles)",
|
||||
"description": "Debug build with Unix Makefiles",
|
||||
"generator": "Unix Makefiles",
|
||||
"binaryDir": "${sourceDir}/_build/debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"OPENEXR_BUILD_TOOLS": "ON",
|
||||
"OPENEXR_BUILD_EXAMPLES": "ON",
|
||||
"OPENEXR_BUILD_PYTHON": "ON"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+280
-255
@@ -11,8 +11,9 @@ explains our contribution process and procedures:
|
||||
* [Development Workflow](#Development-Workflow)
|
||||
* [Coding Style](#Coding-Style)
|
||||
* [Versioning Policy](#Versioning-Policy)
|
||||
* [Contributing to the Website](#Contributing-to-the-Website)
|
||||
* [Creating a Patch Release](#Creating-a-Patch-Release)
|
||||
* [Creating a Major/Minor Release](#Creating-a-Major/Minor-Release)
|
||||
* [Creating a Major/Minor Release](#creating-a-majorminor-release)
|
||||
|
||||
For a description of the roles and responsibilities of the various
|
||||
members of the OpenEXR community, see [GOVERNANCE](GOVERNANCE.md), and
|
||||
@@ -38,7 +39,7 @@ There are two primary ways to connect with the OpenEXR project:
|
||||
If you have trouble installing, building, or using the library, but
|
||||
there's not yet reason to suspect you've encountered a genuine bug,
|
||||
start by posting a question to the
|
||||
[openexr-dev](http://lists.aswf.io/openexr-dev) mailing list. This is
|
||||
[openexr-dev](http://lists.aswf.io/g/openexr-dev) mailing list. This is
|
||||
the place for question such has "How do I...".
|
||||
|
||||
### How to Report a Bug
|
||||
@@ -80,7 +81,7 @@ To contribute code to the project, first read over the [GOVERNANCE](GOVERNANCE.m
|
||||
|
||||
* An understanding of the project's development workflow.
|
||||
|
||||
* Legal authorization, that is, you need to have signed a contributor
|
||||
* Legal authorization, that is, you need to have signed a Contributor
|
||||
License Agreement. See below for details.
|
||||
|
||||
## Legal Requirements
|
||||
@@ -101,19 +102,23 @@ in the OpenEXR distribution must first complete a **Contributor
|
||||
License Agreement**.
|
||||
|
||||
To contribute to OpenEXR, you must sign a CLA through the
|
||||
[EasyCLA](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7?redirect=https:%2F%2Fgithub.com%2FAcademySoftwareFoundation%2Fopenexr%2Fpull%2F1154)
|
||||
[EasyCLA](https://docs.linuxfoundation.org/lfx/easycla)
|
||||
system, which is integrated with GitHub as a pull request check.
|
||||
|
||||
Sign the form through [this
|
||||
link](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7?redirect=https:%2F%2Fgithub.com%2FAcademySoftwareFoundation%2Fopenexr%2Fpull%2F1154)
|
||||
prior to submitting a pull request. If you submit a pull request
|
||||
before the form is signed, the "linux-foundation-easycla" check will
|
||||
fail and a red "NOT COVERED" button will appear in the PR
|
||||
comments. Click that link to sign the form.
|
||||
If a contributor opens a pull request without having a CLA on file, the
|
||||
contributor will be guided through the process to have the appropriate
|
||||
CLA signed. Look in the PR comments for the "linux-foundation-easycla"
|
||||
check that would fail, and a red "NOT COVERED" button will appear in the PR
|
||||
comments; click the link in the comment to sign the CLA. For organizations,
|
||||
you can alternatively go to [this
|
||||
link](https://organization.lfx.linuxfoundation.org/foundation/a09410000182dD2AAI/project/a092M00001If9ujQAB/cla)
|
||||
prior to submitting a pull request, which will guide you through the
|
||||
process to have a CLA signed on behalf of the organization.
|
||||
|
||||
* If you are an individual writing the code on your own time and
|
||||
you're **sure** you are the sole owner of any intellectual property you
|
||||
contribute, you can sign the CLA as an **Individual Contributor**.
|
||||
contribute, you can sign the CLA as an **Individual Contributor**. If you
|
||||
are unsure, please contact your employer for clarity.
|
||||
|
||||
* If you are writing the code as part of your job, or if your employer
|
||||
retains ownership to intellectual property you create, no matter how
|
||||
@@ -127,9 +132,11 @@ The downloadable PDF's on the EasyCLA page are provided for reference
|
||||
only. To execute the signature, sign the form online through the
|
||||
relevant links.
|
||||
|
||||
The OpenEXR CLAs are the standard forms used by Linux Foundation
|
||||
The OpenEXR CLAs are the standard forms used by the Linux Foundation
|
||||
projects and [recommended by the ASWF
|
||||
TAC](https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contributor-license-agreement-cla).
|
||||
TAC](https://github.com/AcademySoftwareFoundation/tac/blob/main/process/contributing.md#contributor-license-agreement-cla).
|
||||
Note that if you have signed a CLA for a different ASWF or LF project, that
|
||||
CLA doesn't apply here and you need to sign for this project specifically.
|
||||
|
||||
### Commit Sign-Off
|
||||
|
||||
@@ -191,7 +198,7 @@ remains linear, avoiding the "bubbles" characteristic of the
|
||||
[GitFlow](https://www.endoflineblog.com/gitflow-considered-harmful)
|
||||
workflow.
|
||||
|
||||
### Use the Fork, Luke.
|
||||
### Use the Fork, Luke
|
||||
|
||||
In a typical workflow, you should **fork** the OpenEXR repository to
|
||||
your account. This creates a copy of the repository under your user
|
||||
@@ -211,9 +218,9 @@ openexr-dev@lists.aswf.io mail list.
|
||||
|
||||
### Pull Requests
|
||||
|
||||
Contributions should be submitted as Github pull requests. See
|
||||
Contributions should be submitted as GitHub pull requests. See
|
||||
[Creating a pull request](https://help.github.com/articles/creating-a-pull-request/)
|
||||
if you're unfamiliar with this concept.
|
||||
if you're unfamiliar with this concept.
|
||||
|
||||
The development cycle for a code change should follow this protocol:
|
||||
|
||||
@@ -227,14 +234,14 @@ with a separate pull request.
|
||||
|
||||
3. Push commits to your fork.
|
||||
|
||||
4. Create a Github pull request from your topic branch.
|
||||
4. Create a GitHub pull request from your topic branch.
|
||||
|
||||
5. Pull requests will be reviewed by project committers and contributors,
|
||||
who may discuss, offer constructive feedback, request changes, or approve
|
||||
the work.
|
||||
|
||||
6. Upon receiving the required number of committer approvals (as
|
||||
outlined in [Required Approvals](#required-approvals)), a committer
|
||||
outlined in [Required Approvals](#code-review-and-required-approvals)), a committer
|
||||
other than the PR contributor may merge changes into the ``main``
|
||||
branch.
|
||||
|
||||
@@ -335,7 +342,7 @@ code.
|
||||
|
||||
* Function return types go on a separate line:
|
||||
|
||||
const float &
|
||||
const float &
|
||||
Header::pixelAspectRatio () const
|
||||
{
|
||||
...
|
||||
@@ -451,301 +458,319 @@ each version with three numbers: ``major.minor.patch``, where:
|
||||
|
||||
* ``major`` - indicates incompatible API changes
|
||||
* ``minor`` - indicates functionality added in a backwards-compatible manner
|
||||
* ``patch`` - indicates backwards-compatible bug fixes
|
||||
* ``patch`` - indicates backwards-compatible bug fixes
|
||||
|
||||
## Contributing to the Website
|
||||
|
||||
The https://openexr.com website is generated via
|
||||
[Sphinx](https://www.sphinx-doc.org) with the
|
||||
[Breathe](https://breathe.readthedocs.io) extension, using the
|
||||
[sphinx-press-theme](https://pypi.org/project/sphinx-press-theme), and
|
||||
is hosted by
|
||||
[readthedocs](https://readthedocs.org/projects/openexr). The website
|
||||
source is in [restructured
|
||||
text](https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html)
|
||||
in the ``website`` directory.
|
||||
|
||||
To build the website locally from the source ``.rst`` files, set the
|
||||
CMake option ``BUILD_WEBSITE=ON``. This adds the ``website`` CMake
|
||||
target. Generation is off by default.
|
||||
|
||||
Building the website requires that ``sphinx``, ``breathe``, and
|
||||
``doxygen`` are installed. It further requires the [sphinx-press-theme]
|
||||
(https://pypi.org/project/sphinx-press-theme). Complete dependencies
|
||||
are described in the [requirements.txt](website/requirements.txt)
|
||||
file.
|
||||
|
||||
On Debian/Ubuntu Linux:
|
||||
|
||||
.. code-block::
|
||||
|
||||
% apt-get install doxygen python3-sphinx
|
||||
% pip3 install breathe
|
||||
% pip3 install sphinx_press_theme
|
||||
|
||||
% mkdir _build
|
||||
% cd _build
|
||||
% cmake .. -DBUILD_WEBSITE=ON
|
||||
% cmake --build . --target website
|
||||
|
||||
### Testing a Website Build
|
||||
|
||||
When you have configured cmake with ``BUILD_WEBSITE=ON`` and done a
|
||||
build, you should find a file ``website/sphinx/index.html`` in the
|
||||
build directory which is the website source. Load this file in a
|
||||
browser to preview the resulting website, that is, load
|
||||
``file://<build-directory>/website/sphinx/index.html`` into your web
|
||||
browser.
|
||||
|
||||
Once you submit a PR, a check labeled ``docs/readthedocs.org:openexr``
|
||||
will validate the build. Click on the ``Details`` link to
|
||||
preview. Also, a link to this preview will be added automatically to
|
||||
the PR description.
|
||||
|
||||
### Test Images
|
||||
|
||||
To contribute a new test image, commit it to the
|
||||
[openexr-images](https://github.com/AcademySoftwareFoundation/openexr-images)
|
||||
repo, along with an associated ``.jpg`` file for display on the
|
||||
website.
|
||||
|
||||
The [website/scripts/test_images.py](website/scripts/test_images.py)
|
||||
utility processes images from
|
||||
[openexr-images](https://github.com/AcademySoftwareFoundation/openexr-images)
|
||||
to produce `.rst` files for input to Sphinx. It runs ``exrheader`` on
|
||||
the ``.exr`` to generate the image description. It also processes
|
||||
``README`` files in the image repo for additional website content,
|
||||
useful for describing a collection of images. Once the new image is in
|
||||
the ``openexr-images`` repo, run ``website/scripts/test_images.py``,
|
||||
then commit the new/modified ``.rst`` files to git and submit a PR.
|
||||
|
||||
## Creating a Patch Release
|
||||
|
||||
Making a patch release typically involves merging changes from the
|
||||
main branch into the release branch, since all development generally
|
||||
takes place on the main branch. The usual workflow is to group these
|
||||
changes together and merge them all just prior to a release, rather
|
||||
than merging one-by-one as the changes go into main, although merging
|
||||
along the way is acceptable as well. For OpenEXR and Imath, a patch
|
||||
release typically involves under a dozen commits, so it's not a huge
|
||||
amount of work to organize them all at once.
|
||||
These instructions are for project administrators who have "push"
|
||||
access on the GitHub repo.
|
||||
|
||||
Making a patch release involves merging changes from the main branch
|
||||
into the release branch, since all development takes place on the main
|
||||
branch. The process involves these steps:
|
||||
|
||||
1. Cherry-pick commits from main to the RB- release branch
|
||||
2. Bump the version number
|
||||
3. Add release notes to CHANGES.md
|
||||
4. Create a "release candidate" tag and announce it publicly
|
||||
5. Draft the GitHub release
|
||||
6. Create a signed release tag
|
||||
7. Publish the release
|
||||
8. Add an entry to the website news page
|
||||
|
||||
Helper scripts in ``share/util/release/`` automate many of the steps
|
||||
in the process.
|
||||
|
||||
A patch release *must* be ABI-compatible with preceding minor releases
|
||||
and should be validated with an ABI-checker tool such as
|
||||
[``abipkgdiff``](https://manpages.ubuntu.com/manpages/lunar/en/man1/abipkgdiff.1.html).
|
||||
|
||||
These instructions are for project administrators who have "push"
|
||||
access on the GitHub repo.
|
||||
### Labeling PRs for Release
|
||||
|
||||
The preferred workflow is:
|
||||
Commits for the patch release are identified via labels on PRs. Create
|
||||
a label for the release, beginning with a `v`, as in
|
||||
``v3.4.11``. Assign this label to all PRs to be included in the
|
||||
release.
|
||||
|
||||
1. Make a PR that merges appropriate changes from the main branch to
|
||||
the release branch:
|
||||
If a PR should be merged into more than one release branch, i.e. a fix
|
||||
goes into v3.4 and v3.3, simply add multiple labels, one per release.
|
||||
|
||||
a. In a forked clone, create a branch to hold the patch commits,
|
||||
e.g. ``v3.1.9-fixes``.
|
||||
It's good practice to label _every_ PR to identify what
|
||||
release it goes into, even if it's the next minor/major release. That
|
||||
helps make sure PRs don't get overlooked.
|
||||
|
||||
b. Cherry-pick the appropriate commits from ``main``, resolving any
|
||||
merge conflicts.
|
||||
The `share/util/release/log.py` script prints all PRs in the order
|
||||
they were merged, annotated by their release labels.
|
||||
|
||||
c. Increment ``OPENEXR_VERSION_PATCH`` in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h)
|
||||
|
||||
d. Update the ``IMATH_TAG`` setting in
|
||||
[cmake/OpenEXRSetup.cmake](cmake/OpenEXRSetup.cmake) to
|
||||
correspond to the proper Imath release.
|
||||
|
||||
e. Add release notes to [CHANGES.md](CHANGES.md):
|
||||
### Security Issues
|
||||
|
||||
- Generate a list of links to merged pull requests.
|
||||
When a PR addresses a security vulnerability, mention it in the
|
||||
description or comments:
|
||||
|
||||
Use ``git log`` to identify the merged commits, and for each
|
||||
commit, and add a link in the notes to the corresponding PR
|
||||
that merged it to ``main``. Citing PR's in the release notes
|
||||
is preferable to citing raw commits because the PR's often
|
||||
have helpful information and discussion missing from the
|
||||
commit descriptions, and the commit history is readily
|
||||
accessible via ``git log`` anyway.
|
||||
Addresses CVE-2026-39886
|
||||
|
||||
The typical OpenEXR project workflow uses "squash and merge"
|
||||
to merge PR's into ``main``, so the changes involved in each
|
||||
PR end up on ``main`` as a single commit. This is preferable
|
||||
because a raw PR often includes numerous commits that address
|
||||
comments and feedback or fix typos or mistakes, intermediate
|
||||
steps not helpful to the preserved history of the main
|
||||
development thread. Note that GitHub's "squash and merge"
|
||||
helpfully appends the PR number to the commit subject line.
|
||||
The release scripts will detect this and add an appropriate entry to the
|
||||
release notes.
|
||||
|
||||
Note that when this PR is merged to the release branch, it
|
||||
should go in via "rebase and merge" that the release branch
|
||||
retains the granular changes, described below.
|
||||
When a PR addresses an OSS-Fuzz issue, mention it by url in the
|
||||
description or comments:
|
||||
|
||||
- Generate a list of OSS-Fuzz issues addressed.
|
||||
Addresses https://issues.oss-fuzz.com/issues/456158449
|
||||
|
||||
These are security concerns, so they deserve special
|
||||
attention. Provide a link in the notes to the issue at
|
||||
https://bugs.chromium.org/p/oss-fuzz, including the issue id
|
||||
number and description.
|
||||
The release scripts will detect this and add an appropriate entry to the
|
||||
release notes.
|
||||
|
||||
- If there are any public CVE's, mention them explicitly with a
|
||||
link to the CVE registry item.
|
||||
### GPG
|
||||
|
||||
The signed git tags associated with the release require a [GPG
|
||||
key](https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key)
|
||||
that is
|
||||
[registered](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key)
|
||||
with your GitHub account and git config.
|
||||
|
||||
## Release Workflow
|
||||
|
||||
Once all PRs have appropriate release labels, follow these steps, all
|
||||
while on the appropriate `RB-` branch:
|
||||
|
||||
1. Cherry-pick commits from the main branch to the release branch.
|
||||
|
||||
This prints the SHAs for the commits associated with the
|
||||
labeled PRs. The output will look something like:
|
||||
|
||||
- Provide an executive summary of the patch changes, in a few
|
||||
sentences as well as bullet points if appropriate.
|
||||
% python share/util/release/cherry.py v3.4.8
|
||||
git cherry-pick 2e32c6b 3df0122 6155271
|
||||
changes.py v3.4.8 2311 2294 2315
|
||||
|
||||
Copy/paste the `git cherry-pick` command to the shell.
|
||||
|
||||
- Choose a proposed release date at least several days in
|
||||
advance.
|
||||
|
||||
f. If there are any public CVE's, reference them in
|
||||
[SECURITY.md](SECURITY.md).
|
||||
|
||||
g. Submit the PR for others to review. The PR should go *to the
|
||||
release branch, not ``main``*, obviously.
|
||||
If there are conflicts, resolve them and continue.
|
||||
|
||||
h. After others have had a chance to sanity-check the changes,
|
||||
merge the PR *with "rebase and merge"*. Unlike with the usual
|
||||
PR's merged to main, it is essential to retain the individual
|
||||
commits on the release branch. That way, the release branch
|
||||
commit history retains the details of the changes.
|
||||
If the conflicts are too messy to resolve, consider
|
||||
cherry-picking the commits one at a time. The `cherry.py`
|
||||
script accepts a `--single` option that prints the commits one
|
||||
`git cherry-pick` command per line:
|
||||
|
||||
i. If further fixes come in that need to go into the release, push
|
||||
them to the PR branch. It's not absolutely essential that all
|
||||
changes to the release branch go in via a PR. The PR is simply a
|
||||
convient forum for publicly discussing and reviewing the
|
||||
composition of the release.
|
||||
% python share/util/release/cherry.py --single v3.4.8
|
||||
git cherry-pick 2e32c6b # Bump actions/cache from 5.0.3 to 5.0.4 (#2311)
|
||||
git cherry-pick 3df0122 # Pin pypa/cibuildwheel actions to release sha (#2294)
|
||||
git cherry-pick 6155271 # Force macos cibuildwheel to use Xcode clang (#2315)
|
||||
changes.py v3.4.8 2311 2294 2315
|
||||
|
||||
2. Bump the OpenEXR version.
|
||||
|
||||
Edit the number in `src/lib/OpenEXRCore/openexr_version.h`. Commit
|
||||
and push the change.
|
||||
|
||||
3. Create an entry in the release notes file `CHANGES.md`.
|
||||
|
||||
The `changes.py` script takes a list of PRs
|
||||
and adds entries in the `CHANGES.md` file:
|
||||
|
||||
% python share/util/release/changes.py v3.4.8 2311 2294 2315
|
||||
|
||||
This adds the `Merged Pull Requests` and the
|
||||
`Merged Workflow Requests` sections. It also adds a `Security` section
|
||||
that lists the CVEs and OSS-Fuzz issues addressed.
|
||||
|
||||
2. Tag the release with a ``-rc`` "release candidate" tag,
|
||||
e.g. ``v3.1.9-rc``.
|
||||
Edit the section by hand to add a summary.
|
||||
|
||||
3. Validate ABI compatibility. Build at the release candidate tag and
|
||||
run
|
||||
[abipkgdiff](https://manpages.ubuntu.com/manpages/lunar/en/man1/abipkgdiff.1.html)
|
||||
against a build of the previous patch release to confirm that no
|
||||
ABI changes have leaked in. Additions to the ABI are acceptable for
|
||||
a patch release, but there should be no symbol changes and no
|
||||
symbols removed. If there are, back up and fix them before proceeding.
|
||||
4. Create a `-rc` "release candidate" tag.
|
||||
|
||||
4. Send mail to ``openexr-dev@lists.aswf.io`` announcing the staging
|
||||
of the release with link to the release candidate tag. Include the
|
||||
release notes from [CHANGES.md](CHANGES.md) for review.
|
||||
Obviously, build locally and confirm nothing broke in the
|
||||
cherry-picking commits and resolving conflicts.
|
||||
|
||||
Push the release branch and confirm the CI succeeds before creating
|
||||
the release candidate tag.
|
||||
|
||||
5. Draft the release on the GitHub
|
||||
Create the tag with a `-rc` suffix, e.g. `v3.4.12-rc`.
|
||||
|
||||
The `tag.py` script create a signed tag using the release notes as
|
||||
the tag message:
|
||||
|
||||
% python share/util/release/tag.py v3.4.12-rc
|
||||
|
||||
Adding the release notes as the tag message is good practice.
|
||||
|
||||
Push the tags. This triggers the `python-wheels-publish-test`
|
||||
CI workflow. Confirm it succeeds.
|
||||
|
||||
Run the `candidate.py` script to format a
|
||||
message about the release candidate, formatted in HTML. Pipe the
|
||||
output to a `.html` file:
|
||||
|
||||
% python share/util/release/candidate.py v3.4.12-rc > v3.4.12.html
|
||||
|
||||
Load the file in a browers to render the formatting, then
|
||||
copy/paste the contents into an email to `openexr-dev@lists.aswf.io`
|
||||
and the `#openexr` Slack channel.
|
||||
|
||||
If any problems arise after tagging the candidate, fix them in
|
||||
subsequent commits and create an
|
||||
additional tag with a number appended:
|
||||
|
||||
% python share/util/release/tag.py v3.4.12-rc2
|
||||
|
||||
5. Draft the GitHub release
|
||||
|
||||
% python share/util/release/draft.py v3.4.12
|
||||
|
||||
Verify the notes look correct on the
|
||||
[Releases](https://github.com/AcademySoftwareFoundation/openexr/releases)
|
||||
page. Include the summary from the notes in
|
||||
[CHANGES.md](CHANGES.md), but don't include the list of PR's.
|
||||
page and edit as appropriate. Save as a "draft". DO NOT PUBLISH THE
|
||||
RELEASE YET.
|
||||
|
||||
Create the release from the latest ``--rc`` tag, and give it a name
|
||||
that begins with ``v``, i.e. ``v3.1.9``.
|
||||
6. Create a signed release tag
|
||||
|
||||
Assuming you have your PGP key set up, create the release tag at
|
||||
the same commit as the release candidate:
|
||||
|
||||
Save the release as a "draft".
|
||||
|
||||
6. Wait at least 48 hours, to give the community time to discover and
|
||||
report any obvious problems. Avoid the temptation to rush changes
|
||||
into a release and publish it immediately, as that is uncomfortably
|
||||
error prone.
|
||||
|
||||
If additional fixes need to go in before release:
|
||||
|
||||
a. Merge commits to the release branch. Push them directly, no need
|
||||
for a pull request.
|
||||
|
||||
b. Update the release notes in a separate commit.
|
||||
|
||||
c. Re-tag with a incremented "release candidate" number,
|
||||
e.g. ``v3.1.9-rc2``.
|
||||
|
||||
d. Send an email update to ``openexr-dev@lists.aswf.io`` notifying
|
||||
the community of the addition and the new tag.
|
||||
% python share/util/release/tag.py v3.4.12
|
||||
|
||||
7. Publish the release
|
||||
|
||||
a. Click the "Publish release" button on the GitHub release draft
|
||||
Set the GitHub release to correspond to the release tag (the `Tag:
|
||||
Select tag` option), then click the "Publish release" button on the
|
||||
GitHub release draft.
|
||||
|
||||
b. Send an email to ``openexr-dev@lists.aswf.io`` officially
|
||||
annoucing the release.
|
||||
Monitor the GitHub actions on the
|
||||
`https://github.com/AcademySoftwareFoundation/openexr` repo to
|
||||
ensure everything builds properly.
|
||||
|
||||
8. Update the ``release`` branch, which should always point to the
|
||||
Update the `release` branch, which should always point to the
|
||||
most recent patch of the most recent minor release, i.e. the most
|
||||
preferred release.
|
||||
|
||||
From a clone of the main repo:
|
||||
|
||||
% git checkout release
|
||||
% git merge RB-3.1
|
||||
% git push
|
||||
|
||||
9. Submit a PR that adds the release notes to [CHANGES.md](CHANGES.md)
|
||||
on the main branch. Cherry-pick the release notes commit from
|
||||
the release branch.
|
||||
% git checkout release
|
||||
% git merge RB-3.1
|
||||
% git push
|
||||
|
||||
- If any changes have gone into [SECURITY.md](SECURITY), cherry-pick
|
||||
the associated commit as well.
|
||||
Publishing the release triggers a post on the `#openexr` Slack
|
||||
channel, but you must manually send an email to
|
||||
`openexr-dev@lists.aswf.io` officially announcing the release.
|
||||
|
||||
- Also include in this PR edits to [``docs/news.rst``](docs/news.rst)
|
||||
that add an announcment of the release.
|
||||
8. Add an entry to the website news page.
|
||||
|
||||
10. After review/merge of the updates to ``docs/news.rst``, build the
|
||||
website at https://readthedocs.org/projects/openexr.
|
||||
% python share/util/release/news.py v3.4.12
|
||||
|
||||
11. If the release has resolved any OSS-Fuzz issues, update the
|
||||
associated pages at https://bugs.chromium.org/p/oss-fuzz with a
|
||||
reference to the release.
|
||||
This pulls the release notes from `CHANGES.md` and inserts a news
|
||||
item in `website/news.rst` and `website/latest_news_title.rst`.
|
||||
|
||||
12. If the release has resolved any public CVE's, request an update
|
||||
from the registry service providing the release and a link to the
|
||||
release notes.
|
||||
Commit this change, and then cherry-pick the commit from the
|
||||
release branch containing the notes and submit the pair as a
|
||||
PR. This pulls the release notes for the patch into the main branch.
|
||||
|
||||
## Creating a Major/Minor Release
|
||||
|
||||
A major/minor release is created from the main branch, assuming there
|
||||
are no changes on ``main`` that should *not* go into the release. We
|
||||
don't generally allow experimental changes onto ``main``. Anything
|
||||
accepted onto ``main`` should be intended for the next release.
|
||||
accepted onto ``main`` should be intended for the next minor/major
|
||||
(not _patch_)release.
|
||||
|
||||
The overall workflow is similar to a patch release, as described
|
||||
above, but it's simpler because there is no cherry-picking and merging
|
||||
of commits. The major/minor release is simply a snapshot of ``main``.
|
||||
above, but it's simpler because there is no cherry-picking of
|
||||
commits. The major/minor release is simply a snapshot of ``main``.
|
||||
|
||||
To create a new release from the ``main`` branch:
|
||||
To create a new release from the ``main`` branch, start by creating
|
||||
the new "release branch", e.g. `RB-3.5` from the tip of `main`. Then
|
||||
follow the same instructions above as for a patch release.
|
||||
|
||||
1. Confirm that the ``OPENEXR_VERSION_MAJOR``,
|
||||
Assuming all PRs that have _not_ been merged into a patch release are
|
||||
labeled with the new minor release, e.g. `v3.5`, the helper scripts in
|
||||
`share/util/release` will automate the various steps in generating the
|
||||
release notes, drafting the release, and helping with the various
|
||||
announcements.
|
||||
|
||||
In addition to the above:
|
||||
|
||||
1. Increment the ``OPENEXR_LIB_SOVERSION`` setting in [CMakeLists.txt](CMakeLists.txt).
|
||||
|
||||
The SO version increases whenever, and only when, the ABI changes
|
||||
in non-backwards-compatible ways. Consistent with the semantic
|
||||
versioning policy, this usually happens at major and minor
|
||||
releases, but never on a patch release.
|
||||
|
||||
Commit this change to the `RB-` branch.
|
||||
|
||||
|
||||
2. Confirm that the ``OPENEXR_VERSION_MAJOR``,
|
||||
``OPENEXR_VERSION_MINOR``, and ``OPENEXR_VERSION_PATCH`` value in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h)
|
||||
are correct. The OpenEXR project policy is that the values on the
|
||||
main branch, which is the bleeding edge of development, correspond
|
||||
to the next minor release, with the patch set to 0.
|
||||
are correct on the main branch. The OpenEXR project policy is that
|
||||
the values on the main branch, which is the bleeding edge of
|
||||
development, correspond to the next minor release, with the patch
|
||||
set to 0.
|
||||
|
||||
2. Update the release notes in [CHANGES.md](CHANGES.md):
|
||||
|
||||
- Write a high-level summary of the features and improvements.
|
||||
|
||||
- Include the log of all PR's that have *not* been merged into the
|
||||
previous minor release.
|
||||
|
||||
- Mention any OSS-Fuzz issues. Provide a link in the notes to the issue at
|
||||
https://bugs.chromium.org/p/oss-fuzz, including the issue id
|
||||
number and description.
|
||||
|
||||
- If there are any public CVE's, mention them explicitly with a
|
||||
link to the CVE registry item.
|
||||
|
||||
- Submit this change as a separate PR.
|
||||
|
||||
3. Add a mention of the release to [``docs/news.rst``](docs/news.rst)
|
||||
|
||||
- Submit this change as a separate PR.
|
||||
|
||||
4. Increment the ``OPENEXR_LIB_SOVERSION`` setting in [CMakeLists.txt](CMakeLists.txt).
|
||||
|
||||
- The SO version increases whenever, and only when, the ABI changes
|
||||
in non-backwards-compatible ways. Consistent with the semantic
|
||||
versioning policy, this usually happens at major and minor
|
||||
releases, but never on a patch release.
|
||||
|
||||
- Submit this change as a separate PR for review.
|
||||
|
||||
5. Once the above PR's are merged, create the release branch with the
|
||||
``RB`` prefix, e.g. ``RB-3.2``.
|
||||
|
||||
6. Update the ``IMATH_TAG`` setting in
|
||||
3. Update the ``IMATH_TAG`` setting in
|
||||
[cmake/OpenEXRSetup.cmake](cmake/OpenEXRSetup.cmake) to correspond
|
||||
to the proper Imath release.
|
||||
|
||||
7. Tag the release with a ``-rc`` "release candidate" tag,
|
||||
e.g. ``v3.2.0-rc``.
|
||||
|
||||
8. Send mail to ``openexr-dev@lists.aswf.io`` announcing the staging
|
||||
of the release with link to the release candidate tag. Include the
|
||||
release notes from [CHANGES.md](CHANGES.md) for review.
|
||||
|
||||
9. If additonal fixes need to go in before release:
|
||||
|
||||
a. Merge commits to the release branch. Push them directly, no need
|
||||
for a pull request.
|
||||
|
||||
b. Update the release notes in a separate commit.
|
||||
|
||||
c. Re-tag with a incremented "release candidate" number,
|
||||
e.g. ``v3.2.0-rc2``.
|
||||
|
||||
d. Send a email update to ``openexr-dev@lists.aswf.io`` notifying
|
||||
the community of the addition.
|
||||
|
||||
10. Draft the release on the GitHub
|
||||
[Releases](https://github.com/AcademySoftwareFoundation/openexr/releases)
|
||||
page. Include the summary from the notes in
|
||||
[CHANGES.md](CHANGES.md), but don't include the list of PR's.
|
||||
|
||||
- Create the release from the latest ``--rc`` tag, and give it a name
|
||||
that begins with ``v`` and ends in ``0``, e.g. ``v3.2.0``.
|
||||
|
||||
- Save the release as a "draft".
|
||||
|
||||
11. Wait at least 48 hours after the email announcement.
|
||||
|
||||
12. Publish the release
|
||||
|
||||
a. Click the "Publish release" button on the GitHub release draft
|
||||
|
||||
b. Send an email to ``openexr-dev@lists.aswf.io`` officially
|
||||
annoucing the release.
|
||||
|
||||
13. Update the ``release`` branch, which should always point to the
|
||||
most recent release.
|
||||
|
||||
From a clone of the main repo:
|
||||
|
||||
% git checkout release
|
||||
% git merge RB-3.1
|
||||
% git push
|
||||
|
||||
14. Increment ``OPENEXR_VERSION_MINOR`` in
|
||||
[src/lib/OpenEXRCore/openexr_version.h](src/lib/OpenEXRCore/openexr_version.h) on the main branch
|
||||
|
||||
- Submit a PR for this. This leaves the release version on the
|
||||
main branch pointing to the next minor release, as described in
|
||||
Step #1.
|
||||
|
||||
15. Build the website at https://readthedocs.org/projects/openexr.
|
||||
|
||||
16. If the release has resolved any OSS-Fuzz issues, update the
|
||||
associated pages at https://bugs.chromium.org/p/oss-fuzz with a
|
||||
reference to the release.
|
||||
|
||||
17. If the release has resolved any public CVE's, request an update
|
||||
from the registry service providing the release and a link to the
|
||||
release notes.
|
||||
|
||||
+48
-2
@@ -4,20 +4,37 @@
|
||||
This is a list of contributors to the OpenEXR project, sorted
|
||||
alphabetically by first name.
|
||||
|
||||
If you know of missing, please email: info@openexr.com.
|
||||
|
||||
If you know of missing, please email info@openexr.com or submit a PR.
|
||||
|
||||
* Aaron Demolder
|
||||
* Abe Fettig
|
||||
* Aloys Baillet
|
||||
* Andre Mazzone
|
||||
* Andrew Kunz
|
||||
* Anton Dukhovnikov
|
||||
* Antonio Rojas
|
||||
* Aras Pranckevičius
|
||||
* Arkady Shapkin
|
||||
* Arkell Rasiah
|
||||
* Axel Waggershauser
|
||||
* Balázs Oroszi
|
||||
* Barnaby Robson
|
||||
* Ben Grimes
|
||||
* Brendan Bolles
|
||||
* Cary Phillips
|
||||
* Chris Leu
|
||||
* Christina Tempelaar-Lietz
|
||||
* Christopher Horvath
|
||||
* Christopher Kulla
|
||||
* Christoph Gohlke
|
||||
* Cristian Martínez
|
||||
* Dan Horák
|
||||
* Daniel Kaneider
|
||||
* Darby Johnston
|
||||
* Dave Sawyer
|
||||
* David Korczynski
|
||||
* Diogo Teles Sant'Anna
|
||||
* Dirk Lemstra
|
||||
* Drew Hess
|
||||
* Ed Hanway
|
||||
* Edward Kmett
|
||||
@@ -25,47 +42,76 @@ If you know of missing, please email: info@openexr.com.
|
||||
* Eric Wimmer
|
||||
* E Sommerlade
|
||||
* Florian Kainz
|
||||
* Grant Kim
|
||||
* Gregorio Litenstein
|
||||
* Gyula Gubacsi
|
||||
* Halfdan Ingvarsson
|
||||
* Harry Mallon
|
||||
* Huibean Luo
|
||||
* Ibraheem Alhashim
|
||||
* Jack Kingsman
|
||||
* Jamie Kenyon
|
||||
* Jan Tojnar
|
||||
* Jean-Francois Panisset
|
||||
* Jens Lindgren
|
||||
* Ji Hun Yu
|
||||
* Johannes Vollmer
|
||||
* John Loy
|
||||
* John Mertic
|
||||
* Jonathan Stone
|
||||
* Jose Luis Cercos-Pita
|
||||
* Joseph Goldstone
|
||||
* Juha Reunanen
|
||||
* Julian Amann
|
||||
* Juri Abramov
|
||||
* Karl Hendrikse
|
||||
* Karl Rasche
|
||||
* Kevin Wheatley
|
||||
* Kimball Thurston
|
||||
* Larry Gritz
|
||||
* Laurens Voerman
|
||||
* L. E. Segovia
|
||||
* Liam Fernandez
|
||||
* Lucy Wilkes
|
||||
* Mark Reid
|
||||
* Mark Sisson
|
||||
* Martin Aumüller
|
||||
* Martin Husemann
|
||||
* Matthäus G. Chajdas
|
||||
* Matthias C. M. Troffaes
|
||||
* Matt Pharr
|
||||
* Md Sadman Chowdhury
|
||||
* Michael Thomas
|
||||
* Moira Shooter
|
||||
* Nicholas Yue
|
||||
* Nick Porcino
|
||||
* Nick Rasmussen
|
||||
* Nicolas Chauvet
|
||||
* Niklas Hambüchen
|
||||
* OgreTransporter
|
||||
* Owen Thompson
|
||||
* Paul Schneider
|
||||
* Peter Hillman
|
||||
* Peter Steneteg
|
||||
* Peter Urbanec
|
||||
* Phil Barrett
|
||||
* Piotr Stanczyk
|
||||
* Ralph Potter
|
||||
* Rémi Achard
|
||||
* Reto Kromer
|
||||
* Richard Goedeken
|
||||
* Sergey Fedorov
|
||||
* Shawn Walker-Salas
|
||||
* Simon Boorer
|
||||
* Simon Otter
|
||||
* Srinath Ravichandran
|
||||
* Thanh Ha
|
||||
* Thomas Debesse
|
||||
* Thorsten Kaufmann
|
||||
* Timothy Lyanguzov
|
||||
* Wenzel Jakob
|
||||
* Wojciech Jarosz
|
||||
* Xo Wang
|
||||
* Yaakov Selkowitz
|
||||
* Yining Karl Li
|
||||
* Yujie Shu
|
||||
|
||||
@@ -110,10 +110,7 @@ ConvertDtexFile (
|
||||
PXDU_THROW (
|
||||
"error (" << dtexOpenError << " opening file: " << i_fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
PXDU_THROW ("missing file: " << i_fileName);
|
||||
}
|
||||
else { PXDU_THROW ("missing file: " << i_fileName); }
|
||||
}
|
||||
|
||||
// Just handling the first image in the Dtex file for now.
|
||||
@@ -438,34 +435,13 @@ ParseArguments (
|
||||
}
|
||||
o_exrFileName = arg;
|
||||
}
|
||||
else if (arg == "--deepOpacity")
|
||||
{
|
||||
o_params.deepOpacity = true;
|
||||
}
|
||||
else if (arg == "--deepAlpha")
|
||||
{
|
||||
o_params.deepOpacity = false;
|
||||
}
|
||||
else if (arg == "--discrete")
|
||||
{
|
||||
o_params.discrete = true;
|
||||
}
|
||||
else if (arg == "--continuous")
|
||||
{
|
||||
o_params.discrete = false;
|
||||
}
|
||||
else if (arg == "--full")
|
||||
{
|
||||
o_full = true;
|
||||
}
|
||||
else if (arg == "--half")
|
||||
{
|
||||
o_full = false;
|
||||
}
|
||||
else if (arg == "--multRgb")
|
||||
{
|
||||
o_params.multiplyColorByAlpha = true;
|
||||
}
|
||||
else if (arg == "--deepOpacity") { o_params.deepOpacity = true; }
|
||||
else if (arg == "--deepAlpha") { o_params.deepOpacity = false; }
|
||||
else if (arg == "--discrete") { o_params.discrete = true; }
|
||||
else if (arg == "--continuous") { o_params.discrete = false; }
|
||||
else if (arg == "--full") { o_full = true; }
|
||||
else if (arg == "--half") { o_full = false; }
|
||||
else if (arg == "--multRgb") { o_params.multiplyColorByAlpha = true; }
|
||||
else if (arg == "--sideways")
|
||||
{
|
||||
if (argi <= argc - 1)
|
||||
@@ -493,10 +469,7 @@ ParseArguments (
|
||||
"Invalid parameter for --sideways: " << argv[argi + 1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
o_params.sideways = true;
|
||||
}
|
||||
else { o_params.sideways = true; }
|
||||
}
|
||||
else if (arg == "--compressionError")
|
||||
{
|
||||
|
||||
@@ -135,14 +135,8 @@ struct Span
|
||||
bool operator< (const Span& i_other) const
|
||||
{
|
||||
if (in < i_other.in) { return true; }
|
||||
else if (in == i_other.in)
|
||||
{
|
||||
return index < i_other.index;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (in == i_other.in) { return index < i_other.index; }
|
||||
else { return false; }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -44,10 +44,7 @@ DensityFromVizDz (double i_viz, double i_dz)
|
||||
{
|
||||
double d = -log (i_viz) / i_dz;
|
||||
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0; }
|
||||
else
|
||||
{
|
||||
return d;
|
||||
}
|
||||
else { return d; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +74,7 @@ DensityTimesDzFromViz (double i_viz)
|
||||
{
|
||||
double d = -log (i_viz);
|
||||
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0 * PXDU_DZ_OF_VIZ_0; }
|
||||
else
|
||||
{
|
||||
return d;
|
||||
}
|
||||
else { return d; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,19 +109,13 @@ DzFromVizDensity (double i_viz, double i_density)
|
||||
// This whole part is hacky at best.
|
||||
double dz = -log (i_viz) / PXDU_MIN_NON_ZERO_DENSITY;
|
||||
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
|
||||
else
|
||||
{
|
||||
return dz;
|
||||
}
|
||||
else { return dz; }
|
||||
}
|
||||
else
|
||||
{
|
||||
double dz = -log (i_viz) / i_density;
|
||||
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
|
||||
else
|
||||
{
|
||||
return dz;
|
||||
}
|
||||
else { return dz; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,10 +287,7 @@ inline T
|
||||
ZeroNAN (T i_f)
|
||||
{
|
||||
if (!isfinite (i_f)) { return (T) 0; }
|
||||
else
|
||||
{
|
||||
return i_f;
|
||||
}
|
||||
else { return i_f; }
|
||||
}
|
||||
|
||||
//-*****************************************************************************
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ represents the project at ASWF TAC meetings.
|
||||
* Kimball Thurston - Weta Digital, Ltd.
|
||||
* Nick Porcino - Pixar Animation Studios
|
||||
* Christina Tempelaar-Lietz - Industrial Light & Magic
|
||||
* Joseph Goldstone - ARRI
|
||||
* Joseph Goldstone - Lilliputian Pictures LLC
|
||||
* John Mertic - The Linux Foundation
|
||||
|
||||
### TSC Meetings
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
<!-- SPDX-License-Identifier: BSD-3-Clause -->
|
||||
<!-- Copyright (c) Contributors to the OpenEXR Project -->
|
||||
|
||||
Copyright (c) Contributors to the OpenEXR Project. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
module(
|
||||
name = "openexr",
|
||||
compatibility_level = 1,
|
||||
)
|
||||
|
||||
bazel_dep(name = "bazel_skylib", version = "1.9.0")
|
||||
bazel_dep(name = "imath", version = "3.2.2.bcr.1")
|
||||
bazel_dep(name = "libdeflate", version = "1.25")
|
||||
bazel_dep(name = "openjph", version = "0.27.3.bcr.1")
|
||||
bazel_dep(name = "platforms", version = "1.1.0")
|
||||
bazel_dep(name = "rules_cc", version = "0.2.22")
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
[](LICENSE.md)
|
||||
[](https://bestpractices.coreinfrastructure.org/projects/2799)
|
||||
[](https://securityscorecards.dev/viewer/?uri=github.com/AcademySoftwareFoundation/openexr)
|
||||
[](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3ACI)
|
||||
[](https://github.com/AcademySoftwareFoundation/openexr/actions?query=workflow%3AAnalysis)
|
||||
[](https://sonarcloud.io/dashboard?id=AcademySoftwareFoundation_openexr)
|
||||
@@ -52,54 +53,70 @@ package.
|
||||
|
||||
OpenEXR is a project of the [Academy Software
|
||||
Foundation](https://www.aswf.io). See the project's [governance
|
||||
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBUTING.md), and [code of conduct](CODE_OF_CONDUCT)
|
||||
policies](GOVERNANCE.md), [contribution guidelines](CONTRIBUTING.md), and [code of conduct](CODE_OF_CONDUCT.md)
|
||||
for more information.
|
||||
|
||||
# Building OpenEXR
|
||||
|
||||
See the [Install instructions](https://openexr.com/en/latest/install.html) for instructions on how to build
|
||||
OpenEXR and its required prerequisites.
|
||||
|
||||
# Quick Start
|
||||
|
||||
See the [technical documentation](https://openexr.readthedocs.io) for
|
||||
complete details, but to get started, the "hello, world" `.exr` writer program is:
|
||||
complete details, but to get started, the "Hello, world" [`exrwriter.cpp`](https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr/main/website/src/exrwriter/exrwriter.cpp) writer program is:
|
||||
|
||||
#include <ImfRgbaFile.h>
|
||||
#include <ImfArray.h>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
using namespace OPENEXR_IMF_NAMESPACE;
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
int width = 100;
|
||||
int height = 50;
|
||||
|
||||
Array2D<Rgba> pixels(height, width);
|
||||
for (int y=0; y<height; y++)
|
||||
{
|
||||
float c = (y / 5 % 2 == 0) ? (y / (float) height) : 0.0;
|
||||
for (int x=0; x<width; x++)
|
||||
pixels[y][x] = Rgba(c, c, c);
|
||||
}
|
||||
|
||||
try {
|
||||
int width = 10;
|
||||
int height = 10;
|
||||
|
||||
Imf::Array2D<Imf::Rgba> pixels(width, height);
|
||||
for (int y=0; y<height; y++)
|
||||
for (int x=0; x<width; x++)
|
||||
pixels[y][x] = Imf::Rgba(0, x / (width-1.0f), y / (height-1.0f));
|
||||
|
||||
Imf::RgbaOutputFile file ("hello.exr", width, height, Imf::WRITE_RGBA);
|
||||
RgbaOutputFile file ("stripes.exr", width, height, WRITE_RGBA);
|
||||
file.setFrameBuffer (&pixels[0][0], 1, width);
|
||||
file.writePixels (height);
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << "Unable to read image file hello.exr:" << e.what() << std::endl;
|
||||
std::cerr << "error writing image file stripes.exr:" << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
The `CMakeLists.txt` to build:
|
||||
This creates an image 100 pixels wide and 50 pixels high with
|
||||
horizontal stripes 5 pixels high of graduated intensity, bright on the
|
||||
bottom of the image and dark towards the top. Note that ``pixel[0][0]``
|
||||
is in the upper left:
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||

|
||||
|
||||
The [`CMakeLists.txt`](https://raw.githubusercontent.com/AcademySoftwareFoundation/openexr/main/website/src/exrwriter/CMakeLists.txt) to build:
|
||||
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
project(exrwriter)
|
||||
find_package(OpenEXR REQUIRED)
|
||||
|
||||
add_executable(${PROJECT_NAME} writer.cpp)
|
||||
|
||||
add_executable(${PROJECT_NAME} exrwriter.cpp)
|
||||
target_link_libraries(${PROJECT_NAME} OpenEXR::OpenEXR)
|
||||
|
||||
To build:
|
||||
|
||||
$ mkdir _build
|
||||
$ cmake -S . -B _build
|
||||
$ make --build _build
|
||||
$ cmake -S . -B _build -DCMAKE_PREFIX_PATH=<path to OpenEXR libraries/includes>
|
||||
$ cmake --build _build
|
||||
|
||||
For more details, see [The OpenEXR
|
||||
API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
|
||||
@@ -117,7 +134,9 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
|
||||
- Technical Steering Committee meetings are open to the
|
||||
public, fortnightly on Thursdays, 1:30pm Pacific Time.
|
||||
|
||||
- Calendar: https://lists.aswf.io/g/openexr-dev/calendar
|
||||
- Calendar: https://zoom-lfx.platform.linuxfoundation.org/meetings/openexr
|
||||
|
||||
- Meeting Notes: https://wiki.aswf.io/display/OEXR/TSC+Meetings
|
||||
|
||||
* **Report a bug:**
|
||||
|
||||
@@ -125,7 +144,10 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
|
||||
|
||||
* **Report a security vulnerability:**
|
||||
|
||||
- Email to security@openexr.com
|
||||
- File a GitHub [security
|
||||
advisory](https://github.com/AcademySoftwareFoundation/openexr/security/advisories/new).
|
||||
Email security@openexr.com for private/secure discussion with the project
|
||||
maintainers.
|
||||
|
||||
* **Contribute a Fix, Feature, or Improvement:**
|
||||
|
||||
@@ -133,9 +155,12 @@ API](https://openexr.readthedocs.io/en/latest/API.html#the-openexr-api).
|
||||
|
||||
- Sign the [Contributor License
|
||||
Agreement](https://contributor.easycla.lfx.linuxfoundation.org/#/cla/project/2e8710cb-e379-4116-a9ba-964f83618cc5/user/564e571e-12d7-4857-abd4-898939accdd7)
|
||||
|
||||
|
||||
- Submit a Pull Request: https://github.com/AcademySoftwareFoundation/openexr/pulls
|
||||
|
||||
- If you'd like to contribute and could use some ideas of what to
|
||||
do, browse "good first issues" [here](https://github.com/AcademySoftwareFoundation/openexr/contribute) or on [Clotributor](https://clotributor.dev/search?ts_query_web=openexr&page=1).
|
||||
|
||||
# Resources
|
||||
|
||||
- Website: http://www.openexr.com
|
||||
|
||||
+255
-43
@@ -6,54 +6,266 @@
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you think you've found a potential vulnerability in OpenEXR, please
|
||||
report it by emailing security@openexr.com. Only Technical Steering
|
||||
Committee members and Academy Software Foundation project management
|
||||
have access to these messages. Include detailed steps to reproduce the
|
||||
issue, and any other information that could aid an investigation. Our
|
||||
policy is to respond to vulnerability reports within 14 days.
|
||||
report it by filing a GitHub [security
|
||||
advisory](https://github.com/AcademySoftwareFoundation/openexr/security/advisories/new). Alternatively,
|
||||
email security@openexr.com and provide your contact info for further
|
||||
private/secure discussion. If your email does not receive a prompt
|
||||
acknowledgement, your address may be blocked.
|
||||
|
||||
Our policy is to address critical security vulnerabilities rapidly and
|
||||
post patches as quickly as possible.
|
||||
Our policy is to acknowledge the receipt of vulnerability reports
|
||||
within 48 hours. Our policy is to address critical security vulnerabilities
|
||||
rapidly and post patches within 14 days if possible.
|
||||
|
||||
## CVE Assignment
|
||||
|
||||
Our criteria for requesting a CVE are:
|
||||
|
||||
- Memory safety violations (out-of-bounds write, use-after-free, heap
|
||||
corruption) reachable on mainstream 64-bit architectures through the
|
||||
public library API, confirmed in an unsanitized build on a mainstream
|
||||
platform, and affecting library code so that every downstream consumer
|
||||
inherits the risk.
|
||||
|
||||
We do not request a CVE for:
|
||||
|
||||
- 32-bit-only bugs — bugs on 32-bit systems are real and will be fixed,
|
||||
but since the vast majority of downstream packages (Linux distros,
|
||||
conda-forge, vcpkg) build for 64-bit exclusively, a CVE creates
|
||||
unnecessary work for maintainers who are not actually affected.
|
||||
|
||||
- Developer-tool-only crashes (exrmetrics, exrcheck) — the library
|
||||
itself and standard utility programs are safe; only users who run
|
||||
one of the developer tools on untrusted input are exposed.
|
||||
|
||||
Flaws whose root cause lies in a bundled dependency (such as OpenJPH)
|
||||
are fixed upstream; the upstream project owns the CVE when one is
|
||||
warranted. This applies even when a flaw is detected in dependency code
|
||||
vendored into OpenEXR's `external/` source directory. OpenEXR addresses
|
||||
such flaws by updating the dependency and noting the upstream advisory
|
||||
in the release notes. We request a CVE for OpenEXR itself only when the
|
||||
flaw is in our code and untrusted input can reach it through normal use
|
||||
of the library.
|
||||
|
||||
## Known Vulnerabilities
|
||||
|
||||
These vulnerabilities are present in the given versions:
|
||||
| CVE | Affected Versions | Patched Versions |
|
||||
| --- | ----------------- | ---------------- |
|
||||
|
||||
* [CVE-2021-45942](https://nvd.nist.gov/vuln/detail/CVE-2021-45942) 3.1.0, 3.1.1, 3.1.2, 3.1.3
|
||||
* [CVE-2021-20296](https://nvd.nist.gov/vuln/detail/CVE-2021-20296) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3479](https://nvd.nist.gov/vuln/detail/CVE-2021-3479) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3478](https://nvd.nist.gov/vuln/detail/CVE-2021-3478) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3477](https://nvd.nist.gov/vuln/detail/CVE-2021-3477) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3476](https://nvd.nist.gov/vuln/detail/CVE-2021-3476) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3475](https://nvd.nist.gov/vuln/detail/CVE-2021-3475) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2021-3474](https://nvd.nist.gov/vuln/detail/CVE-2021-3474) 2.4.0, 2.4.1, 2.4.2, 2.5.0, 2.5.1, 2.5.2, 2.5.3
|
||||
* [CVE-2020-16589](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16589) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-16588](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16588) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-16587](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16587) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0, 2.4.1, 2.5.0, 2.5.1
|
||||
* [CVE-2020-11765](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11765) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11764](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11764) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11763](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11763) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11762](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11762) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11761](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11761) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11760) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11759](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11759) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2020-11758](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11758) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.4.0
|
||||
* [CVE-2018-18444](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18444) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2018-18443](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18443) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2017-9116](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9116) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9115](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9115) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9114](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9114) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9113](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9113) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9112](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9112) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9111](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9111) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-9110](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9110) 2.0.0, 2.0.1, 2.1.0, 2.2.0
|
||||
* [CVE-2017-12596](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12596) 2.0.0, 2.0.1, 2.1.0, 2.2.0, 2.2.1, 2.3.0
|
||||
* [CVE-2009-1722](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1722) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
* [CVE-2009-1721](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1721) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
* [CVE-2009-1720](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1720) 1.0.*, 1.1.*, 1.2.*, 1.3.*, 1.4.*, 1.5.*, 1.6.*
|
||||
| [CVE-2026-55373](https://www.cve.org/CVERecord?id=CVE-2026-55373) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
|
||||
| [CVE-2026-55371](https://www.cve.org/CVERecord?id=CVE-2026-55371) | 3.4.0–3.4.12 | 3.4.13 |
|
||||
| [CVE-2026-55059](https://www.cve.org/CVERecord?id=CVE-2026-55059) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
|
||||
| [CVE-2026-54920](https://www.cve.org/CVERecord?id=CVE-2026-54920) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.9, 3.3.0–3.3.11, 3.4.0–3.4.12 | 3.2.10, 3.3.12, 3.4.13 |
|
||||
| [CVE-2026-53532](https://www.cve.org/CVERecord?id=CVE-2026-53532) | 3.4.0–3.4.12 | 3.4.13 |
|
||||
| [CVE-2026-45696](https://www.cve.org/CVERecord?id=CVE-2026-45696) | 3.4.0–3.4.11 | 3.4.12 |
|
||||
| [CVE-2026-44663](https://www.cve.org/CVERecord?id=CVE-2026-44663) | 3.4.0–3.4.11 | 3.4.12 |
|
||||
| [CVE-2026-42217](https://www.cve.org/CVERecord?id=CVE-2026-42217) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
|
||||
| [CVE-2026-42216](https://www.cve.org/CVERecord?id=CVE-2026-42216) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
|
||||
| [CVE-2026-41142](https://www.cve.org/CVERecord?id=CVE-2026-41142) | 3.2.0–3.2.8, 3.3.0–3.3.10, 3.4.0–3.4.10 | 3.2.9, 3.3.11, 3.4.11 |
|
||||
| [CVE-2026-40250](https://www.cve.org/CVERecord?id=CVE-2026-40250) | 3.2.0–3.2.7, 3.3.0–3.3.9, 3.4.0–3.4.9 | 3.2.8, 3.3.10, 3.4.10 |
|
||||
| [CVE-2026-40244](https://www.cve.org/CVERecord?id=CVE-2026-40244) | 3.2.0–3.2.7, 3.3.0–3.3.9, 3.4.0–3.4.9 | 3.2.8, 3.3.10, 3.4.10 |
|
||||
| [CVE-2026-39886](https://www.cve.org/CVERecord?id=CVE-2026-39886) | 3.4.0–3.4.9 | 3.4.10 |
|
||||
| [CVE-2026-34589](https://www.cve.org/CVERecord?id=CVE-2026-34589) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
|
||||
| [CVE-2026-34588](https://www.cve.org/CVERecord?id=CVE-2026-34588) | 3.1.x, 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
|
||||
| [CVE-2026-34545](https://www.cve.org/CVERecord?id=CVE-2026-34545) | 3.4.0–3.4.6 | 3.4.7 |
|
||||
| [CVE-2026-34544](https://www.cve.org/CVERecord?id=CVE-2026-34544) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.7 | 3.2.7, 3.3.9, 3.4.8 |
|
||||
| [CVE-2026-34543](https://www.cve.org/CVERecord?id=CVE-2026-34543) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.7 | 3.2.7, 3.3.9, 3.4.8 |
|
||||
| [CVE-2026-34380](https://www.cve.org/CVERecord?id=CVE-2026-34380) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
|
||||
| [CVE-2026-34379](https://www.cve.org/CVERecord?id=CVE-2026-34379) | 3.2.0–3.2.6, 3.3.0–3.3.8, 3.4.0–3.4.8 | 3.2.7, 3.3.9, 3.4.9 |
|
||||
| [CVE-2026-34378](https://www.cve.org/CVERecord?id=CVE-2026-34378) | 3.4.0–3.4.8 | 3.4.9 |
|
||||
| [CVE-2026-27622](https://www.cve.org/CVERecord?id=CVE-2026-27622) | 2.x, 3.0.x, 3.1.x, 3.2.0–3.2.5, 3.3.0–3.3.7, 3.4.0–3.4.5 | 3.2.6, 3.3.8, 3.4.6 |
|
||||
| [CVE-2026-26981](https://www.cve.org/CVERecord?id=CVE-2026-26981) | 3.3.0–3.3.6, 3.4.0–3.4.4 | 3.3.7, 3.4.5 |
|
||||
| [CVE-2025-64183](https://www.cve.org/CVERecord?id=CVE-2025-64183) | 3.2.0–3.2.4, 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.2.5, 3.3.6, 3.4.3 |
|
||||
| [CVE-2025-64182](https://www.cve.org/CVERecord?id=CVE-2025-64182) | 3.2.0–3.2.4, 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.2.5, 3.3.6, 3.4.3 |
|
||||
| [CVE-2025-64181](https://www.cve.org/CVERecord?id=CVE-2025-64181) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
|
||||
| [CVE-2025-48074](https://www.cve.org/CVERecord?id=CVE-2025-48074) | 3.3.2 | 3.3.3 |
|
||||
| [CVE-2025-48073](https://www.cve.org/CVERecord?id=CVE-2025-48073) | 3.3.2 | 3.3.3 |
|
||||
| [CVE-2025-48072](https://www.cve.org/CVERecord?id=CVE-2025-48072) | 3.3.2 | 3.3.3 |
|
||||
| [CVE-2025-48071](https://www.cve.org/CVERecord?id=CVE-2025-48071) | 3.3.0–3.3.2 | 3.3.3 |
|
||||
| [CVE-2025-12840](https://www.cve.org/CVERecord?id=CVE-2025-12840) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
|
||||
| [CVE-2025-12839](https://www.cve.org/CVERecord?id=CVE-2025-12839) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
|
||||
| [CVE-2025-12495](https://www.cve.org/CVERecord?id=CVE-2025-12495) | 3.3.0–3.3.5, 3.4.0–3.4.2 | 3.3.6, 3.4.3 |
|
||||
| [CVE-2023-5841](https://nvd.nist.gov/vuln/detail/CVE-2023-5841) | 3.1.0–3.1.11, 3.2.0–3.2.1 | 3.2.2 |
|
||||
| [CVE-2021-45942](https://nvd.nist.gov/vuln/detail/CVE-2021-45942) | 3.1.0–3.1.3 | 3.1.4 |
|
||||
| [CVE-2021-20296](https://nvd.nist.gov/vuln/detail/CVE-2021-20296) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3479](https://nvd.nist.gov/vuln/detail/CVE-2021-3479) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3478](https://nvd.nist.gov/vuln/detail/CVE-2021-3478) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3477](https://nvd.nist.gov/vuln/detail/CVE-2021-3477) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3476](https://nvd.nist.gov/vuln/detail/CVE-2021-3476) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3475](https://nvd.nist.gov/vuln/detail/CVE-2021-3475) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2021-3474](https://nvd.nist.gov/vuln/detail/CVE-2021-3474) | 2.4.0–2.4.2, 2.5.0–2.5.3 | 2.4.3, 2.5.4 |
|
||||
| [CVE-2020-16589](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16589) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0 | 2.4.0 |
|
||||
| [CVE-2020-16588](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16588) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0 | 2.4.0 |
|
||||
| [CVE-2020-16587](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-16587) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0 | 2.4.0 |
|
||||
| [CVE-2020-15306](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15306) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0–2.4.1, 2.5.0–2.5.1 | 2.5.2 |
|
||||
| [CVE-2020-15305](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15305) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0–2.4.1, 2.5.0–2.5.1 | 2.5.2 |
|
||||
| [CVE-2020-15304](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15304) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0–2.4.1, 2.5.0–2.5.1 | 2.5.2 |
|
||||
| [CVE-2020-11765](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11765) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11764](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11764) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11763](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11763) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11762](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11762) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11761](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11761) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11760) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11759](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11759) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2020-11758](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11758) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0, 2.4.0 | 2.4.1 |
|
||||
| [CVE-2018-18444](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18444) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0 | 2.4.0 |
|
||||
| [CVE-2018-18443](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-18443) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1, 2.3.0 | 2.4.0 |
|
||||
| [CVE-2017-9116](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9116) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9115](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9115) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9114](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9114) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9113](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9113) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9112](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9112) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9111](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9111) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-9110](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9110) | 2.0.0–2.0.1, 2.1.0, 2.2.0 | 2.2.1 |
|
||||
| [CVE-2017-12596](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-12596) | 2.0.0–2.0.1, 2.1.0, 2.2.0–2.2.1 | 2.3.0 |
|
||||
| [CVE-2009-1722](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1722) | 1.0.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
|
||||
| [CVE-2009-1721](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1721) | 1.0.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
|
||||
| [CVE-2009-1720](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1720) | 1.0.x, 1.1.x, 1.2.x, 1.3.x, 1.4.x, 1.5.x, 1.6.x | 1.7.0 |
|
||||
|
||||
See the [release notes](CHANGES.md) for more information.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
This gives guidance about which releases/branches are supported with bug fixes and patches to
|
||||
security vulnerabilities.
|
||||
|
||||
| Version / branch | Supported |
|
||||
|-------| ---------------------------------------------------- |
|
||||
| main | :white_check_mark: :construction: All fixes immediately, although this branch is under development with potential unstable ABI/API
|
||||
| 3.4.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility
|
||||
| 3.3.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility
|
||||
| 3.2.x | :warning: Patch releases considered in response to specific requests
|
||||
| 3.1.x | :warning: Patch releases considered in response to specific requests
|
||||
| 3.0.x | :warning: Patch releases considered in response to specific requests
|
||||
| 2.5.x | :warning: Patch releases considered in response to specific requests
|
||||
| 2.4.x | :warning: Patch releases considered in response to specific requests
|
||||
| 2.3.x | :x: No longer receiving patches of any kind
|
||||
| 2.2.x | :x: No longer receiving patches of any kind
|
||||
| 2.1.x | :x: No longer receiving patches of any kind
|
||||
| 2.0.x | :x: No longer receiving patches of any kind
|
||||
| 1.x | :x: No longer receiving patches of any kind
|
||||
|
||||
## Signed Releases
|
||||
|
||||
Releases artifacts are signed via
|
||||
[sigstore](https://www.sigstore.dev). See
|
||||
[release-sign.yml](.github/workflows/release-sign.yml) for details.
|
||||
|
||||
To verify a downloaded release at a given tag:
|
||||
|
||||
% pip install sigstore
|
||||
% sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/openexr/.github/workflows/release-sign.yml@refs/tags/<tag> openexr-<tag>.tar.gz
|
||||
|
||||
## Security Expectations
|
||||
|
||||
### Software Features
|
||||
|
||||
- The OpenEXR project implements the EXR image file format, used
|
||||
throughout the motion picture industry and beyond, on Linux, macOS,
|
||||
and Windows.
|
||||
|
||||
- The project consists of a software run-time library, implemented in
|
||||
C/C++ and built via cmake, that reads and writes image data
|
||||
files. The project also distributes python wrappings for the C/C++
|
||||
I/O API.
|
||||
|
||||
- The library reads and writes binary image data and text-based
|
||||
metadata, treated as blind data, none of which is executable code.
|
||||
|
||||
- Other than the website and online technical documentation, the
|
||||
project implements no web/online services or network communication
|
||||
protocols. The library never requests any security or
|
||||
authentication credentials or login information from users.
|
||||
|
||||
The website implements no interactive features and requires no login
|
||||
credentials.
|
||||
|
||||
- The library reads and writes only to file paths specifically requested
|
||||
via the C/C++ API. The runtime library uses no system configuration
|
||||
files or sidecar data files. Access to data files uses only standard
|
||||
file I/O system calls.
|
||||
|
||||
- The library compresses/decompresses data via standard compression
|
||||
algorithms but uses no cryptographic or confidentiality protocols.
|
||||
|
||||
### Software Dependencies
|
||||
|
||||
OpenEXR depends on
|
||||
[Imath](https://github.com/AcademySoftwareFoundation/Imath), a library
|
||||
of basic math operations also maintained and distributed by the
|
||||
OpenEXR project. Imath follows the same security conventions
|
||||
documented here for OpenEXR itself. The core Imath library has no
|
||||
external dependencies. The Imath python bindings depend on python and
|
||||
boost.
|
||||
|
||||
The only
|
||||
external library dependency of OpenEXR is
|
||||
[libdeflate](https://github.com/ebiggers/libdeflate), which implements
|
||||
standard deflate/zlib/gzip compression and decompression.
|
||||
|
||||
The project uses
|
||||
[Snyk](https://github.com/AcademySoftwareFoundation/openexr/blob/main/.github/workflows/snyk-scan-pr.yml)
|
||||
to scan for dependency vulnerability.
|
||||
|
||||
### Potential Vulnerabilities
|
||||
|
||||
Potential entry points are images being loaded using the
|
||||
library. Malformed images could caused issues such as heap buffer
|
||||
overflows, out-of-memory faults, or segmentation faults that could be
|
||||
exploitable as denial-of-service attacks.
|
||||
|
||||
### Image Size Limits and Out-of-Memory Failures
|
||||
|
||||
The OpenEXR file format places no fixed limit on image size, except
|
||||
that image width and height are represented by signed 32-bit integers
|
||||
and therefore technically limited to a maximum of 2,147,483,647.
|
||||
|
||||
Memory allocation failures caused by large image dimensions declared
|
||||
in file headers are not considered security vulnerabilities when the
|
||||
allocation size is proportional to the declared image dimensions. EXR
|
||||
files can legitimately describe very large images, and the memory
|
||||
required to decode them is inherently proportional to their pixel
|
||||
count. Exhausting available memory on a given machine is a system
|
||||
resource constraint, not a library defect — the same file that
|
||||
triggers an out-of-memory error on one machine may load successfully
|
||||
on another with more memory.
|
||||
|
||||
The OpenEXR library provides
|
||||
`Imf::Header::setMaxImageSize(int maxWidth,int maxHeight)` and
|
||||
`Imf::Header:"setMaxTileSize(int maxWidth,int maxHeight)` (and
|
||||
`exr_set_default_maximum_image_size()` and
|
||||
`exr_set_default_maximum_tile_size()` in OpenEXRCore) to allow
|
||||
applications to reject files with dimensions exceeding a configurable
|
||||
limit before any large allocation occurs. Applications processing
|
||||
untrusted EXR files should set these limits to values appropriate for
|
||||
their deployment environment.
|
||||
|
||||
### Hardening
|
||||
|
||||
#### Testing
|
||||
|
||||
The OpenEXR project implements a comprehensive suite of validation
|
||||
tests, including fuzz testing to harden against malicious input
|
||||
data. Note that fuzz testing hardens only against *small* input data
|
||||
files and is not a comprehensive test against all potential input.
|
||||
|
||||
Note that the
|
||||
[exrcheck](https://github.com/AcademySoftwareFoundation/openexr/tree/main/src/bin/exrcheck)
|
||||
utility is intended to be used by testers to demonstrate a particular
|
||||
proof-of-concept input file exposes a vulnerability, and it is very
|
||||
helpful to let us know if a vulnerability can be reproduced using that
|
||||
tool.
|
||||
|
||||
The project also uses the [OSS
|
||||
Fuzz](https://bugs.chromium.org/p/oss-fuzz) service for continuous
|
||||
fuzz testing.
|
||||
|
||||
#### Development Cycle and Distribution
|
||||
|
||||
OpenEXR is downloadable and buildable by C/C++ source via GitHub. Only
|
||||
members of the project's Technical Steering Committee, all veteran
|
||||
software engineers at major motion picture studios or vendors, have
|
||||
write permissions on the source code repository. All critical software
|
||||
changes are reviewed by multiple TSC members.
|
||||
|
||||
The library is distributed in binary form via many common package
|
||||
managers across all platforms.
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright Contributors to the OpenEXR Project.
|
||||
|
||||
workspace(name = "com_openexr")
|
||||
|
||||
load("//:bazel/third_party/openexr_deps.bzl", "openexr_deps")
|
||||
|
||||
openexr_deps()
|
||||
|
||||
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
||||
|
||||
bazel_skylib_workspace()
|
||||
Vendored
-76
@@ -1,76 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
|
||||
|
||||
expand_template(
|
||||
name = "ImathConfig",
|
||||
out = "src/Imath/ImathConfig.h",
|
||||
substitutions = {
|
||||
"@IMATH_INTERNAL_NAMESPACE@": "Imath_3_1",
|
||||
"@IMATH_LIB_VERSION@": "3.1.9",
|
||||
"@IMATH_NAMESPACE_CUSTOM@": "0",
|
||||
"@IMATH_NAMESPACE@": "Imath",
|
||||
"@IMATH_PACKAGE_NAME@": "Imath 3.1.9",
|
||||
"@Imath_VERSION_MAJOR@": "3",
|
||||
"@Imath_VERSION_MINOR@": "1",
|
||||
"@Imath_VERSION_PATCH@": "9",
|
||||
"@IMATH_VERSION@": "3.1.9",
|
||||
"#cmakedefine IMATH_HALF_USE_LOOKUP_TABLE": "#define IMATH_HALF_USE_LOOKUP_TABLE",
|
||||
"#cmakedefine IMATH_ENABLE_API_VISIBILITY": "#define IMATH_ENABLE_API_VISIBILITY",
|
||||
"#cmakedefine IMATH_HAVE_LARGE_STACK": "/* #undef IMATH_HAVE_LARGE_STACK */",
|
||||
"#cmakedefine01 IMATH_USE_NOEXCEPT": "#define IMATH_USE_NOEXCEPT 1",
|
||||
},
|
||||
template = "config/ImathConfig.h.in",
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "Imath",
|
||||
srcs = [
|
||||
"src/Imath/ImathColorAlgo.cpp",
|
||||
"src/Imath/ImathFun.cpp",
|
||||
"src/Imath/ImathMatrixAlgo.cpp",
|
||||
"src/Imath/ImathRandom.cpp",
|
||||
"src/Imath/half.cpp",
|
||||
"src/Imath/toFloat.h",
|
||||
],
|
||||
hdrs = [
|
||||
"src/Imath/ImathBox.h",
|
||||
"src/Imath/ImathBoxAlgo.h",
|
||||
"src/Imath/ImathColor.h",
|
||||
"src/Imath/ImathColorAlgo.h",
|
||||
"src/Imath/ImathConfig.h",
|
||||
"src/Imath/ImathEuler.h",
|
||||
"src/Imath/ImathExport.h",
|
||||
"src/Imath/ImathForward.h",
|
||||
"src/Imath/ImathFrame.h",
|
||||
"src/Imath/ImathFrustum.h",
|
||||
"src/Imath/ImathFrustumTest.h",
|
||||
"src/Imath/ImathFun.h",
|
||||
"src/Imath/ImathGL.h",
|
||||
"src/Imath/ImathGLU.h",
|
||||
"src/Imath/ImathInt64.h",
|
||||
"src/Imath/ImathInterval.h",
|
||||
"src/Imath/ImathLine.h",
|
||||
"src/Imath/ImathLineAlgo.h",
|
||||
"src/Imath/ImathMath.h",
|
||||
"src/Imath/ImathMatrix.h",
|
||||
"src/Imath/ImathMatrixAlgo.h",
|
||||
"src/Imath/ImathNamespace.h",
|
||||
"src/Imath/ImathPlane.h",
|
||||
"src/Imath/ImathPlatform.h",
|
||||
"src/Imath/ImathQuat.h",
|
||||
"src/Imath/ImathRandom.h",
|
||||
"src/Imath/ImathRoots.h",
|
||||
"src/Imath/ImathShear.h",
|
||||
"src/Imath/ImathSphere.h",
|
||||
"src/Imath/ImathTypeTraits.h",
|
||||
"src/Imath/ImathVec.h",
|
||||
"src/Imath/ImathVecAlgo.h",
|
||||
"src/Imath/half.h",
|
||||
"src/Imath/halfFunction.h",
|
||||
"src/Imath/halfLimits.h",
|
||||
],
|
||||
includes = ["src/Imath"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
cc_library(
|
||||
name = "deflate",
|
||||
srcs = [
|
||||
"common_defs.h",
|
||||
"lib/adler32.c",
|
||||
"lib/adler32_vec_template.h",
|
||||
"lib/arm/adler32_impl.h",
|
||||
"lib/arm/cpu_features.c",
|
||||
"lib/arm/cpu_features.h",
|
||||
"lib/arm/crc32_impl.h",
|
||||
"lib/arm/crc32_pmull_helpers.h",
|
||||
"lib/arm/crc32_pmull_wide.h",
|
||||
"lib/arm/matchfinder_impl.h",
|
||||
"lib/bt_matchfinder.h",
|
||||
"lib/cpu_features_common.h",
|
||||
"lib/crc32.c",
|
||||
"lib/crc32_multipliers.h",
|
||||
"lib/crc32_tables.h",
|
||||
"lib/decompress_template.h",
|
||||
"lib/deflate_compress.c",
|
||||
"lib/deflate_compress.h",
|
||||
"lib/deflate_constants.h",
|
||||
"lib/deflate_decompress.c",
|
||||
"lib/gzip_compress.c",
|
||||
"lib/gzip_constants.h",
|
||||
"lib/gzip_decompress.c",
|
||||
"lib/hc_matchfinder.h",
|
||||
"lib/ht_matchfinder.h",
|
||||
"lib/lib_common.h",
|
||||
"lib/matchfinder_common.h",
|
||||
"lib/utils.c",
|
||||
"lib/x86/adler32_impl.h",
|
||||
"lib/x86/cpu_features.c",
|
||||
"lib/x86/cpu_features.h",
|
||||
"lib/x86/crc32_impl.h",
|
||||
"lib/x86/crc32_pclmul_template.h",
|
||||
"lib/x86/decompress_impl.h",
|
||||
"lib/x86/matchfinder_impl.h",
|
||||
"lib/zlib_compress.c",
|
||||
"lib/zlib_constants.h",
|
||||
"lib/zlib_decompress.c",
|
||||
],
|
||||
hdrs = ["libdeflate.h"],
|
||||
includes = ["."],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
alias(
|
||||
name = "libdeflate",
|
||||
actual = ":deflate",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Contributors to the OpenEXR Project.
|
||||
|
||||
"""External dependencies for openexr."""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
|
||||
|
||||
def openexr_deps():
|
||||
"""Fetches dependencies (libdeflate and Imath) of OpenEXR and Skylib for header generation."""
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "libdeflate",
|
||||
build_file = "@com_openexr//:bazel/third_party/libdeflate.BUILD",
|
||||
sha256 = "225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd",
|
||||
strip_prefix = "libdeflate-1.18",
|
||||
urls = ["https://github.com/ebiggers/libdeflate/archive/refs/tags/v1.18.tar.gz"],
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "Imath",
|
||||
build_file = "@com_openexr//:bazel/third_party/Imath.BUILD",
|
||||
strip_prefix = "Imath-3.1.9",
|
||||
sha256 = "f1d8aacd46afed958babfced3190d2d3c8209b66da451f556abd6da94c165cf3",
|
||||
urls = ["https://github.com/AcademySoftwareFoundation/Imath/archive/refs/tags/v3.1.9.tar.gz"],
|
||||
)
|
||||
|
||||
maybe(
|
||||
http_archive,
|
||||
name = "bazel_skylib",
|
||||
sha256 = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
|
||||
urls = [
|
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
|
||||
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.2/bazel-skylib-1.4.2.tar.gz",
|
||||
],
|
||||
)
|
||||
+60
-16
@@ -37,7 +37,17 @@ int main()
|
||||
int edx = 0;
|
||||
__asm__(
|
||||
\"xgetbv ;\"
|
||||
\"vzeroupper \"
|
||||
//
|
||||
// This feature probe is specifically used to decide whether we can
|
||||
// compile the DWA fast path that contains GCC-style inline asm using
|
||||
// AVX/YMM instructions. Some toolchains (notably older Apple 'as'
|
||||
// invoked by GCC on legacy macOS) can assemble xgetbv/vzeroupper but
|
||||
// still reject YMM/VEX instructions with errors like:
|
||||
// no such instruction: `vmovaps (%rsi), %ymm0'
|
||||
// So include a representative YMM instruction in the try-compile.
|
||||
//
|
||||
\"vmovaps %%ymm0, %%ymm0 ;\"
|
||||
\"vzeroupper \"
|
||||
: \"=a\"(eax), \"=d\"(edx) : \"c\"(n) : );
|
||||
#else
|
||||
# error No SSE support enabled to query AVX support
|
||||
@@ -63,6 +73,11 @@ if (OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
else()
|
||||
set(OPENEXR_ENABLE_API_VISIBILITY ON)
|
||||
endif()
|
||||
if (OPENEXR_FORCE_EMBEDDED_CORE)
|
||||
set(OPENEXR_CORE_FUNCTIONS_EMBEDDED ON)
|
||||
else()
|
||||
set(OPENEXR_CORE_FUNCTIONS_EMBEDDED OFF)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE AND NOT BEOS)
|
||||
find_library(OPENEXR_EXTRA_MATH_LIB m)
|
||||
@@ -74,15 +89,6 @@ configure_file(OpenEXRConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRCon
|
||||
# make a temp copy in the binary dir for OpenEXRConfig.h to include
|
||||
configure_file(../src/lib/OpenEXRCore/openexr_version.h ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRCore/openexr_version.h COPYONLY)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
####### IexConfig.h and IexConfigInternal.h
|
||||
|
||||
@@ -128,6 +134,28 @@ configure_file(IexConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfig.h)
|
||||
configure_file(IexConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/IexConfigInternal.h)
|
||||
configure_file(IlmThreadConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/IlmThreadConfig.h)
|
||||
|
||||
# See comment in LibraryDefine.cmake regarding applications that build
|
||||
# OpenEXR via add_subdirectory(): In that configuration, the *Config.h
|
||||
# headers need to be linked/copied to the OpenEXR/ subdirectory to
|
||||
# support use of #include <OpenEXR/...> when building in-tree. This is
|
||||
# only necessary when OpenEXR is a subproject, i.e. added to an
|
||||
# application via add_subdirectory().
|
||||
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
foreach(_hdr IN ITEMS OpenEXRConfig.h IexConfig.h IlmThreadConfig.h)
|
||||
set(_cfg_src "${CMAKE_CURRENT_BINARY_DIR}/${_hdr}")
|
||||
set(_cfg_dst "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}/${_hdr}")
|
||||
if(EXISTS "${_cfg_src}")
|
||||
file(REMOVE "${_cfg_dst}")
|
||||
if(CMAKE_HOST_UNIX)
|
||||
file(CREATE_LINK "${_cfg_src}" "${_cfg_dst}" SYMBOLIC)
|
||||
else()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_cfg_src}" "${_cfg_dst}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
####### Install public config headers
|
||||
|
||||
@@ -147,7 +175,12 @@ endif()
|
||||
|
||||
add_library(OpenEXRConfig INTERFACE)
|
||||
target_include_directories(OpenEXRConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
target_include_directories(OpenEXRConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
|
||||
endif()
|
||||
target_include_directories(OpenEXRConfig INTERFACE
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
@@ -158,25 +191,35 @@ add_library(${PROJECT_NAME}::Config ALIAS OpenEXRConfig)
|
||||
|
||||
add_library(IexConfig INTERFACE)
|
||||
target_include_directories(IexConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
target_include_directories(IexConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
|
||||
endif()
|
||||
target_include_directories(IexConfig INTERFACE
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS IexConfig EXPORT ${PROJECT_NAME})
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::Config ALIAS IexConfig)
|
||||
add_library(Iex::Config ALIAS IexConfig)
|
||||
|
||||
add_library(IlmThreadConfig INTERFACE)
|
||||
target_include_directories(IlmThreadConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
target_include_directories(IlmThreadConfig INTERFACE
|
||||
$<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
|
||||
endif()
|
||||
target_include_directories(IlmThreadConfig INTERFACE
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}>)
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS IlmThreadConfig EXPORT ${PROJECT_NAME})
|
||||
endif()
|
||||
add_library(${PROJECT_NAME}::Config ALIAS IlmThreadConfig)
|
||||
add_library(IlmThread::Config ALIAS IlmThreadConfig)
|
||||
|
||||
###################################################
|
||||
####### Install pkg-config files if requested
|
||||
@@ -219,8 +262,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG)
|
||||
)
|
||||
endfunction()
|
||||
openexr_pkg_config_help(OpenEXR.pc.in)
|
||||
message(STATUS "OpenEXR pkg-config generation enabled")
|
||||
else()
|
||||
message(STATUS "-- pkg-config generation disabled")
|
||||
message(STATUS "OpenEXR pkg-config generation disabled")
|
||||
endif()
|
||||
|
||||
###################################################
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#cmakedefine01 ILMTHREAD_THREADING_ENABLED
|
||||
#cmakedefine01 ILMTHREAD_HAVE_POSIX_SEMAPHORES
|
||||
#cmakedefine01 ILMTHREAD_USE_TBB
|
||||
|
||||
//
|
||||
// Current internal library namespace name
|
||||
|
||||
+65
-21
@@ -4,33 +4,34 @@
|
||||
# NB: This function has a number of Imath-specific names/variables
|
||||
# in it, so be careful copying...
|
||||
function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
set(options)
|
||||
set(options EMBEDDED)
|
||||
set(oneValueArgs PRIV_EXPORT CURDIR CURBINDIR)
|
||||
set(multiValueArgs SOURCES HEADERS DEPENDENCIES PRIVATE_DEPS)
|
||||
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
||||
|
||||
if (MSVC)
|
||||
set(_openexr_extra_flags "/EHsc")
|
||||
set(_openexr_extra_flags "$<$<COMPILE_LANGUAGE:CXX>:/EHsc>" "$<$<COMPILE_LANGUAGE:CXX>:/MP>")
|
||||
endif()
|
||||
set(objlib ${libname})
|
||||
add_library(${objlib}
|
||||
if(OPENEXR_CURLIB_EMBEDDED)
|
||||
set(libopts STATIC)
|
||||
else()
|
||||
set(libopts)
|
||||
endif()
|
||||
add_library(${objlib} ${libopts}
|
||||
${OPENEXR_CURLIB_HEADERS}
|
||||
${OPENEXR_CURLIB_SOURCES})
|
||||
|
||||
# Use ${OPENEXR_CXX_STANDARD} to determine the standard we use to compile
|
||||
# OpenEXR itself. But the headers only require C++11 features, so that's
|
||||
# all we need to pass on as interface requirements to downstream projects.
|
||||
# For example, it's fine for an OpenEXR built with C++14 to be called from
|
||||
# an app that is compiled with C++11; OpenEXR needn't force the app to
|
||||
# also use C++14.
|
||||
# OpenEXR itself. The headers will use string_view and such, so ensure
|
||||
# the user is at least 17, but could be higher
|
||||
target_compile_features(${objlib}
|
||||
PRIVATE cxx_std_${OPENEXR_CXX_STANDARD}
|
||||
INTERFACE cxx_std_11 )
|
||||
INTERFACE cxx_std_17 )
|
||||
|
||||
# we are embedding libdeflate
|
||||
target_include_directories(${objlib} PRIVATE ${EXR_DEFLATE_INCLUDE_DIR})
|
||||
|
||||
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
|
||||
if(OPENEXR_CURLIB_EMBEDDED)
|
||||
set(libopts)
|
||||
elseif(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
|
||||
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
|
||||
if(WIN32)
|
||||
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
|
||||
@@ -39,11 +40,50 @@ function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
|
||||
if(OPENEXR_CURLIB_CURDIR)
|
||||
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
|
||||
|
||||
# When an application builds against OpenEXR via
|
||||
# add_subdirector(OpenEXR), if should still recognize include
|
||||
# statements with the OpenEXR subdirectory, ie. #include
|
||||
# <OpenEXR/ImfHeader.h>, altough in that configuration, there is
|
||||
# no OpenEXR subdirectory, since it is the install step that
|
||||
# places headers there; for an in-tree build, the headers are in
|
||||
# each library. To allow such an application to use the #include
|
||||
# <OpenEXR/...> construct, create a directory in the build root
|
||||
# with symbolic links to the headers in the library directories.
|
||||
#
|
||||
# We detect this condition via the OPENEXR_IS_SUBPROJECT setting,
|
||||
# which is set in OpenEXRSetup.cmake when CMAKE_PROJECT_NAME is
|
||||
# not "OpenEXR".
|
||||
|
||||
if(OPENEXR_IS_SUBPROJECT AND OPENEXR_CURLIB_HEADERS)
|
||||
foreach(_hdr IN LISTS OPENEXR_CURLIB_HEADERS)
|
||||
if(IS_ABSOLUTE "${_hdr}")
|
||||
set(_hdr_src "${_hdr}")
|
||||
else()
|
||||
set(_hdr_src "${OPENEXR_CURLIB_CURDIR}/${_hdr}")
|
||||
endif()
|
||||
get_filename_component(_hdr_name "${_hdr}" NAME)
|
||||
set(_hdr_dst "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}/${_hdr_name}")
|
||||
if(EXISTS "${_hdr_src}")
|
||||
file(REMOVE "${_hdr_dst}")
|
||||
if(CMAKE_HOST_UNIX)
|
||||
file(CREATE_LINK "${_hdr_src}" "${_hdr_dst}" SYMBOLIC)
|
||||
else()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_hdr_src}" "${_hdr_dst}")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "OpenEXR build-interface include: missing public header ${_hdr_src}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_BUILD_INTERFACE_UNIFIED}>)
|
||||
endif()
|
||||
endif()
|
||||
if(OPENEXR_CURLIB_CURBINDIR)
|
||||
target_include_directories(${objlib} PRIVATE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURBINDIR}>)
|
||||
endif()
|
||||
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES})
|
||||
target_link_libraries(${objlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES} ${CMAKE_DL_LIBS})
|
||||
if(OPENEXR_CURLIB_PRIVATE_DEPS)
|
||||
target_link_libraries(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
|
||||
endif()
|
||||
@@ -52,7 +92,7 @@ function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
CXX_EXTENSIONS OFF
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
if (NOT OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
if (OPENEXR_CURLIB_EMBEDDED OR NOT OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
set_target_properties(${objlib} PROPERTIES
|
||||
C_VISIBILITY_PRESET hidden
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
@@ -62,11 +102,11 @@ function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
target_compile_definitions(${objlib} PUBLIC OPENEXR_USE_DEFAULT_VISIBILITY)
|
||||
endif()
|
||||
if (_openexr_extra_flags)
|
||||
target_compile_options(${objlib} PUBLIC ${_openexr_extra_flags})
|
||||
target_compile_options(${objlib} PRIVATE ${_openexr_extra_flags})
|
||||
endif()
|
||||
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
if(BUILD_SHARED_LIBS AND NOT OPENEXR_CURLIB_EMBEDDED)
|
||||
set_target_properties(${libname} PROPERTIES
|
||||
SOVERSION ${OPENEXR_LIB_SOVERSION}
|
||||
VERSION ${OPENEXR_LIB_VERSION}
|
||||
@@ -76,7 +116,6 @@ function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
||||
)
|
||||
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
|
||||
|
||||
if(OPENEXR_INSTALL)
|
||||
install(TARGETS ${libname}
|
||||
@@ -89,13 +128,18 @@ function(OPENEXR_DEFINE_LIBRARY libname)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
|
||||
)
|
||||
endif()
|
||||
if(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "") AND NOT WIN32)
|
||||
if(OPENEXR_CURLIB_EMBEDDED)
|
||||
set(libopts)
|
||||
elseif(BUILD_SHARED_LIBS AND (NOT "${OPENEXR_LIB_SUFFIX}" STREQUAL "") AND NOT WIN32)
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
|
||||
set(verlibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${OPENEXR_LIB_SUFFIX}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
set(baselibname ${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_${uppercase_CMAKE_BUILD_TYPE}_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E chdir \"\$ENV\{DESTDIR\}${CMAKE_INSTALL_FULL_LIBDIR}\" ${CMAKE_COMMAND} -E create_symlink ${verlibname} ${baselibname})")
|
||||
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_FULL_LIBDIR}/${baselibname} -> ${verlibname}\")")
|
||||
file(CREATE_LINK ${verlibname} ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} SYMBOLIC)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${baselibname} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
install(CODE "message(STATUS \"Creating symlink ${CMAKE_INSTALL_LIBDIR}/${baselibname} -> ${verlibname}\")")
|
||||
set(verlibname)
|
||||
set(baselibname)
|
||||
endif()
|
||||
|
||||
add_library(${PROJECT_NAME}::${libname} ALIAS ${libname})
|
||||
endfunction()
|
||||
|
||||
@@ -17,4 +17,5 @@ Version: @OPENEXR_VERSION@
|
||||
Libs: @exr_pthread_libs@ -L${libdir} -lOpenEXR${libsuffix} -lOpenEXRUtil${libsuffix} -lOpenEXRCore${libsuffix} -lIex${libsuffix} -lIlmThread${libsuffix}
|
||||
Cflags: -I${includedir} -I${OpenEXR_includedir} @exr_pthread_cflags@
|
||||
Requires: Imath
|
||||
Requires.private: @EXR_DEFLATE_PKGCONFIG_REQUIRES@ @EXR_OPENJPH_PKGCONFIG_REQUIRES@
|
||||
|
||||
|
||||
@@ -8,11 +8,19 @@ include(CMakeFindDependencyMacro)
|
||||
set(openexr_needthreads @OPENEXR_ENABLE_THREADING@)
|
||||
if (openexr_needthreads)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_dependency(Threads REQUIRED)
|
||||
find_dependency(Threads)
|
||||
endif()
|
||||
unset(openexr_needthreads)
|
||||
|
||||
find_dependency(Imath REQUIRED)
|
||||
find_dependency(Imath)
|
||||
|
||||
if (@libdeflate_FOUND@)
|
||||
find_dependency(libdeflate)
|
||||
endif()
|
||||
|
||||
if (NOT @OPENEXR_USE_INTERNAL_OPENJPH@)
|
||||
find_dependency(openjph)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
+32
-13
@@ -8,14 +8,29 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
/// @TODO get the version from the header files.
|
||||
/// due to the structure of the cmake configuration steps,
|
||||
/// it's not obvious how to structure things for this to work.
|
||||
/// so for now, just hardcode the version here.
|
||||
//#include <OpenEXRCore/openexr_version.h>
|
||||
#define OPENEXR_VERSION_MAJOR 3
|
||||
#define OPENEXR_VERSION_MINOR 2
|
||||
#define OPENEXR_VERSION_PATCH 0
|
||||
//
|
||||
// The OpenEXR release version is defined officially in
|
||||
// src/lib/OpenEXRCore/openexr_version.h, but CMake doesn't readily allow
|
||||
// that to be included here, so duplicate the settings for
|
||||
// backwards-compatibility with applications that may expect to get the
|
||||
// defines from this include.
|
||||
//
|
||||
|
||||
#ifndef INCLUDED_OPENEXR_VERSION_H
|
||||
#define OPENEXR_VERSION_MAJOR @OPENEXR_VERSION_MAJOR@
|
||||
#define OPENEXR_VERSION_MINOR @OPENEXR_VERSION_MINOR@
|
||||
#define OPENEXR_VERSION_PATCH @OPENEXR_VERSION_PATCH@
|
||||
#define OPENEXR_SOVERSION @OPENEXR_LIB_SOVERSION@
|
||||
#endif
|
||||
|
||||
#define OPENEXR_IMATH_SOVERSION @Imath_SOVERSION@
|
||||
#define OPENEXR_IMATH_VERSION_MAJOR @Imath_VERSION_MAJOR@
|
||||
#define OPENEXR_IMATH_VERSION_MINOR @Imath_VERSION_MINOR@
|
||||
#define OPENEXR_IMATH_VERSION_PATCH @Imath_VERSION_PATCH@
|
||||
|
||||
#define OPENEXR_OPENJPH_VERSION_MAJOR @openjph_VERSION_MAJOR@
|
||||
#define OPENEXR_OPENJPH_VERSION_MINOR @openjph_VERSION_MINOR@
|
||||
#define OPENEXR_OPENJPH_VERSION_PATCH @openjph_VERSION_PATCH@
|
||||
|
||||
//
|
||||
// Options / configuration based on O.S. / compiler
|
||||
@@ -63,10 +78,10 @@
|
||||
// clang-format on
|
||||
|
||||
// Version as a single hex number, e.g. 0x01000300 == 1.0.3
|
||||
#define OPENEXR_VERSION_HEX \
|
||||
((uint32_t (OPENEXR_VERSION_MAJOR) << 24) | \
|
||||
(uint32_t (OPENEXR_VERSION_MINOR) << 16) | \
|
||||
(uint32_t (OPENEXR_VERSION_PATCH) << 8))
|
||||
#define OPENEXR_VERSION_HEX \
|
||||
(((OPENEXR_VERSION_MAJOR) << 24) | \
|
||||
((OPENEXR_VERSION_MINOR) << 16) | \
|
||||
((OPENEXR_VERSION_PATCH) << 8))
|
||||
|
||||
// On modern versions of gcc & clang, __has_attribute can test support for
|
||||
// __attribute__((attr)). Make sure it's safe for other compilers.
|
||||
@@ -78,6 +93,8 @@
|
||||
// tagged
|
||||
#cmakedefine OPENEXR_ENABLE_API_VISIBILITY
|
||||
|
||||
#cmakedefine OPENEXR_CORE_FUNCTIONS_EMBEDDED
|
||||
|
||||
/// \defgroup ExportMacros Macros to manage symbol visibility
|
||||
///
|
||||
/// See website/SymbolVisibility.rst for more discussion about the
|
||||
@@ -110,8 +127,10 @@
|
||||
///
|
||||
/// @{
|
||||
|
||||
// Visibility attributes are ELF-specific; on Windows (MSVC or MinGW) they are
|
||||
// not supported and trigger -Wattributes warnings, so use empty macros there.
|
||||
#if defined(OPENEXR_ENABLE_API_VISIBILITY) && \
|
||||
!(defined(OPENEXR_DLL) || defined(_MSC_VER))
|
||||
!(defined(OPENEXR_DLL) || defined(_MSC_VER) || defined(_WIN32))
|
||||
# define OPENEXR_PUBLIC_SYMBOL_ATTRIBUTE \
|
||||
__attribute__ ((__visibility__ ("default")))
|
||||
# define OPENEXR_PRIVATE_SYMBOL_ATTRIBUTE \
|
||||
|
||||
@@ -8,16 +8,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
//
|
||||
// Whether to use the internally provided vendored version of
|
||||
// deflate or the system provided version
|
||||
#cmakedefine OPENEXR_USE_INTERNAL_DEFLATE 1
|
||||
|
||||
//
|
||||
// Define and set to 1 if the target system supports a proc filesystem
|
||||
// compatible with the Linux kernel's proc filesystem. Note that this
|
||||
// is only used by a program in the OpenEXRTest test suite, it's not
|
||||
// used by any OpenEXR library or application code.
|
||||
//
|
||||
|
||||
// automated formatting does not handle the cmake tags well
|
||||
// clang-format off
|
||||
|
||||
#cmakedefine OPENEXR_IMF_HAVE_LINUX_PROCFS 1
|
||||
|
||||
//
|
||||
|
||||
+256
-77
@@ -11,14 +11,14 @@ endif()
|
||||
########################
|
||||
## Target configuration
|
||||
|
||||
# What C++ standard to compile for
|
||||
# VFX Platform 18 is c++14, so let's enable that by default
|
||||
set(tmp 14)
|
||||
# What C++ standard to compile for. 17 by default
|
||||
set(tmp 17)
|
||||
if(CMAKE_CXX_STANDARD)
|
||||
set(tmp ${CMAKE_CXX_STANDARD})
|
||||
endif()
|
||||
set(OPENEXR_CXX_STANDARD "${tmp}" CACHE STRING "C++ standard to compile against")
|
||||
set(tmp)
|
||||
message(STATUS "Building against C++ Standard: ${OPENEXR_CXX_STANDARD}")
|
||||
|
||||
set(OPENEXR_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)")
|
||||
set(OPENEXR_INTERNAL_IMF_NAMESPACE "Imf_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for OpenEXR that will end up in compiled symbols")
|
||||
@@ -36,15 +36,20 @@ set(IEX_INTERNAL_NAMESPACE "Iex_${OPENEXR_VERSION_API}" CACHE STRING "Real names
|
||||
set(IEX_NAMESPACE "Iex" CACHE STRING "Public namespace alias for Iex")
|
||||
|
||||
# Whether to generate and install a pkg-config file OpenEXR.pc
|
||||
if (WIN32)
|
||||
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" OFF)
|
||||
else()
|
||||
option(OPENEXR_INSTALL_PKG_CONFIG "Install OpenEXR.pc file" ON)
|
||||
endif()
|
||||
|
||||
# Whether to enable threading. This can be disabled, although thread pool and tasks
|
||||
# are still used, just processed immediately
|
||||
# are still used, just processed immediately. Note that if this is disabled, the
|
||||
# OpenEXR library may not be thread-safe and should only be used by a single thread.
|
||||
option(OPENEXR_ENABLE_THREADING "Enables threaded processing of requests" ON)
|
||||
# When set to ON, will change the thread pool to use TBB for the
|
||||
# global thread pool by default.
|
||||
#
|
||||
# Regardless of this setting, if you create your own additional thread
|
||||
# pools, those will NOT use TBB by default, as it can easily cause
|
||||
# recursive mutex deadlocks as TBB shares a single thread pool with
|
||||
# multiple arenas
|
||||
option(OPENEXR_USE_TBB "Switch internals of IlmThreadPool to use TBB by default" OFF)
|
||||
|
||||
option(OPENEXR_USE_DEFAULT_VISIBILITY "Makes the compile use default visibility (by default compiles tidy, hidden-by-default)" OFF)
|
||||
|
||||
@@ -55,21 +60,60 @@ option(OPENEXR_ENABLE_LARGE_STACK "Enables code to take advantage of large stack
|
||||
########################
|
||||
## Build related options
|
||||
|
||||
# Whether to build & install the various command line utility programs
|
||||
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
|
||||
option(OPENEXR_INSTALL "Install OpenEXR libraries/binaries/bindings" ON)
|
||||
|
||||
# This is a variable here for use in controlling where include files are
|
||||
# Whether to build & install the main libraries
|
||||
option(OPENEXR_BUILD_LIBS "Enables building of main libraries" ON)
|
||||
|
||||
# Whether to build the various command line utility programs
|
||||
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
|
||||
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
|
||||
option(OPENEXR_INSTALL_DEVELOPER_TOOLS "Install OpenEXR developer tools" OFF)
|
||||
|
||||
option(OPENEXR_BUILD_EXAMPLES "Build and install OpenEXR examples" ON)
|
||||
|
||||
option(OPENEXR_BUILD_PYTHON "Build python bindings" OFF)
|
||||
|
||||
option(OPENEXR_BUILD_OSS_FUZZ "Build the oss-fuzz fuzzers" OFF)
|
||||
if (OPENEXR_BUILD_OSS_FUZZ)
|
||||
# If building the oss-fuzz fuzzers, accept the comiler/options from
|
||||
# the environment.
|
||||
set(CMAKE_CXX_COMPILER $ENV{CXX})
|
||||
set(CMAKE_CXX_FLAGS $ENV{CXX_FLAGS})
|
||||
set(CMAKE_C_COMPILER $ENV{CC})
|
||||
set(CMAKE_C_FLAGS $ENV{CC_FLAGS})
|
||||
endif()
|
||||
|
||||
option(OPENEXR_TEST_LIBRARIES "Run library tests" ON)
|
||||
option(OPENEXR_TEST_TOOLS "Run tool tests" ON)
|
||||
option(OPENEXR_TEST_PYTHON "Run python binding tests" ON)
|
||||
|
||||
# This is a variable here for use in controlling where include files are
|
||||
# installed. Care must be taken when changing this, as many things
|
||||
# probably assume this is OpenEXR
|
||||
set(OPENEXR_OUTPUT_SUBDIR OpenEXR CACHE STRING "Destination sub-folder of the include path for install")
|
||||
|
||||
# When OpenEXR is pulled in via add_subdirectory(), mirror installed layout under
|
||||
# BUILD_INTERFACE so consumers can use #include <OpenEXR/...>. Not used for a normal
|
||||
# top-level OpenEXR build (clears legacy cache entry from older CMake revisions).
|
||||
if(OPENEXR_IS_SUBPROJECT)
|
||||
set(OPENEXR_BUILD_INTERFACE_UNIFIED "${CMAKE_BINARY_DIR}/OpenEXR_build_interface_include")
|
||||
file(MAKE_DIRECTORY "${OPENEXR_BUILD_INTERFACE_UNIFIED}/${OPENEXR_OUTPUT_SUBDIR}")
|
||||
else()
|
||||
unset(OPENEXR_BUILD_INTERFACE_UNIFIED CACHE)
|
||||
unset(OPENEXR_BUILD_INTERFACE_UNIFIED)
|
||||
endif()
|
||||
|
||||
# This does not seem to be available as a per-target property,
|
||||
# but is pretty harmless to set globally
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# Suffix for debug configuration libraries
|
||||
# (if you should choose to install those)
|
||||
set(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "Suffix for debug builds")
|
||||
# Don't override if the user has set it and don't save it in the cache
|
||||
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_DEBUG_POSTFIX "_d")
|
||||
endif()
|
||||
|
||||
if(NOT OPENEXR_IS_SUBPROJECT)
|
||||
# Usual cmake option to build shared libraries or not, only overridden if OpenEXR is a top level project,
|
||||
@@ -142,6 +186,10 @@ if(OPENEXR_USE_CLANG_TIDY)
|
||||
)
|
||||
endif()
|
||||
|
||||
if (NOT OPENEXR_BUILD_LIBS)
|
||||
return()
|
||||
endif()
|
||||
|
||||
###############################
|
||||
# Dependent libraries
|
||||
|
||||
@@ -155,69 +203,134 @@ if(OPENEXR_ENABLE_THREADING)
|
||||
message(FATAL_ERROR "Unable to find a threading library, disable with OPENEXR_ENABLE_THREADING=OFF")
|
||||
endif()
|
||||
endif()
|
||||
if(OPENEXR_USE_TBB)
|
||||
find_package(TBB)
|
||||
if(NOT TBB_FOUND)
|
||||
message(FATAL_ERROR "Unable to find the OneTBB cmake library, disable with ILMTHREAD_USE_TBB=OFF or fix TBB install")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set (ILMTHREAD_USE_TBB ${OPENEXR_USE_TBB})
|
||||
|
||||
option(OPENEXR_FORCE_INTERNAL_DEFLATE "Force using an internal libdeflate" OFF)
|
||||
set(OPENEXR_DEFLATE_REPO "https://github.com/ebiggers/libdeflate.git" CACHE STRING "Repo path for libdeflate source")
|
||||
set(OPENEXR_DEFLATE_TAG "v1.18" CACHE STRING "Tag to use for libdeflate source repo (defaults to primary if empty)")
|
||||
set (OPENEXR_USE_INTERNAL_DEFLATE OFF)
|
||||
|
||||
if(NOT OPENEXR_FORCE_INTERNAL_DEFLATE)
|
||||
#TODO: ^^ Release should not clone from main, this is a place holder
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/deflate-build/config")
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL libdeflate)
|
||||
# First try cmake config
|
||||
find_package(libdeflate CONFIG QUIET)
|
||||
if(libdeflate_FOUND)
|
||||
if(TARGET libdeflate::libdeflate_shared)
|
||||
set(EXR_DEFLATE_LIB libdeflate::libdeflate_shared)
|
||||
else()
|
||||
set(EXR_DEFLATE_LIB libdeflate::libdeflate_static)
|
||||
endif()
|
||||
set(EXR_DEFLATE_VERSION ${libdeflate_VERSION})
|
||||
message(STATUS "Using libdeflate from ${libdeflate_DIR}")
|
||||
else()
|
||||
# If not found, try pkgconfig
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(deflate IMPORTED_TARGET GLOBAL QUIET libdeflate)
|
||||
if(deflate_FOUND)
|
||||
set(EXR_DEFLATE_LIB PkgConfig::deflate)
|
||||
set(EXR_DEFLATE_VERSION ${deflate_VERSION})
|
||||
message(STATUS "Using libdeflate from ${deflate_LINK_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(CMAKE_IGNORE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET PkgConfig::deflate AND NOT deflate_FOUND)
|
||||
if(OPENEXR_FORCE_INTERNAL_DEFLATE)
|
||||
message(STATUS "libdeflate forced internal, installing from ${OPENEXR_DEFLATE_REPO} (${OPENEXR_DEFLATE_TAG})")
|
||||
else()
|
||||
message(STATUS "libdeflate was not found, installing from ${OPENEXR_DEFLATE_REPO} (${OPENEXR_DEFLATE_TAG})")
|
||||
endif()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(Deflate
|
||||
GIT_REPOSITORY "${OPENEXR_DEFLATE_REPO}"
|
||||
GIT_TAG "${OPENEXR_DEFLATE_TAG}"
|
||||
GIT_SHALLOW ON
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(Deflate)
|
||||
if(NOT Deflate_POPULATED)
|
||||
FetchContent_Populate(Deflate)
|
||||
endif()
|
||||
|
||||
# Rather than actually compile something, just embed the sources
|
||||
# into exrcore. This could in theory cause issues when compiling as
|
||||
# a static library into another application which also uses
|
||||
# libdeflate but we switch the export symbol to hidden which should
|
||||
# hide the symbols when linking...
|
||||
set(EXR_DEFLATE_SOURCES
|
||||
lib/arm/cpu_features.c
|
||||
lib/x86/cpu_features.c
|
||||
lib/utils.c
|
||||
lib/deflate_compress.c
|
||||
lib/deflate_decompress.c
|
||||
lib/adler32.c
|
||||
lib/zlib_compress.c
|
||||
lib/zlib_decompress.c)
|
||||
# don't need these
|
||||
# lib/crc32.c
|
||||
# lib/gzip_compress.c
|
||||
# lib/gzip_decompress.c
|
||||
file(READ ${deflate_SOURCE_DIR}/lib/lib_common.h DEFLATE_HIDE)
|
||||
string(REPLACE "visibility(\"default\")" "visibility(\"hidden\")" DEFLATE_HIDE "${DEFLATE_HIDE}")
|
||||
string(REPLACE "__declspec(dllexport)" "/**/" DEFLATE_HIDE "${DEFLATE_HIDE}")
|
||||
file(WRITE ${deflate_SOURCE_DIR}/lib/lib_common.h "${DEFLATE_HIDE}")
|
||||
|
||||
# cmake makes fetch content name lowercase for the properties (to deflate)
|
||||
list(TRANSFORM EXR_DEFLATE_SOURCES PREPEND ${deflate_SOURCE_DIR}/)
|
||||
set(EXR_DEFLATE_INCLUDE_DIR ${deflate_SOURCE_DIR})
|
||||
set(EXR_DEFLATE_LIB)
|
||||
if(EXR_DEFLATE_LIB)
|
||||
# Using external library
|
||||
message(STATUS "Using externally provided libdeflate: ${EXR_DEFLATE_VERSION}")
|
||||
# For OpenEXR.pc.in for static build
|
||||
set(EXR_DEFLATE_PKGCONFIG_REQUIRES "libdeflate >= ${EXR_DEFLATE_VERSION}")
|
||||
else()
|
||||
set(EXR_DEFLATE_INCLUDE_DIR)
|
||||
set(EXR_DEFLATE_LIB PkgConfig::deflate)
|
||||
set(EXR_DEFLATE_SOURCES)
|
||||
# Using internal deflate
|
||||
if(OPENEXR_FORCE_INTERNAL_DEFLATE)
|
||||
message(STATUS "libdeflate forced internal, using vendored code")
|
||||
else()
|
||||
message(STATUS "libdeflate was not found, using vendored code")
|
||||
endif()
|
||||
|
||||
set (OPENEXR_USE_INTERNAL_DEFLATE ON)
|
||||
set(EXR_DEFLATE_LIB)
|
||||
endif()
|
||||
|
||||
|
||||
#######################################
|
||||
# Find or download OpenJPH
|
||||
#######################################
|
||||
|
||||
option(OPENEXR_FORCE_INTERNAL_OPENJPH "Force downloading OpenJPH from a git repo" OFF)
|
||||
|
||||
set(OPENEXR_USE_INTERNAL_OPENJPH 0 CACHE INTERNAL
|
||||
"Whether OpenEXR bundles vendored OpenJPH into OpenEXRCore (0 or 1)")
|
||||
|
||||
if (NOT OPENEXR_FORCE_INTERNAL_OPENJPH)
|
||||
find_package(openjph CONFIG QUIET)
|
||||
if(openjph_FOUND)
|
||||
if(openjph_VERSION VERSION_LESS "0.21.0")
|
||||
message(FATAL_ERROR "OpenJPH >= 0.21.0 required, but found ${openjph_VERSION}")
|
||||
endif()
|
||||
|
||||
message(STATUS "Using OpenJPH ${openjph_VERSION} from ${openjph_DIR}")
|
||||
set(EXR_OPENJPH_LIB openjph)
|
||||
else()
|
||||
# If not found, try pkgconfig
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(openjph IMPORTED_TARGET GLOBAL QUIET openjph=0.21)
|
||||
if(openjph_FOUND)
|
||||
set(EXR_OPENJPH_LIB PkgConfig::openjph)
|
||||
message(STATUS "Using OpenJPH ${openjph_VERSION} from ${openjph_LINK_LIBRARIES}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXR_OPENJPH_LIB)
|
||||
# Using external library
|
||||
# For OpenEXR.pc.in for static build
|
||||
set(EXR_OPENJPH_PKGCONFIG_REQUIRES "openjph >= 0.21.0")
|
||||
else()
|
||||
# Using internal openjph
|
||||
set(OPENEXR_USE_INTERNAL_OPENJPH 1 CACHE INTERNAL
|
||||
"Whether OpenEXR bundles vendored OpenJPH into OpenEXRCore (0 or 1)" FORCE)
|
||||
|
||||
# extract the openjph version variables from ojph_version.h
|
||||
set(openjph_SOURCE_DIR "${CMAKE_SOURCE_DIR}/external/OpenJPH")
|
||||
set(openjph_version "${openjph_SOURCE_DIR}/src/core/openjph/ojph_version.h")
|
||||
if(EXISTS "${openjph_version}")
|
||||
file(STRINGS "${openjph_version}" _openjph_major REGEX "#define OPENJPH_VERSION_MAJOR")
|
||||
file(STRINGS "${openjph_version}" _openjph_minor REGEX "#define OPENJPH_VERSION_MINOR")
|
||||
file(STRINGS "${openjph_version}" _openjph_patch REGEX "#define OPENJPH_VERSION_PATCH")
|
||||
file(STRINGS "${openjph_version}" _openjph_sha REGEX "#define OPENJPH_VERSION_SHA")
|
||||
string(REGEX REPLACE ".*OPENJPH_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1" openjph_VERSION_MAJOR "${_openjph_major}")
|
||||
string(REGEX REPLACE ".*OPENJPH_VERSION_MINOR[ \t]+([0-9]+).*" "\\1" openjph_VERSION_MINOR "${_openjph_minor}")
|
||||
string(REGEX REPLACE ".*OPENJPH_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" openjph_VERSION_PATCH "${_openjph_patch}")
|
||||
string(REGEX REPLACE ".*OPENJPH_VERSION_SHA[ \t]+([0-9a-f]+).*" "\\1" openjph_VERSION_SHA "${_openjph_sha}")
|
||||
else()
|
||||
message(STATUS "can't find openjph_version.h: ${openjph_version}")
|
||||
endif()
|
||||
|
||||
if(openjph_VERSION_SHA)
|
||||
set(openjph_VERSION "${openjph_VERSION_SHA}")
|
||||
else()
|
||||
set(openjph_VERSION "${openjph_VERSION_MAJOR}.${openjph_VERSION_MINOR}.${openjph_VERSION_PATCH}")
|
||||
endif()
|
||||
|
||||
if(OPENEXR_FORCE_INTERNAL_OPENJPH)
|
||||
message(STATUS "openjph forced internal, using vendored code, version ${openjph_VERSION}")
|
||||
else()
|
||||
message(STATUS "openjph was not found, using vendored code, version ${openjph_VERSION}")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#######################################
|
||||
@@ -226,22 +339,20 @@ endif()
|
||||
|
||||
option(OPENEXR_FORCE_INTERNAL_IMATH "Force using an internal imath" OFF)
|
||||
# Check to see if Imath is installed outside of the current build directory.
|
||||
set(OPENEXR_IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING
|
||||
"Repo for auto-build of Imath")
|
||||
set(OPENEXR_IMATH_TAG "main" CACHE STRING
|
||||
"Tag for auto-build of Imath (branch, tag, or SHA)")
|
||||
set(OPENEXR_IMATH_REPO "https://github.com/AcademySoftwareFoundation/Imath.git" CACHE STRING "Repo for auto-build of Imath")
|
||||
set(OPENEXR_IMATH_TAG "main" CACHE STRING "Tag for auto-build of Imath (branch, tag, or SHA)")
|
||||
if(NOT OPENEXR_FORCE_INTERNAL_IMATH)
|
||||
#TODO: ^^ Release should not clone from main, this is a place holder
|
||||
set(CMAKE_IGNORE_PATH "${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-src/config;${CMAKE_CURRENT_BINARY_DIR}/_deps/imath-build/config")
|
||||
find_package(Imath 3.1)
|
||||
find_package(Imath 3.1 CONFIG QUIET)
|
||||
set(CMAKE_IGNORE_PATH)
|
||||
endif()
|
||||
|
||||
if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
|
||||
if(OPENEXR_FORCE_INTERNAL_IMATH)
|
||||
message(STATUS "Imath forced internal, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
|
||||
message(STATUS "Imath forced internal, fetching from ${OPENEXR_IMATH_REPO} @ ${OPENEXR_IMATH_TAG}")
|
||||
else()
|
||||
message(STATUS "Imath was not found, installing from ${OPENEXR_IMATH_REPO} (${OPENEXR_IMATH_TAG})")
|
||||
message(STATUS "Imath was not found, fetching from ${OPENEXR_IMATH_REPO} @ ${OPENEXR_IMATH_TAG}")
|
||||
endif()
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(Imath
|
||||
@@ -249,13 +360,30 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
|
||||
GIT_TAG "${OPENEXR_IMATH_TAG}"
|
||||
GIT_SHALLOW ON
|
||||
)
|
||||
|
||||
FetchContent_GetProperties(Imath)
|
||||
if(NOT Imath_POPULATED)
|
||||
FetchContent_Populate(Imath)
|
||||
# hrm, cmake makes Imath lowercase for the properties (to imath)
|
||||
add_subdirectory(${imath_SOURCE_DIR} ${imath_BINARY_DIR})
|
||||
FetchContent_MakeAvailable(Imath)
|
||||
|
||||
# Propagate OpenEXR's install setting to Imath
|
||||
set(IMATH_INSTALL ${OPENEXR_INSTALL})
|
||||
|
||||
# Propagate OpenEXR's setting for pkg-config generation to Imath:
|
||||
# If OpenEXR is generating it, the internal Imath should, too.
|
||||
set(IMATH_INSTALL_PKG_CONFIG ${OPENEXR_INSTALL_PKG_CONFIG})
|
||||
endif()
|
||||
|
||||
# extract the imath version variables from ImathConfig.h
|
||||
set(_imath_cfg "${Imath_BINARY_DIR}/config/ImathConfig.h")
|
||||
if(EXISTS "${_imath_cfg}")
|
||||
file(STRINGS "${_imath_cfg}" _ver_line REGEX "IMATH_LIB_VERSION_STRING")
|
||||
string(REGEX REPLACE ".*IMATH_LIB_VERSION_STRING[ \t]+\"([0-9.]+)\".*" "\\1" IMATH_LIB_VERSION_STRING "${_ver_line}")
|
||||
string(REPLACE "." ";" _ver_list "${IMATH_LIB_VERSION_STRING}")
|
||||
list(GET _ver_list 0 Imath_SOVERSION)
|
||||
list(GET _ver_list 1 Imath_VERSION_MAJOR)
|
||||
list(GET _ver_list 2 Imath_VERSION_MINOR)
|
||||
list(GET _ver_list 3 Imath_VERSION_PATCH)
|
||||
endif()
|
||||
|
||||
# the install creates this but if we're using the library locally we
|
||||
# haven't installed the header files yet, so need to extract those
|
||||
# and make a variable for header only usage
|
||||
@@ -264,10 +392,9 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND)
|
||||
get_target_property(imathconfinc ImathConfig INTERFACE_INCLUDE_DIRECTORIES)
|
||||
list(APPEND imathinc ${imathconfinc})
|
||||
set(IMATH_HEADER_ONLY_INCLUDE_DIRS ${imathinc})
|
||||
message(STATUS "Imath interface dirs ${IMATH_HEADER_ONLY_INCLUDE_DIRS}")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Using Imath from ${Imath_DIR}")
|
||||
message(STATUS "Using Imath ${Imath_VERSION} from ${Imath_DIR}")
|
||||
# local build
|
||||
# add_subdirectory(${IMATH_ROOT} Imath)
|
||||
# add_subdirectory(${OPENEXR_ROOT} OpenEXR)
|
||||
@@ -280,6 +407,45 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenEXR includes Imath headers from an "Imath/" subdirectory,
|
||||
# i.e. #include <Imath/ImathVec.h. The Imath library installs its
|
||||
# headers in that folder, although when Imath is built inside the
|
||||
# OpenEXR build tree (brought in via FetchContent or
|
||||
# add_subdirectory), there is no "Imath/" subdirectory. Imath’s CMake
|
||||
# exposes an include dir pointing at …/src/Imath (matches #include
|
||||
# <ImathVec.h> but doesn't match <Imath/ImathVec.h>), and ImathConfig,
|
||||
# an include dir pointing at …/config, where ImathConfig.h lives
|
||||
# (matches #include <ImathConfig.h>, not <Imath/ImathConfig.h>).
|
||||
#
|
||||
# To support #include <Imath/...> in this configuration, we must
|
||||
# create an "Imath/" directory in the build tree and symlink/copy the
|
||||
# ImathConfig.h header into it, and also provide Imath's "src/"
|
||||
# directory as a build interface include dir (because "Imath/" lives
|
||||
# underneath it).
|
||||
|
||||
if(TARGET Imath AND TARGET ImathConfig)
|
||||
get_target_property(_openexr_imath_imported Imath IMPORTED)
|
||||
get_target_property(_openexr_imathcfg_imported ImathConfig IMPORTED)
|
||||
if(NOT _openexr_imath_imported
|
||||
AND NOT _openexr_imathcfg_imported
|
||||
AND EXISTS "${Imath_SOURCE_DIR}/src/Imath/ImathVec.h")
|
||||
set(_openexr_imath_gen_cfg "${Imath_BINARY_DIR}/config/ImathConfig.h")
|
||||
set(_openexr_imath_cfg_compat "${PROJECT_BINARY_DIR}/OpenEXR_ImathIncludeCompat")
|
||||
if(EXISTS "${_openexr_imath_gen_cfg}")
|
||||
file(MAKE_DIRECTORY "${_openexr_imath_cfg_compat}/Imath")
|
||||
configure_file("${_openexr_imath_gen_cfg}"
|
||||
"${_openexr_imath_cfg_compat}/Imath/ImathConfig.h" COPYONLY)
|
||||
endif()
|
||||
|
||||
target_include_directories(Imath INTERFACE
|
||||
"$<BUILD_INTERFACE:${Imath_SOURCE_DIR}/src>")
|
||||
if(EXISTS "${_openexr_imath_gen_cfg}")
|
||||
target_include_directories(ImathConfig INTERFACE
|
||||
"$<BUILD_INTERFACE:${_openexr_imath_cfg_compat}>")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###########################################
|
||||
# Check if we need to emulate vld1q_f32_x2
|
||||
###########################################
|
||||
@@ -297,3 +463,16 @@ int main() {
|
||||
set(OPENEXR_MISSING_ARM_VLD1 TRUE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
###########################################
|
||||
# Enable SSE2 on 32-bit x86
|
||||
###########################################
|
||||
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i[3-6]86|x86)$" AND NOT MSVC)
|
||||
include(CheckCCompilerFlag)
|
||||
check_c_compiler_flag("-msse2" HAS_SSE2_FLAG)
|
||||
if(HAS_SSE2_FLAG)
|
||||
add_compile_options(-msse2 -mfpmath=sse)
|
||||
message(STATUS "Enabling SSE2 for 32-bit x86 build")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -15,18 +15,34 @@
|
||||
#
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_VERSION 1)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
set(TOOLCHAIN_PREFIX i686-w64-mingw32)
|
||||
|
||||
set(CMAKE_CROSSCOMPILING_EMULATOR wine)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
|
||||
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
set(CMAKE_MC_COMPILER ${TOOLCHAIN_PREFIX}-windmc)
|
||||
set(CMAKE_AR:FILEPATH ${TOOLCHAIN_PREFIX}-ar)
|
||||
set(CMAKE_RANLIB:FILEPATH ${TOOLCHAIN_PREFIX}-ranlib)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-m32 -static-libgcc -static-libstdc++ -static" CACHE STRING "link flags")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-m32 -static-libgcc -static-libstdc++ -static" CACHE STRING "slink flags")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
set(CMAKE_C_FLAGS_INIT "-m32 -mfpmath=sse -msse2 -Wl,--large-address-aware $ENV{CFLAGS} ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS_INIT "-m32 -mfpmath=sse -msse2 -Wl,--large-address-aware $ENV{CFLAGS} ${CMAKE_CXX_FLAGS}")
|
||||
unset (CMAKE_C_FLAGS CACHE)
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during all build types.")
|
||||
unset (CMAKE_CXX_FLAGS CACHE)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
|
||||
"Flags used by the compiler during all build types.")
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) Kitware, Inc and Contributors to the OpenEXR Project.
|
||||
# Portions of this file were adapted from the CMake community FAQ:
|
||||
# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
|
||||
|
||||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS
|
||||
"-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif()
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
+5
-7
@@ -41,20 +41,18 @@ define_manpage(exrheader "print exr image header metadata")
|
||||
define_manpage(exrinfo "print exr image header metadata")
|
||||
define_manpage(exrmakepreview "generate exr preview thumbnail images")
|
||||
define_manpage(exrmaketiled "convert exr images to tiled format")
|
||||
define_manpage(exrmanifest "print id manifest")
|
||||
define_manpage(exrmetrics "report read/write time")
|
||||
define_manpage(exrmultipart "combine or split multipart exr images")
|
||||
define_manpage(exrmultiview "convert between single/multi-view exr images")
|
||||
define_manpage(exrstdattr "set exr image metadata")
|
||||
|
||||
add_custom_target(docs ALL DEPENDS
|
||||
${manpage_files})
|
||||
add_custom_target(docs ALL DEPENDS ${manpage_files})
|
||||
|
||||
# Add a target to install the manpages
|
||||
|
||||
if(INSTALL_DOCS)
|
||||
include(GNUInstallDirs)
|
||||
install(DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1 DESTINATION ${CMAKE_INSTALL_MANDIR})
|
||||
endif()
|
||||
include(GNUInstallDirs)
|
||||
install(DIRECTORY ${MANPAGE_OUTPUT_DIR}/man1 DESTINATION ${CMAKE_INSTALL_MANDIR})
|
||||
|
||||
# build the example code to verify that it compiles
|
||||
|
||||
|
||||
|
||||
Vendored
+242
@@ -0,0 +1,242 @@
|
||||
cmake_minimum_required(VERSION 3.12.0)
|
||||
|
||||
## Library name/version
|
||||
include(ojph_version.cmake)
|
||||
|
||||
## project
|
||||
project (openjph VERSION ${OPENJPH_VERSION} DESCRIPTION "Open source implementation of JPH" LANGUAGES C CXX)
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
################################################################################################
|
||||
# Building OpenJPH
|
||||
################################################################################################
|
||||
|
||||
## Target architecture
|
||||
# We use the target architecture to help with arranging files in "source_group" commands.
|
||||
# The code does not use the results provided by target_arch.cmake, and relies, instead,
|
||||
# on its own logic, which matches that in target_arch.cmake, to identify the architecture
|
||||
include(target_arch.cmake)
|
||||
target_architecture(OJPH_TARGET_ARCH)
|
||||
message(STATUS "CPU Architecture is ${OJPH_TARGET_ARCH}")
|
||||
|
||||
## Building for multi-generation
|
||||
# This is useful for when we are building a multi-architecture build, such as when using
|
||||
# the -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" build configuration
|
||||
if (CMAKE_OSX_ARCHITECTURES)
|
||||
list(FIND CMAKE_OSX_ARCHITECTURES "x86_64" x86_64_index)
|
||||
if (${x86_64_index} GREATER -1)
|
||||
set(MULTI_GEN_X86_64 TRUE)
|
||||
endif()
|
||||
unset(x86_64_index)
|
||||
list(FIND CMAKE_OSX_ARCHITECTURES "arm64" arm64_index)
|
||||
if (${arm64_index} GREATER -1)
|
||||
set(MULTI_GEN_ARM64 TRUE)
|
||||
endif()
|
||||
unset(arm64_index)
|
||||
endif()
|
||||
|
||||
## options
|
||||
option(OJPH_ENABLE_TIFF_SUPPORT "Enables input and output support for TIFF files" ON)
|
||||
option(OJPH_BUILD_TESTS "Enables building test code" OFF)
|
||||
option(OJPH_BUILD_EXECUTABLES "Enables building command line executables" ON)
|
||||
option(OJPH_BUILD_STREAM_EXPAND "Enables building ojph_stream_expand executable" OFF)
|
||||
option(OJPH_INSTALL "Install OpenJPH libraries, headers, and CMake config" ON)
|
||||
|
||||
option(OJPH_DISABLE_SIMD "Disables the use of SIMD instructions -- agnostic to architectures" OFF)
|
||||
option(OJPH_DISABLE_SSE "Disables the use of SSE SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_SSE2 "Disables the use of SSE2 SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_SSSE3 "Disables the use of SSSE3 SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_SSE4 "Disables the use of SSE4 SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_AVX "Disables the use of AVX SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_AVX2 "Disables the use of AVX2 SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_AVX512 "Disables the use of AVX512 SIMD instructions and associated files" OFF)
|
||||
option(OJPH_DISABLE_NEON "Disables the use of NEON SIMD instructions and associated files" OFF)
|
||||
|
||||
## options that are being deprecated
|
||||
if (DEFINED OJPH_DISABLE_INTEL_SIMD)
|
||||
message(STATUS "OJPH_DISABLE_INTEL_SIMD is being deprecated. Instead, use \"OJPH_DISABLE_SIMD\", "
|
||||
"which is architecture agnostic. If you do not specify any, the default is "
|
||||
"OJPH_DISABLE_SIMD=OFF.")
|
||||
set(OJPH_DISABLE_SIMD ${OJPH_DISABLE_INTEL_SIMD})
|
||||
message(STATUS "OJPH_DISABLE_SIMD is set to ${OJPH_DISABLE_SIMD}")
|
||||
unset(OJPH_DISABLE_INTEL_SIMD)
|
||||
endif()
|
||||
if (DEFINED OJPH_ENABLE_INTEL_AVX512)
|
||||
message(STATUS "OJPH_ENABLE_INTEL_AVX512 is being deprecated, use \"OJPH_DISABLE_AVX512\" instead."
|
||||
"If you do not specify any, the default is OJPH_DISABLE_AVX512=OFF.")
|
||||
if (OJPH_ENABLE_INTEL_AVX512)
|
||||
set(OJPH_DISABLE_AVX512 OFF)
|
||||
else()
|
||||
set(OJPH_DISABLE_AVX512 ON)
|
||||
endif()
|
||||
message(STATUS "OJPH_DISABLE_AVX512 is set to ${OJPH_DISABLE_AVX512}")
|
||||
unset(OJPH_ENABLE_INTEL_AVX512)
|
||||
endif()
|
||||
|
||||
## Setting some of the options if EMSCRIPTEN is the compiler
|
||||
# In previous releases, the cmake script used to produce both non-SIMD and
|
||||
# SIMD builds in one go. At the time of this writing, all interpreters and
|
||||
# compilers of WASM code, such as web-browser and node, support SIMD, therefore
|
||||
# it is time to make the SIMD build the default. In other words, this cmake
|
||||
# script builds only WASM SIMD code by default, if desired, a non-SIMD build
|
||||
# can be generated using the OJPH_DISABLE_SIMD option (in this case, the
|
||||
# WASM SIMD code is not generated).
|
||||
# It is worth remembering that the SIMD/non-SIMD issue arose because it is
|
||||
# NOT possible to have multiple execution paths in the code, one for non-SIMD
|
||||
# and one for SIMD, as we do for CPUs, letting the program select, at run-time,
|
||||
# the best path to follow.
|
||||
if(EMSCRIPTEN)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(OJPH_ENABLE_TIFF_SUPPORT OFF)
|
||||
set(OJPH_BUILD_STREAM_EXPAND OFF)
|
||||
if (OJPH_DISABLE_SIMD)
|
||||
set(OJPH_ENABLE_WASM_SIMD OFF)
|
||||
else()
|
||||
set(OJPH_ENABLE_WASM_SIMD ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# This is related to how the timestamp is set for URL downloaded files.
|
||||
# Set DOWNLOAD_EXTRACT_TIMESTAMP
|
||||
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0135 NEW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## Added by Michael Smith
|
||||
set(CMAKE_CXX_FLAGS_ASAN
|
||||
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
|
||||
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
|
||||
FORCE)
|
||||
|
||||
## Build type
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
message(STATUS "To use AddressSanitizer, use \"cmake .. -DCMAKE_BUILD_TYPE=asan\"" )
|
||||
endif()
|
||||
message(STATUS "Building ${CMAKE_BUILD_TYPE}")
|
||||
|
||||
## C++ version and flags
|
||||
# C11 is needed for aligned_alloc
|
||||
if (NOT CMAKE_C_STANDARD)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
endif()
|
||||
message(STATUS "C Standard is set to ${CMAKE_C_STANDARD}")
|
||||
# C++14 is needed for gtest, otherwise, C++11 is sufficient for the library
|
||||
if (NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
endif()
|
||||
message(STATUS "C++ Standard is set to ${CMAKE_CXX_STANDARD}")
|
||||
|
||||
if (MSVC)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU" AND NOT MSVC)
|
||||
add_compile_options(
|
||||
-fexceptions
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wconversion
|
||||
-Wunused-parameter
|
||||
)
|
||||
endif()
|
||||
if (EMSCRIPTEN)
|
||||
add_compile_options(-fexceptions)
|
||||
if(OJPH_ENABLE_WASM_SIMD)
|
||||
add_compile_options(-DOJPH_ENABLE_WASM_SIMD -msimd128)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## Enhanced instruction options
|
||||
if (OJPH_DISABLE_SIMD)
|
||||
add_compile_definitions(OJPH_DISABLE_SIMD)
|
||||
else()
|
||||
if(OJPH_DISABLE_SSE)
|
||||
add_compile_definitions(OJPH_DISABLE_SSE)
|
||||
endif()
|
||||
if(OJPH_DISABLE_SSE2)
|
||||
add_compile_definitions(OJPH_DISABLE_SSE2)
|
||||
endif()
|
||||
if(OJPH_DISABLE_SSSE3)
|
||||
add_compile_definitions(OJPH_DISABLE_SSSE3)
|
||||
endif()
|
||||
if(OJPH_DISABLE_SSE4)
|
||||
add_compile_definitions(OJPH_DISABLE_SSE4)
|
||||
endif()
|
||||
if(OJPH_DISABLE_AVX)
|
||||
add_compile_definitions(OJPH_DISABLE_AVX)
|
||||
endif()
|
||||
if(OJPH_DISABLE_AVX2)
|
||||
add_compile_definitions(OJPH_DISABLE_AVX2)
|
||||
endif()
|
||||
if(OJPH_DISABLE_AVX512)
|
||||
add_compile_definitions(OJPH_DISABLE_AVX512)
|
||||
endif()
|
||||
if(OJPH_DISABLE_NEON)
|
||||
add_compile_definitions(OJPH_DISABLE_NEON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
## Build library and applications
|
||||
include(GNUInstallDirs)
|
||||
add_subdirectory(src/core)
|
||||
if (OJPH_BUILD_EXECUTABLES)
|
||||
add_subdirectory(src/apps)
|
||||
endif()
|
||||
|
||||
################################################################################################
|
||||
# Install
|
||||
################################################################################################
|
||||
|
||||
if (OJPH_INSTALL)
|
||||
install(EXPORT openjph-targets
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
|
||||
)
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/src/openjph-config.cmake.in
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake"
|
||||
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
|
||||
)
|
||||
|
||||
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
|
||||
COMPATIBILITY SameMinorVersion)
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openjph-config.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/openjph-config-version.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/openjph
|
||||
)
|
||||
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
else()
|
||||
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
|
||||
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
|
||||
else()
|
||||
set(PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/openjph.pc.in"
|
||||
"${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
|
||||
@ONLY
|
||||
)
|
||||
|
||||
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc"
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||
)
|
||||
endif()
|
||||
|
||||
################################################################################################
|
||||
# Testing (OJPH_BUILD_TESTS)
|
||||
################################################################################################
|
||||
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND OJPH_BUILD_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2019, Aous Naman
|
||||
Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
Copyright (c) 2019, The University of New South Wales, Sydney, Australia
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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
+24
@@ -0,0 +1,24 @@
|
||||
[](https://gitter.im/OpenJPH?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
# Readme #
|
||||
|
||||
Open source implementation of High-throughput JPEG2000 (HTJ2K), also known as JPH, JPEG2000 Part 15, ISO/IEC 15444-15, and ITU-T T.814. Here, we are interested in implementing the HTJ2K only, supporting features that are defined in JPEG2000 Part 1 (for example, for wavelet transform, only reversible 5/3 and irreversible 9/7 are supported).
|
||||
|
||||
The interested reader is referred to the [short HTJ2K white paper](http://ds.jpeg.org/whitepapers/jpeg-htj2k-whitepaper.pdf), or the [extended HTJ2K white paper](https://htj2k.com/wp-content/uploads/white-paper.pdf) for more details on HTJ2K. [This](https://kakadusoftware.com/wp-content/uploads/icip2019.pdf) paper explores the attainable performance on CPU, while [this](https://kakadusoftware.com/wp-content/uploads/ICIP2019_GPU.pdf) and [this](http://hdl.handle.net/1959.4/unsworks_75139) explores performance on the GPU.
|
||||
|
||||
# The standard #
|
||||
|
||||
The standard is available free of charge from [ITU website](https://www.itu.int/rec/T-REC-T.814/en). It can also be purchased from the [ISO website](https://www.iso.org/standard/76621.html).
|
||||
|
||||
# Table of Contents #
|
||||
|
||||
* [Status](/docs/status.md)
|
||||
* [Compiling](./docs/compiling.md)
|
||||
* [Compiling and Running in Docker](./docs/docker.md)
|
||||
* [Usage Example](./docs/usage_examples.md)
|
||||
* [Web-based Demos](./docs/web_demos.md)
|
||||
* [Doxygen Documentation Style](./docs/doxygen_style.md)
|
||||
|
||||
# Repositories #
|
||||
[](https://repology.org/project/openjph/versions)
|
||||
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
################################################################################################
|
||||
# Generating ojph library version number
|
||||
################################################################################################
|
||||
|
||||
############################################################
|
||||
# Parse version file
|
||||
# credit: https://stackoverflow.com/a/47084079
|
||||
|
||||
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/core/openjph/ojph_version.h" VERFILE)
|
||||
if (NOT VERFILE)
|
||||
message(FATAL_ERROR "Failed to parse ojph_version.h!")
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "OPENJPH_VERSION_MAJOR ([0-9]*)" _ ${VERFILE})
|
||||
set(OPENJPH_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "OPENJPH_VERSION_MINOR ([0-9]*)" _ ${VERFILE})
|
||||
set(OPENJPH_VERSION_MINOR ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "OPENJPH_VERSION_PATCH ([0-9]*)" _ ${VERFILE})
|
||||
set(OPENJPH_VERSION_PATCH ${CMAKE_MATCH_1})
|
||||
|
||||
set(OPENJPH_VERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}.${OPENJPH_VERSION_PATCH}")
|
||||
############################################################
|
||||
|
||||
message(STATUS "OpenJPH library version: ${OPENJPH_VERSION}")
|
||||
|
||||
if (OPENJPH_VERSION)
|
||||
else()
|
||||
message(FATAL_ERROR "OPENJPH_VERSION is not set")
|
||||
endif()
|
||||
+185
@@ -0,0 +1,185 @@
|
||||
|
||||
file(GLOB CODESTREAM "codestream/*.cpp" "codestream/*.h")
|
||||
file(GLOB CODESTREAM_SSE "codestream/*_sse.cpp")
|
||||
file(GLOB CODESTREAM_SSE2 "codestream/*_sse2.cpp")
|
||||
file(GLOB CODESTREAM_AVX "codestream/*_avx.cpp")
|
||||
file(GLOB CODESTREAM_AVX2 "codestream/*_avx2.cpp")
|
||||
file(GLOB CODESTREAM_WASM "codestream/*_wasm.cpp")
|
||||
file(GLOB CODING "coding/*.cpp" "coding/*.h")
|
||||
file(GLOB CODING_SSSE3 "coding/*_ssse3.cpp")
|
||||
file(GLOB CODING_WASM "coding/*_wasm.cpp")
|
||||
file(GLOB CODING_AVX2 "coding/*_avx2.cpp")
|
||||
file(GLOB CODING_AVX512 "coding/*_avx512.cpp")
|
||||
file(GLOB COMMON "openjph/*.h")
|
||||
file(GLOB OTHERS "others/*.cpp" "others/*.c")
|
||||
file(GLOB TRANSFORM "transform/*.cpp" "transform/*.h")
|
||||
file(GLOB TRANSFORM_SSE "transform/*_sse.cpp")
|
||||
file(GLOB TRANSFORM_SSE2 "transform/*_sse2.cpp")
|
||||
file(GLOB TRANSFORM_AVX "transform/*_avx.cpp")
|
||||
file(GLOB TRANSFORM_AVX2 "transform/*_avx2.cpp")
|
||||
file(GLOB TRANSFORM_AVX512 "transform/*_avx512.cpp")
|
||||
file(GLOB TRANSFORM_WASM "transform/*_wasm.cpp")
|
||||
|
||||
list(REMOVE_ITEM CODESTREAM ${CODESTREAM_SSE} ${CODESTREAM_SSE2} ${CODESTREAM_AVX} ${CODESTREAM_AVX2} ${CODESTREAM_WASM})
|
||||
list(REMOVE_ITEM CODING ${CODING_SSSE3} ${CODING_WASM} ${CODING_AVX2} ${CODING_AVX512})
|
||||
list(REMOVE_ITEM TRANSFORM ${TRANSFORM_SSE} ${TRANSFORM_SSE2} ${TRANSFORM_AVX} ${TRANSFORM_AVX2} ${TRANSFORM_AVX512} ${TRANSFORM_WASM})
|
||||
list(APPEND SOURCES ${CODESTREAM} ${CODING} ${COMMON} ${OTHERS} ${TRANSFORM})
|
||||
|
||||
source_group("codestream" FILES ${CODESTREAM})
|
||||
source_group("coding" FILES ${CODING})
|
||||
source_group("common" FILES ${COMMON})
|
||||
source_group("others" FILES ${OTHERS})
|
||||
source_group("transform" FILES ${TRANSFORM})
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
if (OJPH_ENABLE_WASM_SIMD)
|
||||
list(APPEND SOURCES ${CODESTREAM_WASM} ${CODING_WASM} ${TRANSFORM_WASM})
|
||||
source_group("codestream" FILES ${CODESTREAM_WASM})
|
||||
source_group("coding" FILES ${CODING_WASM})
|
||||
source_group("transform" FILES ${TRANSFORM_WASM})
|
||||
endif()
|
||||
else()
|
||||
if (NOT OJPH_DISABLE_SIMD)
|
||||
if (("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_X86_64")
|
||||
OR ("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_I386")
|
||||
OR MULTI_GEN_X86_64)
|
||||
|
||||
if (NOT OJPH_DISABLE_SSE)
|
||||
list(APPEND SOURCES ${CODESTREAM_SSE} ${TRANSFORM_SSE})
|
||||
source_group("codestream" FILES ${CODESTREAM_SSE})
|
||||
source_group("transform" FILES ${TRANSFORM_SSE})
|
||||
endif()
|
||||
if (NOT OJPH_DISABLE_SSE2)
|
||||
list(APPEND SOURCES ${CODESTREAM_SSE2} ${TRANSFORM_SSE2})
|
||||
source_group("codestream" FILES ${CODESTREAM_SSE2})
|
||||
source_group("transform" FILES ${TRANSFORM_SSE2})
|
||||
endif()
|
||||
if (NOT OJPH_DISABLE_SSSE3)
|
||||
list(APPEND SOURCES ${CODING_SSSE3})
|
||||
source_group("coding" FILES ${CODING_SSSE3})
|
||||
endif()
|
||||
if (NOT OJPH_DISABLE_AVX)
|
||||
list(APPEND SOURCES ${CODESTREAM_AVX} ${TRANSFORM_AVX})
|
||||
source_group("codestream" FILES ${CODESTREAM_AVX})
|
||||
source_group("transform" FILES ${TRANSFORM_AVX})
|
||||
endif()
|
||||
if (NOT OJPH_DISABLE_AVX2)
|
||||
list(APPEND SOURCES ${CODESTREAM_AVX2} ${TRANSFORM_AVX2} ${CODING_AVX2})
|
||||
source_group("codestream" FILES ${CODESTREAM_AVX2})
|
||||
source_group("transform" FILES ${TRANSFORM_AVX2})
|
||||
source_group("coding" FILES ${CODING_AVX2})
|
||||
endif()
|
||||
if (NOT OJPH_DISABLE_AVX512)
|
||||
list(APPEND SOURCES ${CODING_AVX512} ${TRANSFORM_AVX512})
|
||||
source_group("coding" FILES ${CODING_AVX512})
|
||||
source_group("transform" FILES ${TRANSFORM_AVX512})
|
||||
endif()
|
||||
|
||||
# Set compilation flags
|
||||
if (MSVC)
|
||||
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
|
||||
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
|
||||
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
|
||||
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX512")
|
||||
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
set_source_files_properties(transform/ojph_colour_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
|
||||
set_source_files_properties(transform/ojph_transform_avx.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX")
|
||||
set_source_files_properties(transform/ojph_transform_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2")
|
||||
set_source_files_properties(transform/ojph_transform_avx512.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX512")
|
||||
else()
|
||||
set_source_files_properties(codestream/ojph_codestream_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
|
||||
set_source_files_properties(codestream/ojph_codestream_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
|
||||
set_source_files_properties(codestream/ojph_codestream_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
|
||||
set_source_files_properties(codestream/ojph_codestream_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
|
||||
set_source_files_properties(coding/ojph_block_decoder_ssse3.cpp PROPERTIES COMPILE_FLAGS -mssse3)
|
||||
set_source_files_properties(coding/ojph_block_decoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
|
||||
set_source_files_properties(coding/ojph_block_encoder_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
|
||||
set_source_files_properties(coding/ojph_block_encoder_avx512.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512cd")
|
||||
set_source_files_properties(transform/ojph_colour_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
|
||||
set_source_files_properties(transform/ojph_colour_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
|
||||
set_source_files_properties(transform/ojph_colour_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
|
||||
set_source_files_properties(transform/ojph_colour_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
|
||||
set_source_files_properties(transform/ojph_transform_sse.cpp PROPERTIES COMPILE_FLAGS -msse)
|
||||
set_source_files_properties(transform/ojph_transform_sse2.cpp PROPERTIES COMPILE_FLAGS -msse2)
|
||||
set_source_files_properties(transform/ojph_transform_avx.cpp PROPERTIES COMPILE_FLAGS -mavx)
|
||||
set_source_files_properties(transform/ojph_transform_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2)
|
||||
set_source_files_properties(transform/ojph_transform_avx512.cpp PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512cd")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (("${OJPH_TARGET_ARCH}" MATCHES "OJPH_ARCH_ARM") OR MULTI_GEN_ARM64)
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
## Set debug postfix for different platforms
|
||||
if (MSVC)
|
||||
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
endif()
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
|
||||
if (NOT DEFINED CMAKE_DEBUG_POSTFIX)
|
||||
set(CMAKE_DEBUG_POSTFIX "_d")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT DEFINED OJPH_LIB_TYPE)
|
||||
set(OJPH_LIB_TYPE STATIC)
|
||||
endif()
|
||||
add_library(openjph ${OJPH_LIB_TYPE} ${SOURCES})
|
||||
|
||||
## The option BUILD_SHARED_LIBS
|
||||
if (BUILD_SHARED_LIBS AND WIN32)
|
||||
target_compile_definitions(openjph PRIVATE OJPH_BUILD_SHARED_LIBRARY)
|
||||
endif()
|
||||
|
||||
## include library version/name
|
||||
set_target_properties(openjph PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
target_compile_definitions(openjph PUBLIC _FILE_OFFSET_BITS=64)
|
||||
target_include_directories(openjph PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/openjph> $<INSTALL_INTERFACE:include>)
|
||||
|
||||
## This is to check if aligned_alloc or posix_memalign is available
|
||||
# We want the code to compile for C11 and C++11.
|
||||
# std::aligned_alloc is only availabe in C++17.
|
||||
# So here we try to see which API is available and adapt the code to use it
|
||||
if (NOT MSVC)
|
||||
include(CheckSymbolExists)
|
||||
check_symbol_exists(aligned_alloc "stdlib.h" OJPH_ALIGNED_ALLOC_EXISTS)
|
||||
if (OJPH_ALIGNED_ALLOC_EXISTS)
|
||||
target_compile_definitions(openjph PRIVATE OJPH_ALIGNED_ALLOC_EXISTS)
|
||||
else()
|
||||
check_symbol_exists(posix_memalign "stdlib.h" OJPH_POSIX_MEMALIGN_EXISTS)
|
||||
if (OJPH_POSIX_MEMALIGN_EXISTS)
|
||||
target_compile_definitions(openjph PRIVATE OJPH_POSIX_MEMALIGN_EXISTS)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
|
||||
set_target_properties(openjph
|
||||
PROPERTIES
|
||||
OUTPUT_NAME "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
|
||||
else()
|
||||
set(OJPH_LIB_NAME_STRING "openjph.${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}")
|
||||
set_target_properties(openjph
|
||||
PROPERTIES
|
||||
SOVERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}"
|
||||
VERSION "${OPENJPH_VERSION}")
|
||||
endif()
|
||||
|
||||
if (OJPH_INSTALL)
|
||||
install(TARGETS openjph
|
||||
EXPORT openjph-targets
|
||||
)
|
||||
|
||||
install(DIRECTORY openjph/
|
||||
DESTINATION include/openjph
|
||||
FILES_MATCHING
|
||||
PATTERN "*.h"
|
||||
)
|
||||
endif()
|
||||
@@ -0,0 +1,226 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_bitbuffer_read.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_BITBUFFER_READ_H
|
||||
#define OJPH_BITBUFFER_READ_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_file.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class mem_elastic_allocator;
|
||||
struct coded_lists;
|
||||
|
||||
namespace local {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct bit_read_buf
|
||||
{
|
||||
infile_base *file;
|
||||
ui32 tmp;
|
||||
int avail_bits;
|
||||
bool unstuff;
|
||||
ui32 bytes_left;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_init(bit_read_buf *bbp, ui32 bytes_left, infile_base* file)
|
||||
{
|
||||
bbp->avail_bits = 0;
|
||||
bbp->file = file;
|
||||
bbp->bytes_left = bytes_left;
|
||||
bbp->tmp = 0;
|
||||
bbp->unstuff = false;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_read(bit_read_buf *bbp)
|
||||
{
|
||||
if (bbp->bytes_left > 0)
|
||||
{
|
||||
ui32 t = 0;
|
||||
if (bbp->file->read(&t, 1) != 1)
|
||||
throw "error reading from file";
|
||||
bbp->tmp = t;
|
||||
bbp->avail_bits = 8 - bbp->unstuff;
|
||||
bbp->unstuff = (t == 0xFF);
|
||||
--bbp->bytes_left;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bbp->tmp = 0;
|
||||
bbp->avail_bits = 8 - bbp->unstuff;
|
||||
bbp->unstuff = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_read_bit(bit_read_buf *bbp, ui32& bit)
|
||||
{
|
||||
bool result = true;
|
||||
if (bbp->avail_bits == 0)
|
||||
result = bb_read(bbp);
|
||||
bit = (bbp->tmp >> --bbp->avail_bits) & 1;
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_read_bits(bit_read_buf *bbp, int num_bits, ui32& bits)
|
||||
{
|
||||
assert(num_bits <= 32);
|
||||
|
||||
bits = 0;
|
||||
bool result = true;
|
||||
while (num_bits) {
|
||||
if (bbp->avail_bits == 0)
|
||||
result = bb_read(bbp);
|
||||
int tx_bits = ojph_min(bbp->avail_bits, num_bits);
|
||||
bits <<= tx_bits;
|
||||
bbp->avail_bits -= tx_bits;
|
||||
num_bits -= tx_bits;
|
||||
bits |= (bbp->tmp >> bbp->avail_bits) & ((1 << tx_bits) - 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_read_chunk(bit_read_buf *bbp, ui32 num_bytes,
|
||||
coded_lists*& cur_coded_list,
|
||||
mem_elastic_allocator *elastic)
|
||||
{
|
||||
assert(bbp->avail_bits == 0 && bbp->unstuff == false);
|
||||
elastic->get_buffer(num_bytes + coded_cb_header::prefix_buf_size
|
||||
+ coded_cb_header::suffix_buf_size, cur_coded_list);
|
||||
ui32 bytes = ojph_min(num_bytes, bbp->bytes_left);
|
||||
ui32 bytes_read = (ui32)bbp->file->read(
|
||||
cur_coded_list->buf + coded_cb_header::prefix_buf_size, bytes);
|
||||
if (num_bytes > bytes_read)
|
||||
memset(
|
||||
cur_coded_list->buf + coded_cb_header::prefix_buf_size + bytes_read,
|
||||
0, num_bytes - bytes_read);
|
||||
bbp->bytes_left -= bytes_read;
|
||||
return bytes_read == bytes;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_skip_eph(bit_read_buf *bbp)
|
||||
{
|
||||
if (bbp->bytes_left >= 2)
|
||||
{
|
||||
ui8 marker[2];
|
||||
if (bbp->file->read(marker, 2) != 2)
|
||||
throw "error reading from file";
|
||||
bbp->bytes_left -= 2;
|
||||
if ((int)marker[0] != (EPH >> 8) || (int)marker[1] != (EPH & 0xFF))
|
||||
throw "should find EPH, but found something else";
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_terminate(bit_read_buf *bbp, bool uses_eph)
|
||||
{
|
||||
bool result = true;
|
||||
if (bbp->unstuff)
|
||||
result = bb_read(bbp);
|
||||
assert(bbp->unstuff == false);
|
||||
if (uses_eph)
|
||||
bb_skip_eph(bbp);
|
||||
bbp->tmp = 0;
|
||||
bbp->avail_bits = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
bool bb_skip_sop(bit_read_buf *bbp)
|
||||
{
|
||||
if (bbp->bytes_left >= 2)
|
||||
{
|
||||
ui8 marker[2];
|
||||
if (bbp->file->read(marker, 2) != 2)
|
||||
throw "error reading from file";
|
||||
if ((int)marker[0] == (SOP >> 8) && (int)marker[1] == (SOP & 0xFF))
|
||||
{
|
||||
bbp->bytes_left -= 2;
|
||||
if (bbp->bytes_left >= 4)
|
||||
{
|
||||
ui16 com_len;
|
||||
if (bbp->file->read(&com_len, 2) != 2)
|
||||
throw "error reading from file";
|
||||
com_len = swap_byte(com_len);
|
||||
if (com_len != 4)
|
||||
throw "something is wrong with SOP length";
|
||||
int result =
|
||||
bbp->file->seek(com_len - 2, infile_base::OJPH_SEEK_CUR);
|
||||
if (result != 0)
|
||||
throw "error seeking file";
|
||||
bbp->bytes_left -= com_len;
|
||||
}
|
||||
else
|
||||
throw "precinct truncated early";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//put the bytes back
|
||||
if (bbp->file->seek(-2, infile_base::OJPH_SEEK_CUR) != 0)
|
||||
throw "error seeking file";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_BITBUFFER_READ_H
|
||||
@@ -0,0 +1,147 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_bitbuffer_write.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_BITBUFFER_WRITE_H
|
||||
#define OJPH_BITBUFFER_WRITE_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_file.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class mem_elastic_allocator;
|
||||
struct coded_lists;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct bit_write_buf
|
||||
{
|
||||
static const int needed;
|
||||
|
||||
bit_write_buf() { ccl = NULL; avail_bits = 0; tmp = 0; }
|
||||
coded_lists* ccl;
|
||||
int avail_bits;
|
||||
ui64 tmp;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const int bit_write_buf::needed = 512;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_expand_buf(bit_write_buf *bbp, mem_elastic_allocator *elastic,
|
||||
coded_lists*& cur_coded_list)
|
||||
{
|
||||
assert(cur_coded_list == NULL);
|
||||
elastic->get_buffer(bit_write_buf::needed, cur_coded_list);
|
||||
bbp->ccl = cur_coded_list;
|
||||
bbp->tmp = 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_init(bit_write_buf *bbp, mem_elastic_allocator *elastic,
|
||||
coded_lists*& cur_coded_list)
|
||||
{
|
||||
bb_expand_buf(bbp, elastic, cur_coded_list);
|
||||
bbp->avail_bits = 8;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_put_bit(bit_write_buf *bbp, ui32 bit,
|
||||
mem_elastic_allocator *elastic,
|
||||
coded_lists*& cur_coded_list, ui32& ph_bytes)
|
||||
{
|
||||
--bbp->avail_bits;
|
||||
bbp->tmp |= (bit & 1) << bbp->avail_bits;
|
||||
if (bbp->avail_bits <= 0)
|
||||
{
|
||||
bbp->avail_bits = 8 - (bbp->tmp != 0xFF ? 0 : 1);
|
||||
bbp->ccl->buf[bbp->ccl->buf_size - bbp->ccl->avail_size] =
|
||||
(ui8)(bbp->tmp & 0xFF);
|
||||
bbp->tmp = 0;
|
||||
--bbp->ccl->avail_size;
|
||||
if (bbp->ccl->avail_size == 0)
|
||||
{
|
||||
bb_expand_buf(bbp, elastic, cur_coded_list->next_list);
|
||||
cur_coded_list = cur_coded_list->next_list;
|
||||
ph_bytes += bit_write_buf::needed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_put_zeros(bit_write_buf *bbp, int num_zeros,
|
||||
mem_elastic_allocator *elastic,
|
||||
coded_lists*& cur_coded_list, ui32& ph_bytes)
|
||||
{
|
||||
for (int i = num_zeros; i > 0; --i)
|
||||
bb_put_bit(bbp, 0, elastic, cur_coded_list, ph_bytes);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_put_bits(bit_write_buf *bbp, ui32 data, int num_bits,
|
||||
mem_elastic_allocator *elastic,
|
||||
coded_lists*& cur_coded_list, ui32& ph_bytes)
|
||||
{
|
||||
assert(num_bits <= 32);
|
||||
for (int i = num_bits - 1; i >= 0; --i)
|
||||
bb_put_bit(bbp, data >> i, elastic, cur_coded_list, ph_bytes);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
void bb_terminate(bit_write_buf *bbp)
|
||||
{
|
||||
if (bbp->avail_bits < 8) //bits have been written
|
||||
{
|
||||
ui8 val = (ui8)(bbp->tmp & 0xFF);
|
||||
bbp->ccl->buf[bbp->ccl->buf_size - bbp->ccl->avail_size] = val;
|
||||
--bbp->ccl->avail_size;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif // !OJPH_BITBUFFER_WRITE_H
|
||||
@@ -0,0 +1,264 @@
|
||||
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codeblock.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_codeblock.h"
|
||||
#include "ojph_subband.h"
|
||||
#include "ojph_resolution.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::pre_alloc(codestream *codestream, const size& nominal,
|
||||
ui32 precision)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
assert(byte_alignment / sizeof(ui32) > 1);
|
||||
const ui32 f = byte_alignment / sizeof(ui32) - 1;
|
||||
ui32 stride = (nominal.w + f) & ~f; // a multiple of 8
|
||||
|
||||
if (precision <= 32)
|
||||
allocator->pre_alloc_data<ui32>(nominal.h * (size_t)stride, 0);
|
||||
else
|
||||
allocator->pre_alloc_data<ui64>(nominal.h * (size_t)stride, 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::finalize_alloc(codestream *codestream,
|
||||
subband *parent, const size& nominal,
|
||||
const size& cb_size,
|
||||
coded_cb_header* coded_cb,
|
||||
ui32 K_max, int line_offset,
|
||||
ui32 precision, ui32 comp_idx)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
const ui32 f = byte_alignment / sizeof(ui32) - 1;
|
||||
this->stride = (nominal.w + f) & ~f; // a multiple of 8
|
||||
this->buf_size = this->stride * nominal.h;
|
||||
|
||||
if (precision <= 32) {
|
||||
this->precision = BUF32;
|
||||
this->buf32 = allocator->post_alloc_data<ui32>(this->buf_size, 0);
|
||||
}
|
||||
else {
|
||||
this->precision = BUF64;
|
||||
this->buf64 = allocator->post_alloc_data<ui64>(this->buf_size, 0);
|
||||
}
|
||||
|
||||
this->nominal_size = nominal;
|
||||
this->cb_size = cb_size;
|
||||
this->parent = parent;
|
||||
this->line_offset = line_offset;
|
||||
this->cur_line = 0;
|
||||
this->delta = parent->get_delta();
|
||||
this->delta_inv = 1.0f / this->delta;
|
||||
this->K_max = K_max;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
this->max_val64[i] = 0;
|
||||
const param_cod* coc = codestream->get_coc(comp_idx);
|
||||
this->reversible = coc->is_reversible();
|
||||
this->resilient = codestream->is_resilient();
|
||||
this->stripe_causal = coc->get_block_vertical_causality();
|
||||
this->zero_block = false;
|
||||
this->coded_cb = coded_cb;
|
||||
|
||||
this->codeblock_functions.init(reversible);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::push(line_buf *line)
|
||||
{
|
||||
// convert to sign and magnitude and keep max_val
|
||||
if (precision == BUF32)
|
||||
{
|
||||
assert(line->flags & line_buf::LFT_32BIT);
|
||||
const si32 *sp = line->i32 + line_offset;
|
||||
ui32 *dp = buf32 + cur_line * stride;
|
||||
this->codeblock_functions.tx_to_cb32(sp, dp, K_max, delta_inv,
|
||||
cb_size.w, max_val32);
|
||||
++cur_line;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(precision == BUF64);
|
||||
assert(line->flags & line_buf::LFT_64BIT);
|
||||
const si64 *sp = line->i64 + line_offset;
|
||||
ui64 *dp = buf64 + cur_line * stride;
|
||||
this->codeblock_functions.tx_to_cb64(sp, dp, K_max, delta_inv,
|
||||
cb_size.w, max_val64);
|
||||
++cur_line;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::encode(mem_elastic_allocator *elastic)
|
||||
{
|
||||
if (precision == BUF32)
|
||||
{
|
||||
ui32 mv = this->codeblock_functions.find_max_val32(max_val32);
|
||||
if (mv >= 1u << (31 - K_max))
|
||||
{
|
||||
coded_cb->missing_msbs = K_max - 1;
|
||||
assert(coded_cb->missing_msbs > 0);
|
||||
assert(coded_cb->missing_msbs < K_max);
|
||||
coded_cb->num_passes = 1;
|
||||
|
||||
this->codeblock_functions.encode_cb32(buf32, K_max-1, 1,
|
||||
cb_size.w, cb_size.h, stride, coded_cb->pass_length,
|
||||
elastic, coded_cb->next_coded);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(precision == BUF64);
|
||||
ui64 mv = this->codeblock_functions.find_max_val64(max_val64);
|
||||
if (mv >= 1ULL << (63 - K_max))
|
||||
{
|
||||
coded_cb->missing_msbs = K_max - 1;
|
||||
assert(coded_cb->missing_msbs > 0);
|
||||
assert(coded_cb->missing_msbs < K_max);
|
||||
coded_cb->num_passes = 1;
|
||||
|
||||
this->codeblock_functions.encode_cb64(buf64, K_max-1, 1,
|
||||
cb_size.w, cb_size.h, stride, coded_cb->pass_length,
|
||||
elastic, coded_cb->next_coded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::recreate(const size &cb_size, coded_cb_header* coded_cb)
|
||||
{
|
||||
assert(cb_size.h * stride <= buf_size && cb_size.w <= stride);
|
||||
this->cb_size = cb_size;
|
||||
this->coded_cb = coded_cb;
|
||||
this->cur_line = 0;
|
||||
for (int i = 0; i < 4; ++i)
|
||||
this->max_val64[i] = 0;
|
||||
this->zero_block = false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::decode()
|
||||
{
|
||||
if (coded_cb->pass_length[0] > 0 && coded_cb->num_passes > 0 &&
|
||||
coded_cb->next_coded != NULL)
|
||||
{
|
||||
bool result;
|
||||
if (precision == BUF32)
|
||||
{
|
||||
result = this->codeblock_functions.decode_cb32(
|
||||
coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
|
||||
buf32, coded_cb->missing_msbs, coded_cb->num_passes,
|
||||
coded_cb->pass_length[0], coded_cb->pass_length[1],
|
||||
cb_size.w, cb_size.h, stride, stripe_causal);
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(precision == BUF64);
|
||||
result = this->codeblock_functions.decode_cb64(
|
||||
coded_cb->next_coded->buf + coded_cb_header::prefix_buf_size,
|
||||
buf64, coded_cb->missing_msbs, coded_cb->num_passes,
|
||||
coded_cb->pass_length[0], coded_cb->pass_length[1],
|
||||
cb_size.w, cb_size.h, stride, stripe_causal);
|
||||
}
|
||||
|
||||
if (result == false)
|
||||
{
|
||||
if (resilient == true) {
|
||||
OJPH_INFO(0x000300A1, "Error decoding a codeblock.");
|
||||
zero_block = true;
|
||||
}
|
||||
else
|
||||
OJPH_ERROR(0x000300A1, "Error decoding a codeblock.");
|
||||
}
|
||||
}
|
||||
else
|
||||
zero_block = true;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void codeblock::pull_line(line_buf *line)
|
||||
{
|
||||
//convert to sign and magnitude
|
||||
if (precision == BUF32)
|
||||
{
|
||||
assert(line->flags & line_buf::LFT_32BIT);
|
||||
si32 *dp = line->i32 + line_offset;
|
||||
if (!zero_block)
|
||||
{
|
||||
const ui32 *sp = buf32 + cur_line * stride;
|
||||
this->codeblock_functions.tx_from_cb32(sp, dp, K_max, delta,
|
||||
cb_size.w);
|
||||
}
|
||||
else
|
||||
this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(ui32));
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(precision == BUF64);
|
||||
assert(line->flags & line_buf::LFT_64BIT);
|
||||
si64 *dp = line->i64 + line_offset;
|
||||
if (!zero_block)
|
||||
{
|
||||
const ui64 *sp = buf64 + cur_line * stride;
|
||||
this->codeblock_functions.tx_from_cb64(sp, dp, K_max, delta,
|
||||
cb_size.w);
|
||||
}
|
||||
else
|
||||
this->codeblock_functions.mem_clear(dp, cb_size.w * sizeof(*dp));
|
||||
}
|
||||
|
||||
++cur_line;
|
||||
assert(cur_line <= cb_size.h);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codeblock.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_CODEBLOCK_H
|
||||
#define OJPH_CODEBLOCK_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_file.h"
|
||||
#include "ojph_codeblock_fun.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class mem_elastic_allocator;
|
||||
class codestream;
|
||||
struct coded_lists;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
struct precinct;
|
||||
class subband;
|
||||
struct coded_cb_header;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class codeblock
|
||||
{
|
||||
friend struct precinct;
|
||||
enum : ui32 {
|
||||
BUF32 = 4,
|
||||
BUF64 = 8,
|
||||
};
|
||||
|
||||
public:
|
||||
static void pre_alloc(codestream *codestream, const size& nominal,
|
||||
ui32 precision);
|
||||
void finalize_alloc(codestream *codestream, subband* parent,
|
||||
const size& nominal, const size& cb_size,
|
||||
coded_cb_header* coded_cb, ui32 K_max,
|
||||
int tbx0, ui32 precision, ui32 comp_idx);
|
||||
void push(line_buf *line);
|
||||
void encode(mem_elastic_allocator *elastic);
|
||||
void recreate(const size& cb_size, coded_cb_header* coded_cb);
|
||||
|
||||
void decode();
|
||||
void pull_line(line_buf *line);
|
||||
|
||||
private:
|
||||
ui32 precision;
|
||||
union {
|
||||
ui32* buf32;
|
||||
ui64* buf64;
|
||||
};
|
||||
size nominal_size;
|
||||
size cb_size;
|
||||
ui32 stride;
|
||||
ui32 buf_size;
|
||||
subband* parent;
|
||||
int line_offset;
|
||||
ui32 cur_line;
|
||||
float delta, delta_inv;
|
||||
ui32 K_max;
|
||||
bool reversible;
|
||||
bool resilient;
|
||||
bool stripe_causal;
|
||||
bool zero_block; // true when the decoded block is all zero
|
||||
union {
|
||||
ui32 max_val32[8]; // supports up to 256 bits
|
||||
ui64 max_val64[4]; // supports up to 256 bits
|
||||
};
|
||||
coded_cb_header* coded_cb;
|
||||
codeblock_fun codeblock_functions;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct coded_cb_header
|
||||
{
|
||||
ui32 pass_length[2];
|
||||
ui32 num_passes; // number of passes to be decoded
|
||||
ui32 Kmax;
|
||||
ui32 missing_msbs;
|
||||
coded_lists *next_coded;
|
||||
|
||||
static const int prefix_buf_size = 8;
|
||||
static const int suffix_buf_size = 16;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_CODEBLOCK_H
|
||||
@@ -0,0 +1,286 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codeblock_fun.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_file.h"
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_codeblock_fun.h"
|
||||
|
||||
#include "../transform/ojph_colour.h"
|
||||
#include "../transform/ojph_transform.h"
|
||||
#include "../coding/ojph_block_decoder.h"
|
||||
#include "../coding/ojph_block_encoder.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_mem_clear(void* addr, size_t count);
|
||||
void sse_mem_clear(void* addr, size_t count);
|
||||
void avx_mem_clear(void* addr, size_t count);
|
||||
void wasm_mem_clear(void* addr, size_t count);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 gen_find_max_val32(ui32* address);
|
||||
ui32 sse2_find_max_val32(ui32* address);
|
||||
ui32 avx2_find_max_val32(ui32* address);
|
||||
ui32 wasm_find_max_val32(ui32* address);
|
||||
ui64 gen_find_max_val64(ui64* address);
|
||||
ui64 sse2_find_max_val64(ui64* address);
|
||||
ui64 avx2_find_max_val64(ui64* address);
|
||||
ui64 wasm_find_max_val64(ui64* address);
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void sse2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void avx2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void gen_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void sse2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void avx2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void wasm_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
void wasm_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
|
||||
void gen_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val);
|
||||
void sse2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val);
|
||||
void avx2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val);
|
||||
void wasm_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void sse2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void avx2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void gen_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void sse2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void avx2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void wasm_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void wasm_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
|
||||
void gen_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void sse2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void avx2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
void wasm_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
|
||||
void codeblock_fun::init(bool reversible) {
|
||||
|
||||
#if !defined(OJPH_ENABLE_WASM_SIMD) || !defined(OJPH_EMSCRIPTEN)
|
||||
|
||||
// Default path, no acceleration. We may change this later
|
||||
decode_cb32 = ojph_decode_codeblock32;
|
||||
find_max_val32 = gen_find_max_val32;
|
||||
mem_clear = gen_mem_clear;
|
||||
if (reversible) {
|
||||
tx_to_cb32 = gen_rev_tx_to_cb32;
|
||||
tx_from_cb32 = gen_rev_tx_from_cb32;
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_to_cb32 = gen_irv_tx_to_cb32;
|
||||
tx_from_cb32 = gen_irv_tx_from_cb32;
|
||||
}
|
||||
encode_cb32 = ojph_encode_codeblock32;
|
||||
|
||||
decode_cb64 = ojph_decode_codeblock64;
|
||||
find_max_val64 = gen_find_max_val64;
|
||||
if (reversible) {
|
||||
tx_to_cb64 = gen_rev_tx_to_cb64;
|
||||
tx_from_cb64 = gen_rev_tx_from_cb64;
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_to_cb64 = NULL;
|
||||
tx_from_cb64 = NULL;
|
||||
}
|
||||
encode_cb64 = ojph_encode_codeblock64;
|
||||
bool result = initialize_block_encoder_tables();
|
||||
assert(result); ojph_unused(result);
|
||||
|
||||
#ifndef OJPH_DISABLE_SIMD
|
||||
|
||||
#if (defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
|
||||
|
||||
// Accelerated functions for INTEL/AMD CPUs
|
||||
#ifndef OJPH_DISABLE_SSE
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE)
|
||||
mem_clear = sse_mem_clear;
|
||||
#endif // !OJPH_DISABLE_SSE
|
||||
|
||||
#ifndef OJPH_DISABLE_SSE2
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSE2) {
|
||||
find_max_val32 = sse2_find_max_val32;
|
||||
if (reversible) {
|
||||
tx_to_cb32 = sse2_rev_tx_to_cb32;
|
||||
tx_from_cb32 = sse2_rev_tx_from_cb32;
|
||||
}
|
||||
else {
|
||||
tx_to_cb32 = sse2_irv_tx_to_cb32;
|
||||
tx_from_cb32 = sse2_irv_tx_from_cb32;
|
||||
}
|
||||
find_max_val64 = sse2_find_max_val64;
|
||||
if (reversible) {
|
||||
tx_to_cb64 = sse2_rev_tx_to_cb64;
|
||||
tx_from_cb64 = sse2_rev_tx_from_cb64;
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_to_cb64 = NULL;
|
||||
tx_from_cb64 = NULL;
|
||||
}
|
||||
}
|
||||
#endif // !OJPH_DISABLE_SSE2
|
||||
|
||||
#ifndef OJPH_DISABLE_SSSE3
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_SSSE3)
|
||||
decode_cb32 = ojph_decode_codeblock_ssse3;
|
||||
#endif // !OJPH_DISABLE_SSSE3
|
||||
|
||||
#ifndef OJPH_DISABLE_AVX
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX)
|
||||
mem_clear = avx_mem_clear;
|
||||
#endif // !OJPH_DISABLE_AVX
|
||||
|
||||
#ifndef OJPH_DISABLE_AVX2
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX2) {
|
||||
decode_cb32 = ojph_decode_codeblock_avx2;
|
||||
find_max_val32 = avx2_find_max_val32;
|
||||
if (reversible) {
|
||||
tx_to_cb32 = avx2_rev_tx_to_cb32;
|
||||
tx_from_cb32 = avx2_rev_tx_from_cb32;
|
||||
}
|
||||
else {
|
||||
tx_to_cb32 = avx2_irv_tx_to_cb32;
|
||||
tx_from_cb32 = avx2_irv_tx_from_cb32;
|
||||
}
|
||||
encode_cb32 = ojph_encode_codeblock_avx2;
|
||||
bool result = initialize_block_encoder_tables_avx2();
|
||||
assert(result); ojph_unused(result);
|
||||
|
||||
find_max_val64 = avx2_find_max_val64;
|
||||
if (reversible) {
|
||||
tx_to_cb64 = avx2_rev_tx_to_cb64;
|
||||
tx_from_cb64 = avx2_rev_tx_from_cb64;
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_to_cb64 = NULL;
|
||||
tx_from_cb64 = NULL;
|
||||
}
|
||||
}
|
||||
#endif // !OJPH_DISABLE_AVX2
|
||||
|
||||
#if (defined(OJPH_ARCH_X86_64) && !defined(OJPH_DISABLE_AVX512))
|
||||
if (get_cpu_ext_level() >= X86_CPU_EXT_LEVEL_AVX512) {
|
||||
encode_cb32 = ojph_encode_codeblock_avx512;
|
||||
bool result = initialize_block_encoder_tables_avx512();
|
||||
assert(result); ojph_unused(result);
|
||||
}
|
||||
#endif // !OJPH_DISABLE_AVX512
|
||||
|
||||
#elif defined(OJPH_ARCH_ARM)
|
||||
|
||||
#endif // !(defined(OJPH_ARCH_X86_64) || defined(OJPH_ARCH_I386))
|
||||
|
||||
#endif // !OJPH_DISABLE_SIMD
|
||||
|
||||
#else // OJPH_ENABLE_WASM_SIMD
|
||||
|
||||
// Accelerated functions for WASM SIMD.
|
||||
decode_cb32 = ojph_decode_codeblock_wasm;
|
||||
find_max_val32 = wasm_find_max_val32;
|
||||
mem_clear = wasm_mem_clear;
|
||||
if (reversible) {
|
||||
tx_to_cb32 = wasm_rev_tx_to_cb32;
|
||||
tx_from_cb32 = wasm_rev_tx_from_cb32;
|
||||
}
|
||||
else {
|
||||
tx_to_cb32 = wasm_irv_tx_to_cb32;
|
||||
tx_from_cb32 = wasm_irv_tx_from_cb32;
|
||||
}
|
||||
encode_cb32 = ojph_encode_codeblock32;
|
||||
|
||||
decode_cb64 = ojph_decode_codeblock64;
|
||||
find_max_val64 = wasm_find_max_val64;
|
||||
if (reversible) {
|
||||
tx_to_cb64 = wasm_rev_tx_to_cb64;
|
||||
tx_from_cb64 = wasm_rev_tx_from_cb64;
|
||||
}
|
||||
else
|
||||
{
|
||||
tx_to_cb64 = NULL;
|
||||
tx_from_cb64 = NULL;
|
||||
}
|
||||
encode_cb64 = ojph_encode_codeblock64;
|
||||
bool result = initialize_block_encoder_tables();
|
||||
assert(result); ojph_unused(result);
|
||||
|
||||
#endif // !OJPH_ENABLE_WASM_SIMD
|
||||
|
||||
}
|
||||
} // local
|
||||
} // ojph
|
||||
@@ -0,0 +1,123 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codeblock_fun.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_CODEBLOCK_FUN_H
|
||||
#define OJPH_CODEBLOCK_FUN_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_file.h"
|
||||
#include "ojph_params_local.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local {
|
||||
|
||||
// define function signature simple memory clearing
|
||||
typedef void (*mem_clear_fun)(void* addr, size_t count);
|
||||
|
||||
// define function signature for max value finding
|
||||
typedef ui32 (*find_max_val_fun32)(ui32* addr);
|
||||
|
||||
typedef ui64 (*find_max_val_fun64)(ui64* addr);
|
||||
|
||||
// define line transfer function signature from subbands to codeblocks
|
||||
typedef void (*tx_to_cb_fun32)(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val);
|
||||
|
||||
typedef void (*tx_to_cb_fun64)(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val);
|
||||
|
||||
// define line transfer function signature from codeblock to subband
|
||||
typedef void (*tx_from_cb_fun32)(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
|
||||
typedef void (*tx_from_cb_fun64)(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count);
|
||||
|
||||
// define the block decoder function signature
|
||||
typedef bool (*cb_decoder_fun32)(ui8* coded_data, ui32* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
typedef bool (*cb_decoder_fun64)(ui8* coded_data, ui64* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
// define the block encoder function signature
|
||||
typedef void (*cb_encoder_fun32)(ui32* buf, ui32 missing_msbs,
|
||||
ui32 num_passes, ui32 width, ui32 height, ui32 stride,
|
||||
ui32* lengths, ojph::mem_elastic_allocator* elastic,
|
||||
ojph::coded_lists*& coded);
|
||||
|
||||
typedef void (*cb_encoder_fun64)(ui64* buf, ui32 missing_msbs,
|
||||
ui32 num_passes, ui32 width, ui32 height, ui32 stride,
|
||||
ui32* lengths, ojph::mem_elastic_allocator* elastic,
|
||||
ojph::coded_lists*& coded);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct codeblock_fun {
|
||||
|
||||
void init(bool reversible);
|
||||
|
||||
// a pointer to the max value finding function
|
||||
mem_clear_fun mem_clear;
|
||||
|
||||
// a pointer to the max value finding function
|
||||
find_max_val_fun32 find_max_val32;
|
||||
find_max_val_fun64 find_max_val64;
|
||||
|
||||
// a pointer to function transferring samples from subbands to codeblocks
|
||||
tx_to_cb_fun32 tx_to_cb32;
|
||||
tx_to_cb_fun64 tx_to_cb64;
|
||||
|
||||
// a pointer to function transferring samples from codeblocks to subbands
|
||||
tx_from_cb_fun32 tx_from_cb32;
|
||||
tx_from_cb_fun64 tx_from_cb64;
|
||||
|
||||
// a pointer to the decoder function
|
||||
cb_decoder_fun32 decode_cb32;
|
||||
cb_decoder_fun64 decode_cb64;
|
||||
|
||||
// a pointer to the encoder function
|
||||
cb_encoder_fun32 encode_cb32;
|
||||
cb_encoder_fun64 encode_cb64;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
#endif // !OJPH_CODEBLOCK_FUN_H
|
||||
@@ -0,0 +1,217 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
codestream::~codestream()
|
||||
{
|
||||
if (state)
|
||||
delete state;
|
||||
state = NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
codestream::codestream()
|
||||
{
|
||||
state = new local::codestream;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::restart()
|
||||
{
|
||||
assert(state != NULL);
|
||||
state->restart();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
param_siz codestream::access_siz()
|
||||
{
|
||||
return param_siz(&state->siz);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
param_cod codestream::access_cod()
|
||||
{
|
||||
return param_cod(&state->cod);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
param_qcd codestream::access_qcd()
|
||||
{
|
||||
return param_qcd(&state->qcd);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
param_nlt codestream::access_nlt()
|
||||
{
|
||||
return param_nlt(&state->nlt);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::set_planar(bool planar)
|
||||
{
|
||||
state->set_planar(planar ? 1 : 0);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::set_profile(const char *s)
|
||||
{
|
||||
state->set_profile(s);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::set_tilepart_divisions(bool at_resolutions,
|
||||
bool at_components)
|
||||
{
|
||||
ui32 value = 0;
|
||||
if (at_resolutions)
|
||||
value |= OJPH_TILEPART_RESOLUTIONS;
|
||||
if (at_components)
|
||||
value |= OJPH_TILEPART_COMPONENTS;
|
||||
state->set_tilepart_divisions(value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool codestream::is_tilepart_division_at_resolutions()
|
||||
{
|
||||
ui32 res = state->get_tilepart_div() & OJPH_TILEPART_RESOLUTIONS;
|
||||
return res ? true : false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool codestream::is_tilepart_division_at_components()
|
||||
{
|
||||
ui32 comp = state->get_tilepart_div() & OJPH_TILEPART_COMPONENTS;
|
||||
return comp ? true : false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::request_tlm_marker(bool needed)
|
||||
{
|
||||
state->request_tlm_marker(needed);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool codestream::is_tlm_requested()
|
||||
{
|
||||
return state->is_tlm_needed();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
bool codestream::is_planar() const
|
||||
{
|
||||
return state->is_planar();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::write_headers(outfile_base *file,
|
||||
const comment_exchange* comments,
|
||||
ui32 num_comments)
|
||||
{
|
||||
state->write_headers(file, comments, num_comments);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::enable_resilience()
|
||||
{
|
||||
state->enable_resilience();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::read_headers(infile_base *file)
|
||||
{
|
||||
state->read_headers(file);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::restrict_input_resolution(ui32 skipped_res_for_read,
|
||||
ui32 skipped_res_for_recon)
|
||||
{
|
||||
state->restrict_input_resolution(skipped_res_for_read,
|
||||
skipped_res_for_recon);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::create()
|
||||
{
|
||||
state->read();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
line_buf* codestream::pull(ui32 &comp_num)
|
||||
{
|
||||
return state->pull(comp_num);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::flush()
|
||||
{
|
||||
state->flush();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
void codestream::close()
|
||||
{
|
||||
state->close();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
line_buf* codestream::exchange(line_buf* line, ui32& next_component)
|
||||
{
|
||||
return state->exchange(line, next_component);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_avx.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_arch.h"
|
||||
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
|
||||
#include <immintrin.h>
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx_mem_clear(void* addr, size_t count)
|
||||
{
|
||||
float* p = (float*)addr;
|
||||
__m256 zero = _mm256_setzero_ps();
|
||||
for (size_t i = 0; i < count; i += 32, p += 8)
|
||||
_mm256_storeu_ps(p, zero);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,278 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_avx2.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_arch.h"
|
||||
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
|
||||
|
||||
#include <climits>
|
||||
#include <immintrin.h>
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_arch.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 avx2_find_max_val32(ui32* address)
|
||||
{
|
||||
__m128i x0 = _mm_loadu_si128((__m128i*)address);
|
||||
__m128i x1 = _mm_loadu_si128((__m128i*)address + 1);
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
x1 = _mm_shuffle_epi32(x0, 0x55); // x1 = x0[1,1,1,1]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
ui32 t = (ui32)_mm_extract_epi32(x0, 0);
|
||||
return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui64 avx2_find_max_val64(ui64* address)
|
||||
{
|
||||
__m128i x0 = _mm_loadu_si128((__m128i*)address);
|
||||
__m128i x1 = _mm_loadu_si128((__m128i*)address + 1);
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
ui64 t;
|
||||
#ifdef OJPH_ARCH_X86_64
|
||||
t = (ui64)_mm_extract_epi64(x0, 0);
|
||||
#elif (defined OJPH_ARCH_I386)
|
||||
t = (ui64)(ui32)_mm_extract_epi32(x0, 0);
|
||||
t |= (ui64)(ui32)_mm_extract_epi32(x0, 1) << 32;
|
||||
#else
|
||||
#error Error unsupport compiler
|
||||
#endif
|
||||
return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 31 - K_max;
|
||||
__m256i m0 = _mm256_set1_epi32(INT_MIN);
|
||||
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
|
||||
__m256i *p = (__m256i*)sp;
|
||||
for ( ; count >= 8; count -= 8, p += 1, dp += 8)
|
||||
{
|
||||
__m256i v = _mm256_loadu_si256(p);
|
||||
__m256i sign = _mm256_and_si256(v, m0);
|
||||
__m256i val = _mm256_abs_epi32(v);
|
||||
val = _mm256_slli_epi32(val, (int)shift);
|
||||
tmax = _mm256_or_si256(tmax, val);
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m256i v = _mm256_loadu_si256(p);
|
||||
__m256i sign = _mm256_and_si256(v, m0);
|
||||
__m256i val = _mm256_abs_epi32(v);
|
||||
val = _mm256_slli_epi32(val, (int)shift);
|
||||
|
||||
__m256i c = _mm256_set1_epi32((si32)count);
|
||||
__m256i idx = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
|
||||
__m256i mask = _mm256_cmpgt_epi32(c, idx);
|
||||
c = _mm256_and_si256(val, mask);
|
||||
tmax = _mm256_or_si256(tmax, c);
|
||||
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
_mm256_storeu_si256((__m256i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
|
||||
//quantize and convert to sign and magnitude and keep max_val
|
||||
__m256 d = _mm256_set1_ps(delta_inv);
|
||||
__m256i m0 = _mm256_set1_epi32(INT_MIN);
|
||||
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
|
||||
float *p = (float*)sp;
|
||||
|
||||
for ( ; count >= 8; count -= 8, p += 8, dp += 8)
|
||||
{
|
||||
__m256 vf = _mm256_loadu_ps(p);
|
||||
vf = _mm256_mul_ps(vf, d); // multiply
|
||||
__m256i val = _mm256_cvtps_epi32(vf); // convert to int
|
||||
__m256i sign = _mm256_and_si256(val, m0); // get sign
|
||||
val = _mm256_abs_epi32(val);
|
||||
tmax = _mm256_or_si256(tmax, val);
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m256 vf = _mm256_loadu_ps(p);
|
||||
vf = _mm256_mul_ps(vf, d); // multiply
|
||||
__m256i val = _mm256_cvtps_epi32(vf); // convert to int
|
||||
__m256i sign = _mm256_and_si256(val, m0); // get sign
|
||||
val = _mm256_abs_epi32(val);
|
||||
|
||||
__m256i c = _mm256_set1_epi32((si32)count);
|
||||
__m256i idx = _mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0);
|
||||
__m256i mask = _mm256_cmpgt_epi32(c, idx);
|
||||
c = _mm256_and_si256(val, mask);
|
||||
tmax = _mm256_or_si256(tmax, c);
|
||||
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
_mm256_storeu_si256((__m256i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 31 - K_max;
|
||||
__m256i m1 = _mm256_set1_epi32(INT_MAX);
|
||||
si32 *p = (si32*)dp;
|
||||
for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
|
||||
{
|
||||
__m256i v = _mm256_load_si256((__m256i*)sp);
|
||||
__m256i val = _mm256_and_si256(v, m1);
|
||||
val = _mm256_srli_epi32(val, (int)shift);
|
||||
val = _mm256_sign_epi32(val, v);
|
||||
_mm256_storeu_si256((__m256i*)p, val);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
__m256i m1 = _mm256_set1_epi32(INT_MAX);
|
||||
__m256 d = _mm256_set1_ps(delta);
|
||||
float *p = (float*)dp;
|
||||
for (ui32 i = 0; i < count; i += 8, sp += 8, p += 8)
|
||||
{
|
||||
__m256i v = _mm256_load_si256((__m256i*)sp);
|
||||
__m256i vali = _mm256_and_si256(v, m1);
|
||||
__m256 valf = _mm256_cvtepi32_ps(vali);
|
||||
valf = _mm256_mul_ps(valf, d);
|
||||
__m256i sign = _mm256_andnot_si256(m1, v);
|
||||
valf = _mm256_or_ps(valf, _mm256_castsi256_ps(sign));
|
||||
_mm256_storeu_ps(p, valf);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 63 - K_max;
|
||||
__m256i m0 = _mm256_set1_epi64x(LLONG_MIN);
|
||||
__m256i zero = _mm256_setzero_si256();
|
||||
__m256i one = _mm256_set1_epi64x(1);
|
||||
__m256i tmax = _mm256_loadu_si256((__m256i*)max_val);
|
||||
__m256i *p = (__m256i*)sp;
|
||||
for ( ; count >= 4; count -= 4, p += 1, dp += 4)
|
||||
{
|
||||
__m256i v = _mm256_loadu_si256(p);
|
||||
__m256i sign = _mm256_cmpgt_epi64(zero, v);
|
||||
__m256i val = _mm256_xor_si256(v, sign); // negate 1's complement
|
||||
__m256i ones = _mm256_and_si256(sign, one);
|
||||
val = _mm256_add_epi64(val, ones); // 2's complement
|
||||
sign = _mm256_and_si256(sign, m0);
|
||||
val = _mm256_slli_epi64(val, (int)shift);
|
||||
tmax = _mm256_or_si256(tmax, val);
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m256i v = _mm256_loadu_si256(p);
|
||||
__m256i sign = _mm256_cmpgt_epi64(zero, v);
|
||||
__m256i val = _mm256_xor_si256(v, sign); // negate 1's complement
|
||||
__m256i ones = _mm256_and_si256(sign, one);
|
||||
val = _mm256_add_epi64(val, ones); // 2's complement
|
||||
sign = _mm256_and_si256(sign, m0);
|
||||
val = _mm256_slli_epi64(val, (int)shift);
|
||||
|
||||
__m256i c = _mm256_set1_epi64x(count);
|
||||
__m256i idx = _mm256_set_epi64x(3, 2, 1, 0);
|
||||
__m256i mask = _mm256_cmpgt_epi64(c, idx);
|
||||
c = _mm256_and_si256(val, mask);
|
||||
tmax = _mm256_or_si256(tmax, c);
|
||||
|
||||
val = _mm256_or_si256(val, sign);
|
||||
_mm256_storeu_si256((__m256i*)dp, val);
|
||||
}
|
||||
_mm256_storeu_si256((__m256i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void avx2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
|
||||
ui32 shift = 63 - K_max;
|
||||
__m256i m1 = _mm256_set1_epi64x(LLONG_MAX);
|
||||
__m256i zero = _mm256_setzero_si256();
|
||||
__m256i one = _mm256_set1_epi64x(1);
|
||||
si64 *p = (si64*)dp;
|
||||
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
|
||||
{
|
||||
__m256i v = _mm256_load_si256((__m256i*)sp);
|
||||
__m256i val = _mm256_and_si256(v, m1);
|
||||
val = _mm256_srli_epi64(val, (int)shift);
|
||||
__m256i sign = _mm256_cmpgt_epi64(zero, v);
|
||||
val = _mm256_xor_si256(val, sign); // negate 1's complement
|
||||
__m256i ones = _mm256_and_si256(sign, one);
|
||||
val = _mm256_add_epi64(val, ones); // 2's complement
|
||||
_mm256_storeu_si256((__m256i*)p, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,171 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_gen.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_arch.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_mem_clear(void* addr, size_t count)
|
||||
{
|
||||
si64* p = (si64*)addr;
|
||||
for (size_t i = 0; i < count; i += 8)
|
||||
*p++ = 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 gen_find_max_val32(ui32* addr) { return addr[0]; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui64 gen_find_max_val64(ui64* addr) { return addr[0]; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count,
|
||||
ui32* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
ui32 shift = 31 - K_max;
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 tmax = *max_val;
|
||||
si32 *p = (si32*)sp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
si32 v = *p++;
|
||||
ui32 sign = v >= 0 ? 0U : 0x80000000U;
|
||||
ui32 val = (ui32)(v >= 0 ? v : -v);
|
||||
val <<= shift;
|
||||
*dp++ = sign | val;
|
||||
tmax |= val; // it is more efficient to use or than max
|
||||
}
|
||||
*max_val = tmax;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count,
|
||||
ui64* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
ui32 shift = 63 - K_max;
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui64 tmax = *max_val;
|
||||
si64 *p = (si64*)sp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
si64 v = *p++;
|
||||
ui64 sign = v >= 0 ? 0ULL : 0x8000000000000000ULL;
|
||||
ui64 val = (ui64)(v >= 0 ? v : -v);
|
||||
val <<= shift;
|
||||
*dp++ = sign | val;
|
||||
tmax |= val; // it is more efficient to use or than max
|
||||
}
|
||||
*max_val = tmax;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count,
|
||||
ui32* max_val)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
//quantize and convert to sign and magnitude and keep max_val
|
||||
ui32 tmax = *max_val;
|
||||
float *p = (float*)sp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
float v = *p++;
|
||||
si32 t = ojph_trunc(v * delta_inv);
|
||||
ui32 sign = t >= 0 ? 0U : 0x80000000U;
|
||||
ui32 val = (ui32)(t >= 0 ? t : -t);
|
||||
*dp++ = sign | val;
|
||||
tmax |= val; // it is more efficient to use or than max
|
||||
}
|
||||
*max_val = tmax;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 31 - K_max;
|
||||
//convert to sign and magnitude
|
||||
si32 *p = (si32*)dp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
ui32 v = *sp++;
|
||||
si32 val = (v & 0x7FFFFFFFU) >> shift;
|
||||
*p++ = (v & 0x80000000U) ? -val : val;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 63 - K_max;
|
||||
//convert to sign and magnitude
|
||||
si64 *p = (si64*)dp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
ui64 v = *sp++;
|
||||
si64 val = (v & 0x7FFFFFFFFFFFFFFFULL) >> shift;
|
||||
*p++ = (v & 0x8000000000000000ULL) ? -val : val;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void gen_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
//convert to sign and magnitude
|
||||
float *p = (float*)dp;
|
||||
for (ui32 i = count; i > 0; --i)
|
||||
{
|
||||
ui32 v = *sp++;
|
||||
float val = (float)(v & 0x7FFFFFFFU) * delta;
|
||||
*p++ = (v & 0x80000000U) ? -val : val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,178 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_local.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_CODESTREAM_LOCAL_H
|
||||
#define OJPH_CODESTREAM_LOCAL_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_params_local.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class mem_fixed_allocator;
|
||||
class mem_elastic_allocator;
|
||||
class codestream;
|
||||
|
||||
namespace local {
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
static inline
|
||||
ui16 swap_byte(ui16 t)
|
||||
{
|
||||
return (ui16)((t << 8) | (t >> 8));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class tile;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class codestream
|
||||
{
|
||||
friend ::ojph::codestream;
|
||||
|
||||
public:
|
||||
codestream();
|
||||
~codestream();
|
||||
|
||||
void restart();
|
||||
|
||||
void pre_alloc();
|
||||
void finalize_alloc();
|
||||
|
||||
ojph::param_siz access_siz() // returns externally wrapped siz
|
||||
{ return ojph::param_siz(&siz); }
|
||||
const param_siz* get_siz() // returns internal siz
|
||||
{ return &siz; }
|
||||
ojph::param_cod access_cod() // returns externally wrapped cod
|
||||
{ return ojph::param_cod(&cod); }
|
||||
const param_cod* get_cod() // returns internal cod
|
||||
{ return &cod; }
|
||||
const param_cod* get_coc(ui32 comp_num) // returns internal cod
|
||||
{ return cod.get_coc(comp_num); }
|
||||
const param_qcd* access_qcd()
|
||||
{ return &qcd; }
|
||||
const param_dfs* access_dfs()
|
||||
{ if (dfs.exists()) return &dfs; else return NULL; }
|
||||
const param_nlt* get_nlt()
|
||||
{ return ≮ }
|
||||
mem_fixed_allocator* get_allocator() { return allocator; }
|
||||
mem_elastic_allocator* get_elastic_alloc() { return elastic_alloc; }
|
||||
outfile_base* get_file() { return outfile; }
|
||||
|
||||
line_buf* exchange(line_buf* line, ui32& next_component);
|
||||
void write_headers(outfile_base *file, const comment_exchange* comments,
|
||||
ui32 num_comments);
|
||||
void enable_resilience();
|
||||
bool is_resilient() { return resilient; }
|
||||
void read_headers(infile_base *file);
|
||||
void restrict_input_resolution(ui32 skipped_res_for_data,
|
||||
ui32 skipped_res_for_recon);
|
||||
void read();
|
||||
void set_planar(int planar);
|
||||
void set_profile(const char *s);
|
||||
void set_tilepart_divisions(ui32 value);
|
||||
void request_tlm_marker(bool needed);
|
||||
line_buf* pull(ui32 &comp_num);
|
||||
void flush();
|
||||
void close();
|
||||
|
||||
bool is_planar() const { return planar != 0; }
|
||||
si32 get_profile() const { return profile; };
|
||||
ui32 get_tilepart_div() const { return tilepart_div; };
|
||||
bool is_tlm_needed() const { return need_tlm; };
|
||||
|
||||
void check_imf_validity();
|
||||
void check_broadcast_validity();
|
||||
|
||||
ui8* get_precinct_scratch() { return precinct_scratch; }
|
||||
ui32 get_skipped_res_for_recon()
|
||||
{ return skipped_res_for_recon; }
|
||||
ui32 get_skipped_res_for_read()
|
||||
{ return skipped_res_for_read; }
|
||||
|
||||
private:
|
||||
ui32 precinct_scratch_needed_bytes;
|
||||
ui8* precinct_scratch;
|
||||
|
||||
private:
|
||||
ui32 cur_line;
|
||||
ui32 cur_comp;
|
||||
ui32 cur_tile_row;
|
||||
bool resilient;
|
||||
ui32 skipped_res_for_read, skipped_res_for_recon;
|
||||
|
||||
private:
|
||||
size num_tiles;
|
||||
tile *tiles;
|
||||
line_buf* lines;
|
||||
ui32 num_comps;
|
||||
size *comp_size; //stores full resolution no. of lines and width
|
||||
size *recon_comp_size; //stores number of lines and width of each comp
|
||||
bool employ_color_transform;
|
||||
int planar;
|
||||
int profile;
|
||||
ui32 tilepart_div; // tilepart division value
|
||||
bool need_tlm; // true if tlm markers are needed
|
||||
|
||||
private:
|
||||
param_siz siz; // image and tile size
|
||||
param_cod cod; // coding style default
|
||||
param_cap cap; // extended capabilities
|
||||
param_qcd qcd; // quantization default
|
||||
param_tlm tlm; // tile-part lengths
|
||||
param_nlt nlt; // non-linearity point transformation
|
||||
|
||||
private: // these are from Part 2 of the standard
|
||||
param_dfs dfs; // downsmapling factor styles
|
||||
param_atk atk; // wavelet structure and coefficients
|
||||
|
||||
private:
|
||||
mem_fixed_allocator *allocator;
|
||||
mem_elastic_allocator *elastic_alloc;
|
||||
outfile_base *outfile;
|
||||
infile_base *infile;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_CODESTREAM_LOCAL_H
|
||||
@@ -0,0 +1,58 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_sse.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_arch.h"
|
||||
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
|
||||
|
||||
#include <immintrin.h>
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse_mem_clear(void* addr, size_t count)
|
||||
{
|
||||
float* p = (float*)addr;
|
||||
__m128 zero = _mm_setzero_ps();
|
||||
for (size_t i = 0; i < count; i += 16, p += 4)
|
||||
_mm_storeu_ps(p, zero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,295 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_sse2.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_arch.h"
|
||||
#if defined(OJPH_ARCH_I386) || defined(OJPH_ARCH_X86_64)
|
||||
|
||||
#include <climits>
|
||||
#include <immintrin.h>
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 sse2_find_max_val32(ui32* address)
|
||||
{
|
||||
__m128i x1, x0 = _mm_loadu_si128((__m128i*)address);
|
||||
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
x1 = _mm_shuffle_epi32(x0, 0x55); // x1 = x0[1,1,1,1]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
_mm_storeu_si128((__m128i*)address, x0);
|
||||
return *address;
|
||||
// A single movd t, xmm0 can do the trick, but it is not available
|
||||
// in SSE2 intrinsics. extract_epi32 is available in sse4.1
|
||||
// ui32 t = (ui32)_mm_extract_epi16(x0, 0);
|
||||
// t |= (ui32)_mm_extract_epi16(x0, 1) << 16;
|
||||
// return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui64 sse2_find_max_val64(ui64* address)
|
||||
{
|
||||
__m128i x1, x0 = _mm_loadu_si128((__m128i*)address);
|
||||
x1 = _mm_shuffle_epi32(x0, 0xEE); // x1 = x0[2,3,2,3]
|
||||
x0 = _mm_or_si128(x0, x1);
|
||||
_mm_storeu_si128((__m128i*)address, x0);
|
||||
return *address;
|
||||
// A single movd t, xmm0 can do the trick, but it is not available
|
||||
// in SSE2 intrinsics. extract_epi32 is available in sse4.1
|
||||
// ui32 t = (ui32)_mm_extract_epi16(x0, 0);
|
||||
// t |= (ui32)_mm_extract_epi16(x0, 1) << 16;
|
||||
// return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 31 - K_max;
|
||||
__m128i m0 = _mm_set1_epi32(INT_MIN);
|
||||
__m128i zero = _mm_setzero_si128();
|
||||
__m128i one = _mm_set1_epi32(1);
|
||||
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
|
||||
__m128i *p = (__m128i*)sp;
|
||||
for ( ; count >= 4; count -= 4, p += 1, dp += 4)
|
||||
{
|
||||
__m128i v = _mm_loadu_si128(p);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi32(val, ones); // 2's complement
|
||||
sign = _mm_and_si128(sign, m0);
|
||||
val = _mm_slli_epi32(val, (int)shift);
|
||||
tmax = _mm_or_si128(tmax, val);
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m128i v = _mm_loadu_si128(p);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi32(val, ones); // 2's complement
|
||||
sign = _mm_and_si128(sign, m0);
|
||||
val = _mm_slli_epi32(val, (int)shift);
|
||||
|
||||
__m128i c = _mm_set1_epi32((si32)count);
|
||||
__m128i idx = _mm_set_epi32(3, 2, 1, 0);
|
||||
__m128i mask = _mm_cmpgt_epi32(c, idx);
|
||||
c = _mm_and_si128(val, mask);
|
||||
tmax = _mm_or_si128(tmax, c);
|
||||
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
_mm_storeu_si128((__m128i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
|
||||
//quantize and convert to sign and magnitude and keep max_val
|
||||
|
||||
__m128 d = _mm_set1_ps(delta_inv);
|
||||
__m128i zero = _mm_setzero_si128();
|
||||
__m128i one = _mm_set1_epi32(1);
|
||||
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
|
||||
float *p = (float*)sp;
|
||||
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
|
||||
{
|
||||
__m128 vf = _mm_loadu_ps(p);
|
||||
vf = _mm_mul_ps(vf, d); // multiply
|
||||
__m128i val = _mm_cvtps_epi32(vf); // convert to int
|
||||
__m128i sign = _mm_cmplt_epi32(val, zero); // get sign
|
||||
val = _mm_xor_si128(val, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi32(val, ones); // 2's complement
|
||||
tmax = _mm_or_si128(tmax, val);
|
||||
sign = _mm_slli_epi32(sign, 31);
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m128 vf = _mm_loadu_ps(p);
|
||||
vf = _mm_mul_ps(vf, d); // multiply
|
||||
__m128i val = _mm_cvtps_epi32(vf); // convert to int
|
||||
__m128i sign = _mm_cmplt_epi32(val, zero); // get sign
|
||||
val = _mm_xor_si128(val, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi32(val, ones); // 2's complement
|
||||
|
||||
__m128i c = _mm_set1_epi32((si32)count);
|
||||
__m128i idx = _mm_set_epi32(3, 2, 1, 0);
|
||||
__m128i mask = _mm_cmpgt_epi32(c, idx);
|
||||
c = _mm_and_si128(val, mask);
|
||||
tmax = _mm_or_si128(tmax, c);
|
||||
|
||||
sign = _mm_slli_epi32(sign, 31);
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
_mm_storeu_si128((__m128i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 31 - K_max;
|
||||
__m128i m1 = _mm_set1_epi32(INT_MAX);
|
||||
__m128i zero = _mm_setzero_si128();
|
||||
__m128i one = _mm_set1_epi32(1);
|
||||
si32 *p = (si32*)dp;
|
||||
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
|
||||
{
|
||||
__m128i v = _mm_load_si128((__m128i*)sp);
|
||||
__m128i val = _mm_and_si128(v, m1);
|
||||
val = _mm_srli_epi32(val, (int)shift);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
val = _mm_xor_si128(val, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi32(val, ones); // 2's complement
|
||||
_mm_storeu_si128((__m128i*)p, val);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
__m128i m1 = _mm_set1_epi32(INT_MAX);
|
||||
__m128 d = _mm_set1_ps(delta);
|
||||
float *p = (float*)dp;
|
||||
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
|
||||
{
|
||||
__m128i v = _mm_load_si128((__m128i*)sp);
|
||||
__m128i vali = _mm_and_si128(v, m1);
|
||||
__m128 valf = _mm_cvtepi32_ps(vali);
|
||||
valf = _mm_mul_ps(valf, d);
|
||||
__m128i sign = _mm_andnot_si128(m1, v);
|
||||
valf = _mm_or_ps(valf, _mm_castsi128_ps(sign));
|
||||
_mm_storeu_ps(p, valf);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 63 - K_max;
|
||||
__m128i m0 = _mm_set1_epi64x(LLONG_MIN);
|
||||
__m128i zero = _mm_setzero_si128();
|
||||
__m128i one = _mm_set1_epi64x(1);
|
||||
__m128i tmax = _mm_loadu_si128((__m128i*)max_val);
|
||||
__m128i *p = (__m128i*)sp;
|
||||
for ( ; count >= 2; count -= 2, p += 1, dp += 2)
|
||||
{
|
||||
__m128i v = _mm_loadu_si128(p);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
|
||||
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi64(val, ones); // 2's complement
|
||||
sign = _mm_and_si128(sign, m0);
|
||||
val = _mm_slli_epi64(val, (int)shift);
|
||||
tmax = _mm_or_si128(tmax, val);
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
__m128i v = _mm_loadu_si128(p);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
|
||||
__m128i val = _mm_xor_si128(v, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi64(val, ones); // 2's complement
|
||||
sign = _mm_and_si128(sign, m0);
|
||||
val = _mm_slli_epi64(val, (int)shift);
|
||||
|
||||
__m128i c = _mm_set_epi32(0, 0, (si32)0xFFFFFFFF, (si32)0xFFFFFFFF);
|
||||
c = _mm_and_si128(val, c);
|
||||
tmax = _mm_or_si128(tmax, c);
|
||||
|
||||
val = _mm_or_si128(val, sign);
|
||||
_mm_storeu_si128((__m128i*)dp, val);
|
||||
}
|
||||
_mm_storeu_si128((__m128i*)max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void sse2_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 63 - K_max;
|
||||
__m128i m1 = _mm_set1_epi64x(LLONG_MAX);
|
||||
__m128i zero = _mm_setzero_si128();
|
||||
__m128i one = _mm_set1_epi64x(1);
|
||||
si64 *p = (si64*)dp;
|
||||
for (ui32 i = 0; i < count; i += 2, sp += 2, p += 2)
|
||||
{
|
||||
__m128i v = _mm_load_si128((__m128i*)sp);
|
||||
__m128i val = _mm_and_si128(v, m1);
|
||||
val = _mm_srli_epi64(val, (int)shift);
|
||||
__m128i sign = _mm_cmplt_epi32(v, zero);
|
||||
sign = _mm_shuffle_epi32(sign, 0xF5); // sign = sign[1,1,3,3];
|
||||
val = _mm_xor_si128(val, sign); // negate 1's complement
|
||||
__m128i ones = _mm_and_si128(sign, one);
|
||||
val = _mm_add_epi64(val, ones); // 2's complement
|
||||
_mm_storeu_si128((__m128i*)p, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,289 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_codestream_wasm.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 15 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include <climits>
|
||||
#include <cstddef>
|
||||
#include <wasm_simd128.h>
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_mem_clear(void* addr, size_t count)
|
||||
{
|
||||
float* p = (float*)addr;
|
||||
v128_t zero = wasm_i32x4_splat(0);
|
||||
for (size_t i = 0; i < count; i += 16, p += 4)
|
||||
wasm_v128_store(p, zero);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 wasm_find_max_val32(ui32* address)
|
||||
{
|
||||
v128_t x1, x0 = wasm_v128_load(address);
|
||||
x1 = wasm_i32x4_shuffle(x0, x0, 2, 3, 2, 3); // x1 = x0[2,3,2,3]
|
||||
x0 = wasm_v128_or(x0, x1);
|
||||
x1 = wasm_i32x4_shuffle(x0, x0, 1, 1, 1, 1); // x1 = x0[1,1,1,1]
|
||||
x0 = wasm_v128_or(x0, x1);
|
||||
ui32 t = (ui32)wasm_i32x4_extract_lane(x0, 0);
|
||||
return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui64 wasm_find_max_val64(ui64* address)
|
||||
{
|
||||
v128_t x1, x0 = wasm_v128_load(address);
|
||||
x1 = wasm_i64x2_shuffle(x0, x0, 1, 1); // x1 = x0[2,3,2,3]
|
||||
x0 = wasm_v128_or(x0, x1);
|
||||
ui64 t = (ui64)wasm_i64x2_extract_lane(x0, 0);
|
||||
return t;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_rev_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 31 - K_max;
|
||||
v128_t m0 = wasm_i32x4_splat(INT_MIN);
|
||||
v128_t zero = wasm_i32x4_splat(0);
|
||||
v128_t one = wasm_i32x4_splat(1);
|
||||
v128_t tmax = wasm_v128_load(max_val);
|
||||
si32 *p = (si32*)sp;
|
||||
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
|
||||
{
|
||||
v128_t v = wasm_v128_load(p);
|
||||
v128_t sign = wasm_i32x4_lt(v, zero);
|
||||
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i32x4_add(val, ones); // 2's complement
|
||||
sign = wasm_v128_and(sign, m0);
|
||||
val = wasm_i32x4_shl(val, shift);
|
||||
tmax = wasm_v128_or(tmax, val);
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
v128_t v = wasm_v128_load(p);
|
||||
v128_t sign = wasm_i32x4_lt(v, zero);
|
||||
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i32x4_add(val, ones); // 2's complement
|
||||
sign = wasm_v128_and(sign, m0);
|
||||
val = wasm_i32x4_shl(val, shift);
|
||||
|
||||
v128_t c = wasm_i32x4_splat((si32)count);
|
||||
v128_t idx = wasm_i32x4_make(0, 1, 2, 3);
|
||||
v128_t mask = wasm_i32x4_gt(c, idx);
|
||||
c = wasm_v128_and(val, mask);
|
||||
tmax = wasm_v128_or(tmax, c);
|
||||
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
wasm_v128_store(max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_irv_tx_to_cb32(const void *sp, ui32 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui32* max_val)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
|
||||
//quantize and convert to sign and magnitude and keep max_val
|
||||
|
||||
v128_t d = wasm_f32x4_splat(delta_inv);
|
||||
v128_t zero = wasm_i32x4_splat(0);
|
||||
v128_t one = wasm_i32x4_splat(1);
|
||||
v128_t tmax = wasm_v128_load(max_val);
|
||||
float *p = (float*)sp;
|
||||
for ( ; count >= 4; count -= 4, p += 4, dp += 4)
|
||||
{
|
||||
v128_t vf = wasm_v128_load(p);
|
||||
vf = wasm_f32x4_mul(vf, d); // multiply
|
||||
v128_t val = wasm_i32x4_trunc_sat_f32x4(vf); // convert to signed int
|
||||
v128_t sign = wasm_i32x4_lt(val, zero); // get sign
|
||||
val = wasm_v128_xor(val, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i32x4_add(val, ones); // 2's complement
|
||||
tmax = wasm_v128_or(tmax, val);
|
||||
sign = wasm_i32x4_shl(sign, 31);
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
v128_t vf = wasm_v128_load(p);
|
||||
vf = wasm_f32x4_mul(vf, d); // multiply
|
||||
v128_t val = wasm_i32x4_trunc_sat_f32x4(vf); // convert to signed int
|
||||
v128_t sign = wasm_i32x4_lt(val, zero); // get sign
|
||||
val = wasm_v128_xor(val, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i32x4_add(val, ones); // 2's complement
|
||||
|
||||
v128_t c = wasm_i32x4_splat((si32)count);
|
||||
v128_t idx = wasm_i32x4_make(0, 1, 2, 3);
|
||||
v128_t mask = wasm_i32x4_gt(c, idx);
|
||||
c = wasm_v128_and(val, mask);
|
||||
tmax = wasm_v128_or(tmax, c);
|
||||
|
||||
sign = wasm_i32x4_shl(sign, 31);
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
wasm_v128_store(max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_rev_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 31 - K_max;
|
||||
v128_t m1 = wasm_i32x4_splat(INT_MAX);
|
||||
v128_t zero = wasm_i32x4_splat(0);
|
||||
v128_t one = wasm_i32x4_splat(1);
|
||||
si32 *p = (si32*)dp;
|
||||
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
|
||||
{
|
||||
v128_t v = wasm_v128_load((v128_t*)sp);
|
||||
v128_t val = wasm_v128_and(v, m1);
|
||||
val = wasm_i32x4_shr(val, shift);
|
||||
v128_t sign = wasm_i32x4_lt(v, zero);
|
||||
val = wasm_v128_xor(val, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i32x4_add(val, ones); // 2's complement
|
||||
wasm_v128_store(p, val);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_irv_tx_from_cb32(const ui32 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(K_max);
|
||||
v128_t m1 = wasm_i32x4_splat(INT_MAX);
|
||||
v128_t d = wasm_f32x4_splat(delta);
|
||||
float *p = (float*)dp;
|
||||
for (ui32 i = 0; i < count; i += 4, sp += 4, p += 4)
|
||||
{
|
||||
v128_t v = wasm_v128_load((v128_t*)sp);
|
||||
v128_t vali = wasm_v128_and(v, m1);
|
||||
v128_t valf = wasm_f32x4_convert_i32x4(vali);
|
||||
valf = wasm_f32x4_mul(valf, d);
|
||||
v128_t sign = wasm_v128_andnot(v, m1);
|
||||
valf = wasm_v128_or(valf, sign);
|
||||
wasm_v128_store(p, valf);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_rev_tx_to_cb64(const void *sp, ui64 *dp, ui32 K_max,
|
||||
float delta_inv, ui32 count, ui64* max_val)
|
||||
{
|
||||
ojph_unused(delta_inv);
|
||||
|
||||
// convert to sign and magnitude and keep max_val
|
||||
ui32 shift = 63 - K_max;
|
||||
v128_t m0 = wasm_i64x2_splat(LLONG_MIN);
|
||||
v128_t zero = wasm_i64x2_splat(0);
|
||||
v128_t one = wasm_i64x2_splat(1);
|
||||
v128_t tmax = wasm_v128_load(max_val);
|
||||
si64 *p = (si64*)sp;
|
||||
for ( ; count >= 2; count -= 2, p += 2, dp += 2)
|
||||
{
|
||||
v128_t v = wasm_v128_load(p);
|
||||
v128_t sign = wasm_i64x2_lt(v, zero);
|
||||
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i64x2_add(val, ones); // 2's complement
|
||||
sign = wasm_v128_and(sign, m0);
|
||||
val = wasm_i64x2_shl(val, shift);
|
||||
tmax = wasm_v128_or(tmax, val);
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
if (count)
|
||||
{
|
||||
v128_t v = wasm_v128_load(p);
|
||||
v128_t sign = wasm_i64x2_lt(v, zero);
|
||||
v128_t val = wasm_v128_xor(v, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i64x2_add(val, ones); // 2's complement
|
||||
sign = wasm_v128_and(sign, m0);
|
||||
val = wasm_i64x2_shl(val, shift);
|
||||
|
||||
v128_t c = wasm_i32x4_make((si32)0xFFFFFFFF, (si32)0xFFFFFFFF, 0, 0);
|
||||
c = wasm_v128_and(val, c);
|
||||
tmax = wasm_v128_or(tmax, c);
|
||||
|
||||
val = wasm_v128_or(val, sign);
|
||||
wasm_v128_store(dp, val);
|
||||
}
|
||||
|
||||
wasm_v128_store(max_val, tmax);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void wasm_rev_tx_from_cb64(const ui64 *sp, void *dp, ui32 K_max,
|
||||
float delta, ui32 count)
|
||||
{
|
||||
ojph_unused(delta);
|
||||
ui32 shift = 63 - K_max;
|
||||
v128_t m1 = wasm_i64x2_splat(LLONG_MAX);
|
||||
v128_t zero = wasm_i64x2_splat(0);
|
||||
v128_t one = wasm_i64x2_splat(1);
|
||||
si64 *p = (si64*)dp;
|
||||
for (ui32 i = 0; i < count; i += 2, sp += 2, p += 2)
|
||||
{
|
||||
v128_t v = wasm_v128_load((v128_t*)sp);
|
||||
v128_t val = wasm_v128_and(v, m1);
|
||||
val = wasm_i64x2_shr(val, shift);
|
||||
v128_t sign = wasm_i64x2_lt(v, zero);
|
||||
val = wasm_v128_xor(val, sign); // negate 1's complement
|
||||
v128_t ones = wasm_v128_and(sign, one);
|
||||
val = wasm_i64x2_add(val, ones); // 2's complement
|
||||
wasm_v128_store(p, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2615
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,576 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_precinct.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_precinct.h"
|
||||
#include "ojph_subband.h"
|
||||
#include "ojph_codeblock.h" // for coded_cb_header
|
||||
#include "ojph_bitbuffer_write.h"
|
||||
#include "ojph_bitbuffer_read.h"
|
||||
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct tag_tree
|
||||
{
|
||||
void init(ui8* buf, ui32 *lev_idx, ui32 num_levels, size s, int init_val)
|
||||
{
|
||||
for (ui32 i = 0; i <= num_levels; ++i) //on extra level
|
||||
levs[i] = buf + lev_idx[i];
|
||||
for (ui32 i = num_levels + 1; i < 16; ++i)
|
||||
levs[i] = (ui8*)INT_MAX; //make it crash on error
|
||||
width = s.w;
|
||||
height = s.h;
|
||||
for (ui32 i = 0; i < num_levels; ++i)
|
||||
{
|
||||
ui32 size = 1u << ((num_levels - 1 - i) << 1);
|
||||
memset(levs[i], init_val, size);
|
||||
}
|
||||
*levs[num_levels] = 0;
|
||||
this->num_levels = num_levels;
|
||||
}
|
||||
|
||||
ui8* get(ui32 x, ui32 y, ui32 lev)
|
||||
{
|
||||
return levs[lev] + (x + y * ((width + (1 << lev) - 1) >> lev));
|
||||
}
|
||||
|
||||
ui32 width, height, num_levels;
|
||||
ui8* levs[16]; // you cannot have this high number of levels
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static inline ui32 log2ceil(ui32 x)
|
||||
{
|
||||
ui32 t = 31 - count_leading_zeros(x);
|
||||
return t + (x & (x - 1) ? 1 : 0);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 precinct::prepare_precinct(int tag_tree_size, ui32* lev_idx,
|
||||
mem_elastic_allocator* elastic)
|
||||
{
|
||||
bit_write_buf bb;
|
||||
coded_lists *cur_coded_list = NULL;
|
||||
ui32 cb_bytes = 0; //cb_bytes;
|
||||
ui32 ph_bytes = 0; //precinct header size
|
||||
int num_skipped_subbands = 0;
|
||||
for (int s = 0; s < 4; ++s)
|
||||
{
|
||||
if (bands[s].empty)
|
||||
continue;
|
||||
|
||||
if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
|
||||
continue;
|
||||
|
||||
ui32 num_levels = 1 +
|
||||
ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
|
||||
|
||||
//create quad trees for inclusion and missing msbs
|
||||
tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
|
||||
inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 255);
|
||||
inc_tag_flags.init(scratch + tag_tree_size,
|
||||
lev_idx, num_levels, cb_idxs[s].siz, 0);
|
||||
mmsb_tag.init(scratch + (tag_tree_size<<1),
|
||||
lev_idx, num_levels, cb_idxs[s].siz, 255);
|
||||
mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
|
||||
lev_idx, num_levels, cb_idxs[s].siz, 0);
|
||||
ui32 band_width = bands[s].num_blocks.w;
|
||||
coded_cb_header *cp = bands[s].coded_cbs;
|
||||
cp += cb_idxs[s].org.x + cb_idxs[s].org.y * band_width;
|
||||
for (ui32 y = 0; y < cb_idxs[s].siz.h; ++y)
|
||||
{
|
||||
for (ui32 x = 0; x < cb_idxs[s].siz.w; ++x)
|
||||
{
|
||||
coded_cb_header *p = cp + x;
|
||||
*inc_tag.get(x, y, 0) = (p->next_coded == NULL); //1 if true
|
||||
*mmsb_tag.get(x, y, 0) = (ui8)p->missing_msbs;
|
||||
}
|
||||
cp += band_width;
|
||||
}
|
||||
for (ui32 lev = 1; lev < num_levels; ++lev)
|
||||
{
|
||||
ui32 height = (cb_idxs[s].siz.h + (1<<lev) - 1) >> lev;
|
||||
ui32 width = (cb_idxs[s].siz.w + (1<<lev) - 1) >> lev;
|
||||
for (ui32 y = 0; y < height; ++y)
|
||||
{
|
||||
for (ui32 x = 0; x < width; ++x)
|
||||
{
|
||||
ui8 t1, t2;
|
||||
t1 = ojph_min(*inc_tag.get(x<<1, y<<1, lev-1),
|
||||
*inc_tag.get((x<<1) + 1, y<<1, lev-1));
|
||||
t2 = ojph_min(*inc_tag.get(x<<1, (y<<1) + 1, lev-1),
|
||||
*inc_tag.get((x<<1) + 1, (y<<1) + 1, lev-1));
|
||||
*inc_tag.get(x, y, lev) = ojph_min(t1, t2);
|
||||
*inc_tag_flags.get(x, y, lev) = 0;
|
||||
t1 = ojph_min(*mmsb_tag.get(x<<1, y<<1, lev-1),
|
||||
*mmsb_tag.get((x<<1) + 1, y<<1, lev-1));
|
||||
t2 = ojph_min(*mmsb_tag.get(x<<1, (y<<1) + 1, lev-1),
|
||||
*mmsb_tag.get((x<<1) + 1, (y<<1) + 1, lev-1));
|
||||
*mmsb_tag.get(x, y, lev) = ojph_min(t1, t2);
|
||||
*mmsb_tag_flags.get(x, y, lev) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
*inc_tag.get(0,0,num_levels) = 0;
|
||||
*inc_tag_flags.get(0,0,num_levels) = 0;
|
||||
*mmsb_tag.get(0,0,num_levels) = 0;
|
||||
*mmsb_tag_flags.get(0,0,num_levels) = 0;
|
||||
if (*inc_tag.get(0, 0, num_levels-1) != 0) //empty subband
|
||||
{
|
||||
if (coded) //non empty precinct, tag tree top is 0
|
||||
bb_put_bits(&bb, 0, 1, elastic, cur_coded_list, ph_bytes);
|
||||
else
|
||||
++num_skipped_subbands;
|
||||
continue;
|
||||
}
|
||||
//now we are in a position to code
|
||||
if (coded == NULL)
|
||||
{
|
||||
bb_init(&bb, elastic, cur_coded_list);
|
||||
coded = cur_coded_list;
|
||||
//store non empty packet
|
||||
bb_put_bit(&bb, 1, elastic, cur_coded_list, ph_bytes);
|
||||
|
||||
// if the first one or two subbands are empty (has codeblocks but
|
||||
// no data in them), we need to code them here.
|
||||
bb_put_bits(&bb, 0, num_skipped_subbands, elastic, cur_coded_list,
|
||||
ph_bytes);
|
||||
num_skipped_subbands = 0; //this line is not needed
|
||||
}
|
||||
|
||||
ui32 width = cb_idxs[s].siz.w;
|
||||
ui32 height = cb_idxs[s].siz.h;
|
||||
for (ui32 y = 0; y < height; ++y)
|
||||
{
|
||||
cp = bands[s].coded_cbs;
|
||||
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
|
||||
for (ui32 x = 0; x < width; ++x, ++cp)
|
||||
{
|
||||
//inclusion bits
|
||||
for (ui32 cur_lev = num_levels; cur_lev > 0; --cur_lev)
|
||||
{
|
||||
ui32 levm1 = cur_lev - 1;
|
||||
//check sent
|
||||
if (*inc_tag_flags.get(x>>levm1, y>>levm1, levm1) == 0)
|
||||
{
|
||||
ui32 skipped = *inc_tag.get(x>>levm1, y>>levm1, levm1);
|
||||
skipped -= *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev);
|
||||
assert(skipped <= 1); // for HTJ2K, this should 0 or 1
|
||||
bb_put_bits(&bb, 1 - skipped, 1,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
*inc_tag_flags.get(x>>levm1, y>>levm1, levm1) = 1;
|
||||
}
|
||||
if (*inc_tag.get(x>>levm1, y>>levm1, levm1) > 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (cp->num_passes == 0) //empty codeblock
|
||||
continue;
|
||||
|
||||
//missing msbs
|
||||
for (ui32 cur_lev = num_levels; cur_lev > 0; --cur_lev)
|
||||
{
|
||||
ui32 levm1 = cur_lev - 1;
|
||||
//check sent
|
||||
if (*mmsb_tag_flags.get(x>>levm1, y>>levm1, levm1) == 0)
|
||||
{
|
||||
int num_zeros = *mmsb_tag.get(x>>levm1, y>>levm1, levm1);
|
||||
num_zeros -= *mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev);
|
||||
bb_put_zeros(&bb, num_zeros,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
bb_put_bits(&bb, 1, 1,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
*mmsb_tag_flags.get(x>>levm1, y>>levm1, levm1) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
//number of coding passes
|
||||
switch (cp->num_passes)
|
||||
{
|
||||
case 3:
|
||||
bb_put_bits(&bb, 12, 4, elastic, cur_coded_list, ph_bytes);
|
||||
break;
|
||||
case 2:
|
||||
bb_put_bits(&bb, 2, 2, elastic, cur_coded_list, ph_bytes);
|
||||
break;
|
||||
case 1:
|
||||
bb_put_bits(&bb, 0, 1, elastic, cur_coded_list, ph_bytes);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
//pass lengths
|
||||
//either one, two, or three passes, but only one or two lengths
|
||||
int bits1 = 32 - (int)count_leading_zeros(cp->pass_length[0]);
|
||||
int extra_bit = cp->num_passes > 2 ? 1 : 0; //for 2nd length
|
||||
int bits2 = 0;
|
||||
if (cp->num_passes > 1)
|
||||
bits2 = 32 - (int)count_leading_zeros(cp->pass_length[1]);
|
||||
int bits = ojph_max(bits1, bits2 - extra_bit) - 3;
|
||||
bits = ojph_max(bits, 0);
|
||||
bb_put_bits(&bb, 0xFFFFFFFEu, bits+1,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
|
||||
bb_put_bits(&bb, cp->pass_length[0], bits+3,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
if (cp->num_passes > 1)
|
||||
bb_put_bits(&bb, cp->pass_length[1], bits+3+extra_bit,
|
||||
elastic, cur_coded_list, ph_bytes);
|
||||
|
||||
cb_bytes += cp->pass_length[0] + cp->pass_length[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (coded)
|
||||
{
|
||||
bb_terminate(&bb);
|
||||
ph_bytes += cur_coded_list->buf_size - cur_coded_list->avail_size;
|
||||
}
|
||||
|
||||
return coded ? cb_bytes + ph_bytes : 1; // 1 for empty packet
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void precinct::write(outfile_base *file)
|
||||
{
|
||||
if (coded)
|
||||
{
|
||||
//write packet header
|
||||
coded_lists *ccl = coded;
|
||||
while (ccl)
|
||||
{
|
||||
file->write(ccl->buf, ccl->buf_size - ccl->avail_size);
|
||||
ccl = ccl->next_list;
|
||||
}
|
||||
|
||||
//write codeblocks
|
||||
for (int s = 0; s < 4; ++s)
|
||||
{
|
||||
if (bands[s].empty)
|
||||
continue;
|
||||
|
||||
ui32 band_width = bands[s].num_blocks.w;
|
||||
ui32 width = cb_idxs[s].siz.w;
|
||||
ui32 height = cb_idxs[s].siz.h;
|
||||
for (ui32 y = 0; y < height; ++y)
|
||||
{
|
||||
coded_cb_header *cp = bands[s].coded_cbs;
|
||||
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
|
||||
for (ui32 x = 0; x < width; ++x, ++cp)
|
||||
{
|
||||
coded_lists *ccl = cp->next_coded;
|
||||
while (ccl)
|
||||
{
|
||||
file->write(ccl->buf, ccl->buf_size - ccl->avail_size);
|
||||
ccl = ccl->next_list;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//empty packet
|
||||
char buf = 0x00;
|
||||
file->write(&buf, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void precinct::parse(int tag_tree_size, ui32* lev_idx,
|
||||
mem_elastic_allocator *elastic,
|
||||
ui32 &data_left, infile_base *file,
|
||||
bool skipped)
|
||||
{
|
||||
assert(data_left > 0);
|
||||
bit_read_buf bb;
|
||||
bb_init(&bb, data_left, file);
|
||||
if (may_use_sop)
|
||||
bb_skip_sop(&bb);
|
||||
|
||||
bool empty_packet = true;
|
||||
for (int s = 0; s < 4; ++s)
|
||||
{
|
||||
if (bands[s].empty)
|
||||
continue;
|
||||
|
||||
if (cb_idxs[s].siz.w == 0 || cb_idxs[s].siz.h == 0)
|
||||
continue;
|
||||
|
||||
if (empty_packet) //one bit to check if the packet is empty
|
||||
{
|
||||
ui32 bit;
|
||||
bb_read_bit(&bb, bit);
|
||||
if (bit == 0) //empty packet
|
||||
{ bb_terminate(&bb, uses_eph); data_left = bb.bytes_left; return; }
|
||||
empty_packet = false;
|
||||
}
|
||||
|
||||
ui32 num_levels = 1 +
|
||||
ojph_max(log2ceil(cb_idxs[s].siz.w), log2ceil(cb_idxs[s].siz.h));
|
||||
|
||||
//create quad trees for inclusion and missing msbs
|
||||
tag_tree inc_tag, inc_tag_flags, mmsb_tag, mmsb_tag_flags;
|
||||
inc_tag.init(scratch, lev_idx, num_levels, cb_idxs[s].siz, 0);
|
||||
*inc_tag.get(0, 0, num_levels) = 0;
|
||||
inc_tag_flags.init(scratch + tag_tree_size, lev_idx, num_levels,
|
||||
cb_idxs[s].siz, 0);
|
||||
*inc_tag_flags.get(0, 0, num_levels) = 0;
|
||||
mmsb_tag.init(scratch + (tag_tree_size<<1), lev_idx, num_levels,
|
||||
cb_idxs[s].siz, 0);
|
||||
*mmsb_tag.get(0, 0, num_levels) = 0;
|
||||
mmsb_tag_flags.init(scratch + (tag_tree_size<<1) + tag_tree_size,
|
||||
lev_idx, num_levels, cb_idxs[s].siz, 0);
|
||||
*mmsb_tag_flags.get(0, 0, num_levels) = 0;
|
||||
|
||||
//
|
||||
ui32 band_width = bands[s].num_blocks.w;
|
||||
ui32 width = cb_idxs[s].siz.w;
|
||||
ui32 height = cb_idxs[s].siz.h;
|
||||
for (ui32 y = 0; y < height; ++y)
|
||||
{
|
||||
coded_cb_header *cp = bands[s].coded_cbs;
|
||||
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
|
||||
for (ui32 x = 0; x < width; ++x, ++cp)
|
||||
{
|
||||
//process inclusion
|
||||
bool empty_cb = false;
|
||||
for (ui32 cl = num_levels; cl > 0; --cl)
|
||||
{
|
||||
ui32 cur_lev = cl - 1;
|
||||
empty_cb = *inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) == 1;
|
||||
if (empty_cb)
|
||||
break;
|
||||
//check received
|
||||
if (*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
|
||||
{
|
||||
ui32 bit;
|
||||
if (bb_read_bit(&bb, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p1"; }
|
||||
empty_cb = (bit == 0);
|
||||
*inc_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)(1 - bit);
|
||||
*inc_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
|
||||
}
|
||||
if (empty_cb)
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty_cb)
|
||||
continue;
|
||||
|
||||
//process missing msbs
|
||||
ui32 mmsbs = 0;
|
||||
for (ui32 levp1 = num_levels; levp1 > 0; --levp1)
|
||||
{
|
||||
ui32 cur_lev = levp1 - 1;
|
||||
mmsbs = *mmsb_tag.get(x>>levp1, y>>levp1, levp1);
|
||||
//check received
|
||||
if (*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) == 0)
|
||||
{
|
||||
ui32 bit = 0;
|
||||
while (bit == 0)
|
||||
{
|
||||
if (bb_read_bit(&bb, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p2"; }
|
||||
mmsbs += 1 - bit;
|
||||
}
|
||||
*mmsb_tag.get(x>>cur_lev, y>>cur_lev, cur_lev) = (ui8)mmsbs;
|
||||
*mmsb_tag_flags.get(x>>cur_lev, y>>cur_lev, cur_lev) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (mmsbs > cp->Kmax)
|
||||
throw "error in parsing a tile header; "
|
||||
"missing msbs are larger or equal to Kmax. The most likely "
|
||||
"cause is a corruption in the bitstream.";
|
||||
cp->missing_msbs = mmsbs;
|
||||
|
||||
//get number of passes
|
||||
ui32 bit, num_passes = 1;
|
||||
if (bb_read_bit(&bb, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p3"; }
|
||||
if (bit)
|
||||
{
|
||||
num_passes = 2;
|
||||
if (bb_read_bit(&bb, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p4"; }
|
||||
if (bit)
|
||||
{
|
||||
if (bb_read_bits(&bb, 2, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p5"; }
|
||||
num_passes = 3 + bit;
|
||||
if (bit == 3)
|
||||
{
|
||||
if (bb_read_bits(&bb, 5, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p6"; }
|
||||
num_passes = 6 + bit;
|
||||
if (bit == 31)
|
||||
{
|
||||
if (bb_read_bits(&bb, 7, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p7"; }
|
||||
num_passes = 37 + bit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cp->num_passes = num_passes;
|
||||
|
||||
// Parse pass lengths
|
||||
// When number of passes is one, one length.
|
||||
// When number of passes is two or three, two lengths.
|
||||
// When number of passes > 3, we have place holder passes;
|
||||
// In this case, subtract multiples of 3 from the number of
|
||||
// passes; for example, if we have 10 passes, we subtract 9,
|
||||
// producing 1 pass.
|
||||
|
||||
// 1 => 1, 2 => 2, 3 => 3, 4 => 1, 5 => 2, 6 => 3
|
||||
ui32 num_phld_passes = (num_passes - 1) / 3;
|
||||
cp->missing_msbs += num_phld_passes;
|
||||
|
||||
num_phld_passes *= 3;
|
||||
cp->num_passes = num_passes - num_phld_passes;
|
||||
cp->pass_length[0] = cp->pass_length[1] = 0;
|
||||
|
||||
int Lblock = 3;
|
||||
bit = 1;
|
||||
while (bit)
|
||||
{
|
||||
// add any extra bits here
|
||||
if (bb_read_bit(&bb, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p8"; }
|
||||
Lblock += bit;
|
||||
}
|
||||
|
||||
int bits = Lblock + 31 -
|
||||
(int)count_leading_zeros(num_phld_passes + 1);
|
||||
if (bb_read_bits(&bb, bits, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p9"; }
|
||||
if (bit < 2)
|
||||
throw "The cleanup segment of an HT codeblock cannot contain "
|
||||
"less than 2 bytes";
|
||||
if (bit >= 65535)
|
||||
throw "The cleanup segment of an HT codeblock must contain "
|
||||
"less than 65535 bytes";
|
||||
cp->pass_length[0] = bit;
|
||||
|
||||
if (cp->num_passes > 1)
|
||||
{
|
||||
//bits = Lblock + 31 - count_leading_zeros(cp->num_passes - 1);
|
||||
// The following is simpler than the above, I think?
|
||||
bits = Lblock + (cp->num_passes > 2 ? 1 : 0);
|
||||
if (bb_read_bits(&bb, bits, bit) == false)
|
||||
{ data_left = 0; throw "error reading from file p10"; }
|
||||
if (bit >= 2047)
|
||||
throw "The refinement segment (SigProp and MagRep passes) of "
|
||||
"an HT codeblock must contain less than 2047 bytes";
|
||||
cp->pass_length[1] = bit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty_packet)
|
||||
{ // all subbands are empty
|
||||
ui32 bit = 0;
|
||||
bb_read_bit(&bb, bit);
|
||||
//assert(bit == 0);
|
||||
}
|
||||
bb_terminate(&bb, uses_eph);
|
||||
//read codeblock data
|
||||
for (int s = 0; s < 4; ++s)
|
||||
{
|
||||
if (bands[s].empty)
|
||||
continue;
|
||||
|
||||
ui32 band_width = bands[s].num_blocks.w;
|
||||
ui32 width = cb_idxs[s].siz.w;
|
||||
ui32 height = cb_idxs[s].siz.h;
|
||||
for (ui32 y = 0; y < height; ++y)
|
||||
{
|
||||
coded_cb_header *cp = bands[s].coded_cbs;
|
||||
cp += cb_idxs[s].org.x + (y + cb_idxs[s].org.y) * band_width;
|
||||
for (ui32 x = 0; x < width; ++x, ++cp)
|
||||
{
|
||||
ui32 num_bytes = cp->pass_length[0] + cp->pass_length[1];
|
||||
if (data_left)
|
||||
{
|
||||
if (num_bytes)
|
||||
{
|
||||
if (skipped)
|
||||
{ //no need to read
|
||||
si64 cur_loc = file->tell();
|
||||
ui32 t = ojph_min(num_bytes, bb.bytes_left);
|
||||
file->seek(t, infile_base::OJPH_SEEK_CUR);
|
||||
ui32 bytes_read = (ui32)(file->tell() - cur_loc);
|
||||
cp->pass_length[0] = cp->pass_length[1] = 0;
|
||||
bb.bytes_left -= bytes_read;
|
||||
assert(bytes_read == t || bb.bytes_left == 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bb_read_chunk(&bb, num_bytes, cp->next_coded, elastic))
|
||||
{
|
||||
//no need to decode a broken codeblock
|
||||
cp->pass_length[0] = cp->pass_length[1] = 0;
|
||||
data_left = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
cp->pass_length[0] = cp->pass_length[1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
data_left = bb.bytes_left;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_precinct.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_PRECINCT_H
|
||||
#define OJPH_PRECINCT_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class mem_elastic_allocator;
|
||||
struct coded_lists;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
class subband;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct precinct
|
||||
{
|
||||
precinct() {
|
||||
scratch = NULL; bands = NULL; coded = NULL;
|
||||
may_use_sop = uses_eph = false;
|
||||
}
|
||||
ui32 prepare_precinct(int tag_tree_size, ui32* lev_idx,
|
||||
mem_elastic_allocator *elastic);
|
||||
void write(outfile_base *file);
|
||||
void parse(int tag_tree_size, ui32* lev_idx,
|
||||
mem_elastic_allocator *elastic,
|
||||
ui32& data_left, infile_base *file, bool skipped);
|
||||
|
||||
ui8 *scratch;
|
||||
point img_point; //the precinct projected to full resolution
|
||||
rect cb_idxs[4]; //indices of codeblocks
|
||||
subband *bands; //the subbands
|
||||
coded_lists* coded;
|
||||
bool may_use_sop, uses_eph;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_PRECINCT_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,133 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_resolution.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_RESOLUTION_H
|
||||
#define OJPH_RESOLUTION_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class mem_elastic_allocator;
|
||||
class codestream;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
class tile_comp;
|
||||
struct precinct;
|
||||
class subband;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class resolution
|
||||
{
|
||||
public:
|
||||
enum : ui32 {
|
||||
HORZ_TRX = 0x01, // horizontal transform
|
||||
VERT_TRX = 0x02, // vertical transform
|
||||
};
|
||||
|
||||
public:
|
||||
static void pre_alloc(codestream *codestream, const rect& res_rect,
|
||||
const rect& recon_res_rect,
|
||||
ui32 comp_num, ui32 res_num);
|
||||
void finalize_alloc(codestream *codestream, const rect& res_rect,
|
||||
const rect& recon_res_rect, ui32 comp_num,
|
||||
ui32 res_num, point comp_downsamp,
|
||||
point res_downsamp, tile_comp *parent_tile_comp,
|
||||
resolution *parent_res);
|
||||
|
||||
line_buf* get_line();
|
||||
void push_line();
|
||||
line_buf* pull_line();
|
||||
rect get_rect() { return res_rect; }
|
||||
ui32 get_comp_num() { return comp_num; }
|
||||
bool has_horz_transform() { return (transform_flags & HORZ_TRX) != 0; }
|
||||
bool has_vert_transform() { return (transform_flags & VERT_TRX) != 0; }
|
||||
|
||||
ui32 prepare_precinct();
|
||||
void write_precincts(outfile_base *file);
|
||||
bool get_top_left_precinct(point &top_left);
|
||||
void write_one_precinct(outfile_base *file);
|
||||
resolution *next_resolution() { return child_res; }
|
||||
void parse_all_precincts(ui32& data_left, infile_base *file);
|
||||
void parse_one_precinct(ui32& data_left, infile_base *file);
|
||||
|
||||
ui32 get_num_bytes() const { return num_bytes; }
|
||||
ui32 get_num_bytes(ui32 resolution_num) const;
|
||||
|
||||
private:
|
||||
bool reversible, skipped_res_for_read, skipped_res_for_recon;
|
||||
ui32 num_steps;
|
||||
ui32 res_num;
|
||||
ui32 comp_num;
|
||||
ui32 num_bytes; // number of bytes in this resolution
|
||||
// used for tilepart length
|
||||
point comp_downsamp;
|
||||
rect res_rect; // resolution rectangle
|
||||
line_buf* lines; // used to store lines
|
||||
lifting_buf *ssp; // step state pointer
|
||||
lifting_buf *aug, *sig;
|
||||
subband *bands;
|
||||
tile_comp *parent_comp;
|
||||
resolution *parent_res, *child_res;
|
||||
//precincts stuff
|
||||
precinct *precincts;
|
||||
size num_precincts;
|
||||
size log_PP;
|
||||
ui32 max_num_levels;
|
||||
int tag_tree_size;
|
||||
ui32 level_index[20]; //more than enough
|
||||
point cur_precinct_loc; //used for progressing spatial modes (2, 3, 4)
|
||||
const param_atk* atk;
|
||||
ui32 transform_flags;
|
||||
//wavelet machinery
|
||||
ui32 cur_line;
|
||||
ui32 rows_to_produce;
|
||||
bool vert_even, horz_even;
|
||||
mem_elastic_allocator *elastic;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_RESOLUTION_H
|
||||
@@ -0,0 +1,382 @@
|
||||
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_subband.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_subband.h"
|
||||
#include "ojph_resolution.h"
|
||||
#include "ojph_codeblock.h"
|
||||
#include "ojph_precinct.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void subband::pre_alloc(codestream *codestream, const rect &band_rect,
|
||||
ui32 comp_num, ui32 res_num, ui32 transform_flags)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
bool empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
|
||||
if (empty)
|
||||
return;
|
||||
|
||||
const param_cod* cdp = codestream->get_coc(comp_num);
|
||||
size log_cb = cdp->get_log_block_dims();
|
||||
size log_PP = cdp->get_log_precinct_size(res_num);
|
||||
|
||||
ui32 x_off = ((transform_flags & resolution::HORZ_TRX) ? 1 : 0);
|
||||
ui32 y_off = ((transform_flags & resolution::VERT_TRX) ? 1 : 0);
|
||||
|
||||
ui32 xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
|
||||
ui32 ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
|
||||
|
||||
size nominal(1 << xcb_prime, 1 << ycb_prime);
|
||||
|
||||
ui32 tbx0 = band_rect.org.x;
|
||||
ui32 tby0 = band_rect.org.y;
|
||||
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
|
||||
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
|
||||
|
||||
size num_blocks;
|
||||
num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
|
||||
num_blocks.w -= tbx0 >> xcb_prime;
|
||||
num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
|
||||
num_blocks.h -= tby0 >> ycb_prime;
|
||||
|
||||
allocator->pre_alloc_obj<codeblock>(num_blocks.w);
|
||||
//allocate codeblock headers
|
||||
allocator->pre_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
|
||||
|
||||
const param_qcd* qp = codestream->access_qcd()->get_qcc(comp_num);
|
||||
ui32 precision = qp->propose_precision(cdp);
|
||||
const param_atk* atk = cdp->access_atk();
|
||||
bool reversible = atk->is_reversible();
|
||||
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
codeblock::pre_alloc(codestream, nominal, precision);
|
||||
|
||||
//allocate lines
|
||||
allocator->pre_alloc_obj<line_buf>(1);
|
||||
//allocate line_buf
|
||||
ui32 width = band_rect.siz.w + 1;
|
||||
if (reversible)
|
||||
{
|
||||
if (precision <= 32)
|
||||
allocator->pre_alloc_data<si32>(width, 1);
|
||||
else
|
||||
allocator->pre_alloc_data<si64>(width, 1);
|
||||
}
|
||||
else
|
||||
allocator->pre_alloc_data<float>(width, 1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void subband::finalize_alloc(codestream *codestream,
|
||||
const rect &band_rect,
|
||||
resolution* res, ui32 res_num,
|
||||
ui32 subband_num)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
elastic = codestream->get_elastic_alloc();
|
||||
|
||||
this->res_num = res_num;
|
||||
this->band_num = subband_num;
|
||||
this->band_rect = band_rect;
|
||||
this->parent = res;
|
||||
|
||||
const param_cod* cdp = codestream->get_coc(parent->get_comp_num());
|
||||
this->reversible = cdp->access_atk()->is_reversible();
|
||||
size log_cb = cdp->get_log_block_dims();
|
||||
log_PP = cdp->get_log_precinct_size(res_num);
|
||||
|
||||
ui32 x_off = ((parent->has_horz_transform()) ? 1 : 0);
|
||||
ui32 y_off = ((parent->has_vert_transform()) ? 1 : 0);
|
||||
|
||||
xcb_prime = ojph_min(log_cb.w, log_PP.w - x_off);
|
||||
ycb_prime = ojph_min(log_cb.h, log_PP.h - y_off);
|
||||
|
||||
size nominal(1 << xcb_prime, 1 << ycb_prime);
|
||||
|
||||
cur_cb_row = 0;
|
||||
cur_line = 0;
|
||||
cur_cb_height = 0;
|
||||
const param_dfs* dfs = NULL;
|
||||
if (cdp->is_dfs_defined()) {
|
||||
dfs = codestream->access_dfs();
|
||||
if (dfs != NULL)
|
||||
dfs = dfs->get_dfs(cdp->get_dfs_index());
|
||||
}
|
||||
ui32 comp_num = parent->get_comp_num();
|
||||
const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num);
|
||||
ui32 num_decomps = cdp->get_num_decompositions();
|
||||
this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num);
|
||||
if (!reversible)
|
||||
{
|
||||
float d =
|
||||
qcd->get_irrev_delta(dfs, num_decomps, res_num, subband_num);
|
||||
d /= (float)(1u << (31 - this->K_max));
|
||||
delta = d;
|
||||
delta_inv = (1.0f/d);
|
||||
}
|
||||
ui32 precision = qcd->propose_precision(cdp);
|
||||
|
||||
this->empty = ((band_rect.siz.w == 0) || (band_rect.siz.h == 0));
|
||||
if (this->empty)
|
||||
return;
|
||||
|
||||
ui32 tbx0 = band_rect.org.x;
|
||||
ui32 tby0 = band_rect.org.y;
|
||||
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
|
||||
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
|
||||
|
||||
num_blocks = size();
|
||||
num_blocks.w = (tbx1 + (1 << xcb_prime) - 1) >> xcb_prime;
|
||||
num_blocks.w -= tbx0 >> xcb_prime;
|
||||
num_blocks.h = (tby1 + (1 << ycb_prime) - 1) >> ycb_prime;
|
||||
num_blocks.h -= tby0 >> ycb_prime;
|
||||
|
||||
blocks = allocator->post_alloc_obj<codeblock>(num_blocks.w);
|
||||
//allocate codeblock headers
|
||||
coded_cb_header *cp = coded_cbs =
|
||||
allocator->post_alloc_obj<coded_cb_header>((size_t)num_blocks.area());
|
||||
memset(coded_cbs, 0, sizeof(coded_cb_header) * (size_t)num_blocks.area());
|
||||
for (int i = (int)num_blocks.area(); i > 0; --i, ++cp)
|
||||
cp->Kmax = K_max;
|
||||
|
||||
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
|
||||
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
|
||||
|
||||
size cb_size;
|
||||
cb_size.h = ojph_min(tby1, y_lower_bound + nominal.h) - tby0;
|
||||
cur_cb_height = (si32)cb_size.h;
|
||||
int line_offset = 0;
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
{
|
||||
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
|
||||
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
|
||||
cb_size.w = cbx1 - cbx0;
|
||||
blocks[i].finalize_alloc(codestream, this, nominal, cb_size,
|
||||
coded_cbs + i, K_max, line_offset,
|
||||
precision, comp_num);
|
||||
line_offset += cb_size.w;
|
||||
}
|
||||
|
||||
//allocate lines
|
||||
lines = allocator->post_alloc_obj<line_buf>(1);
|
||||
//allocate line_buf
|
||||
ui32 width = band_rect.siz.w + 1;
|
||||
if (reversible)
|
||||
{
|
||||
if (precision <= 32)
|
||||
lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1);
|
||||
else
|
||||
lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
|
||||
}
|
||||
else
|
||||
lines->wrap(allocator->post_alloc_data<float>(width, 1), width, 1);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void subband::get_cb_indices(const size& num_precincts,
|
||||
precinct *precincts)
|
||||
{
|
||||
if (empty)
|
||||
return;
|
||||
|
||||
rect res_rect = parent->get_rect();
|
||||
ui32 trx0 = res_rect.org.x;
|
||||
ui32 try0 = res_rect.org.y;
|
||||
ui32 trx1 = res_rect.org.x + res_rect.siz.w;
|
||||
ui32 try1 = res_rect.org.y + res_rect.siz.h;
|
||||
|
||||
ui32 pc_lft = (res_rect.org.x >> log_PP.w) << log_PP.w;
|
||||
ui32 pc_top = (res_rect.org.y >> log_PP.h) << log_PP.h;
|
||||
|
||||
ui32 pcx0, pcx1, pcy0, pcy1;
|
||||
ui32 x_shift = parent->has_horz_transform() ? 1 : 0;
|
||||
ui32 y_shift = parent->has_vert_transform() ? 1 : 0;
|
||||
ui32 yb, xb, coly = 0, colx = 0;
|
||||
for (ui32 y = 0; y < num_precincts.h; ++y)
|
||||
{
|
||||
pcy0 = ojph_max(try0, pc_top + (y << log_PP.h));
|
||||
pcy1 = ojph_min(try1, pc_top + ((y + 1) << log_PP.h));
|
||||
pcy0 = (pcy0 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
|
||||
pcy1 = (pcy1 - (band_num >> 1) + (1 << y_shift) - 1) >> y_shift;
|
||||
|
||||
precinct *p = precincts + y * num_precincts.w;
|
||||
yb = ((pcy1 + (1<<ycb_prime) - 1) >> ycb_prime);
|
||||
yb -= (pcy0 >> ycb_prime);
|
||||
colx = 0;
|
||||
|
||||
for (ui32 x = 0; x < num_precincts.w; ++x, ++p)
|
||||
{
|
||||
pcx0 = ojph_max(trx0, pc_lft + (x << log_PP.w));
|
||||
pcx1 = ojph_min(trx1, pc_lft + ((x + 1) << log_PP.w));
|
||||
pcx0 = (pcx0 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
|
||||
pcx1 = (pcx1 - (band_num & 1) + (1 << x_shift) - 1) >> x_shift;
|
||||
|
||||
rect *bp = p->cb_idxs + band_num;
|
||||
xb = ((pcx1 + (1<<xcb_prime) - 1) >> xcb_prime);
|
||||
xb -= (pcx0 >> xcb_prime);
|
||||
|
||||
bp->org.x = colx;
|
||||
bp->org.y = coly;
|
||||
bp->siz.w = xb;
|
||||
bp->siz.h = yb;
|
||||
|
||||
colx += xb;
|
||||
}
|
||||
coly += yb;
|
||||
}
|
||||
assert(colx == num_blocks.w && coly == num_blocks.h);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void subband::exchange_buf(line_buf *l)
|
||||
{
|
||||
if (empty)
|
||||
return;
|
||||
|
||||
assert(l->pre_size == lines[0].pre_size && l->size == lines[0].size &&
|
||||
l->flags == lines[0].flags);
|
||||
void* p = lines[0].p;
|
||||
lines[0].p = l->p;
|
||||
l->p = p;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void subband::push_line()
|
||||
{
|
||||
if (empty)
|
||||
return;
|
||||
|
||||
//push to codeblocks
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
blocks[i].push(lines + 0);
|
||||
if (++cur_line >= cur_cb_height)
|
||||
{
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
blocks[i].encode(elastic);
|
||||
|
||||
if (++cur_cb_row < num_blocks.h)
|
||||
{
|
||||
cur_line = 0;
|
||||
|
||||
ui32 tbx0 = band_rect.org.x;
|
||||
ui32 tby0 = band_rect.org.y;
|
||||
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
|
||||
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
|
||||
size nominal(1 << xcb_prime, 1 << ycb_prime);
|
||||
|
||||
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
|
||||
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
|
||||
ui32 cby0 = y_lower_bound + cur_cb_row * nominal.h;
|
||||
ui32 cby1 = ojph_min(tby1, cby0 + nominal.h);
|
||||
|
||||
size cb_size;
|
||||
cb_size.h = cby1 - ojph_max(tby0, cby0);
|
||||
cur_cb_height = (int)cb_size.h;
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
{
|
||||
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
|
||||
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
|
||||
cb_size.w = cbx1 - cbx0;
|
||||
blocks[i].recreate(cb_size,
|
||||
coded_cbs + i + cur_cb_row * num_blocks.w);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
line_buf *subband::pull_line()
|
||||
{
|
||||
if (empty)
|
||||
return lines;
|
||||
|
||||
//pull from codeblocks
|
||||
if (--cur_line <= 0)
|
||||
{
|
||||
if (cur_cb_row < num_blocks.h)
|
||||
{
|
||||
ui32 tbx0 = band_rect.org.x;
|
||||
ui32 tby0 = band_rect.org.y;
|
||||
ui32 tbx1 = band_rect.org.x + band_rect.siz.w;
|
||||
ui32 tby1 = band_rect.org.y + band_rect.siz.h;
|
||||
size nominal(1 << xcb_prime, 1 << ycb_prime);
|
||||
|
||||
ui32 x_lower_bound = (tbx0 >> xcb_prime) << xcb_prime;
|
||||
ui32 y_lower_bound = (tby0 >> ycb_prime) << ycb_prime;
|
||||
ui32 cby0 = ojph_max(tby0, y_lower_bound + cur_cb_row * nominal.h);
|
||||
ui32 cby1 = ojph_min(tby1, y_lower_bound+(cur_cb_row+1)*nominal.h);
|
||||
|
||||
size cb_size;
|
||||
cb_size.h = cby1 - cby0;
|
||||
cur_line = cur_cb_height = (int)cb_size.h;
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
{
|
||||
ui32 cbx0 = ojph_max(tbx0, x_lower_bound + i * nominal.w);
|
||||
ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w);
|
||||
cb_size.w = cbx1 - cbx0;
|
||||
blocks[i].recreate(cb_size,
|
||||
coded_cbs + i + cur_cb_row * num_blocks.w);
|
||||
blocks[i].decode();
|
||||
}
|
||||
++cur_cb_row;
|
||||
}
|
||||
}
|
||||
|
||||
assert(cur_line >= 0);
|
||||
|
||||
//pull from codeblocks
|
||||
for (ui32 i = 0; i < num_blocks.w; ++i)
|
||||
blocks[i].pull_line(lines + 0);
|
||||
|
||||
return lines;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_subband.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_SUBBAND_H
|
||||
#define OJPH_SUBBAND_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class mem_elastic_allocator;
|
||||
class codestream;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
class resolution;
|
||||
struct precinct;
|
||||
class codeblock;
|
||||
struct coded_cb_header;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class subband
|
||||
{
|
||||
friend struct precinct;
|
||||
public:
|
||||
subband() {
|
||||
res_num = band_num = 0;
|
||||
reversible = false;
|
||||
empty = true; // <---- true
|
||||
lines = NULL;
|
||||
parent = NULL;
|
||||
blocks = NULL;
|
||||
xcb_prime = ycb_prime = 0;
|
||||
cur_cb_row = 0;
|
||||
cur_line = 0;
|
||||
cur_cb_height = 0;
|
||||
delta = delta_inv = 0.0f;
|
||||
K_max = 0;
|
||||
coded_cbs = NULL;
|
||||
elastic = NULL;
|
||||
}
|
||||
|
||||
static void pre_alloc(codestream *codestream, const rect& band_rect,
|
||||
ui32 comp_num, ui32 res_num, ui32 transform_flags);
|
||||
void finalize_alloc(codestream *codestream, const rect& band_rect,
|
||||
resolution* res, ui32 res_num, ui32 subband_num);
|
||||
|
||||
void exchange_buf(line_buf* l);
|
||||
line_buf* get_line() { return lines; }
|
||||
void push_line();
|
||||
|
||||
void get_cb_indices(const size& num_precincts, precinct *precincts);
|
||||
float get_delta() { return delta; }
|
||||
bool exists() { return !empty; }
|
||||
|
||||
line_buf* pull_line();
|
||||
resolution* get_parent() { return parent; }
|
||||
const resolution* get_parent() const { return parent; }
|
||||
|
||||
private:
|
||||
bool empty; // true if the subband has no pixels or
|
||||
// the subband is NOT USED
|
||||
ui32 res_num, band_num;
|
||||
bool reversible;
|
||||
rect band_rect;
|
||||
line_buf *lines;
|
||||
resolution* parent;
|
||||
codeblock* blocks;
|
||||
size num_blocks;
|
||||
size log_PP;
|
||||
ui32 xcb_prime, ycb_prime;
|
||||
ui32 cur_cb_row;
|
||||
int cur_line;
|
||||
int cur_cb_height;
|
||||
float delta, delta_inv;
|
||||
ui32 K_max;
|
||||
coded_cb_header *coded_cbs;
|
||||
mem_elastic_allocator *elastic;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_SUBBAND_H
|
||||
+899
@@ -0,0 +1,899 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_tile.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_tile.h"
|
||||
#include "ojph_tile_comp.h"
|
||||
|
||||
#include "../transform/ojph_colour.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::pre_alloc(codestream *codestream, const rect& tile_rect,
|
||||
const rect& recon_tile_rect, ui32& num_tileparts)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
//allocate tiles_comp
|
||||
const param_siz *szp = codestream->get_siz();
|
||||
ui32 num_comps = szp->get_num_components();
|
||||
allocator->pre_alloc_obj<tile_comp>(num_comps);
|
||||
allocator->pre_alloc_obj<rect>(num_comps); //for comp_rects
|
||||
allocator->pre_alloc_obj<rect>(num_comps); //for recon_comp_rects
|
||||
allocator->pre_alloc_obj<ui32>(num_comps); //for line_offsets
|
||||
allocator->pre_alloc_obj<ui32>(num_comps); //for num_bits
|
||||
allocator->pre_alloc_obj<bool>(num_comps); //for is_signed
|
||||
allocator->pre_alloc_obj<bool>(num_comps); //for reversible
|
||||
allocator->pre_alloc_obj<ui8>(num_comps); //for nlt_type3
|
||||
allocator->pre_alloc_obj<ui32>(num_comps); //for cur_line
|
||||
|
||||
{
|
||||
ui32 tilepart_div = codestream->get_tilepart_div();
|
||||
ui32 t = tilepart_div & OJPH_TILEPART_MASK;
|
||||
if (t == OJPH_TILEPART_NO_DIVISIONS)
|
||||
num_tileparts = 1; //for num_rc_bytes
|
||||
else if (t == OJPH_TILEPART_COMPONENTS)
|
||||
num_tileparts = num_comps;
|
||||
else if (t == OJPH_TILEPART_RESOLUTIONS)
|
||||
{
|
||||
ui32 max_decs = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c) {
|
||||
ui32 s = codestream->get_coc(c)->get_num_decompositions();
|
||||
max_decs = ojph_max(max_decs, s);
|
||||
}
|
||||
num_tileparts = 1 + max_decs;
|
||||
}
|
||||
else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
|
||||
{
|
||||
num_tileparts = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c) {
|
||||
ui32 s = codestream->get_coc(c)->get_num_decompositions();
|
||||
num_tileparts += s + 1;
|
||||
}
|
||||
}
|
||||
if (num_tileparts > 255)
|
||||
OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
|
||||
"cannot have more than 255 tile parts.", num_tileparts);
|
||||
}
|
||||
|
||||
ui32 tx0 = tile_rect.org.x;
|
||||
ui32 ty0 = tile_rect.org.y;
|
||||
ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
|
||||
ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
|
||||
ui32 recon_tx0 = recon_tile_rect.org.x;
|
||||
ui32 recon_ty0 = recon_tile_rect.org.y;
|
||||
ui32 recon_tx1 = recon_tile_rect.org.x + recon_tile_rect.siz.w;
|
||||
ui32 recon_ty1 = recon_tile_rect.org.y + recon_tile_rect.siz.h;
|
||||
|
||||
ui32 width = 0;
|
||||
for (ui32 i = 0; i < num_comps; ++i)
|
||||
{
|
||||
point downsamp = szp->get_downsampling(i);
|
||||
|
||||
ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
|
||||
ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
|
||||
ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
|
||||
ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
|
||||
ui32 recon_tcx0 = ojph_div_ceil(recon_tx0, downsamp.x);
|
||||
ui32 recon_tcy0 = ojph_div_ceil(recon_ty0, downsamp.y);
|
||||
ui32 recon_tcx1 = ojph_div_ceil(recon_tx1, downsamp.x);
|
||||
ui32 recon_tcy1 = ojph_div_ceil(recon_ty1, downsamp.y);
|
||||
|
||||
rect comp_rect;
|
||||
comp_rect.org.x = tcx0;
|
||||
comp_rect.org.y = tcy0;
|
||||
comp_rect.siz.w = tcx1 - tcx0;
|
||||
comp_rect.siz.h = tcy1 - tcy0;
|
||||
|
||||
rect recon_comp_rect;
|
||||
recon_comp_rect.org.x = recon_tcx0;
|
||||
recon_comp_rect.org.y = recon_tcy0;
|
||||
recon_comp_rect.siz.w = recon_tcx1 - recon_tcx0;
|
||||
recon_comp_rect.siz.h = recon_tcy1 - recon_tcy0;
|
||||
|
||||
tile_comp::pre_alloc(codestream, i, comp_rect, recon_comp_rect);
|
||||
width = ojph_max(width, recon_comp_rect.siz.w);
|
||||
}
|
||||
|
||||
//allocate lines
|
||||
const param_cod* cdp = codestream->get_cod();
|
||||
if (cdp->is_employing_color_transform())
|
||||
{
|
||||
bool reversible[3];
|
||||
for (ui32 i = 0; i < 3; ++i)
|
||||
reversible[i] = codestream->get_coc(i)->is_reversible();
|
||||
if (reversible[0] != reversible[1] || reversible[1] != reversible[2])
|
||||
OJPH_ERROR(0x000300A2, "When the colour transform is employed. "
|
||||
"all colour components must undergo either reversible or "
|
||||
"irreversible wavelet transform; if not, then it is not clear "
|
||||
"what colour transform should be used (reversible or "
|
||||
"irreversible). Here we found that the first three colour "
|
||||
"components uses %s, %s, and %s transforms, respectively.",
|
||||
reversible[0] ? "reversible" : "irreversible",
|
||||
reversible[1] ? "reversible" : "irreversible",
|
||||
reversible[2] ? "reversible" : "irreversible");
|
||||
|
||||
allocator->pre_alloc_obj<line_buf>(3);
|
||||
if (reversible[0])
|
||||
for (int i = 0; i < 3; ++i)
|
||||
allocator->pre_alloc_data<si32>(width, 0);
|
||||
else
|
||||
for (int i = 0; i < 3; ++i)
|
||||
allocator->pre_alloc_data<float>(width, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::finalize_alloc(codestream *codestream, const rect& tile_rect,
|
||||
ui32 tile_idx, ui32& offset,
|
||||
ui32 &num_tileparts)
|
||||
{
|
||||
//this->parent = codestream;
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
sot.init(0, (ui16)tile_idx, 0, 1);
|
||||
prog_order = codestream->access_cod().get_progression_order();
|
||||
|
||||
//allocate tiles_comp
|
||||
const param_siz *szp = codestream->get_siz();
|
||||
const param_nlt *nlp = codestream->get_nlt();
|
||||
|
||||
this->num_bytes = 0;
|
||||
num_comps = szp->get_num_components();
|
||||
skipped_res_for_read = codestream->get_skipped_res_for_read();
|
||||
comps = allocator->post_alloc_obj<tile_comp>(num_comps);
|
||||
comp_rects = allocator->post_alloc_obj<rect>(num_comps);
|
||||
recon_comp_rects = allocator->post_alloc_obj<rect>(num_comps);
|
||||
line_offsets = allocator->post_alloc_obj<ui32>(num_comps);
|
||||
num_bits = allocator->post_alloc_obj<ui32>(num_comps);
|
||||
is_signed = allocator->post_alloc_obj<bool>(num_comps);
|
||||
reversible = allocator->post_alloc_obj<bool>(num_comps);
|
||||
nlt_type3 = allocator->post_alloc_obj<ui8>(num_comps);
|
||||
cur_line = allocator->post_alloc_obj<ui32>(num_comps);
|
||||
|
||||
profile = codestream->get_profile();
|
||||
tilepart_div = codestream->get_tilepart_div();
|
||||
need_tlm = codestream->is_tlm_needed();
|
||||
{
|
||||
ui32 tilepart_div = codestream->get_tilepart_div();
|
||||
ui32 t = tilepart_div & OJPH_TILEPART_MASK;
|
||||
if (t == OJPH_TILEPART_NO_DIVISIONS)
|
||||
num_tileparts = 1; //for num_rc_bytes
|
||||
else if (t == OJPH_TILEPART_COMPONENTS)
|
||||
num_tileparts = num_comps;
|
||||
else if (t == OJPH_TILEPART_RESOLUTIONS)
|
||||
{
|
||||
ui32 max_decs = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c) {
|
||||
ui32 s = codestream->get_coc(c)->get_num_decompositions();
|
||||
max_decs = ojph_max(max_decs, s);
|
||||
}
|
||||
num_tileparts = 1 + max_decs;
|
||||
}
|
||||
else if (t == (OJPH_TILEPART_COMPONENTS | OJPH_TILEPART_RESOLUTIONS))
|
||||
{
|
||||
num_tileparts = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c) {
|
||||
ui32 s = codestream->get_coc(c)->get_num_decompositions();
|
||||
num_tileparts += s + 1;
|
||||
}
|
||||
}
|
||||
if (num_tileparts > 255)
|
||||
OJPH_ERROR(0x000300D1, "Trying to create %d tileparts; a tile "
|
||||
"cannot have more than 255 tile parts.", num_tileparts);
|
||||
}
|
||||
|
||||
this->resilient = codestream->is_resilient();
|
||||
this->tile_rect = tile_rect;
|
||||
|
||||
ui32 tx0 = tile_rect.org.x;
|
||||
ui32 ty0 = tile_rect.org.y;
|
||||
ui32 tx1 = tile_rect.org.x + tile_rect.siz.w;
|
||||
ui32 ty1 = tile_rect.org.y + tile_rect.siz.h;
|
||||
|
||||
ui32 width = 0;
|
||||
for (ui32 i = 0; i < num_comps; ++i)
|
||||
{
|
||||
ui8 bd; bool is; // used for nlt_type3
|
||||
|
||||
point downsamp = szp->get_downsampling(i);
|
||||
point recon_downsamp = szp->get_recon_downsampling(i);
|
||||
|
||||
ui32 tcx0 = ojph_div_ceil(tx0, downsamp.x);
|
||||
ui32 tcy0 = ojph_div_ceil(ty0, downsamp.y);
|
||||
ui32 tcx1 = ojph_div_ceil(tx1, downsamp.x);
|
||||
ui32 tcy1 = ojph_div_ceil(ty1, downsamp.y);
|
||||
ui32 recon_tcx0 = ojph_div_ceil(tx0, recon_downsamp.x);
|
||||
ui32 recon_tcy0 = ojph_div_ceil(ty0, recon_downsamp.y);
|
||||
ui32 recon_tcx1 = ojph_div_ceil(tx1, recon_downsamp.x);
|
||||
ui32 recon_tcy1 = ojph_div_ceil(ty1, recon_downsamp.y);
|
||||
|
||||
line_offsets[i] =
|
||||
recon_tcx0 - ojph_div_ceil(tx0 - offset, recon_downsamp.x);
|
||||
comp_rects[i].org.x = tcx0;
|
||||
comp_rects[i].org.y = tcy0;
|
||||
comp_rects[i].siz.w = tcx1 - tcx0;
|
||||
comp_rects[i].siz.h = tcy1 - tcy0;
|
||||
recon_comp_rects[i].org.x = recon_tcx0;
|
||||
recon_comp_rects[i].org.y = recon_tcy0;
|
||||
recon_comp_rects[i].siz.w = recon_tcx1 - recon_tcx0;
|
||||
recon_comp_rects[i].siz.h = recon_tcy1 - recon_tcy0;
|
||||
|
||||
comps[i].finalize_alloc(codestream, this, i, comp_rects[i],
|
||||
recon_comp_rects[i]);
|
||||
width = ojph_max(width, recon_comp_rects[i].siz.w);
|
||||
|
||||
num_bits[i] = szp->get_bit_depth(i);
|
||||
is_signed[i] = szp->is_signed(i);
|
||||
bool result = nlp->get_nonlinear_transform(i, bd, is, nlt_type3[i]);
|
||||
if (result == true && (bd != num_bits[i] || is != is_signed[i]))
|
||||
OJPH_ERROR(0x000300A1, "Mismatch between Ssiz (bit_depth = %d, "
|
||||
"is_signed = %s) from SIZ marker segment, and BDnlt "
|
||||
"(bit_depth = %d, is_signed = %s) from NLT marker segment, "
|
||||
"for component %d", i, num_bits[i],
|
||||
is_signed[i] ? "True" : "False", bd, is ? "True" : "False");
|
||||
if (result == false)
|
||||
nlt_type3[i] = param_nlt::nonlinearity::OJPH_NLT_NO_NLT;
|
||||
cur_line[i] = 0;
|
||||
reversible[i] = codestream->get_coc(i)->is_reversible();
|
||||
}
|
||||
|
||||
offset += tile_rect.siz.w;
|
||||
|
||||
//allocate lines
|
||||
const param_cod* cdp = codestream->get_cod();
|
||||
this->employ_color_transform = cdp->is_employing_color_transform();
|
||||
if (this->employ_color_transform)
|
||||
{
|
||||
num_lines = 3;
|
||||
lines = allocator->post_alloc_obj<line_buf>(num_lines);
|
||||
if (reversible[0])
|
||||
for (int i = 0; i < 3; ++i)
|
||||
lines[i].wrap(
|
||||
allocator->post_alloc_data<si32>(width, 0), width, 0);
|
||||
else
|
||||
for (int i = 0; i < 3; ++i)
|
||||
lines[i].wrap(
|
||||
allocator->post_alloc_data<float>(width, 0), width, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
lines = NULL;
|
||||
num_lines = 0;
|
||||
}
|
||||
next_tile_part = 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool tile::push(line_buf *line, ui32 comp_num)
|
||||
{
|
||||
constexpr ui8 type3 =
|
||||
param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
|
||||
|
||||
assert(comp_num < num_comps);
|
||||
if (cur_line[comp_num] >= comp_rects[comp_num].siz.h)
|
||||
return false;
|
||||
cur_line[comp_num]++;
|
||||
|
||||
//converts to signed representation
|
||||
//employs color transform if there is a need
|
||||
if (!employ_color_transform || comp_num >= 3)
|
||||
{
|
||||
assert(comp_num < num_comps);
|
||||
ui32 comp_width = comp_rects[comp_num].siz.w;
|
||||
line_buf *tc = comps[comp_num].get_line();
|
||||
if (reversible[comp_num])
|
||||
{
|
||||
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
|
||||
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
|
||||
rev_convert_nlt_type3(line, line_offsets[comp_num],
|
||||
tc, 0, shift + 1, comp_width);
|
||||
else {
|
||||
shift = is_signed[comp_num] ? 0 : -shift;
|
||||
rev_convert(line, line_offsets[comp_num], tc, 0,
|
||||
shift, comp_width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nlt_type3[comp_num] == type3)
|
||||
irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
|
||||
tc, num_bits[comp_num], is_signed[comp_num], comp_width);
|
||||
else
|
||||
irv_convert_to_float(line, line_offsets[comp_num],
|
||||
tc, num_bits[comp_num], is_signed[comp_num], comp_width);
|
||||
}
|
||||
comps[comp_num].push_line();
|
||||
}
|
||||
else
|
||||
{
|
||||
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
|
||||
ui32 comp_width = comp_rects[comp_num].siz.w;
|
||||
if (reversible[comp_num])
|
||||
{
|
||||
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
|
||||
rev_convert_nlt_type3(line, line_offsets[comp_num],
|
||||
lines + comp_num, 0, shift + 1, comp_width);
|
||||
else {
|
||||
shift = is_signed[comp_num] ? 0 : -shift;
|
||||
rev_convert(line, line_offsets[comp_num], lines + comp_num, 0,
|
||||
shift, comp_width);
|
||||
}
|
||||
|
||||
if (comp_num == 2)
|
||||
{ // reversible color transform
|
||||
rct_forward(lines + 0, lines + 1, lines + 2,
|
||||
comps[0].get_line(),
|
||||
comps[1].get_line(),
|
||||
comps[2].get_line(), comp_width);
|
||||
comps[0].push_line();
|
||||
comps[1].push_line();
|
||||
comps[2].push_line();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nlt_type3[comp_num] == type3)
|
||||
irv_convert_to_float_nlt_type3(line, line_offsets[comp_num],
|
||||
lines + comp_num, num_bits[comp_num], is_signed[comp_num],
|
||||
comp_width);
|
||||
else
|
||||
irv_convert_to_float(line, line_offsets[comp_num],
|
||||
lines + comp_num, num_bits[comp_num], is_signed[comp_num],
|
||||
comp_width);
|
||||
if (comp_num == 2)
|
||||
{ // irreversible color transform
|
||||
ict_forward(lines[0].f32, lines[1].f32, lines[2].f32,
|
||||
comps[0].get_line()->f32,
|
||||
comps[1].get_line()->f32,
|
||||
comps[2].get_line()->f32, comp_width);
|
||||
comps[0].push_line();
|
||||
comps[1].push_line();
|
||||
comps[2].push_line();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool tile::pull(line_buf* tgt_line, ui32 comp_num)
|
||||
{
|
||||
constexpr ui8 type3 =
|
||||
param_nlt::nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
|
||||
|
||||
assert(comp_num < num_comps);
|
||||
if (cur_line[comp_num] >= recon_comp_rects[comp_num].siz.h)
|
||||
return false;
|
||||
|
||||
cur_line[comp_num]++;
|
||||
|
||||
if (!employ_color_transform || num_comps == 1)
|
||||
{
|
||||
line_buf *src_line = comps[comp_num].pull_line();
|
||||
ui32 comp_width = recon_comp_rects[comp_num].siz.w;
|
||||
if (reversible[comp_num])
|
||||
{
|
||||
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
|
||||
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
|
||||
rev_convert_nlt_type3(src_line, 0, tgt_line,
|
||||
line_offsets[comp_num], shift + 1, comp_width);
|
||||
else {
|
||||
shift = is_signed[comp_num] ? 0 : shift;
|
||||
rev_convert(src_line, 0, tgt_line,
|
||||
line_offsets[comp_num], shift, comp_width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nlt_type3[comp_num] == type3)
|
||||
irv_convert_to_integer_nlt_type3(src_line, tgt_line,
|
||||
line_offsets[comp_num], num_bits[comp_num],
|
||||
is_signed[comp_num], comp_width);
|
||||
else
|
||||
irv_convert_to_integer(src_line, tgt_line,
|
||||
line_offsets[comp_num], num_bits[comp_num],
|
||||
is_signed[comp_num], comp_width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(num_comps >= 3);
|
||||
ui32 comp_width = recon_comp_rects[comp_num].siz.w;
|
||||
if (comp_num == 0)
|
||||
{
|
||||
if (reversible[comp_num])
|
||||
rct_backward(comps[0].pull_line(), comps[1].pull_line(),
|
||||
comps[2].pull_line(), lines + 0, lines + 1,
|
||||
lines + 2, comp_width);
|
||||
else
|
||||
ict_backward(comps[0].pull_line()->f32, comps[1].pull_line()->f32,
|
||||
comps[2].pull_line()->f32, lines[0].f32, lines[1].f32,
|
||||
lines[2].f32, comp_width);
|
||||
}
|
||||
if (reversible[comp_num])
|
||||
{
|
||||
si64 shift = (si64)1 << (num_bits[comp_num] - 1);
|
||||
line_buf* src_line;
|
||||
if (comp_num < 3)
|
||||
src_line = lines + comp_num;
|
||||
else
|
||||
src_line = comps[comp_num].pull_line();
|
||||
if (is_signed[comp_num] && nlt_type3[comp_num] == type3)
|
||||
rev_convert_nlt_type3(src_line, 0, tgt_line,
|
||||
line_offsets[comp_num], shift + 1, comp_width);
|
||||
else {
|
||||
shift = is_signed[comp_num] ? 0 : shift;
|
||||
rev_convert(src_line, 0, tgt_line,
|
||||
line_offsets[comp_num], shift, comp_width);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
line_buf* lbp;
|
||||
if (comp_num < 3)
|
||||
lbp = lines + comp_num;
|
||||
else
|
||||
lbp = comps[comp_num].pull_line();
|
||||
if (nlt_type3[comp_num] == type3)
|
||||
irv_convert_to_integer_nlt_type3(lbp, tgt_line,
|
||||
line_offsets[comp_num], num_bits[comp_num],
|
||||
is_signed[comp_num], comp_width);
|
||||
else
|
||||
irv_convert_to_integer(lbp, tgt_line,
|
||||
line_offsets[comp_num], num_bits[comp_num],
|
||||
is_signed[comp_num], comp_width);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::prepare_for_flush()
|
||||
{
|
||||
this->num_bytes = 0;
|
||||
//prepare precinct headers
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
num_bytes += comps[c].prepare_precincts();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::fill_tlm(param_tlm *tlm)
|
||||
{
|
||||
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS) {
|
||||
tlm->set_next_pair(sot.get_tile_index(), this->num_bytes);
|
||||
}
|
||||
else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
|
||||
{
|
||||
assert(prog_order != OJPH_PO_PCRL && prog_order != OJPH_PO_CPRL);
|
||||
ui32 max_decs = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
|
||||
for (ui32 r = 0; r <= max_decs; ++r)
|
||||
{
|
||||
ui32 bytes = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
bytes += comps[c].get_num_bytes(r);
|
||||
tlm->set_next_pair(sot.get_tile_index(), bytes);
|
||||
}
|
||||
}
|
||||
else if (tilepart_div == OJPH_TILEPART_COMPONENTS)
|
||||
{
|
||||
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
|
||||
{
|
||||
ui32 max_decs = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
|
||||
for (ui32 r = 0; r <= max_decs; ++r)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
if (r <= comps[c].get_num_decompositions())
|
||||
tlm->set_next_pair(sot.get_tile_index(),
|
||||
comps[c].get_num_bytes(r));
|
||||
}
|
||||
else if (prog_order == OJPH_PO_CPRL)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
tlm->set_next_pair(sot.get_tile_index(), comps[c].get_num_bytes());
|
||||
else
|
||||
assert(0); // should not be here
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP);
|
||||
ui32 max_decs = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
max_decs = ojph_max(max_decs, comps[c].get_num_decompositions());
|
||||
for (ui32 r = 0; r <= max_decs; ++r)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
if (r <= comps[c].get_num_decompositions())
|
||||
tlm->set_next_pair(sot.get_tile_index(),
|
||||
comps[c].get_num_bytes(r));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::flush(outfile_base *file)
|
||||
{
|
||||
ui32 max_decompositions = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
max_decompositions = ojph_max(max_decompositions,
|
||||
comps[c].get_num_decompositions());
|
||||
|
||||
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
|
||||
{
|
||||
//write tile header
|
||||
if (!sot.write(file, this->num_bytes))
|
||||
OJPH_ERROR(0x00030081, "Error writing to file");
|
||||
|
||||
//write start of data
|
||||
ui16 t = swap_byte(JP2K_MARKER::SOD);
|
||||
if (!file->write(&t, 2))
|
||||
OJPH_ERROR(0x00030082, "Error writing to file");
|
||||
}
|
||||
|
||||
|
||||
//sequence the writing of precincts according to progression order
|
||||
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
|
||||
{
|
||||
if (tilepart_div == OJPH_TILEPART_NO_DIVISIONS)
|
||||
{
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
comps[c].write_precincts(r, file);
|
||||
}
|
||||
else if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
|
||||
{
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
{
|
||||
ui32 bytes = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
bytes += comps[c].get_num_bytes(r);
|
||||
|
||||
//write tile header
|
||||
if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
|
||||
OJPH_ERROR(0x00030083, "Error writing to file");
|
||||
|
||||
//write start of data
|
||||
ui16 t = swap_byte(JP2K_MARKER::SOD);
|
||||
if (!file->write(&t, 2))
|
||||
OJPH_ERROR(0x00030084, "Error writing to file");
|
||||
|
||||
//write precincts
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
comps[c].write_precincts(r, file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui32 num_tileparts = num_comps * (max_decompositions + 1);
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
if (r <= comps[c].get_num_decompositions()) {
|
||||
//write tile header
|
||||
if (!sot.write(file, comps[c].get_num_bytes(r),
|
||||
(ui8)(c + r * num_comps), (ui8)num_tileparts))
|
||||
OJPH_ERROR(0x00030085, "Error writing to file");
|
||||
//write start of data
|
||||
ui16 t = swap_byte(JP2K_MARKER::SOD);
|
||||
if (!file->write(&t, 2))
|
||||
OJPH_ERROR(0x00030086, "Error writing to file");
|
||||
comps[c].write_precincts(r, file);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (prog_order == OJPH_PO_RPCL)
|
||||
{
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
{
|
||||
if (tilepart_div == OJPH_TILEPART_RESOLUTIONS)
|
||||
{
|
||||
ui32 bytes = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
bytes += comps[c].get_num_bytes(r);
|
||||
//write tile header
|
||||
if (!sot.write(file, bytes, (ui8)r, (ui8)(max_decompositions + 1)))
|
||||
OJPH_ERROR(0x00030087, "Error writing to file");
|
||||
|
||||
//write start of data
|
||||
ui16 t = swap_byte(JP2K_MARKER::SOD);
|
||||
if (!file->write(&t, 2))
|
||||
OJPH_ERROR(0x00030088, "Error writing to file");
|
||||
}
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 comp_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur))
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; comp_num = c; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; comp_num = c; }
|
||||
}
|
||||
if (found == true)
|
||||
comps[comp_num].write_one_precinct(r, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (prog_order == OJPH_PO_PCRL)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 comp_num = 0;
|
||||
ui32 res_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur))
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x == smallest.x &&
|
||||
c < comp_num)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x == smallest.x &&
|
||||
c == comp_num && r < res_num)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
}
|
||||
}
|
||||
if (found == true)
|
||||
comps[comp_num].write_one_precinct(res_num, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (prog_order == OJPH_PO_CPRL)
|
||||
{
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
if (tilepart_div == OJPH_TILEPART_COMPONENTS)
|
||||
{
|
||||
ui32 bytes = comps[c].get_num_bytes();
|
||||
//write tile header
|
||||
if (!sot.write(file, bytes, (ui8)c, (ui8)num_comps))
|
||||
OJPH_ERROR(0x0003008A, "Error writing to file");
|
||||
|
||||
//write start of data
|
||||
ui16 t = swap_byte(JP2K_MARKER::SOD);
|
||||
if (!file->write(&t, 2))
|
||||
OJPH_ERROR(0x0003008B, "Error writing to file");
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 res_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; res_num = r; }
|
||||
}
|
||||
if (found == true)
|
||||
comps[c].write_one_precinct(res_num, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile::parse_tile_header(const param_sot &sot, infile_base *file,
|
||||
const ui64& tile_start_location)
|
||||
{
|
||||
if (sot.get_tile_part_index() != next_tile_part)
|
||||
{
|
||||
if (resilient)
|
||||
OJPH_INFO(0x00030091, "wrong tile part index")
|
||||
else
|
||||
OJPH_ERROR(0x00030091, "wrong tile part index")
|
||||
}
|
||||
++next_tile_part;
|
||||
|
||||
//tile_end_location used on failure
|
||||
ui64 tile_end_location = tile_start_location + sot.get_payload_length();
|
||||
|
||||
ui32 data_left = sot.get_payload_length(); //bytes left to parse
|
||||
data_left -= (ui32)((ui64)file->tell() - tile_start_location);
|
||||
|
||||
if (data_left == 0)
|
||||
return;
|
||||
|
||||
ui32 max_decompositions = 0;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
max_decompositions = ojph_max(max_decompositions,
|
||||
comps[c].get_num_decompositions());
|
||||
|
||||
try
|
||||
{
|
||||
//sequence the reading of precincts according to progression order
|
||||
if (prog_order == OJPH_PO_LRCP || prog_order == OJPH_PO_RLCP)
|
||||
{
|
||||
max_decompositions -= skipped_res_for_read;
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
if (data_left > 0)
|
||||
comps[c].parse_precincts(r, data_left, file);
|
||||
}
|
||||
else if (prog_order == OJPH_PO_RPCL)
|
||||
{
|
||||
max_decompositions -= skipped_res_for_read;
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 comp_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur))
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; comp_num = c; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; comp_num = c; }
|
||||
}
|
||||
if (found == true && data_left > 0)
|
||||
comps[comp_num].parse_one_precinct(r, data_left, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (prog_order == OJPH_PO_PCRL)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 comp_num = 0;
|
||||
ui32 res_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
for (ui32 r = 0; r <= comps[c].get_num_decompositions(); ++r)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur))
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x == smallest.x &&
|
||||
c < comp_num)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x == smallest.x &&
|
||||
c == comp_num && r < res_num)
|
||||
{ smallest = cur; comp_num = c; res_num = r; }
|
||||
}
|
||||
}
|
||||
if (found == true && data_left > 0)
|
||||
comps[comp_num].parse_one_precinct(res_num, data_left, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (prog_order == OJPH_PO_CPRL)
|
||||
{
|
||||
for (ui32 c = 0; c < num_comps; ++c)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
bool found = false;
|
||||
ui32 res_num = 0;
|
||||
point smallest(INT_MAX, INT_MAX), cur;
|
||||
for (ui32 r = 0; r <= max_decompositions; ++r)
|
||||
{
|
||||
if (!comps[c].get_top_left_precinct(r, cur)) //res exist?
|
||||
continue;
|
||||
else
|
||||
found = true;
|
||||
|
||||
if (cur.y < smallest.y)
|
||||
{ smallest = cur; res_num = r; }
|
||||
else if (cur.y == smallest.y && cur.x < smallest.x)
|
||||
{ smallest = cur; res_num = r; }
|
||||
}
|
||||
if (found == true && data_left > 0)
|
||||
comps[c].parse_one_precinct(res_num, data_left, file);
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
assert(0);
|
||||
|
||||
}
|
||||
catch (const char *error)
|
||||
{
|
||||
if (resilient)
|
||||
OJPH_INFO(0x00030092, "%s", error)
|
||||
else
|
||||
OJPH_ERROR(0x00030092, "%s", error)
|
||||
}
|
||||
file->seek((si64)tile_end_location, infile_base::OJPH_SEEK_SET);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_tile.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_TILE_H
|
||||
#define OJPH_TILE_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_file.h"
|
||||
#include "ojph_params_local.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class codestream;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
class tile_comp;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class tile
|
||||
{
|
||||
public:
|
||||
static void pre_alloc(codestream *codestream, const rect& tile_rect,
|
||||
const rect& recon_tile_rect, ui32 &num_tileparts);
|
||||
void finalize_alloc(codestream *codestream, const rect& tile_rect,
|
||||
ui32 tile_idx, ui32& offset, ui32 &num_tileparts);
|
||||
|
||||
bool push(line_buf *line, ui32 comp_num);
|
||||
void prepare_for_flush();
|
||||
void fill_tlm(param_tlm* tlm);
|
||||
void flush(outfile_base *file);
|
||||
void parse_tile_header(const param_sot& sot, infile_base *file,
|
||||
const ui64& tile_start_location);
|
||||
bool pull(line_buf *, ui32 comp_num);
|
||||
rect get_tile_rect() { return tile_rect; }
|
||||
|
||||
private:
|
||||
//codestream *parent;
|
||||
rect tile_rect;
|
||||
ui32 num_comps;
|
||||
tile_comp *comps;
|
||||
ui32 num_lines;
|
||||
line_buf* lines;
|
||||
bool employ_color_transform, resilient;
|
||||
bool *reversible;
|
||||
rect *comp_rects, *recon_comp_rects;
|
||||
ui32 *line_offsets;
|
||||
ui32 skipped_res_for_read;
|
||||
|
||||
ui32 *num_bits;
|
||||
bool *is_signed;
|
||||
ui32 *cur_line;
|
||||
ui8 *nlt_type3;
|
||||
int prog_order;
|
||||
|
||||
private:
|
||||
param_sot sot;
|
||||
int next_tile_part;
|
||||
|
||||
private:
|
||||
int profile;
|
||||
ui32 tilepart_div; // tilepart division value
|
||||
bool need_tlm; // true if tlm markers are needed
|
||||
|
||||
ui32 num_bytes; // number of bytes in this tile
|
||||
// used for tile length
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_TILE_H
|
||||
@@ -0,0 +1,200 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_tile_comp.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
|
||||
#include "ojph_mem.h"
|
||||
#include "ojph_params.h"
|
||||
#include "ojph_codestream_local.h"
|
||||
#include "ojph_tile_comp.h"
|
||||
#include "ojph_resolution.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
namespace local
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::pre_alloc(codestream *codestream, ui32 comp_num,
|
||||
const rect& comp_rect,
|
||||
const rect& recon_comp_rect)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
//allocate a resolution
|
||||
ui32 num_decomps;
|
||||
num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
|
||||
allocator->pre_alloc_obj<resolution>(1);
|
||||
|
||||
resolution::pre_alloc(codestream, comp_rect, recon_comp_rect, comp_num,
|
||||
num_decomps);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::finalize_alloc(codestream *codestream, tile *parent,
|
||||
ui32 comp_num, const rect& comp_rect,
|
||||
const rect& recon_comp_rect)
|
||||
{
|
||||
mem_fixed_allocator* allocator = codestream->get_allocator();
|
||||
|
||||
//allocate a resolution
|
||||
num_decomps = codestream->get_coc(comp_num)->get_num_decompositions();
|
||||
|
||||
comp_downsamp = codestream->get_siz()->get_downsampling(comp_num);
|
||||
this->comp_rect = comp_rect;
|
||||
this->parent_tile = parent;
|
||||
|
||||
this->comp_num = comp_num;
|
||||
this->num_bytes = 0;
|
||||
res = allocator->post_alloc_obj<resolution>(1);
|
||||
res->finalize_alloc(codestream, comp_rect, recon_comp_rect, comp_num,
|
||||
num_decomps, comp_downsamp, comp_downsamp, this,
|
||||
NULL);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
line_buf* tile_comp::get_line()
|
||||
{
|
||||
return res->get_line();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::push_line()
|
||||
{
|
||||
res->push_line();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
line_buf* tile_comp::pull_line()
|
||||
{
|
||||
return res->pull_line();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 tile_comp::prepare_precincts()
|
||||
{
|
||||
this->num_bytes = res->prepare_precinct();
|
||||
return this->num_bytes;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::write_precincts(ui32 res_num, outfile_base *file)
|
||||
{
|
||||
assert(res_num <= num_decomps);
|
||||
res_num = num_decomps - res_num; //how many levels to go down
|
||||
resolution *r = res;
|
||||
while (res_num > 0 && r != NULL)
|
||||
{
|
||||
r = r->next_resolution();
|
||||
--res_num;
|
||||
}
|
||||
if (r) //resolution does not exist if r is NULL
|
||||
r->write_precincts(file);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool tile_comp::get_top_left_precinct(ui32 res_num, point &top_left)
|
||||
{
|
||||
int resolution_num = (int)num_decomps - (int)res_num;
|
||||
resolution *r = res;
|
||||
while (resolution_num > 0 && r != NULL)
|
||||
{
|
||||
r = r->next_resolution();
|
||||
--resolution_num;
|
||||
}
|
||||
if (r) //resolution does not exist if r is NULL
|
||||
return r->get_top_left_precinct(top_left);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::write_one_precinct(ui32 res_num, outfile_base *file)
|
||||
{
|
||||
int resolution_num = (int)num_decomps - (int)res_num;
|
||||
resolution *r = res;
|
||||
while (resolution_num > 0 && r != NULL)
|
||||
{
|
||||
r = r->next_resolution();
|
||||
--resolution_num;
|
||||
}
|
||||
if (r) //resolution does not exist if r is NULL
|
||||
r->write_one_precinct(file);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::parse_precincts(ui32 res_num, ui32& data_left,
|
||||
infile_base *file)
|
||||
{
|
||||
assert(res_num <= num_decomps);
|
||||
res_num = num_decomps - res_num; //how many levels to go down
|
||||
resolution *r = res;
|
||||
while (res_num > 0 && r != NULL)
|
||||
{
|
||||
r = r->next_resolution();
|
||||
--res_num;
|
||||
}
|
||||
if (r) //resolution does not exist if r is NULL
|
||||
r->parse_all_precincts(data_left, file);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void tile_comp::parse_one_precinct(ui32 res_num, ui32& data_left,
|
||||
infile_base *file)
|
||||
{
|
||||
assert(res_num <= num_decomps);
|
||||
res_num = num_decomps - res_num;
|
||||
resolution *r = res;
|
||||
while (res_num > 0 && r != NULL)
|
||||
{
|
||||
r = r->next_resolution();
|
||||
--res_num;
|
||||
}
|
||||
if (r) //resolution does not exist if r is NULL
|
||||
r->parse_one_precinct(data_left, file);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
ui32 tile_comp::get_num_bytes(ui32 resolution_num) const
|
||||
{
|
||||
return res->get_num_bytes(resolution_num);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_tile_comp.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_TILE_COMP_H
|
||||
#define OJPH_TILE_COMP_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
#include "ojph_base.h"
|
||||
#include "ojph_file.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//defined elsewhere
|
||||
class line_buf;
|
||||
class codestream;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//defined here
|
||||
class tile;
|
||||
class resolution;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class tile_comp
|
||||
{
|
||||
public:
|
||||
static void pre_alloc(codestream *codestream, ui32 comp_num,
|
||||
const rect& comp_rect,
|
||||
const rect& recon_comp_rect);
|
||||
void finalize_alloc(codestream *codestream, tile *parent,
|
||||
ui32 comp_num, const rect& comp_rect,
|
||||
const rect& recon_comp_rect);
|
||||
|
||||
ui32 get_num_resolutions() { return num_decomps + 1; }
|
||||
ui32 get_num_decompositions() { return num_decomps; }
|
||||
tile* get_tile() { return parent_tile; }
|
||||
line_buf* get_line();
|
||||
void push_line();
|
||||
line_buf* pull_line();
|
||||
|
||||
ui32 prepare_precincts();
|
||||
void write_precincts(ui32 res_num, outfile_base *file);
|
||||
bool get_top_left_precinct(ui32 res_num, point &top_left);
|
||||
void write_one_precinct(ui32 res_num, outfile_base *file);
|
||||
void parse_precincts(ui32 res_num, ui32& data_left, infile_base *file);
|
||||
void parse_one_precinct(ui32 res_num, ui32& data_left,
|
||||
infile_base *file);
|
||||
|
||||
ui32 get_num_bytes() const { return num_bytes; }
|
||||
ui32 get_num_bytes(ui32 resolution_num) const;
|
||||
|
||||
private:
|
||||
tile *parent_tile;
|
||||
resolution *res;
|
||||
rect comp_rect;
|
||||
ojph::point comp_downsamp;
|
||||
ui32 num_decomps;
|
||||
ui32 comp_num;
|
||||
ui32 num_bytes; // number of bytes in this tile component
|
||||
// used for tilepart length
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_TILE_COMP_H
|
||||
@@ -0,0 +1,345 @@
|
||||
/***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_block_common.cpp
|
||||
// Author: Aous Naman
|
||||
// Date: 13 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include "ojph_block_common.h"
|
||||
|
||||
//***************************************************************************/
|
||||
/** @file ojph_block_common.cpp
|
||||
* @brief defines tables used for decoding HTJ2K blocks
|
||||
*/
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//************************************************************************/
|
||||
/** @defgroup vlc_decoding_tables_grp VLC decoding tables
|
||||
* @{
|
||||
* VLC decoding tables used in decoding VLC codewords to these fields: \n
|
||||
* \li \c cwd_len : 3bits -> the codeword length of the VLC codeword;
|
||||
* the VLC cwd is in the LSB of bitstream \n
|
||||
* \li \c u_off : 1bit -> u_offset, which is 1 if u value is not 0 \n
|
||||
* \li \c rho : 4bits -> significant samples within a quad \n
|
||||
* \li \c e_1 : 4bits -> EMB e_1 \n
|
||||
* \li \c e_k : 4bits -> EMB e_k \n
|
||||
* \n
|
||||
* The table index is 10 bits and composed of two parts: \n
|
||||
* The 7 LSBs contain a codeword which might be shorter than 7 bits;
|
||||
* this word is the next decodable bits in the bitstream. \n
|
||||
* The 3 MSB is the context of for the codeword. \n
|
||||
*/
|
||||
|
||||
/// @brief vlc_tbl0 contains decoding information for initial row of quads
|
||||
ui16 vlc_tbl0[1024] = { 0 };
|
||||
/// @brief vlc_tbl1 contains decoding information for non-initial row of
|
||||
/// quads
|
||||
ui16 vlc_tbl1[1024] = { 0 };
|
||||
/// @}
|
||||
|
||||
//************************************************************************/
|
||||
/** @defgroup uvlc_decoding_tables_grp VLC decoding tables
|
||||
* @{
|
||||
* UVLC decoding tables used to partially decode u values from UVLC
|
||||
* codewords. \n
|
||||
* The table index is 8 (or 9) bits and composed of two parts: \n
|
||||
* The 6 LSBs carries the head of the VLC to be decoded. Up to 6 bits to
|
||||
* be used; these are uvlc prefix code for quad 0 and 1 \n
|
||||
* The 2 (or 3) MSBs contain u_off of quad 0 + 2 * o_off quad 1
|
||||
* + 4 * mel event for initial row of quads when needed \n
|
||||
* \n
|
||||
* Each entry contains, starting from the LSB \n
|
||||
* \li \c total total prefix length for quads 0 and 1 (3 bits) \n
|
||||
* \li \c total total suffix length for quads 0 and 1 (4 bits) \n
|
||||
* \li \c suffix length for quad 0 (3 bits) \n
|
||||
* \li \c prefix for quad 0 (3 bits) \n
|
||||
* \li \c prefix for quad 1 (3 bits) \n
|
||||
* \n
|
||||
* Another table is uvlc_bias, which is needed to correctly decode the
|
||||
* extension u_ext for initial row of quads. Under certain condition,
|
||||
* we deduct 1 or 2 from u_q0 and u_q1 before encoding them; so for us
|
||||
* to know that decoding u_ext is needed, we recreate the u_q0 and u_q1
|
||||
* that we actually encoded. \n
|
||||
* For simplicity, we use the same index as before \n
|
||||
* \li \c u_q0 bias is 2 bits \n
|
||||
* \li \c u_q1 bias is 2 bits \n
|
||||
*/
|
||||
|
||||
/// @brief uvlc_tbl0 contains decoding information for initial row of quads
|
||||
ui16 uvlc_tbl0[256+64] = { 0 };
|
||||
/// @brief uvlc_tbl1 contains decoding information for non-initial row of
|
||||
/// quads
|
||||
ui16 uvlc_tbl1[256] = { 0 };
|
||||
/// @brief uvlc_bias contains decoding info. for initial row of quads
|
||||
ui8 uvlc_bias[256+64] = { 0 };
|
||||
/// @}
|
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup vlc_decoding_tables_grp
|
||||
* @brief Initializes vlc_tbl0 and vlc_tbl1 tables, from table0.h and
|
||||
* table1.h
|
||||
*/
|
||||
static bool vlc_init_tables()
|
||||
{
|
||||
const bool debug = false; //useful for checking
|
||||
|
||||
//Data in the table is arranged in this format (taken from the standard)
|
||||
// c_q is the context for a quad
|
||||
// rho is the significance pattern for a quad
|
||||
// u_off indicate if u value is 0 (u_off is 0), or communicated
|
||||
// e_k, e_1 EMB patterns
|
||||
// cwd VLC codeword
|
||||
// cwd VLC codeword length
|
||||
struct vlc_src_table { int c_q, rho, u_off, e_k, e_1, cwd, cwd_len; };
|
||||
// initial quad rows
|
||||
vlc_src_table tbl0[] = {
|
||||
#include "table0.h"
|
||||
};
|
||||
// number of entries in the table
|
||||
size_t tbl0_size = sizeof(tbl0) / sizeof(vlc_src_table);
|
||||
|
||||
// nono-initial quad rows
|
||||
vlc_src_table tbl1[] = {
|
||||
#include "table1.h"
|
||||
};
|
||||
// number of entries in the table
|
||||
size_t tbl1_size = sizeof(tbl1) / sizeof(vlc_src_table);
|
||||
|
||||
if (debug) memset(vlc_tbl0, 0, sizeof(vlc_tbl0)); //unnecessary
|
||||
|
||||
// this is to convert table entries into values for decoder look up
|
||||
// There can be at most 1024 possibilities, not all of them are valid.
|
||||
//
|
||||
for (int i = 0; i < 1024; ++i)
|
||||
{
|
||||
int cwd = i & 0x7F; // from i extract codeword
|
||||
int c_q = i >> 7; // from i extract context
|
||||
// See if this case exist in the table, if so then set the entry in
|
||||
// vlc_tbl0
|
||||
for (size_t j = 0; j < tbl0_size; ++j)
|
||||
if (tbl0[j].c_q == c_q) // this is an and operation
|
||||
if (tbl0[j].cwd == (cwd & ((1 << tbl0[j].cwd_len) - 1)))
|
||||
{
|
||||
if (debug) assert(vlc_tbl0[i] == 0);
|
||||
// Put this entry into the table
|
||||
vlc_tbl0[i] = (ui16)((tbl0[j].rho << 4) | (tbl0[j].u_off << 3)
|
||||
| (tbl0[j].e_k << 12) | (tbl0[j].e_1 << 8) | tbl0[j].cwd_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (debug) memset(vlc_tbl1, 0, sizeof(vlc_tbl1)); //unnecessary
|
||||
|
||||
// this the same as above but for non-initial rows
|
||||
for (int i = 0; i < 1024; ++i)
|
||||
{
|
||||
int cwd = i & 0x7F; //7 bits
|
||||
int c_q = i >> 7;
|
||||
for (size_t j = 0; j < tbl1_size; ++j)
|
||||
if (tbl1[j].c_q == c_q) // this is an and operation
|
||||
if (tbl1[j].cwd == (cwd & ((1 << tbl1[j].cwd_len) - 1)))
|
||||
{
|
||||
if (debug) assert(vlc_tbl1[i] == 0);
|
||||
vlc_tbl1[i] = (ui16)((tbl1[j].rho << 4) | (tbl1[j].u_off << 3)
|
||||
| (tbl1[j].e_k << 12) | (tbl1[j].e_1 << 8) | tbl1[j].cwd_len);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup uvlc_decoding_tables_grp
|
||||
* @brief Initializes uvlc_tbl0 and uvlc_tbl1 tables
|
||||
*/
|
||||
static bool uvlc_init_tables()
|
||||
{
|
||||
// table stores possible decoding three bits from vlc
|
||||
// there are 8 entries for xx1, x10, 100, 000, where x means do not
|
||||
// care table value is made up of
|
||||
// 2 bits in the LSB for prefix length
|
||||
// 3 bits for suffix length
|
||||
// 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
|
||||
static const ui8 dec[8] = { // the index is the prefix codeword
|
||||
3 | (5 << 2) | (5 << 5), //000 == 000, prefix codeword "000"
|
||||
1 | (0 << 2) | (1 << 5), //001 == xx1, prefix codeword "1"
|
||||
2 | (0 << 2) | (2 << 5), //010 == x10, prefix codeword "01"
|
||||
1 | (0 << 2) | (1 << 5), //011 == xx1, prefix codeword "1"
|
||||
3 | (1 << 2) | (3 << 5), //100 == 100, prefix codeword "001"
|
||||
1 | (0 << 2) | (1 << 5), //101 == xx1, prefix codeword "1"
|
||||
2 | (0 << 2) | (2 << 5), //110 == x10, prefix codeword "01"
|
||||
1 | (0 << 2) | (1 << 5) //111 == xx1, prefix codeword "1"
|
||||
};
|
||||
|
||||
for (ui32 i = 0; i < 256 + 64; ++i)
|
||||
{
|
||||
ui32 mode = i >> 6;
|
||||
ui32 vlc = i & 0x3F;
|
||||
|
||||
if (mode == 0) { // both u_off are 0
|
||||
uvlc_tbl0[i] = 0;
|
||||
uvlc_bias[i] = 0;
|
||||
}
|
||||
else if (mode <= 2) // u_off are either 01 or 10
|
||||
{
|
||||
ui32 d = dec[vlc & 0x7]; //look at the least significant 3 bits
|
||||
|
||||
ui32 total_prefix = d & 0x3;
|
||||
ui32 total_suffix = (d >> 2) & 0x7;
|
||||
ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
|
||||
ui32 u0 = (mode == 1) ? (d >> 5) : 0;
|
||||
ui32 u1 = (mode == 1) ? 0 : (d >> 5);
|
||||
|
||||
uvlc_tbl0[i] = (ui16)(total_prefix |
|
||||
(total_suffix << 3) |
|
||||
(u0_suffix_len << 7) |
|
||||
(u0 << 10) |
|
||||
(u1 << 13));
|
||||
|
||||
}
|
||||
else if (mode == 3) // both u_off are 1, and MEL event is 0
|
||||
{
|
||||
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
vlc >>= d0 & 0x3; // Consume bits
|
||||
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
|
||||
ui32 total_prefix, u0_suffix_len, total_suffix, u0, u1;
|
||||
if ((d0 & 0x3) == 3)
|
||||
{
|
||||
total_prefix = (d0 & 0x3) + 1;
|
||||
u0_suffix_len = (d0 >> 2) & 0x7;
|
||||
total_suffix = u0_suffix_len;
|
||||
u0 = d0 >> 5;
|
||||
u1 = (vlc & 1) + 1;
|
||||
uvlc_bias[i] = 4; // 0b00 for u0 and 0b01 for u1
|
||||
}
|
||||
else
|
||||
{
|
||||
total_prefix = (d0 & 0x3) + (d1 & 0x3);
|
||||
u0_suffix_len = (d0 >> 2) & 0x7;
|
||||
total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
|
||||
u0 = d0 >> 5;
|
||||
u1 = d1 >> 5;
|
||||
uvlc_bias[i] = 0;
|
||||
}
|
||||
|
||||
uvlc_tbl0[i] = (ui16)(total_prefix |
|
||||
(total_suffix << 3) |
|
||||
(u0_suffix_len << 7) |
|
||||
(u0 << 10) |
|
||||
(u1 << 13));
|
||||
}
|
||||
else if (mode == 4) // both u_off are 1, and MEL event is 1
|
||||
{
|
||||
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
vlc >>= d0 & 0x3; // Consume bits
|
||||
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
|
||||
ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
|
||||
ui32 u0_suffix_len = (d0 >> 2) & 0x7;
|
||||
ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
|
||||
ui32 u0 = (d0 >> 5) + 2;
|
||||
ui32 u1 = (d1 >> 5) + 2;
|
||||
|
||||
uvlc_tbl0[i] = (ui16)(total_prefix |
|
||||
(total_suffix << 3) |
|
||||
(u0_suffix_len << 7) |
|
||||
(u0 << 10) |
|
||||
(u1 << 13));
|
||||
uvlc_bias[i] = 10; // 0b10 for u0 and 0b10 for u1
|
||||
}
|
||||
}
|
||||
|
||||
for (ui32 i = 0; i < 256; ++i)
|
||||
{
|
||||
ui32 mode = i >> 6;
|
||||
ui32 vlc = i & 0x3F;
|
||||
|
||||
if (mode == 0) // both u_off are 0
|
||||
uvlc_tbl1[i] = 0;
|
||||
else if (mode <= 2) // u_off are either 01 or 10
|
||||
{
|
||||
ui32 d = dec[vlc & 0x7]; // look at the 3 LSB bits
|
||||
|
||||
ui32 total_prefix = d & 0x3;
|
||||
ui32 total_suffix = (d >> 2) & 0x7;
|
||||
ui32 u0_suffix_len = (mode == 1) ? total_suffix : 0;
|
||||
ui32 u0 = (mode == 1) ? (d >> 5) : 0;
|
||||
ui32 u1 = (mode == 1) ? 0 : (d >> 5);
|
||||
|
||||
uvlc_tbl1[i] = (ui16)(total_prefix |
|
||||
(total_suffix << 3) |
|
||||
(u0_suffix_len << 7) |
|
||||
(u0 << 10) |
|
||||
(u1 << 13));
|
||||
}
|
||||
else if (mode == 3) // both u_off are 1
|
||||
{
|
||||
ui32 d0 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
vlc >>= d0 & 0x3; // Consume bits
|
||||
ui32 d1 = dec[vlc & 0x7]; // LSBs of VLC are prefix codeword
|
||||
|
||||
ui32 total_prefix = (d0 & 0x3) + (d1 & 0x3);
|
||||
ui32 u0_suffix_len = (d0 >> 2) & 0x7;
|
||||
ui32 total_suffix = u0_suffix_len + ((d1 >> 2) & 0x7);
|
||||
ui32 u0 = d0 >> 5;
|
||||
ui32 u1 = d1 >> 5;
|
||||
|
||||
uvlc_tbl1[i] = (ui16)(total_prefix |
|
||||
(total_suffix << 3) |
|
||||
(u0_suffix_len << 7) |
|
||||
(u0 << 10) |
|
||||
(u1 << 13));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup vlc_decoding_tables_grp
|
||||
* @brief Initializes VLC tables vlc_tbl0 and vlc_tbl1
|
||||
*/
|
||||
static bool vlc_tables_initialized = vlc_init_tables();
|
||||
|
||||
//************************************************************************/
|
||||
/** @ingroup uvlc_decoding_tables_grp
|
||||
* @brief Initializes UVLC tables uvlc_tbl0 and uvlc_tbl1
|
||||
*/
|
||||
static bool uvlc_tables_initialized = uvlc_init_tables();
|
||||
|
||||
} // !namespace local
|
||||
} // !namespace ojph
|
||||
@@ -0,0 +1,49 @@
|
||||
/***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2022, Aous Naman
|
||||
// Copyright (c) 2022, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2022, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_block_common.h
|
||||
// Author: Aous Naman
|
||||
// Date: 13 May 2022
|
||||
//***************************************************************************/
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph{
|
||||
namespace local {
|
||||
|
||||
extern ui16 vlc_tbl0[1024];
|
||||
extern ui16 vlc_tbl1[1024];
|
||||
extern ui16 uvlc_tbl0[256+64];
|
||||
extern ui16 uvlc_tbl1[256];
|
||||
extern ui8 uvlc_bias[256+64];
|
||||
} // !namespace local
|
||||
} // !namespace ojph
|
||||
@@ -0,0 +1,83 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_block_decoder.h
|
||||
// Author: Aous Naman
|
||||
// Date: 28 August 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_BLOCK_DECODER_H
|
||||
#define OJPH_BLOCK_DECODER_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//decodes the cleanup pass, significance propagation pass,
|
||||
// and magnitude refinement pass
|
||||
|
||||
// generic decoder
|
||||
bool
|
||||
ojph_decode_codeblock32(ui8* coded_data, ui32* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
bool
|
||||
ojph_decode_codeblock64(ui8* coded_data, ui64* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
// SSSE3-accelerated decoder
|
||||
bool
|
||||
ojph_decode_codeblock_ssse3(ui8* coded_data, ui32* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
// AVX2-accelerated decoder
|
||||
bool
|
||||
ojph_decode_codeblock_avx2(ui8* coded_data, ui32* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
// WASM SIMD-accelerated decoder
|
||||
bool
|
||||
ojph_decode_codeblock_wasm(ui8* coded_data, ui32* decoded_data,
|
||||
ui32 missing_msbs, ui32 num_passes, ui32 lengths1, ui32 lengths2,
|
||||
ui32 width, ui32 height, ui32 stride, bool stripe_causal);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_BLOCK_DECODER_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1523
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,88 @@
|
||||
//***************************************************************************/
|
||||
// This software is released under the 2-Clause BSD license, included
|
||||
// below.
|
||||
//
|
||||
// Copyright (c) 2019, Aous Naman
|
||||
// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
|
||||
// Copyright (c) 2019, The University of New South Wales, Australia
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// 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.
|
||||
//***************************************************************************/
|
||||
// This file is part of the OpenJPH software implementation.
|
||||
// File: ojph_block_encoder.h
|
||||
// Author: Aous Naman
|
||||
// Date: 17 September 2019
|
||||
//***************************************************************************/
|
||||
|
||||
|
||||
#ifndef OJPH_BLOCK_ENCODER_H
|
||||
#define OJPH_BLOCK_ENCODER_H
|
||||
|
||||
#include "ojph_defs.h"
|
||||
|
||||
namespace ojph {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// defined elsewhere
|
||||
class mem_elastic_allocator;
|
||||
struct coded_lists;
|
||||
|
||||
namespace local {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void
|
||||
ojph_encode_codeblock32(ui32* buf, ui32 missing_msbs, ui32 num_passes,
|
||||
ui32 width, ui32 height, ui32 stride,
|
||||
ui32* lengths,
|
||||
ojph::mem_elastic_allocator *elastic,
|
||||
ojph::coded_lists *& coded);
|
||||
|
||||
void
|
||||
ojph_encode_codeblock64(ui64* buf, ui32 missing_msbs, ui32 num_passes,
|
||||
ui32 width, ui32 height, ui32 stride,
|
||||
ui32* lengths,
|
||||
ojph::mem_elastic_allocator *elastic,
|
||||
ojph::coded_lists *& coded);
|
||||
|
||||
void
|
||||
ojph_encode_codeblock_avx2(ui32* buf, ui32 missing_msbs,
|
||||
ui32 num_passes, ui32 width, ui32 height,
|
||||
ui32 stride, ui32* lengths,
|
||||
ojph::mem_elastic_allocator* elastic,
|
||||
ojph::coded_lists*& coded);
|
||||
|
||||
void
|
||||
ojph_encode_codeblock_avx512(ui32* buf, ui32 missing_msbs,
|
||||
ui32 num_passes, ui32 width, ui32 height,
|
||||
ui32 stride, ui32* lengths,
|
||||
ojph::mem_elastic_allocator *elastic,
|
||||
ojph::coded_lists *& coded);
|
||||
|
||||
bool initialize_block_encoder_tables();
|
||||
bool initialize_block_encoder_tables_avx2();
|
||||
bool initialize_block_encoder_tables_avx512();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !OJPH_BLOCK_ENCODER_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+444
@@ -0,0 +1,444 @@
|
||||
{0, 0x1, 0x0, 0x0, 0x0, 0x06, 4},
|
||||
{0, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
|
||||
{0, 0x2, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{0, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
|
||||
{0, 0x3, 0x0, 0x0, 0x0, 0x11, 5},
|
||||
{0, 0x3, 0x1, 0x2, 0x2, 0x5F, 7},
|
||||
{0, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
|
||||
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
|
||||
{0, 0x4, 0x1, 0x4, 0x4, 0x13, 6},
|
||||
{0, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
|
||||
{0, 0x5, 0x1, 0x4, 0x4, 0x23, 6},
|
||||
{0, 0x5, 0x1, 0x5, 0x1, 0x0F, 7},
|
||||
{0, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{0, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
|
||||
{0, 0x7, 0x0, 0x0, 0x0, 0x2F, 7},
|
||||
{0, 0x7, 0x1, 0x2, 0x2, 0x4F, 7},
|
||||
{0, 0x7, 0x1, 0x2, 0x0, 0x0D, 6},
|
||||
{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
|
||||
{0, 0x8, 0x1, 0x8, 0x8, 0x3D, 6},
|
||||
{0, 0x9, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{0, 0x9, 0x1, 0x0, 0x0, 0x2D, 6},
|
||||
{0, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
|
||||
{0, 0xA, 0x1, 0x8, 0x8, 0x35, 6},
|
||||
{0, 0xA, 0x1, 0xA, 0x2, 0x77, 7},
|
||||
{0, 0xB, 0x0, 0x0, 0x0, 0x37, 7},
|
||||
{0, 0xB, 0x1, 0x1, 0x1, 0x57, 7},
|
||||
{0, 0xB, 0x1, 0x1, 0x0, 0x09, 6},
|
||||
{0, 0xC, 0x0, 0x0, 0x0, 0x1E, 5},
|
||||
{0, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
|
||||
{0, 0xC, 0x1, 0xC, 0x4, 0x15, 6},
|
||||
{0, 0xC, 0x1, 0xC, 0x8, 0x25, 6},
|
||||
{0, 0xD, 0x0, 0x0, 0x0, 0x67, 7},
|
||||
{0, 0xD, 0x1, 0x1, 0x1, 0x27, 7},
|
||||
{0, 0xD, 0x1, 0x5, 0x4, 0x47, 7},
|
||||
{0, 0xD, 0x1, 0xD, 0x8, 0x07, 7},
|
||||
{0, 0xE, 0x0, 0x0, 0x0, 0x7B, 7},
|
||||
{0, 0xE, 0x1, 0x2, 0x2, 0x4B, 7},
|
||||
{0, 0xE, 0x1, 0xA, 0x8, 0x05, 6},
|
||||
{0, 0xE, 0x1, 0xE, 0x4, 0x3B, 7},
|
||||
{0, 0xF, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{0, 0xF, 0x1, 0x9, 0x9, 0x1B, 7},
|
||||
{0, 0xF, 0x1, 0xB, 0xA, 0x6B, 7},
|
||||
{0, 0xF, 0x1, 0xF, 0xC, 0x2B, 7},
|
||||
{0, 0xF, 0x1, 0xF, 0x8, 0x39, 6},
|
||||
{0, 0xF, 0x1, 0xE, 0x6, 0x73, 7},
|
||||
{0, 0xF, 0x1, 0xE, 0x2, 0x19, 6},
|
||||
{0, 0xF, 0x1, 0xF, 0x5, 0x0B, 7},
|
||||
{0, 0xF, 0x1, 0xF, 0x4, 0x29, 6},
|
||||
{0, 0xF, 0x1, 0xF, 0x1, 0x33, 7},
|
||||
{1, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
|
||||
{1, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
|
||||
{1, 0x1, 0x1, 0x1, 0x1, 0x1F, 7},
|
||||
{1, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
|
||||
{1, 0x2, 0x1, 0x2, 0x2, 0x3B, 6},
|
||||
{1, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
|
||||
{1, 0x3, 0x1, 0x0, 0x0, 0x3D, 6},
|
||||
{1, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
|
||||
{1, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
|
||||
{1, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
|
||||
{1, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
|
||||
{1, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
|
||||
{1, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
|
||||
{1, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
|
||||
{1, 0x7, 0x0, 0x0, 0x0, 0x3F, 7},
|
||||
{1, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
|
||||
{1, 0x7, 0x1, 0x2, 0x0, 0x03, 6},
|
||||
{1, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{1, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
|
||||
{1, 0x9, 0x0, 0x0, 0x0, 0x2D, 6},
|
||||
{1, 0x9, 0x1, 0x0, 0x0, 0x0D, 6},
|
||||
{1, 0xA, 0x0, 0x0, 0x0, 0x35, 6},
|
||||
{1, 0xA, 0x1, 0x8, 0x8, 0x15, 6},
|
||||
{1, 0xA, 0x1, 0xA, 0x2, 0x6F, 7},
|
||||
{1, 0xB, 0x0, 0x0, 0x0, 0x2F, 7},
|
||||
{1, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
|
||||
{1, 0xB, 0x1, 0x1, 0x0, 0x11, 6},
|
||||
{1, 0xC, 0x0, 0x0, 0x0, 0x01, 5},
|
||||
{1, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
|
||||
{1, 0xC, 0x1, 0xC, 0x4, 0x05, 6},
|
||||
{1, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
|
||||
{1, 0xD, 0x1, 0x1, 0x1, 0x17, 7},
|
||||
{1, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
|
||||
{1, 0xD, 0x1, 0xD, 0x8, 0x77, 7},
|
||||
{1, 0xE, 0x0, 0x0, 0x0, 0x37, 7},
|
||||
{1, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
|
||||
{1, 0xE, 0x1, 0xA, 0x8, 0x19, 6},
|
||||
{1, 0xE, 0x1, 0xE, 0x4, 0x67, 7},
|
||||
{1, 0xF, 0x0, 0x0, 0x0, 0x07, 7},
|
||||
{1, 0xF, 0x1, 0xB, 0x8, 0x29, 6},
|
||||
{1, 0xF, 0x1, 0x8, 0x8, 0x27, 7},
|
||||
{1, 0xF, 0x1, 0xA, 0x2, 0x09, 6},
|
||||
{1, 0xF, 0x1, 0xE, 0x4, 0x31, 6},
|
||||
{1, 0xF, 0x1, 0xF, 0x1, 0x47, 7},
|
||||
{2, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
|
||||
{2, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
|
||||
{2, 0x1, 0x1, 0x1, 0x1, 0x1B, 6},
|
||||
{2, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
|
||||
{2, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{2, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
|
||||
{2, 0x3, 0x1, 0x1, 0x1, 0x33, 6},
|
||||
{2, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
|
||||
{2, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
|
||||
{2, 0x4, 0x1, 0x4, 0x4, 0x0B, 6},
|
||||
{2, 0x5, 0x0, 0x0, 0x0, 0x01, 5},
|
||||
{2, 0x5, 0x1, 0x5, 0x5, 0x2F, 7},
|
||||
{2, 0x5, 0x1, 0x5, 0x1, 0x13, 6},
|
||||
{2, 0x5, 0x1, 0x5, 0x4, 0x23, 6},
|
||||
{2, 0x6, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{2, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
|
||||
{2, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
|
||||
{2, 0x7, 0x1, 0x2, 0x2, 0x6F, 7},
|
||||
{2, 0x7, 0x1, 0x3, 0x1, 0x11, 6},
|
||||
{2, 0x7, 0x1, 0x7, 0x4, 0x37, 7},
|
||||
{2, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{2, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
|
||||
{2, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
|
||||
{2, 0x9, 0x1, 0x0, 0x0, 0x1D, 6},
|
||||
{2, 0xA, 0x0, 0x0, 0x0, 0x2D, 6},
|
||||
{2, 0xA, 0x1, 0x0, 0x0, 0x0D, 6},
|
||||
{2, 0xB, 0x0, 0x0, 0x0, 0x0F, 7},
|
||||
{2, 0xB, 0x1, 0x2, 0x2, 0x77, 7},
|
||||
{2, 0xB, 0x1, 0x2, 0x0, 0x35, 6},
|
||||
{2, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{2, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
|
||||
{2, 0xC, 0x1, 0xC, 0x8, 0x57, 7},
|
||||
{2, 0xD, 0x0, 0x0, 0x0, 0x17, 7},
|
||||
{2, 0xD, 0x1, 0x8, 0x8, 0x05, 6},
|
||||
{2, 0xD, 0x1, 0xC, 0x4, 0x39, 6},
|
||||
{2, 0xD, 0x1, 0xD, 0x1, 0x67, 7},
|
||||
{2, 0xE, 0x0, 0x0, 0x0, 0x27, 7},
|
||||
{2, 0xE, 0x1, 0x2, 0x2, 0x7B, 7},
|
||||
{2, 0xE, 0x1, 0x2, 0x0, 0x19, 6},
|
||||
{2, 0xF, 0x0, 0x0, 0x0, 0x47, 7},
|
||||
{2, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
|
||||
{2, 0xF, 0x1, 0x1, 0x1, 0x09, 6},
|
||||
{2, 0xF, 0x1, 0x3, 0x2, 0x07, 7},
|
||||
{2, 0xF, 0x1, 0x7, 0x4, 0x31, 6},
|
||||
{2, 0xF, 0x1, 0xF, 0x8, 0x3B, 7},
|
||||
{3, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{3, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
|
||||
{3, 0x1, 0x1, 0x1, 0x1, 0x3D, 6},
|
||||
{3, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
|
||||
{3, 0x2, 0x1, 0x2, 0x2, 0x4F, 7},
|
||||
{3, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{3, 0x3, 0x1, 0x1, 0x1, 0x05, 6},
|
||||
{3, 0x3, 0x1, 0x3, 0x2, 0x7F, 7},
|
||||
{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
|
||||
{3, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
|
||||
{3, 0x5, 0x0, 0x0, 0x0, 0x06, 5},
|
||||
{3, 0x5, 0x1, 0x5, 0x5, 0x1A, 5},
|
||||
{3, 0x5, 0x1, 0x5, 0x1, 0x0D, 6},
|
||||
{3, 0x5, 0x1, 0x5, 0x4, 0x35, 6},
|
||||
{3, 0x6, 0x0, 0x0, 0x0, 0x3F, 7},
|
||||
{3, 0x6, 0x1, 0x4, 0x4, 0x5F, 7},
|
||||
{3, 0x6, 0x1, 0x6, 0x2, 0x1F, 7},
|
||||
{3, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
|
||||
{3, 0x7, 0x1, 0x6, 0x6, 0x2F, 7},
|
||||
{3, 0x7, 0x1, 0x6, 0x4, 0x15, 6},
|
||||
{3, 0x7, 0x1, 0x7, 0x3, 0x77, 7},
|
||||
{3, 0x7, 0x1, 0x7, 0x1, 0x25, 6},
|
||||
{3, 0x7, 0x1, 0x7, 0x2, 0x0F, 7},
|
||||
{3, 0x8, 0x0, 0x0, 0x0, 0x0A, 5},
|
||||
{3, 0x8, 0x1, 0x8, 0x8, 0x07, 7},
|
||||
{3, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
|
||||
{3, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
|
||||
{3, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
|
||||
{3, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
|
||||
{3, 0xA, 0x1, 0x8, 0x8, 0x29, 6},
|
||||
{3, 0xA, 0x1, 0xA, 0x2, 0x17, 7},
|
||||
{3, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
|
||||
{3, 0xB, 0x1, 0xB, 0x1, 0x27, 7},
|
||||
{3, 0xB, 0x1, 0x1, 0x1, 0x47, 7},
|
||||
{3, 0xB, 0x1, 0x3, 0x2, 0x09, 6},
|
||||
{3, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
|
||||
{3, 0xC, 0x0, 0x0, 0x0, 0x31, 6},
|
||||
{3, 0xC, 0x1, 0x4, 0x4, 0x11, 6},
|
||||
{3, 0xC, 0x1, 0xC, 0x8, 0x3B, 7},
|
||||
{3, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{3, 0xD, 0x1, 0x9, 0x9, 0x1B, 7},
|
||||
{3, 0xD, 0x1, 0xD, 0x5, 0x2B, 7},
|
||||
{3, 0xD, 0x1, 0xD, 0x1, 0x21, 6},
|
||||
{3, 0xD, 0x1, 0xD, 0xC, 0x6B, 7},
|
||||
{3, 0xD, 0x1, 0xD, 0x4, 0x01, 6},
|
||||
{3, 0xD, 0x1, 0xD, 0x8, 0x4B, 7},
|
||||
{3, 0xE, 0x0, 0x0, 0x0, 0x0B, 7},
|
||||
{3, 0xE, 0x1, 0xE, 0x4, 0x73, 7},
|
||||
{3, 0xE, 0x1, 0x4, 0x4, 0x13, 7},
|
||||
{3, 0xE, 0x1, 0xC, 0x8, 0x3E, 6},
|
||||
{3, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
|
||||
{3, 0xF, 0x0, 0x0, 0x0, 0x53, 7},
|
||||
{3, 0xF, 0x1, 0xA, 0xA, 0x0E, 6},
|
||||
{3, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0xC, 0x03, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
|
||||
{3, 0xF, 0x1, 0xE, 0x6, 0x23, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x5, 0x1E, 6},
|
||||
{3, 0xF, 0x1, 0xF, 0x4, 0x02, 5},
|
||||
{3, 0xF, 0x1, 0xF, 0x3, 0x43, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
|
||||
{3, 0xF, 0x1, 0xF, 0x2, 0x2E, 6},
|
||||
{4, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
|
||||
{4, 0x1, 0x0, 0x0, 0x0, 0x0E, 4},
|
||||
{4, 0x1, 0x1, 0x1, 0x1, 0x3F, 7},
|
||||
{4, 0x2, 0x0, 0x0, 0x0, 0x06, 4},
|
||||
{4, 0x2, 0x1, 0x2, 0x2, 0x1B, 6},
|
||||
{4, 0x3, 0x0, 0x0, 0x0, 0x2B, 6},
|
||||
{4, 0x3, 0x1, 0x2, 0x2, 0x3D, 6},
|
||||
{4, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
|
||||
{4, 0x4, 0x0, 0x0, 0x0, 0x0A, 4},
|
||||
{4, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
|
||||
{4, 0x5, 0x0, 0x0, 0x0, 0x0B, 6},
|
||||
{4, 0x5, 0x1, 0x0, 0x0, 0x33, 6},
|
||||
{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
|
||||
{4, 0x6, 0x1, 0x0, 0x0, 0x23, 6},
|
||||
{4, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
|
||||
{4, 0x7, 0x1, 0x4, 0x4, 0x6F, 7},
|
||||
{4, 0x7, 0x1, 0x4, 0x0, 0x03, 6},
|
||||
{4, 0x8, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{4, 0x8, 0x1, 0x8, 0x8, 0x1D, 6},
|
||||
{4, 0x9, 0x0, 0x0, 0x0, 0x11, 6},
|
||||
{4, 0x9, 0x1, 0x0, 0x0, 0x77, 7},
|
||||
{4, 0xA, 0x0, 0x0, 0x0, 0x01, 5},
|
||||
{4, 0xA, 0x1, 0xA, 0xA, 0x2F, 7},
|
||||
{4, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
|
||||
{4, 0xA, 0x1, 0xA, 0x8, 0x0D, 6},
|
||||
{4, 0xB, 0x0, 0x0, 0x0, 0x4F, 7},
|
||||
{4, 0xB, 0x1, 0xB, 0x2, 0x0F, 7},
|
||||
{4, 0xB, 0x1, 0x0, 0x0, 0x35, 6},
|
||||
{4, 0xC, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{4, 0xC, 0x1, 0x8, 0x8, 0x25, 6},
|
||||
{4, 0xC, 0x1, 0xC, 0x4, 0x37, 7},
|
||||
{4, 0xD, 0x0, 0x0, 0x0, 0x57, 7},
|
||||
{4, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
|
||||
{4, 0xD, 0x1, 0x1, 0x0, 0x05, 6},
|
||||
{4, 0xE, 0x0, 0x0, 0x0, 0x17, 7},
|
||||
{4, 0xE, 0x1, 0x4, 0x4, 0x39, 6},
|
||||
{4, 0xE, 0x1, 0xC, 0x8, 0x19, 6},
|
||||
{4, 0xE, 0x1, 0xE, 0x2, 0x67, 7},
|
||||
{4, 0xF, 0x0, 0x0, 0x0, 0x27, 7},
|
||||
{4, 0xF, 0x1, 0x9, 0x9, 0x47, 7},
|
||||
{4, 0xF, 0x1, 0x9, 0x1, 0x29, 6},
|
||||
{4, 0xF, 0x1, 0x7, 0x6, 0x7B, 7},
|
||||
{4, 0xF, 0x1, 0x7, 0x2, 0x09, 6},
|
||||
{4, 0xF, 0x1, 0xB, 0x8, 0x31, 6},
|
||||
{4, 0xF, 0x1, 0xF, 0x4, 0x3B, 7},
|
||||
{5, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{5, 0x1, 0x0, 0x0, 0x0, 0x1A, 5},
|
||||
{5, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
|
||||
{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
|
||||
{5, 0x2, 0x1, 0x2, 0x2, 0x1D, 6},
|
||||
{5, 0x3, 0x0, 0x0, 0x0, 0x2D, 6},
|
||||
{5, 0x3, 0x1, 0x3, 0x3, 0x5F, 7},
|
||||
{5, 0x3, 0x1, 0x3, 0x2, 0x39, 6},
|
||||
{5, 0x3, 0x1, 0x3, 0x1, 0x3F, 7},
|
||||
{5, 0x4, 0x0, 0x0, 0x0, 0x12, 5},
|
||||
{5, 0x4, 0x1, 0x4, 0x4, 0x1F, 7},
|
||||
{5, 0x5, 0x0, 0x0, 0x0, 0x0D, 6},
|
||||
{5, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
|
||||
{5, 0x5, 0x1, 0x5, 0x1, 0x6F, 7},
|
||||
{5, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{5, 0x6, 0x1, 0x2, 0x2, 0x25, 6},
|
||||
{5, 0x6, 0x1, 0x6, 0x4, 0x2F, 7},
|
||||
{5, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
|
||||
{5, 0x7, 0x1, 0x6, 0x6, 0x57, 7},
|
||||
{5, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
|
||||
{5, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
|
||||
{5, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
|
||||
{5, 0x7, 0x1, 0x7, 0x1, 0x37, 7},
|
||||
{5, 0x8, 0x0, 0x0, 0x0, 0x02, 5},
|
||||
{5, 0x8, 0x1, 0x8, 0x8, 0x19, 6},
|
||||
{5, 0x9, 0x0, 0x0, 0x0, 0x26, 6},
|
||||
{5, 0x9, 0x1, 0x8, 0x8, 0x17, 7},
|
||||
{5, 0x9, 0x1, 0x9, 0x1, 0x67, 7},
|
||||
{5, 0xA, 0x0, 0x0, 0x0, 0x1C, 5},
|
||||
{5, 0xA, 0x1, 0xA, 0xA, 0x29, 6},
|
||||
{5, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
|
||||
{5, 0xA, 0x1, 0xA, 0x8, 0x31, 6},
|
||||
{5, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
|
||||
{5, 0xB, 0x1, 0x9, 0x9, 0x07, 7},
|
||||
{5, 0xB, 0x1, 0x9, 0x8, 0x11, 6},
|
||||
{5, 0xB, 0x1, 0xB, 0x3, 0x47, 7},
|
||||
{5, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
|
||||
{5, 0xB, 0x1, 0xB, 0x1, 0x7B, 7},
|
||||
{5, 0xC, 0x0, 0x0, 0x0, 0x01, 6},
|
||||
{5, 0xC, 0x1, 0x8, 0x8, 0x3E, 6},
|
||||
{5, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
|
||||
{5, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{5, 0xD, 0x1, 0x9, 0x9, 0x6B, 7},
|
||||
{5, 0xD, 0x1, 0x9, 0x8, 0x1E, 6},
|
||||
{5, 0xD, 0x1, 0xD, 0x5, 0x1B, 7},
|
||||
{5, 0xD, 0x1, 0xD, 0x4, 0x2E, 6},
|
||||
{5, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
|
||||
{5, 0xE, 0x0, 0x0, 0x0, 0x4B, 7},
|
||||
{5, 0xE, 0x1, 0x6, 0x6, 0x0B, 7},
|
||||
{5, 0xE, 0x1, 0xE, 0xA, 0x33, 7},
|
||||
{5, 0xE, 0x1, 0xE, 0x2, 0x0E, 6},
|
||||
{5, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
|
||||
{5, 0xE, 0x1, 0xE, 0x8, 0x36, 6},
|
||||
{5, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
|
||||
{5, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
|
||||
{5, 0xF, 0x1, 0x7, 0x7, 0x43, 7},
|
||||
{5, 0xF, 0x1, 0x7, 0x6, 0x16, 6},
|
||||
{5, 0xF, 0x1, 0x7, 0x5, 0x63, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0xC, 0x23, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x4, 0x0C, 5},
|
||||
{5, 0xF, 0x1, 0xD, 0x9, 0x03, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0xA, 0x3D, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x8, 0x14, 5},
|
||||
{5, 0xF, 0x1, 0xF, 0x3, 0x7D, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x2, 0x04, 5},
|
||||
{5, 0xF, 0x1, 0xF, 0x1, 0x06, 6},
|
||||
{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{6, 0x1, 0x0, 0x0, 0x0, 0x04, 4},
|
||||
{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
|
||||
{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 5},
|
||||
{6, 0x2, 0x1, 0x2, 0x2, 0x0D, 6},
|
||||
{6, 0x3, 0x0, 0x0, 0x0, 0x1A, 5},
|
||||
{6, 0x3, 0x1, 0x3, 0x3, 0x3D, 6},
|
||||
{6, 0x3, 0x1, 0x3, 0x1, 0x1D, 6},
|
||||
{6, 0x3, 0x1, 0x3, 0x2, 0x2D, 6},
|
||||
{6, 0x4, 0x0, 0x0, 0x0, 0x0A, 5},
|
||||
{6, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
|
||||
{6, 0x5, 0x0, 0x0, 0x0, 0x35, 6},
|
||||
{6, 0x5, 0x1, 0x1, 0x1, 0x15, 6},
|
||||
{6, 0x5, 0x1, 0x5, 0x4, 0x7F, 7},
|
||||
{6, 0x6, 0x0, 0x0, 0x0, 0x25, 6},
|
||||
{6, 0x6, 0x1, 0x2, 0x2, 0x5F, 7},
|
||||
{6, 0x6, 0x1, 0x6, 0x4, 0x1F, 7},
|
||||
{6, 0x7, 0x0, 0x0, 0x0, 0x6F, 7},
|
||||
{6, 0x7, 0x1, 0x6, 0x6, 0x4F, 7},
|
||||
{6, 0x7, 0x1, 0x6, 0x4, 0x05, 6},
|
||||
{6, 0x7, 0x1, 0x7, 0x3, 0x2F, 7},
|
||||
{6, 0x7, 0x1, 0x7, 0x1, 0x36, 6},
|
||||
{6, 0x7, 0x1, 0x7, 0x2, 0x77, 7},
|
||||
{6, 0x8, 0x0, 0x0, 0x0, 0x12, 5},
|
||||
{6, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
|
||||
{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
|
||||
{6, 0x9, 0x1, 0x1, 0x1, 0x37, 7},
|
||||
{6, 0x9, 0x1, 0x9, 0x8, 0x57, 7},
|
||||
{6, 0xA, 0x0, 0x0, 0x0, 0x19, 6},
|
||||
{6, 0xA, 0x1, 0x2, 0x2, 0x29, 6},
|
||||
{6, 0xA, 0x1, 0xA, 0x8, 0x17, 7},
|
||||
{6, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
|
||||
{6, 0xB, 0x1, 0x9, 0x9, 0x47, 7},
|
||||
{6, 0xB, 0x1, 0x9, 0x1, 0x09, 6},
|
||||
{6, 0xB, 0x1, 0xB, 0xA, 0x27, 7},
|
||||
{6, 0xB, 0x1, 0xB, 0x2, 0x31, 6},
|
||||
{6, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
|
||||
{6, 0xC, 0x0, 0x0, 0x0, 0x11, 6},
|
||||
{6, 0xC, 0x1, 0xC, 0xC, 0x07, 7},
|
||||
{6, 0xC, 0x1, 0xC, 0x8, 0x21, 6},
|
||||
{6, 0xC, 0x1, 0xC, 0x4, 0x3B, 7},
|
||||
{6, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{6, 0xD, 0x1, 0x5, 0x5, 0x33, 7},
|
||||
{6, 0xD, 0x1, 0x5, 0x4, 0x01, 6},
|
||||
{6, 0xD, 0x1, 0xC, 0x8, 0x1B, 7},
|
||||
{6, 0xD, 0x1, 0xD, 0x1, 0x6B, 7},
|
||||
{6, 0xE, 0x0, 0x0, 0x0, 0x2B, 7},
|
||||
{6, 0xE, 0x1, 0xE, 0x2, 0x4B, 7},
|
||||
{6, 0xE, 0x1, 0x2, 0x2, 0x0B, 7},
|
||||
{6, 0xE, 0x1, 0xE, 0xC, 0x73, 7},
|
||||
{6, 0xE, 0x1, 0xE, 0x8, 0x3E, 6},
|
||||
{6, 0xE, 0x1, 0xE, 0x4, 0x53, 7},
|
||||
{6, 0xF, 0x0, 0x0, 0x0, 0x13, 7},
|
||||
{6, 0xF, 0x1, 0x6, 0x6, 0x1E, 6},
|
||||
{6, 0xF, 0x1, 0xE, 0xA, 0x2E, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x3, 0x0E, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x2, 0x02, 5},
|
||||
{6, 0xF, 0x1, 0xB, 0x9, 0x63, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x8, 0x06, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x5, 0x23, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0x1, 0x1C, 5},
|
||||
{6, 0xF, 0x1, 0xF, 0x4, 0x26, 6},
|
||||
{7, 0x0, 0x0, 0x0, 0x0, 0x12, 5},
|
||||
{7, 0x1, 0x0, 0x0, 0x0, 0x05, 6},
|
||||
{7, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
|
||||
{7, 0x2, 0x0, 0x0, 0x0, 0x39, 6},
|
||||
{7, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{7, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
|
||||
{7, 0x3, 0x1, 0x3, 0x3, 0x1F, 7},
|
||||
{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
|
||||
{7, 0x3, 0x1, 0x3, 0x1, 0x2F, 7},
|
||||
{7, 0x4, 0x0, 0x0, 0x0, 0x4F, 7},
|
||||
{7, 0x4, 0x1, 0x4, 0x4, 0x0F, 7},
|
||||
{7, 0x5, 0x0, 0x0, 0x0, 0x57, 7},
|
||||
{7, 0x5, 0x1, 0x1, 0x1, 0x19, 6},
|
||||
{7, 0x5, 0x1, 0x5, 0x4, 0x77, 7},
|
||||
{7, 0x6, 0x0, 0x0, 0x0, 0x37, 7},
|
||||
{7, 0x6, 0x1, 0x0, 0x0, 0x29, 6},
|
||||
{7, 0x7, 0x0, 0x0, 0x0, 0x17, 7},
|
||||
{7, 0x7, 0x1, 0x6, 0x6, 0x67, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x3, 0x27, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x2, 0x47, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x5, 0x1B, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x1, 0x09, 6},
|
||||
{7, 0x7, 0x1, 0x7, 0x4, 0x07, 7},
|
||||
{7, 0x8, 0x0, 0x0, 0x0, 0x7B, 7},
|
||||
{7, 0x8, 0x1, 0x8, 0x8, 0x3B, 7},
|
||||
{7, 0x9, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{7, 0x9, 0x1, 0x0, 0x0, 0x31, 6},
|
||||
{7, 0xA, 0x0, 0x0, 0x0, 0x53, 7},
|
||||
{7, 0xA, 0x1, 0x2, 0x2, 0x11, 6},
|
||||
{7, 0xA, 0x1, 0xA, 0x8, 0x6B, 7},
|
||||
{7, 0xB, 0x0, 0x0, 0x0, 0x2B, 7},
|
||||
{7, 0xB, 0x1, 0x9, 0x9, 0x4B, 7},
|
||||
{7, 0xB, 0x1, 0xB, 0x3, 0x0B, 7},
|
||||
{7, 0xB, 0x1, 0xB, 0x1, 0x73, 7},
|
||||
{7, 0xB, 0x1, 0xB, 0xA, 0x33, 7},
|
||||
{7, 0xB, 0x1, 0xB, 0x2, 0x21, 6},
|
||||
{7, 0xB, 0x1, 0xB, 0x8, 0x13, 7},
|
||||
{7, 0xC, 0x0, 0x0, 0x0, 0x63, 7},
|
||||
{7, 0xC, 0x1, 0x8, 0x8, 0x23, 7},
|
||||
{7, 0xC, 0x1, 0xC, 0x4, 0x43, 7},
|
||||
{7, 0xD, 0x0, 0x0, 0x0, 0x03, 7},
|
||||
{7, 0xD, 0x1, 0x9, 0x9, 0x7D, 7},
|
||||
{7, 0xD, 0x1, 0xD, 0x5, 0x5D, 7},
|
||||
{7, 0xD, 0x1, 0xD, 0x1, 0x01, 6},
|
||||
{7, 0xD, 0x1, 0xD, 0xC, 0x3D, 7},
|
||||
{7, 0xD, 0x1, 0xD, 0x4, 0x3E, 6},
|
||||
{7, 0xD, 0x1, 0xD, 0x8, 0x1D, 7},
|
||||
{7, 0xE, 0x0, 0x0, 0x0, 0x6D, 7},
|
||||
{7, 0xE, 0x1, 0x6, 0x6, 0x2D, 7},
|
||||
{7, 0xE, 0x1, 0xE, 0xA, 0x0D, 7},
|
||||
{7, 0xE, 0x1, 0xE, 0x2, 0x1E, 6},
|
||||
{7, 0xE, 0x1, 0xE, 0xC, 0x4D, 7},
|
||||
{7, 0xE, 0x1, 0xE, 0x8, 0x0E, 6},
|
||||
{7, 0xE, 0x1, 0xE, 0x4, 0x75, 7},
|
||||
{7, 0xF, 0x0, 0x0, 0x0, 0x15, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0xF, 0x06, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0xD, 0x35, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x7, 0x55, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x5, 0x1A, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0xB, 0x25, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x3, 0x0A, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0x9, 0x2E, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0x1, 0x00, 4},
|
||||
{7, 0xF, 0x1, 0xF, 0xE, 0x65, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x6, 0x36, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0xA, 0x02, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0x2, 0x0C, 4},
|
||||
{7, 0xF, 0x1, 0xF, 0xC, 0x16, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0x8, 0x04, 4},
|
||||
{7, 0xF, 0x1, 0xF, 0x4, 0x08, 4}
|
||||
+358
@@ -0,0 +1,358 @@
|
||||
{0, 0x1, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{0, 0x1, 0x1, 0x1, 0x1, 0x27, 6},
|
||||
{0, 0x2, 0x0, 0x0, 0x0, 0x06, 3},
|
||||
{0, 0x2, 0x1, 0x2, 0x2, 0x17, 6},
|
||||
{0, 0x3, 0x0, 0x0, 0x0, 0x0D, 5},
|
||||
{0, 0x3, 0x1, 0x0, 0x0, 0x3B, 6},
|
||||
{0, 0x4, 0x0, 0x0, 0x0, 0x02, 3},
|
||||
{0, 0x4, 0x1, 0x4, 0x4, 0x07, 6},
|
||||
{0, 0x5, 0x0, 0x0, 0x0, 0x15, 5},
|
||||
{0, 0x5, 0x1, 0x0, 0x0, 0x2B, 6},
|
||||
{0, 0x6, 0x0, 0x0, 0x0, 0x01, 5},
|
||||
{0, 0x6, 0x1, 0x0, 0x0, 0x7F, 7},
|
||||
{0, 0x7, 0x0, 0x0, 0x0, 0x1F, 7},
|
||||
{0, 0x7, 0x1, 0x0, 0x0, 0x1B, 6},
|
||||
{0, 0x8, 0x0, 0x0, 0x0, 0x04, 3},
|
||||
{0, 0x8, 0x1, 0x8, 0x8, 0x05, 5},
|
||||
{0, 0x9, 0x0, 0x0, 0x0, 0x19, 5},
|
||||
{0, 0x9, 0x1, 0x0, 0x0, 0x13, 6},
|
||||
{0, 0xA, 0x0, 0x0, 0x0, 0x09, 5},
|
||||
{0, 0xA, 0x1, 0x8, 0x8, 0x0B, 6},
|
||||
{0, 0xA, 0x1, 0xA, 0x2, 0x3F, 7},
|
||||
{0, 0xB, 0x0, 0x0, 0x0, 0x5F, 7},
|
||||
{0, 0xB, 0x1, 0x0, 0x0, 0x33, 6},
|
||||
{0, 0xC, 0x0, 0x0, 0x0, 0x11, 5},
|
||||
{0, 0xC, 0x1, 0x8, 0x8, 0x23, 6},
|
||||
{0, 0xC, 0x1, 0xC, 0x4, 0x6F, 7},
|
||||
{0, 0xD, 0x0, 0x0, 0x0, 0x0F, 7},
|
||||
{0, 0xD, 0x1, 0x0, 0x0, 0x03, 6},
|
||||
{0, 0xE, 0x0, 0x0, 0x0, 0x2F, 7},
|
||||
{0, 0xE, 0x1, 0x4, 0x4, 0x4F, 7},
|
||||
{0, 0xE, 0x1, 0x4, 0x0, 0x3D, 6},
|
||||
{0, 0xF, 0x0, 0x0, 0x0, 0x77, 7},
|
||||
{0, 0xF, 0x1, 0x1, 0x1, 0x37, 7},
|
||||
{0, 0xF, 0x1, 0x1, 0x0, 0x1D, 6},
|
||||
{1, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
|
||||
{1, 0x1, 0x0, 0x0, 0x0, 0x05, 4},
|
||||
{1, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
|
||||
{1, 0x2, 0x0, 0x0, 0x0, 0x09, 4},
|
||||
{1, 0x2, 0x1, 0x2, 0x2, 0x1F, 7},
|
||||
{1, 0x3, 0x0, 0x0, 0x0, 0x1D, 5},
|
||||
{1, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
|
||||
{1, 0x3, 0x1, 0x3, 0x2, 0x5F, 7},
|
||||
{1, 0x4, 0x0, 0x0, 0x0, 0x0D, 5},
|
||||
{1, 0x4, 0x1, 0x4, 0x4, 0x37, 7},
|
||||
{1, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{1, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
|
||||
{1, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
|
||||
{1, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
|
||||
{1, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
|
||||
{1, 0x7, 0x1, 0x0, 0x0, 0x77, 7},
|
||||
{1, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
|
||||
{1, 0x8, 0x1, 0x8, 0x8, 0x17, 7},
|
||||
{1, 0x9, 0x0, 0x0, 0x0, 0x0B, 6},
|
||||
{1, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
|
||||
{1, 0xA, 0x0, 0x0, 0x0, 0x33, 6},
|
||||
{1, 0xA, 0x1, 0x0, 0x0, 0x67, 7},
|
||||
{1, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
|
||||
{1, 0xB, 0x1, 0x0, 0x0, 0x2B, 7},
|
||||
{1, 0xC, 0x0, 0x0, 0x0, 0x13, 6},
|
||||
{1, 0xC, 0x1, 0x0, 0x0, 0x47, 7},
|
||||
{1, 0xD, 0x0, 0x0, 0x0, 0x07, 7},
|
||||
{1, 0xD, 0x1, 0x0, 0x0, 0x7B, 7},
|
||||
{1, 0xE, 0x0, 0x0, 0x0, 0x3B, 7},
|
||||
{1, 0xE, 0x1, 0x0, 0x0, 0x5B, 7},
|
||||
{1, 0xF, 0x0, 0x0, 0x0, 0x1B, 7},
|
||||
{1, 0xF, 0x1, 0x4, 0x4, 0x6B, 7},
|
||||
{1, 0xF, 0x1, 0x4, 0x0, 0x23, 6},
|
||||
{2, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
|
||||
{2, 0x1, 0x0, 0x0, 0x0, 0x09, 4},
|
||||
{2, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
|
||||
{2, 0x2, 0x0, 0x0, 0x0, 0x01, 4},
|
||||
{2, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
|
||||
{2, 0x3, 0x0, 0x0, 0x0, 0x3D, 6},
|
||||
{2, 0x3, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{2, 0x3, 0x1, 0x3, 0x1, 0x1F, 7},
|
||||
{2, 0x4, 0x0, 0x0, 0x0, 0x15, 5},
|
||||
{2, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
|
||||
{2, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{2, 0x5, 0x1, 0x0, 0x0, 0x6F, 7},
|
||||
{2, 0x6, 0x0, 0x0, 0x0, 0x2F, 7},
|
||||
{2, 0x6, 0x1, 0x0, 0x0, 0x4F, 7},
|
||||
{2, 0x7, 0x0, 0x0, 0x0, 0x0F, 7},
|
||||
{2, 0x7, 0x1, 0x0, 0x0, 0x17, 7},
|
||||
{2, 0x8, 0x0, 0x0, 0x0, 0x05, 5},
|
||||
{2, 0x8, 0x1, 0x8, 0x8, 0x77, 7},
|
||||
{2, 0x9, 0x0, 0x0, 0x0, 0x37, 7},
|
||||
{2, 0x9, 0x1, 0x0, 0x0, 0x57, 7},
|
||||
{2, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{2, 0xA, 0x1, 0xA, 0xA, 0x7B, 7},
|
||||
{2, 0xA, 0x1, 0xA, 0x2, 0x2D, 6},
|
||||
{2, 0xA, 0x1, 0xA, 0x8, 0x67, 7},
|
||||
{2, 0xB, 0x0, 0x0, 0x0, 0x27, 7},
|
||||
{2, 0xB, 0x1, 0xB, 0x2, 0x47, 7},
|
||||
{2, 0xB, 0x1, 0x0, 0x0, 0x07, 7},
|
||||
{2, 0xC, 0x0, 0x0, 0x0, 0x0D, 6},
|
||||
{2, 0xC, 0x1, 0x0, 0x0, 0x3B, 7},
|
||||
{2, 0xD, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{2, 0xD, 0x1, 0x0, 0x0, 0x1B, 7},
|
||||
{2, 0xE, 0x0, 0x0, 0x0, 0x6B, 7},
|
||||
{2, 0xE, 0x1, 0x4, 0x4, 0x2B, 7},
|
||||
{2, 0xE, 0x1, 0x4, 0x0, 0x4B, 7},
|
||||
{2, 0xF, 0x0, 0x0, 0x0, 0x0B, 7},
|
||||
{2, 0xF, 0x1, 0x4, 0x4, 0x73, 7},
|
||||
{2, 0xF, 0x1, 0x5, 0x1, 0x33, 7},
|
||||
{2, 0xF, 0x1, 0x7, 0x2, 0x53, 7},
|
||||
{2, 0xF, 0x1, 0xF, 0x8, 0x13, 7},
|
||||
{3, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
|
||||
{3, 0x1, 0x0, 0x0, 0x0, 0x0A, 4},
|
||||
{3, 0x1, 0x1, 0x1, 0x1, 0x0B, 6},
|
||||
{3, 0x2, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{3, 0x2, 0x1, 0x2, 0x2, 0x23, 6},
|
||||
{3, 0x3, 0x0, 0x0, 0x0, 0x0E, 5},
|
||||
{3, 0x3, 0x1, 0x3, 0x3, 0x7F, 7},
|
||||
{3, 0x3, 0x1, 0x3, 0x2, 0x33, 6},
|
||||
{3, 0x3, 0x1, 0x3, 0x1, 0x13, 6},
|
||||
{3, 0x4, 0x0, 0x0, 0x0, 0x16, 5},
|
||||
{3, 0x4, 0x1, 0x4, 0x4, 0x3F, 7},
|
||||
{3, 0x5, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{3, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
|
||||
{3, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
|
||||
{3, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{3, 0x6, 0x1, 0x0, 0x0, 0x5F, 7},
|
||||
{3, 0x7, 0x0, 0x0, 0x0, 0x2D, 6},
|
||||
{3, 0x7, 0x1, 0x4, 0x4, 0x2F, 7},
|
||||
{3, 0x7, 0x1, 0x5, 0x1, 0x1E, 6},
|
||||
{3, 0x7, 0x1, 0x7, 0x2, 0x6F, 7},
|
||||
{3, 0x8, 0x0, 0x0, 0x0, 0x06, 5},
|
||||
{3, 0x8, 0x1, 0x8, 0x8, 0x4F, 7},
|
||||
{3, 0x9, 0x0, 0x0, 0x0, 0x0D, 6},
|
||||
{3, 0x9, 0x1, 0x0, 0x0, 0x35, 6},
|
||||
{3, 0xA, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{3, 0xA, 0x1, 0x2, 0x2, 0x25, 6},
|
||||
{3, 0xA, 0x1, 0xA, 0x8, 0x0F, 7},
|
||||
{3, 0xB, 0x0, 0x0, 0x0, 0x05, 6},
|
||||
{3, 0xB, 0x1, 0x8, 0x8, 0x39, 6},
|
||||
{3, 0xB, 0x1, 0xB, 0x3, 0x17, 7},
|
||||
{3, 0xB, 0x1, 0xB, 0x2, 0x19, 6},
|
||||
{3, 0xB, 0x1, 0xB, 0x1, 0x77, 7},
|
||||
{3, 0xC, 0x0, 0x0, 0x0, 0x29, 6},
|
||||
{3, 0xC, 0x1, 0x0, 0x0, 0x09, 6},
|
||||
{3, 0xD, 0x0, 0x0, 0x0, 0x37, 7},
|
||||
{3, 0xD, 0x1, 0x4, 0x4, 0x57, 7},
|
||||
{3, 0xD, 0x1, 0x4, 0x0, 0x31, 6},
|
||||
{3, 0xE, 0x0, 0x0, 0x0, 0x67, 7},
|
||||
{3, 0xE, 0x1, 0x4, 0x4, 0x27, 7},
|
||||
{3, 0xE, 0x1, 0xC, 0x8, 0x47, 7},
|
||||
{3, 0xE, 0x1, 0xE, 0x2, 0x6B, 7},
|
||||
{3, 0xF, 0x0, 0x0, 0x0, 0x11, 6},
|
||||
{3, 0xF, 0x1, 0x6, 0x6, 0x07, 7},
|
||||
{3, 0xF, 0x1, 0x7, 0x3, 0x7B, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0xA, 0x3B, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
|
||||
{3, 0xF, 0x1, 0xF, 0x8, 0x01, 6},
|
||||
{3, 0xF, 0x1, 0xA, 0x8, 0x5B, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x5, 0x1B, 7},
|
||||
{3, 0xF, 0x1, 0xF, 0x1, 0x3E, 6},
|
||||
{3, 0xF, 0x1, 0xF, 0x4, 0x2B, 7},
|
||||
{4, 0x0, 0x0, 0x0, 0x0, 0x00, 1},
|
||||
{4, 0x1, 0x0, 0x0, 0x0, 0x0D, 5},
|
||||
{4, 0x1, 0x1, 0x1, 0x1, 0x7F, 7},
|
||||
{4, 0x2, 0x0, 0x0, 0x0, 0x15, 5},
|
||||
{4, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{4, 0x3, 0x0, 0x0, 0x0, 0x5F, 7},
|
||||
{4, 0x3, 0x1, 0x0, 0x0, 0x6F, 7},
|
||||
{4, 0x4, 0x0, 0x0, 0x0, 0x09, 4},
|
||||
{4, 0x4, 0x1, 0x4, 0x4, 0x23, 6},
|
||||
{4, 0x5, 0x0, 0x0, 0x0, 0x33, 6},
|
||||
{4, 0x5, 0x1, 0x0, 0x0, 0x1F, 7},
|
||||
{4, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
|
||||
{4, 0x6, 0x1, 0x0, 0x0, 0x2F, 7},
|
||||
{4, 0x7, 0x0, 0x0, 0x0, 0x4F, 7},
|
||||
{4, 0x7, 0x1, 0x0, 0x0, 0x57, 7},
|
||||
{4, 0x8, 0x0, 0x0, 0x0, 0x01, 4},
|
||||
{4, 0x8, 0x1, 0x8, 0x8, 0x0F, 7},
|
||||
{4, 0x9, 0x0, 0x0, 0x0, 0x77, 7},
|
||||
{4, 0x9, 0x1, 0x0, 0x0, 0x37, 7},
|
||||
{4, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{4, 0xA, 0x1, 0x0, 0x0, 0x17, 7},
|
||||
{4, 0xB, 0x0, 0x0, 0x0, 0x67, 7},
|
||||
{4, 0xB, 0x1, 0x0, 0x0, 0x6B, 7},
|
||||
{4, 0xC, 0x0, 0x0, 0x0, 0x05, 5},
|
||||
{4, 0xC, 0x1, 0xC, 0xC, 0x27, 7},
|
||||
{4, 0xC, 0x1, 0xC, 0x8, 0x47, 7},
|
||||
{4, 0xC, 0x1, 0xC, 0x4, 0x07, 7},
|
||||
{4, 0xD, 0x0, 0x0, 0x0, 0x7B, 7},
|
||||
{4, 0xD, 0x1, 0x0, 0x0, 0x3B, 7},
|
||||
{4, 0xE, 0x0, 0x0, 0x0, 0x5B, 7},
|
||||
{4, 0xE, 0x1, 0x2, 0x2, 0x1B, 7},
|
||||
{4, 0xE, 0x1, 0x2, 0x0, 0x03, 6},
|
||||
{4, 0xF, 0x0, 0x0, 0x0, 0x2B, 7},
|
||||
{4, 0xF, 0x1, 0x1, 0x1, 0x4B, 7},
|
||||
{4, 0xF, 0x1, 0x3, 0x2, 0x0B, 7},
|
||||
{4, 0xF, 0x1, 0x3, 0x0, 0x3D, 6},
|
||||
{5, 0x0, 0x0, 0x0, 0x0, 0x00, 2},
|
||||
{5, 0x1, 0x0, 0x0, 0x0, 0x1E, 5},
|
||||
{5, 0x1, 0x1, 0x1, 0x1, 0x3B, 6},
|
||||
{5, 0x2, 0x0, 0x0, 0x0, 0x0A, 5},
|
||||
{5, 0x2, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{5, 0x3, 0x0, 0x0, 0x0, 0x1B, 6},
|
||||
{5, 0x3, 0x1, 0x0, 0x0, 0x0B, 6},
|
||||
{5, 0x4, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{5, 0x4, 0x1, 0x4, 0x4, 0x2B, 6},
|
||||
{5, 0x5, 0x0, 0x0, 0x0, 0x0E, 5},
|
||||
{5, 0x5, 0x1, 0x4, 0x4, 0x33, 6},
|
||||
{5, 0x5, 0x1, 0x5, 0x1, 0x7F, 7},
|
||||
{5, 0x6, 0x0, 0x0, 0x0, 0x13, 6},
|
||||
{5, 0x6, 0x1, 0x0, 0x0, 0x6F, 7},
|
||||
{5, 0x7, 0x0, 0x0, 0x0, 0x23, 6},
|
||||
{5, 0x7, 0x1, 0x2, 0x2, 0x5F, 7},
|
||||
{5, 0x7, 0x1, 0x2, 0x0, 0x15, 6},
|
||||
{5, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
|
||||
{5, 0x8, 0x1, 0x8, 0x8, 0x03, 6},
|
||||
{5, 0x9, 0x0, 0x0, 0x0, 0x3D, 6},
|
||||
{5, 0x9, 0x1, 0x0, 0x0, 0x1F, 7},
|
||||
{5, 0xA, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{5, 0xA, 0x1, 0x0, 0x0, 0x2D, 6},
|
||||
{5, 0xB, 0x0, 0x0, 0x0, 0x0D, 6},
|
||||
{5, 0xB, 0x1, 0x1, 0x1, 0x4F, 7},
|
||||
{5, 0xB, 0x1, 0x1, 0x0, 0x35, 6},
|
||||
{5, 0xC, 0x0, 0x0, 0x0, 0x06, 5},
|
||||
{5, 0xC, 0x1, 0x4, 0x4, 0x25, 6},
|
||||
{5, 0xC, 0x1, 0xC, 0x8, 0x2F, 7},
|
||||
{5, 0xD, 0x0, 0x0, 0x0, 0x05, 6},
|
||||
{5, 0xD, 0x1, 0x1, 0x1, 0x77, 7},
|
||||
{5, 0xD, 0x1, 0x5, 0x4, 0x39, 6},
|
||||
{5, 0xD, 0x1, 0xD, 0x8, 0x0F, 7},
|
||||
{5, 0xE, 0x0, 0x0, 0x0, 0x19, 6},
|
||||
{5, 0xE, 0x1, 0x2, 0x2, 0x57, 7},
|
||||
{5, 0xE, 0x1, 0xA, 0x8, 0x01, 6},
|
||||
{5, 0xE, 0x1, 0xE, 0x4, 0x37, 7},
|
||||
{5, 0xF, 0x0, 0x0, 0x0, 0x1A, 5},
|
||||
{5, 0xF, 0x1, 0x9, 0x9, 0x17, 7},
|
||||
{5, 0xF, 0x1, 0xD, 0x5, 0x67, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x3, 0x07, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x1, 0x29, 6},
|
||||
{5, 0xF, 0x1, 0x7, 0x6, 0x27, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0xC, 0x09, 6},
|
||||
{5, 0xF, 0x1, 0xF, 0x4, 0x31, 6},
|
||||
{5, 0xF, 0x1, 0xF, 0xA, 0x47, 7},
|
||||
{5, 0xF, 0x1, 0xF, 0x8, 0x11, 6},
|
||||
{5, 0xF, 0x1, 0xF, 0x2, 0x21, 6},
|
||||
{6, 0x0, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{6, 0x1, 0x0, 0x0, 0x0, 0x02, 4},
|
||||
{6, 0x1, 0x1, 0x1, 0x1, 0x03, 6},
|
||||
{6, 0x2, 0x0, 0x0, 0x0, 0x0C, 4},
|
||||
{6, 0x2, 0x1, 0x2, 0x2, 0x3D, 6},
|
||||
{6, 0x3, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{6, 0x3, 0x1, 0x2, 0x2, 0x0D, 6},
|
||||
{6, 0x3, 0x1, 0x3, 0x1, 0x7F, 7},
|
||||
{6, 0x4, 0x0, 0x0, 0x0, 0x04, 4},
|
||||
{6, 0x4, 0x1, 0x4, 0x4, 0x2D, 6},
|
||||
{6, 0x5, 0x0, 0x0, 0x0, 0x0A, 5},
|
||||
{6, 0x5, 0x1, 0x4, 0x4, 0x35, 6},
|
||||
{6, 0x5, 0x1, 0x5, 0x1, 0x2F, 7},
|
||||
{6, 0x6, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{6, 0x6, 0x1, 0x2, 0x2, 0x3F, 7},
|
||||
{6, 0x6, 0x1, 0x6, 0x4, 0x5F, 7},
|
||||
{6, 0x7, 0x0, 0x0, 0x0, 0x25, 6},
|
||||
{6, 0x7, 0x1, 0x2, 0x2, 0x29, 6},
|
||||
{6, 0x7, 0x1, 0x3, 0x1, 0x1F, 7},
|
||||
{6, 0x7, 0x1, 0x7, 0x4, 0x6F, 7},
|
||||
{6, 0x8, 0x0, 0x0, 0x0, 0x16, 5},
|
||||
{6, 0x8, 0x1, 0x8, 0x8, 0x05, 6},
|
||||
{6, 0x9, 0x0, 0x0, 0x0, 0x39, 6},
|
||||
{6, 0x9, 0x1, 0x0, 0x0, 0x19, 6},
|
||||
{6, 0xA, 0x0, 0x0, 0x0, 0x06, 5},
|
||||
{6, 0xA, 0x1, 0xA, 0xA, 0x0F, 7},
|
||||
{6, 0xA, 0x1, 0xA, 0x2, 0x09, 6},
|
||||
{6, 0xA, 0x1, 0xA, 0x8, 0x4F, 7},
|
||||
{6, 0xB, 0x0, 0x0, 0x0, 0x0E, 6},
|
||||
{6, 0xB, 0x1, 0xB, 0x2, 0x77, 7},
|
||||
{6, 0xB, 0x1, 0x2, 0x2, 0x37, 7},
|
||||
{6, 0xB, 0x1, 0xA, 0x8, 0x57, 7},
|
||||
{6, 0xB, 0x1, 0xB, 0x1, 0x47, 7},
|
||||
{6, 0xC, 0x0, 0x0, 0x0, 0x1A, 5},
|
||||
{6, 0xC, 0x1, 0xC, 0xC, 0x17, 7},
|
||||
{6, 0xC, 0x1, 0xC, 0x8, 0x67, 7},
|
||||
{6, 0xC, 0x1, 0xC, 0x4, 0x27, 7},
|
||||
{6, 0xD, 0x0, 0x0, 0x0, 0x31, 6},
|
||||
{6, 0xD, 0x1, 0xD, 0x4, 0x07, 7},
|
||||
{6, 0xD, 0x1, 0x4, 0x4, 0x7B, 7},
|
||||
{6, 0xD, 0x1, 0xC, 0x8, 0x3B, 7},
|
||||
{6, 0xD, 0x1, 0xD, 0x1, 0x2B, 7},
|
||||
{6, 0xE, 0x0, 0x0, 0x0, 0x11, 6},
|
||||
{6, 0xE, 0x1, 0xE, 0x4, 0x5B, 7},
|
||||
{6, 0xE, 0x1, 0x4, 0x4, 0x1B, 7},
|
||||
{6, 0xE, 0x1, 0xE, 0xA, 0x6B, 7},
|
||||
{6, 0xE, 0x1, 0xE, 0x8, 0x21, 6},
|
||||
{6, 0xE, 0x1, 0xE, 0x2, 0x33, 7},
|
||||
{6, 0xF, 0x0, 0x0, 0x0, 0x01, 6},
|
||||
{6, 0xF, 0x1, 0x3, 0x3, 0x4B, 7},
|
||||
{6, 0xF, 0x1, 0x7, 0x6, 0x0B, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0xA, 0x73, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0x2, 0x3E, 6},
|
||||
{6, 0xF, 0x1, 0xB, 0x9, 0x53, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0xC, 0x63, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0x8, 0x1E, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x5, 0x13, 7},
|
||||
{6, 0xF, 0x1, 0xF, 0x4, 0x2E, 6},
|
||||
{6, 0xF, 0x1, 0xF, 0x1, 0x23, 7},
|
||||
{7, 0x0, 0x0, 0x0, 0x0, 0x04, 4},
|
||||
{7, 0x1, 0x0, 0x0, 0x0, 0x33, 6},
|
||||
{7, 0x1, 0x1, 0x1, 0x1, 0x13, 6},
|
||||
{7, 0x2, 0x0, 0x0, 0x0, 0x23, 6},
|
||||
{7, 0x2, 0x1, 0x2, 0x2, 0x7F, 7},
|
||||
{7, 0x3, 0x0, 0x0, 0x0, 0x03, 6},
|
||||
{7, 0x3, 0x1, 0x1, 0x1, 0x3F, 7},
|
||||
{7, 0x3, 0x1, 0x3, 0x2, 0x6F, 7},
|
||||
{7, 0x4, 0x0, 0x0, 0x0, 0x2D, 6},
|
||||
{7, 0x4, 0x1, 0x4, 0x4, 0x5F, 7},
|
||||
{7, 0x5, 0x0, 0x0, 0x0, 0x16, 5},
|
||||
{7, 0x5, 0x1, 0x1, 0x1, 0x3D, 6},
|
||||
{7, 0x5, 0x1, 0x5, 0x4, 0x1F, 7},
|
||||
{7, 0x6, 0x0, 0x0, 0x0, 0x1D, 6},
|
||||
{7, 0x6, 0x1, 0x0, 0x0, 0x77, 7},
|
||||
{7, 0x7, 0x0, 0x0, 0x0, 0x06, 5},
|
||||
{7, 0x7, 0x1, 0x7, 0x4, 0x2F, 7},
|
||||
{7, 0x7, 0x1, 0x4, 0x4, 0x4F, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x3, 0x0F, 7},
|
||||
{7, 0x7, 0x1, 0x7, 0x1, 0x0D, 6},
|
||||
{7, 0x7, 0x1, 0x7, 0x2, 0x57, 7},
|
||||
{7, 0x8, 0x0, 0x0, 0x0, 0x35, 6},
|
||||
{7, 0x8, 0x1, 0x8, 0x8, 0x37, 7},
|
||||
{7, 0x9, 0x0, 0x0, 0x0, 0x15, 6},
|
||||
{7, 0x9, 0x1, 0x0, 0x0, 0x27, 7},
|
||||
{7, 0xA, 0x0, 0x0, 0x0, 0x25, 6},
|
||||
{7, 0xA, 0x1, 0x0, 0x0, 0x29, 6},
|
||||
{7, 0xB, 0x0, 0x0, 0x0, 0x1A, 5},
|
||||
{7, 0xB, 0x1, 0xB, 0x1, 0x17, 7},
|
||||
{7, 0xB, 0x1, 0x1, 0x1, 0x67, 7},
|
||||
{7, 0xB, 0x1, 0x3, 0x2, 0x05, 6},
|
||||
{7, 0xB, 0x1, 0xB, 0x8, 0x7B, 7},
|
||||
{7, 0xC, 0x0, 0x0, 0x0, 0x39, 6},
|
||||
{7, 0xC, 0x1, 0x0, 0x0, 0x19, 6},
|
||||
{7, 0xD, 0x0, 0x0, 0x0, 0x0C, 5},
|
||||
{7, 0xD, 0x1, 0xD, 0x1, 0x47, 7},
|
||||
{7, 0xD, 0x1, 0x1, 0x1, 0x07, 7},
|
||||
{7, 0xD, 0x1, 0x5, 0x4, 0x09, 6},
|
||||
{7, 0xD, 0x1, 0xD, 0x8, 0x1B, 7},
|
||||
{7, 0xE, 0x0, 0x0, 0x0, 0x31, 6},
|
||||
{7, 0xE, 0x1, 0xE, 0x2, 0x3B, 7},
|
||||
{7, 0xE, 0x1, 0x2, 0x2, 0x5B, 7},
|
||||
{7, 0xE, 0x1, 0xA, 0x8, 0x3E, 6},
|
||||
{7, 0xE, 0x1, 0xE, 0x4, 0x0B, 7},
|
||||
{7, 0xF, 0x0, 0x0, 0x0, 0x00, 3},
|
||||
{7, 0xF, 0x1, 0xF, 0xF, 0x6B, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x7, 0x2B, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0xB, 0x4B, 7},
|
||||
{7, 0xF, 0x1, 0xF, 0x3, 0x11, 6},
|
||||
{7, 0xF, 0x1, 0x7, 0x6, 0x21, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0xA, 0x01, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0x2, 0x0A, 5},
|
||||
{7, 0xF, 0x1, 0xB, 0x9, 0x1E, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0xC, 0x0E, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0x8, 0x12, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0x5, 0x2E, 6},
|
||||
{7, 0xF, 0x1, 0xF, 0x1, 0x02, 5},
|
||||
{7, 0xF, 0x1, 0xF, 0x4, 0x1C, 5}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user