Compare commits
1646 Commits
experiment
...
sandbox/de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f708a843b7 | ||
|
|
a2d6abacf7 | ||
|
|
89b6d40690 | ||
|
|
ae0e383d35 | ||
|
|
d8557a052c | ||
|
|
f71f581ba2 | ||
|
|
02d5ebcfdc | ||
|
|
2424ba3d8b | ||
|
|
1b8b8b0d0d | ||
|
|
bb12bbaefb | ||
|
|
b46da98f3a | ||
|
|
05d5332407 | ||
|
|
9d754dcca8 | ||
|
|
85770264ac | ||
|
|
af416c4daf | ||
|
|
ea8482fe74 | ||
|
|
9e41d569d7 | ||
|
|
b720ba165f | ||
|
|
bbf53047b0 | ||
|
|
ede392d765 | ||
|
|
c6a1ff223b | ||
|
|
ed90a176af | ||
|
|
eb0c73b6e0 | ||
|
|
ed7e3d2447 | ||
|
|
0f512788c8 | ||
|
|
d2f4940783 | ||
|
|
941e0b6150 | ||
|
|
7386bde9d2 | ||
|
|
bb28520891 | ||
|
|
074dc67277 | ||
|
|
e903cacf5b | ||
|
|
bd9a388a06 | ||
|
|
ccffac2b06 | ||
|
|
83baed0b6b | ||
|
|
3df4d9f62d | ||
|
|
1f919cf27d | ||
|
|
36c4e27454 | ||
|
|
07a28c77e3 | ||
|
|
ef838c349c | ||
|
|
9a005c994c | ||
|
|
3cce464342 | ||
|
|
50ec6311e6 | ||
|
|
e71985632e | ||
|
|
1e59cbf23b | ||
|
|
3755be94ed | ||
|
|
a3e919a4ba | ||
|
|
332169d39c | ||
|
|
5894e7ef50 | ||
|
|
e883c7478d | ||
|
|
bb7b4bad6d | ||
|
|
865d5b83f2 | ||
|
|
75cfadbd1f | ||
|
|
fb53409d2a | ||
|
|
b1d821704b | ||
|
|
4f0a381b49 | ||
|
|
25e5552630 | ||
|
|
1a23a34419 | ||
|
|
f00d4e0198 | ||
|
|
4a535efcfd | ||
|
|
fbada948fa | ||
|
|
d0ee1fd797 | ||
|
|
10f891696b | ||
|
|
4d2d1591a3 | ||
|
|
2aadc06e0d | ||
|
|
c5aaf923d8 | ||
|
|
b41574e379 | ||
|
|
095b03231c | ||
|
|
64cf398713 | ||
|
|
33df4f0483 | ||
|
|
f54b515797 | ||
|
|
25da21b14e | ||
|
|
d4b500d9d7 | ||
|
|
84acc988eb | ||
|
|
466cc94e7a | ||
|
|
ec79db6086 | ||
|
|
3aa75bcef6 | ||
|
|
a793cf953f | ||
|
|
df13e01665 | ||
|
|
15a23c8131 | ||
|
|
33859ad8e3 | ||
|
|
2f9d118f21 | ||
|
|
930ae71ef0 | ||
|
|
da9f55c3fb | ||
|
|
2ec473bb0a | ||
|
|
8b73296d7b | ||
|
|
15cf59605f | ||
|
|
e121bf4c1d | ||
|
|
178db94cd6 | ||
|
|
934f0fbbcb | ||
|
|
3b5a90bd86 | ||
|
|
c2634188ce | ||
|
|
52bf93479c | ||
|
|
629fb85f17 | ||
|
|
38536f6b1c | ||
|
|
802fc78bd7 | ||
|
|
994a552c09 | ||
|
|
52b2d50db4 | ||
|
|
1586bbf7f1 | ||
|
|
2a6c7a1a9b | ||
|
|
7edd5170b5 | ||
|
|
1b92ab0ecb | ||
|
|
efe5b28c09 | ||
|
|
a4ccfadcc2 | ||
|
|
b8dc52f4a3 | ||
|
|
e79103166f | ||
|
|
3897de6098 | ||
|
|
e33855cc47 | ||
|
|
9d6e7ce12d | ||
|
|
cf83dfb283 | ||
|
|
d62af81f6a | ||
|
|
9460226acd | ||
|
|
1339f3842c | ||
|
|
dce5b82f12 | ||
|
|
1f07e804f0 | ||
|
|
a67e654b6c | ||
|
|
8af3e6507e | ||
|
|
f9d69bd0fd | ||
|
|
3d7cc9d2d1 | ||
|
|
345fbfef06 | ||
|
|
3274fc30ee | ||
|
|
021a15fe9f | ||
|
|
098d13ba10 | ||
|
|
014b9c70f7 | ||
|
|
1048a7e314 | ||
|
|
bcee73f7ae | ||
|
|
020a1e7006 | ||
|
|
e0f82c6ed6 | ||
|
|
2dd20e468a | ||
|
|
35b7b0b549 | ||
|
|
19bbe41c71 | ||
|
|
48088f210d | ||
|
|
e18eb7721e | ||
|
|
6c9dcae532 | ||
|
|
0102f1d5ec | ||
|
|
d2dad31e79 | ||
|
|
af7b7ffb4e | ||
|
|
d70a8c09c6 | ||
|
|
9edd4d4db7 | ||
|
|
ff2c96be1f | ||
|
|
54040f94b9 | ||
|
|
f92b5842bf | ||
|
|
dad8dfe254 | ||
|
|
08c48ddc01 | ||
|
|
347df4ce55 | ||
|
|
7293ef7ac0 | ||
|
|
2c3120274a | ||
|
|
45bac0c496 | ||
|
|
267daddecc | ||
|
|
a19d694f09 | ||
|
|
1c3e04bb94 | ||
|
|
cb92f4f042 | ||
|
|
2341747805 | ||
|
|
dcb17eaefc | ||
|
|
44627a9677 | ||
|
|
b6e5bb27c9 | ||
|
|
af04bfa300 | ||
|
|
f8c06fb2ac | ||
|
|
18744fe3ab | ||
|
|
b295092b8f | ||
|
|
2da30a96d4 | ||
|
|
52618d28e1 | ||
|
|
63963f51ef | ||
|
|
d6b159d4a6 | ||
|
|
2dd730ccb3 | ||
|
|
cf4dfdc8e7 | ||
|
|
8eac2ca840 | ||
|
|
5be34ba80f | ||
|
|
de2046275d | ||
|
|
ee02f3fbed | ||
|
|
570b6d25c0 | ||
|
|
937c3b990b | ||
|
|
d77b9d1ce9 | ||
|
|
4ac6a2552b | ||
|
|
d72c847fe8 | ||
|
|
377fa8aff8 | ||
|
|
6fd71e1b09 | ||
|
|
8de1d8bfe3 | ||
|
|
da519166e9 | ||
|
|
f7396f3394 | ||
|
|
52d273674b | ||
|
|
0d4b8d7e43 | ||
|
|
2b95a05bf6 | ||
|
|
bbf61e35e7 | ||
|
|
93d8a3fd29 | ||
|
|
3eb0170ea6 | ||
|
|
6df9ec52a0 | ||
|
|
bdf3f07677 | ||
|
|
7ecf3bc91c | ||
|
|
5eeffc9fc5 | ||
|
|
a1123538a5 | ||
|
|
8363349b84 | ||
|
|
45aa6f15b0 | ||
|
|
934e10d0f1 | ||
|
|
61da0870b9 | ||
|
|
4afd141a05 | ||
|
|
cf8e3d2c5c | ||
|
|
9ed616a56c | ||
|
|
3712b58c2f | ||
|
|
97b36b26e0 | ||
|
|
16c3a25f71 | ||
|
|
bc02079cb2 | ||
|
|
c6ca5c5ad9 | ||
|
|
ebb583d291 | ||
|
|
d84c098417 | ||
|
|
da2da79012 | ||
|
|
beb35aba19 | ||
|
|
475d1d60b8 | ||
|
|
f6582d6928 | ||
|
|
1470789927 | ||
|
|
584c72992a | ||
|
|
920a074e89 | ||
|
|
30a5a07a71 | ||
|
|
ff6d6a9f07 | ||
|
|
ecc0a1ece8 | ||
|
|
43110b2c29 | ||
|
|
f00d157c12 | ||
|
|
8e89e2f2e0 | ||
|
|
33e5e35fdb | ||
|
|
a0f77f6acb | ||
|
|
3c34619125 | ||
|
|
fd16baae25 | ||
|
|
4585b9dbac | ||
|
|
ac830b3970 | ||
|
|
09577b8c8d | ||
|
|
f63c75de84 | ||
|
|
b88b49a7bc | ||
|
|
8a4310b160 | ||
|
|
f01ad926d0 | ||
|
|
54b5deff77 | ||
|
|
2360a5f093 | ||
|
|
e4419ab691 | ||
|
|
9f81a50c85 | ||
|
|
5ab920d2ae | ||
|
|
e7922a5b70 | ||
|
|
8f182a1cac | ||
|
|
5cf74bf10c | ||
|
|
9144111296 | ||
|
|
962fc2e1e7 | ||
|
|
37e68aba55 | ||
|
|
b9db869a3d | ||
|
|
2e88f2f2ec | ||
|
|
862c22cf7d | ||
|
|
526a774adb | ||
|
|
e237b7dea3 | ||
|
|
56d9a4fcd5 | ||
|
|
e924057d80 | ||
|
|
8f05e70340 | ||
|
|
d83d61d942 | ||
|
|
a622ed554f | ||
|
|
d17ac4feb2 | ||
|
|
f9da823216 | ||
|
|
e2f1d02eb3 | ||
|
|
e9c19617bf | ||
|
|
d3a2e55af4 | ||
|
|
971112f965 | ||
|
|
c5bdc9dfd2 | ||
|
|
fc3c3303f1 | ||
|
|
f4bf712fbb | ||
|
|
b60293e1ce | ||
|
|
4622cd14c2 | ||
|
|
d7efe068d2 | ||
|
|
08d6fa6de4 | ||
|
|
099d27432b | ||
|
|
20a7691c92 | ||
|
|
f234136414 | ||
|
|
5e4f4196a9 | ||
|
|
b4874e2c82 | ||
|
|
03094a5533 | ||
|
|
7a5fd6a1bf | ||
|
|
65f14b0067 | ||
|
|
f97d91ab67 | ||
|
|
f0339cc9cf | ||
|
|
5488da280d | ||
|
|
d5f6ca8255 | ||
|
|
25f1195a25 | ||
|
|
56d048c412 | ||
|
|
7ba7a5f817 | ||
|
|
204ff1c868 | ||
|
|
249366b1ac | ||
|
|
939b297ac7 | ||
|
|
22216a8691 | ||
|
|
3e72277272 | ||
|
|
cfc1f91c9f | ||
|
|
e8af3db88a | ||
|
|
dd69337e6e | ||
|
|
cc1e05ca5f | ||
|
|
f547fb8e07 | ||
|
|
644bd87e8e | ||
|
|
3183135dd3 | ||
|
|
0c54beb1ee | ||
|
|
ba8b5e8d6d | ||
|
|
12e5ec6aa8 | ||
|
|
3173c21909 | ||
|
|
86368faca9 | ||
|
|
c6c7557f8e | ||
|
|
87375e257b | ||
|
|
2d50c8498d | ||
|
|
9fe88870c5 | ||
|
|
78d3adbb21 | ||
|
|
f345da5238 | ||
|
|
52b43a2876 | ||
|
|
520aa705cb | ||
|
|
8caeeb886a | ||
|
|
28e44bbb0b | ||
|
|
fb9c19c62d | ||
|
|
350731e8f9 | ||
|
|
52fa10a9a3 | ||
|
|
75e4377d81 | ||
|
|
86d2a9b978 | ||
|
|
2117fe0593 | ||
|
|
0a64f943fc | ||
|
|
e0ec61187e | ||
|
|
384089004d | ||
|
|
ed36720b66 | ||
|
|
16ad35f64e | ||
|
|
d427fab587 | ||
|
|
a64a192c90 | ||
|
|
5576a4e1cb | ||
|
|
f1781e86b7 | ||
|
|
7c8cac3c21 | ||
|
|
36dfb90c53 | ||
|
|
65ac291f20 | ||
|
|
70ffd5d055 | ||
|
|
5925ba08a3 | ||
|
|
49dc9cafa6 | ||
|
|
ad3333e2cd | ||
|
|
6042f781f7 | ||
|
|
485682c30a | ||
|
|
27e6b5b6bd | ||
|
|
3aeebfb231 | ||
|
|
fe847e7660 | ||
|
|
8def766de2 | ||
|
|
97d1258375 | ||
|
|
4fbc1210ed | ||
|
|
272c82c13a | ||
|
|
da359253d5 | ||
|
|
2b55cfcfbd | ||
|
|
e4f3b970ad | ||
|
|
37a83b447e | ||
|
|
0d28133b12 | ||
|
|
b38e42fe9d | ||
|
|
864e7c51b6 | ||
|
|
ec2dbdd107 | ||
|
|
4896d5c7ef | ||
|
|
e002bb99a8 | ||
|
|
370bf116a2 | ||
|
|
2dd77580c0 | ||
|
|
b5e6d6cccf | ||
|
|
6c4964602a | ||
|
|
98de15137e | ||
|
|
c90b6bb101 | ||
|
|
44dd3274da | ||
|
|
77a865d970 | ||
|
|
a218a96784 | ||
|
|
d54893da1d | ||
|
|
87ff7f2af3 | ||
|
|
a84c5f0f64 | ||
|
|
256cf7ee7d | ||
|
|
79b5a2b142 | ||
|
|
302c33e49f | ||
|
|
1a69eed2c4 | ||
|
|
4956fcd31b | ||
|
|
82f8ae4c5b | ||
|
|
6debc446e0 | ||
|
|
25aae73a30 | ||
|
|
5bbb0c6295 | ||
|
|
9f26861147 | ||
|
|
81b9fd4310 | ||
|
|
03276bf6e6 | ||
|
|
0ef63f596d | ||
|
|
b00057c88a | ||
|
|
c511f560bf | ||
|
|
d486427cf1 | ||
|
|
7a8a68e2bd | ||
|
|
e8f8e77642 | ||
|
|
75673cfc3d | ||
|
|
e8346f8cf7 | ||
|
|
dd04ff506b | ||
|
|
82c32fe1b5 | ||
|
|
d6667dd54f | ||
|
|
a944deae97 | ||
|
|
3d50da5397 | ||
|
|
65cee2f01a | ||
|
|
86b629efb6 | ||
|
|
e55d3e6d1b | ||
|
|
60aba6558f | ||
|
|
df78fea166 | ||
|
|
69541e1dec | ||
|
|
f92cfa1ca6 | ||
|
|
8cf352abac | ||
|
|
ff4f1c4b76 | ||
|
|
30b03050a2 | ||
|
|
5b3a8563de | ||
|
|
f6ec323906 | ||
|
|
296b4be859 | ||
|
|
f16fb829e6 | ||
|
|
a7c7e78aa5 | ||
|
|
2abe2d4664 | ||
|
|
51490e5654 | ||
|
|
953b1e9683 | ||
|
|
9e1e7bee48 | ||
|
|
b5c4520101 | ||
|
|
220af9ac2c | ||
|
|
613e2d2e90 | ||
|
|
d8c06d23da | ||
|
|
a782d63954 | ||
|
|
a7c4209724 | ||
|
|
f225b1e69b | ||
|
|
040dc8c945 | ||
|
|
a42ab027fd | ||
|
|
e63aaf9ad1 | ||
|
|
e813843b46 | ||
|
|
1c61e1960d | ||
|
|
46ce6ddec4 | ||
|
|
bbe68fbd2a | ||
|
|
e3168b0c54 | ||
|
|
c8e38a6c69 | ||
|
|
83eb1975df | ||
|
|
5ae4ba5774 | ||
|
|
64f728caef | ||
|
|
7fb5e73897 | ||
|
|
bdc4371174 | ||
|
|
dc90541563 | ||
|
|
7424492a0b | ||
|
|
3b9befe52e | ||
|
|
49cbe4580d | ||
|
|
5380739a87 | ||
|
|
6f25c15d23 | ||
|
|
81c4a42e2a | ||
|
|
17084657e6 | ||
|
|
8d7bd4d126 | ||
|
|
b4a28b3314 | ||
|
|
37d7550391 | ||
|
|
a9b9f22bcd | ||
|
|
16344c4a55 | ||
|
|
5d0c33b8e5 | ||
|
|
00a35aab7c | ||
|
|
e1b6c42eed | ||
|
|
ffb17e2c09 | ||
|
|
38e6cb8c7b | ||
|
|
7637387cf1 | ||
|
|
38144ed8b2 | ||
|
|
3f9fc6f6f8 | ||
|
|
49fbbf72fa | ||
|
|
f91ac9b436 | ||
|
|
e6b72d0119 | ||
|
|
f16cde998b | ||
|
|
ef99b7b884 | ||
|
|
a638bdf4c4 | ||
|
|
58f754374d | ||
|
|
4995dbc713 | ||
|
|
b6ca9d917d | ||
|
|
cfcd5c4f61 | ||
|
|
7bfc20ac7a | ||
|
|
8282c1a68d | ||
|
|
30d4c5ed7a | ||
|
|
11631fec16 | ||
|
|
9977332615 | ||
|
|
697846d76e | ||
|
|
fabc783695 | ||
|
|
b3c75a2d6c | ||
|
|
e4d10f3838 | ||
|
|
26a1ad604f | ||
|
|
b6b9143218 | ||
|
|
d1899557eb | ||
|
|
60d1a52995 | ||
|
|
8ce0967df8 | ||
|
|
4da2a8b718 | ||
|
|
1530a6b77f | ||
|
|
248cf6f69f | ||
|
|
3f3d14e1d3 | ||
|
|
e69461593d | ||
|
|
25af150911 | ||
|
|
919eeef5c8 | ||
|
|
73a5cbeba4 | ||
|
|
3a2ea76469 | ||
|
|
58b004ff64 | ||
|
|
8dd3905163 | ||
|
|
53d797840e | ||
|
|
20f34ff0db | ||
|
|
c88f1ec8ca | ||
|
|
ed5a993a97 | ||
|
|
ce89309b45 | ||
|
|
458951d8e3 | ||
|
|
a33a84b11a | ||
|
|
e72d49a97a | ||
|
|
17322275dd | ||
|
|
7989768766 | ||
|
|
5ade423774 | ||
|
|
e5ed605f01 | ||
|
|
50f97cf7fb | ||
|
|
34b6abefa2 | ||
|
|
e5741c56d1 | ||
|
|
42b1f62085 | ||
|
|
3740d67d76 | ||
|
|
b45438181c | ||
|
|
84581e56d3 | ||
|
|
4e39d530f0 | ||
|
|
78cb2e6553 | ||
|
|
3b3aea6834 | ||
|
|
6f9549381d | ||
|
|
14f2cf1757 | ||
|
|
3551e25099 | ||
|
|
5f86576187 | ||
|
|
d8b4c79270 | ||
|
|
d2c8cb70bd | ||
|
|
94d4add1f7 | ||
|
|
c689a126ed | ||
|
|
ec8128e27f | ||
|
|
ab38f4f8fc | ||
|
|
e657919ddf | ||
|
|
c53a9c70fb | ||
|
|
f6baa62cd8 | ||
|
|
3aa4b42a35 | ||
|
|
974a27131e | ||
|
|
68a0f40c35 | ||
|
|
af2559c0d6 | ||
|
|
cae7e0741a | ||
|
|
ee1e4e645a | ||
|
|
6c270ed087 | ||
|
|
22a001988b | ||
|
|
a596975eb6 | ||
|
|
e731b2ba2c | ||
|
|
49cf335e7f | ||
|
|
814112d0f6 | ||
|
|
614effc0f6 | ||
|
|
a4a5a210cb | ||
|
|
283427c053 | ||
|
|
0ed606fd40 | ||
|
|
d28f30ef4e | ||
|
|
a6462990e6 | ||
|
|
d7289658fb | ||
|
|
abdefeaa89 | ||
|
|
6cf3b98ac2 | ||
|
|
4bdb1d2e6c | ||
|
|
e91d770511 | ||
|
|
84b3b03705 | ||
|
|
672ba3ddf5 | ||
|
|
741c14fcf0 | ||
|
|
af36c1f2e7 | ||
|
|
a1dc97beb1 | ||
|
|
1ed0e1beb5 | ||
|
|
bfdfeb62a7 | ||
|
|
00adebd184 | ||
|
|
7b011c5467 | ||
|
|
e52d3efe8a | ||
|
|
ab9160de90 | ||
|
|
2f4bade348 | ||
|
|
9b744922dd | ||
|
|
8810db303c | ||
|
|
1f0c2e72c4 | ||
|
|
4722654851 | ||
|
|
103c4603d2 | ||
|
|
03848f5ca7 | ||
|
|
0c39318a8b | ||
|
|
d54ff9dc3d | ||
|
|
4a96e64dc2 | ||
|
|
278856319b | ||
|
|
6b16f63332 | ||
|
|
6c217d97df | ||
|
|
d172201403 | ||
|
|
648e30bca6 | ||
|
|
815189613b | ||
|
|
4f30cc2708 | ||
|
|
69cb7dc839 | ||
|
|
551829d8f3 | ||
|
|
3a833ea38f | ||
|
|
be8a4cbbdd | ||
|
|
f3efb9903c | ||
|
|
4fc8320f4c | ||
|
|
a8260a38e0 | ||
|
|
c2217f2238 | ||
|
|
9f37d89037 | ||
|
|
ac115a1f9a | ||
|
|
c622e1d18f | ||
|
|
dde8069e57 | ||
|
|
44e25155f7 | ||
|
|
dd45530ee6 | ||
|
|
dd209fae3a | ||
|
|
a0a6590e0f | ||
|
|
c96f94c63a | ||
|
|
4efa6a0176 | ||
|
|
2de7cbe980 | ||
|
|
152181b25c | ||
|
|
2d980b803a | ||
|
|
df19c6b64c | ||
|
|
333345cd26 | ||
|
|
0f76ba5523 | ||
|
|
41138e01f5 | ||
|
|
340b2b076e | ||
|
|
5113d9c3c9 | ||
|
|
a272530bf0 | ||
|
|
f0446164fb | ||
|
|
0e1756330b | ||
|
|
a49e77af50 | ||
|
|
970eb39bdc | ||
|
|
25a2740abb | ||
|
|
7c524bbef4 | ||
|
|
47b6030dda | ||
|
|
d515716140 | ||
|
|
d03b3cbdd7 | ||
|
|
54f9205653 | ||
|
|
1df7ef2974 | ||
|
|
d5a52edc11 | ||
|
|
b26ce8b1be | ||
|
|
a2a5c6f821 | ||
|
|
ca39a00822 | ||
|
|
6761872e49 | ||
|
|
8c8381d543 | ||
|
|
2901bf2d00 | ||
|
|
54c2854fe2 | ||
|
|
2a67a34f4a | ||
|
|
b18ea70b20 | ||
|
|
272d76e3ce | ||
|
|
d03d960369 | ||
|
|
15a24c6fba | ||
|
|
9ed2d0a577 | ||
|
|
ce053e7006 | ||
|
|
3b47e05908 | ||
|
|
fb484524bd | ||
|
|
6b00202f1b | ||
|
|
1bea58e4a8 | ||
|
|
27b8040c76 | ||
|
|
065972f959 | ||
|
|
e6863ef318 | ||
|
|
cd94eee45f | ||
|
|
b4139d582d | ||
|
|
dc799a875b | ||
|
|
47613d071c | ||
|
|
0f20c839d7 | ||
|
|
7e5f5e26ba | ||
|
|
1fb7a735dc | ||
|
|
cb035614d0 | ||
|
|
e6dcf2aeb6 | ||
|
|
86ef5a0689 | ||
|
|
156de9c3ef | ||
|
|
502912de3a | ||
|
|
a8bbe7d808 | ||
|
|
a8e31d624a | ||
|
|
e5956258dd | ||
|
|
038b26c312 | ||
|
|
c634ec6a56 | ||
|
|
f58eca9020 | ||
|
|
7795c1911e | ||
|
|
d39f279daa | ||
|
|
aa76cd1e49 | ||
|
|
fa1ac00aee | ||
|
|
8b47e1cfe1 | ||
|
|
19cf72eddc | ||
|
|
8253532c2d | ||
|
|
080150d96f | ||
|
|
58a0f6dbdd | ||
|
|
f0eabfd432 | ||
|
|
3ffa41aae3 | ||
|
|
ded951793c | ||
|
|
ea9b2c0312 | ||
|
|
50c4026e93 | ||
|
|
e5edad3dc7 | ||
|
|
7b9ca3caa7 | ||
|
|
e571d3badc | ||
|
|
d9a317c8b2 | ||
|
|
b133cbf5f3 | ||
|
|
8f177bb0b6 | ||
|
|
00053aa6c4 | ||
|
|
ae2f732e8c | ||
|
|
07502f1963 | ||
|
|
ddfc87c6f3 | ||
|
|
00dbd369c7 | ||
|
|
ce2c337261 | ||
|
|
d72dfab296 | ||
|
|
d2bf696ee0 | ||
|
|
88d79eabdc | ||
|
|
71097d9cf2 | ||
|
|
d5ac877f7f | ||
|
|
9f528ce057 | ||
|
|
47665452f0 | ||
|
|
39b6ab6a29 | ||
|
|
f88315cb29 | ||
|
|
35c4437bf5 | ||
|
|
237ce8724a | ||
|
|
8a74a9e2f9 | ||
|
|
600a3860a4 | ||
|
|
7bb48e5e8e | ||
|
|
4593866eb9 | ||
|
|
dfc7945d1e | ||
|
|
a9e00cd451 | ||
|
|
1dcf094077 | ||
|
|
4a59def9b4 | ||
|
|
8001ed71ed | ||
|
|
710ca1fe36 | ||
|
|
153d70ca9b | ||
|
|
93ec31dff6 | ||
|
|
03b2ae16f2 | ||
|
|
eec622d178 | ||
|
|
3c038b6c40 | ||
|
|
1699eb0bf6 | ||
|
|
5d28b63687 | ||
|
|
ad867fe237 | ||
|
|
a53075f7c5 | ||
|
|
fd724f13b0 | ||
|
|
dea22b4bda | ||
|
|
4d88b3837b | ||
|
|
ae0e747d6a | ||
|
|
a018988ce8 | ||
|
|
5bdd4d9ccf | ||
|
|
a9c8251b9d | ||
|
|
4e2732c3c3 | ||
|
|
f3b31380fa | ||
|
|
9cc4935d7b | ||
|
|
02feb63684 | ||
|
|
fa143dbc8e | ||
|
|
73fe696c91 | ||
|
|
789a6c1bd2 | ||
|
|
2f58b813bb | ||
|
|
bd23e084eb | ||
|
|
34d6077c93 | ||
|
|
9d3f27f3da | ||
|
|
175c313a12 | ||
|
|
ec414372e8 | ||
|
|
5645b2d89b | ||
|
|
9f09618bd4 | ||
|
|
c9af3de155 | ||
|
|
64d94b4aa6 | ||
|
|
68c02593df | ||
|
|
fa57135b2c | ||
|
|
a767d10fa5 | ||
|
|
0c10a94581 | ||
|
|
7b54556008 | ||
|
|
c807949408 | ||
|
|
908a992d7f | ||
|
|
cd74a901a7 | ||
|
|
a82001b1cf | ||
|
|
190c2b4591 | ||
|
|
f6d870f7ae | ||
|
|
663916cea7 | ||
|
|
1e05c9a7e6 | ||
|
|
a0be71c703 | ||
|
|
deb10ac6f9 | ||
|
|
a698e52926 | ||
|
|
33a29f3c35 | ||
|
|
2d1ab9a850 | ||
|
|
4afc3a6542 | ||
|
|
282157f1e7 | ||
|
|
28985bb274 | ||
|
|
d1b65c6bda | ||
|
|
41ff8d7aaa | ||
|
|
e6a0099971 | ||
|
|
0aee867f00 | ||
|
|
27aec502ae | ||
|
|
2f5b7ad6ca | ||
|
|
a06cadba22 | ||
|
|
f8797a5aac | ||
|
|
eec3def7c5 | ||
|
|
a2769bb73d | ||
|
|
6d2a0da7a7 | ||
|
|
dd51042802 | ||
|
|
18a4bd2510 | ||
|
|
997e19092e | ||
|
|
4e6c799e9f | ||
|
|
b905dab377 | ||
|
|
68573c9d2b | ||
|
|
7563dd4a8d | ||
|
|
db1045f2c0 | ||
|
|
5cb8cca9eb | ||
|
|
72033fcff8 | ||
|
|
67e41fe2f6 | ||
|
|
ea77b03479 | ||
|
|
e5fa44c869 | ||
|
|
1f5d744742 | ||
|
|
c093b6228c | ||
|
|
1aa7fd5aef | ||
|
|
535a1085bc | ||
|
|
ce34b6f50d | ||
|
|
a8ffa96e9b | ||
|
|
062fb50562 | ||
|
|
eaf2d4cbfc | ||
|
|
dd54f0babd | ||
|
|
30d1ec38a7 | ||
|
|
08fc2c925f | ||
|
|
ab1e65b380 | ||
|
|
631d216273 | ||
|
|
ff3aada6cb | ||
|
|
2726f383cd | ||
|
|
e05412fc23 | ||
|
|
518fc282f4 | ||
|
|
820201caa8 | ||
|
|
01993f7d4a | ||
|
|
1350f885f6 | ||
|
|
7fd2561d64 | ||
|
|
47e784eab6 | ||
|
|
5b984b36ca | ||
|
|
acf0d56f0b | ||
|
|
9a03154f46 | ||
|
|
6c891d4303 | ||
|
|
42bcb4a7ad | ||
|
|
f5377cd74f | ||
|
|
9deb614a57 | ||
|
|
ab829274b1 | ||
|
|
ba71191ce1 | ||
|
|
aa60db19d2 | ||
|
|
501a8c6b91 | ||
|
|
65583b14e0 | ||
|
|
9e66515886 | ||
|
|
e078c3d854 | ||
|
|
e55f60240a | ||
|
|
660fc5f560 | ||
|
|
12b2c712ca | ||
|
|
e404db44ff | ||
|
|
9b05f23e05 | ||
|
|
d6a59fb12c | ||
|
|
355db16734 | ||
|
|
bf187d1b2d | ||
|
|
fd1cd89da6 | ||
|
|
3f52cfa130 | ||
|
|
c8e48f4b02 | ||
|
|
67cf81b1c0 | ||
|
|
650caeca0b | ||
|
|
e4d12a1352 | ||
|
|
f999d791e0 | ||
|
|
f2cb97bbda | ||
|
|
da9e67ce3c | ||
|
|
50494d5c1b | ||
|
|
52a39f75f2 | ||
|
|
ff1083c113 | ||
|
|
45dbe94ee0 | ||
|
|
9115d84509 | ||
|
|
0a66541619 | ||
|
|
9622271033 | ||
|
|
a4585285ed | ||
|
|
8e3ce1a9e3 | ||
|
|
9d98e936b5 | ||
|
|
77cd8db1bf | ||
|
|
6965e6f3d5 | ||
|
|
a97fe89538 | ||
|
|
942c820d95 | ||
|
|
bee4abc3ff | ||
|
|
a0d8ec7b76 | ||
|
|
f60a3910c4 | ||
|
|
798cf80c1e | ||
|
|
706d4a7c29 | ||
|
|
f36ba3da20 | ||
|
|
898c217cbc | ||
|
|
7336f1f156 | ||
|
|
51af8a5103 | ||
|
|
65f118d72f | ||
|
|
1ea04d980c | ||
|
|
860e467643 | ||
|
|
ac468dde46 | ||
|
|
107897cf05 | ||
|
|
3806bab283 | ||
|
|
e765aade0b | ||
|
|
c222b96bfd | ||
|
|
7ef573914d | ||
|
|
1ab7eb1406 | ||
|
|
4c20bff9d2 | ||
|
|
44195fda71 | ||
|
|
4a0f9478ef | ||
|
|
6e21ca7635 | ||
|
|
9c8f3063b1 | ||
|
|
d9655e42b8 | ||
|
|
8b175679be | ||
|
|
dc079ab138 | ||
|
|
54e702b5d7 | ||
|
|
57b97b56f6 | ||
|
|
b30445edd6 | ||
|
|
39c0e4e034 | ||
|
|
3a0b59e3fd | ||
|
|
704028d435 | ||
|
|
8b989f5b23 | ||
|
|
899ab95c8c | ||
|
|
98400c1bc4 | ||
|
|
ddf1b76205 | ||
|
|
83936e8cd5 | ||
|
|
2be3b84aed | ||
|
|
3309b040c8 | ||
|
|
86528586a3 | ||
|
|
3fb728c749 | ||
|
|
61c607fd79 | ||
|
|
e2d6e37a54 | ||
|
|
09aca3089f | ||
|
|
b364176c08 | ||
|
|
f0772dc5b8 | ||
|
|
fc82dbb434 | ||
|
|
1e766b50e2 | ||
|
|
fc19243ced | ||
|
|
b47cef056e | ||
|
|
1e8fc24af8 | ||
|
|
9a1250e3e0 | ||
|
|
419c3f6fba | ||
|
|
5bcc11b17a | ||
|
|
2b055dfe3f | ||
|
|
be6ae20510 | ||
|
|
4793324c16 | ||
|
|
c317fbd6cf | ||
|
|
e4b0fce41c | ||
|
|
d9d7040e98 | ||
|
|
80f215198f | ||
|
|
013db649fa | ||
|
|
8a06cb55ee | ||
|
|
850a919640 | ||
|
|
d6aae4d456 | ||
|
|
eb8b1cd764 | ||
|
|
8933b964e9 | ||
|
|
03fe08ca30 | ||
|
|
eeb5b62dc1 | ||
|
|
b4148c3a03 | ||
|
|
c5e9108018 | ||
|
|
83b285e546 | ||
|
|
6594ca8897 | ||
|
|
c983c966cb | ||
|
|
8d3ef287a2 | ||
|
|
ee6b7c1b6c | ||
|
|
f9ec0433ad | ||
|
|
e29137df05 | ||
|
|
9390862702 | ||
|
|
08feefbe7b | ||
|
|
46b192d36d | ||
|
|
56af13a1b1 | ||
|
|
9d4c6fab44 | ||
|
|
9603989c72 | ||
|
|
f43c3199bd | ||
|
|
2b491c19b8 | ||
|
|
b096c5a336 | ||
|
|
c8f481fa3d | ||
|
|
2ae93a776b | ||
|
|
23cc1cd8e6 | ||
|
|
7eb7dd2fed | ||
|
|
e3597c6af7 | ||
|
|
272adbbec4 | ||
|
|
86f4681450 | ||
|
|
6d3db91d3b | ||
|
|
18a2617126 | ||
|
|
31b7a912d1 | ||
|
|
92519a005a | ||
|
|
ccc5a483f4 | ||
|
|
a2a3b4a479 | ||
|
|
65f0cc7f4b | ||
|
|
879e21ddfd | ||
|
|
950058765d | ||
|
|
bf893e84bd | ||
|
|
c6ad70d5f1 | ||
|
|
5c0b108639 | ||
|
|
9dba044be2 | ||
|
|
a5db3967ea | ||
|
|
7edc5ac42f | ||
|
|
44228663f1 | ||
|
|
bf21ce63ee | ||
|
|
30dee8adfc | ||
|
|
c9f3f9ed70 | ||
|
|
7fd13472ae | ||
|
|
f59cb3eacc | ||
|
|
4410bbbf88 | ||
|
|
b79b7c354d | ||
|
|
6a7b1fb754 | ||
|
|
2dba2eb46a | ||
|
|
c4697a6690 | ||
|
|
557862d152 | ||
|
|
0d0ed6a29b | ||
|
|
0500cf429f | ||
|
|
a36045fb3b | ||
|
|
fa7dbab3fe | ||
|
|
cac3e1588e | ||
|
|
eead4bb89e | ||
|
|
e2d73897d0 | ||
|
|
6e161a26e3 | ||
|
|
5f80d2ad33 | ||
|
|
38f6a3cdc7 | ||
|
|
ee74054e81 | ||
|
|
d07545b7b8 | ||
|
|
56acf7e528 | ||
|
|
d129eea9fa | ||
|
|
de5cb8b140 | ||
|
|
02f28bac29 | ||
|
|
9c2b3744c9 | ||
|
|
5b4f836148 | ||
|
|
eb5b7ac27b | ||
|
|
3a0602578e | ||
|
|
25ecb1f0b3 | ||
|
|
f3e6a35cdb | ||
|
|
424c74e736 | ||
|
|
c6960b6086 | ||
|
|
660dcfe6a2 | ||
|
|
19641c40f9 | ||
|
|
014a2c17df | ||
|
|
042c475a8f | ||
|
|
d9215a6616 | ||
|
|
19e227561a | ||
|
|
916f803175 | ||
|
|
1ab60f7bfb | ||
|
|
44e039b4f5 | ||
|
|
8abd92f12f | ||
|
|
de6ecc5ac3 | ||
|
|
03dd2818e4 | ||
|
|
bde3ae0c60 | ||
|
|
d975804e9a | ||
|
|
9ec09700d6 | ||
|
|
934c4e6621 | ||
|
|
8b34437522 | ||
|
|
63a92eb665 | ||
|
|
3b7794f9eb | ||
|
|
0e23048303 | ||
|
|
2952b7d1fb | ||
|
|
b9daef91d8 | ||
|
|
4093192ec9 | ||
|
|
793c2d8429 | ||
|
|
a55625873f | ||
|
|
134dfea878 | ||
|
|
3aed95dbdb | ||
|
|
11abab356e | ||
|
|
8394f1a015 | ||
|
|
9250d1529c | ||
|
|
6f1bb2246c | ||
|
|
ad6ed536d5 | ||
|
|
b03d3da9c1 | ||
|
|
fa71882e63 | ||
|
|
fd6c4c71d6 | ||
|
|
6cb6987d4d | ||
|
|
ed22179a82 | ||
|
|
6253cc9279 | ||
|
|
f1d3e5e4d6 | ||
|
|
ece99b3da0 | ||
|
|
68a3e4a888 | ||
|
|
5215b83aea | ||
|
|
40edab5e39 | ||
|
|
43e979db3b | ||
|
|
7fa14f42c1 | ||
|
|
a88a0e88a4 | ||
|
|
f5bcc372c9 | ||
|
|
be7eec79be | ||
|
|
20a09d928a | ||
|
|
d958c0486a | ||
|
|
c4d1ab573a | ||
|
|
54bc73151b | ||
|
|
6d3bd96607 | ||
|
|
6c2082db71 | ||
|
|
3c4e9e341f | ||
|
|
771f3ef5ad | ||
|
|
e83ebc8992 | ||
|
|
825b7c301d | ||
|
|
691177842c | ||
|
|
d0308b7daa | ||
|
|
aeb603f2af | ||
|
|
c52d85442c | ||
|
|
5491a1f33e | ||
|
|
c4627a9ff1 | ||
|
|
b6e2f9b752 | ||
|
|
6b78f11a03 | ||
|
|
dcab9896e8 | ||
|
|
03698aa6d8 | ||
|
|
df8e156432 | ||
|
|
0a5e9ee054 | ||
|
|
5c66f6f5eb | ||
|
|
27b390e1a1 | ||
|
|
c982a73b9f | ||
|
|
c64e23832f | ||
|
|
40047bef5d | ||
|
|
cd945c7bd9 | ||
|
|
195061feda | ||
|
|
c151bdd412 | ||
|
|
e288c6015e | ||
|
|
1a9d4fedf3 | ||
|
|
548671dd20 | ||
|
|
4906fe45e2 | ||
|
|
fd09be0984 | ||
|
|
e3c1f0880f | ||
|
|
509ba98938 | ||
|
|
7ddd9f7f27 | ||
|
|
c424c5e808 | ||
|
|
282704145d | ||
|
|
58a09c32c2 | ||
|
|
9e056fa094 | ||
|
|
d2a4ddf982 | ||
|
|
cbdcc215b3 | ||
|
|
d35e9a0c53 | ||
|
|
14916b0ca6 | ||
|
|
4e5d99ca72 | ||
|
|
bc1b089372 | ||
|
|
0f8805e086 | ||
|
|
d12a502ef9 | ||
|
|
7f13b33a78 | ||
|
|
1a2f4fd2f5 | ||
|
|
88251c86dc | ||
|
|
68b8d1ea0a | ||
|
|
821b987486 | ||
|
|
fad3d07df3 | ||
|
|
65b93c7e52 | ||
|
|
a76caa7ff4 | ||
|
|
777460329b | ||
|
|
7019e34c34 | ||
|
|
f6d7e3679c | ||
|
|
c66bfc70d1 | ||
|
|
a57912f893 | ||
|
|
8f229caf87 | ||
|
|
623e163f84 | ||
|
|
c288b94ab9 | ||
|
|
03df17070b | ||
|
|
6249a5b17e | ||
|
|
855d078f95 | ||
|
|
2b5bf7b8d8 | ||
|
|
716d37f8bf | ||
|
|
2ecd0dae1e | ||
|
|
7a59efe7f8 | ||
|
|
152fd59964 | ||
|
|
ec421b7810 | ||
|
|
31ceb6b13c | ||
|
|
11cf0c39c9 | ||
|
|
01d43aaa24 | ||
|
|
ab03c00504 | ||
|
|
eb506a6590 | ||
|
|
fb6e6cd24d | ||
|
|
d052117319 | ||
|
|
efc8638890 | ||
|
|
4ecdf26d9c | ||
|
|
0f9efe9e7a | ||
|
|
8e45778eaf | ||
|
|
8486741e15 | ||
|
|
8d0b712af6 | ||
|
|
8d50d766d4 | ||
|
|
a88f3110f8 | ||
|
|
b927620231 | ||
|
|
29815ca729 | ||
|
|
4ab01fb5f7 | ||
|
|
b3d3578ee4 | ||
|
|
7343681675 | ||
|
|
efbacc9f89 | ||
|
|
5df8b1d05b | ||
|
|
3bb773d03e | ||
|
|
cf688474ea | ||
|
|
33c7ed4478 | ||
|
|
11fe8ecf57 | ||
|
|
67a0a89272 | ||
|
|
ef6d82358d | ||
|
|
fff4caeac1 | ||
|
|
2ce70a15d2 | ||
|
|
da17ffa937 | ||
|
|
e81a3ede4c | ||
|
|
681fb22820 | ||
|
|
cfbc246d57 | ||
|
|
6903efa93d | ||
|
|
b6c5dbe9ef | ||
|
|
b10e6b2943 | ||
|
|
bd9c057433 | ||
|
|
ceaa3c37a9 | ||
|
|
3fab2125ff | ||
|
|
b1b4ba1bdd | ||
|
|
209c6cbf8f | ||
|
|
80d582239e | ||
|
|
db60c02c9e | ||
|
|
36d2794369 | ||
|
|
35830879db | ||
|
|
398ddafb62 | ||
|
|
931c34e955 | ||
|
|
3c465af2ab | ||
|
|
15a36a0a0d | ||
|
|
2b426969c3 | ||
|
|
b55170ce95 | ||
|
|
437f63144a | ||
|
|
253fd256bf | ||
|
|
794a7ccd78 | ||
|
|
da0ce28fe3 | ||
|
|
831d72ac5f | ||
|
|
e45f4a4a4c | ||
|
|
5b1dc1515f | ||
|
|
eda4e24c0d | ||
|
|
7755b9dada | ||
|
|
6b5490cf68 | ||
|
|
0c02bfcc2a | ||
|
|
b5242368f3 | ||
|
|
8266da1cd1 | ||
|
|
f9e2140cab | ||
|
|
64eff7f360 | ||
|
|
2b5670238b | ||
|
|
e2c92d1510 | ||
|
|
87a214c277 | ||
|
|
9cd14ea6ed | ||
|
|
49f5efa8d8 | ||
|
|
208658490c | ||
|
|
d445945a84 | ||
|
|
d0365c4a2c | ||
|
|
c7b7b1da86 | ||
|
|
682c27239f | ||
|
|
450cbfe53a | ||
|
|
12d57a9409 | ||
|
|
d571e4e785 | ||
|
|
57272e41dd | ||
|
|
35c5d79e6b | ||
|
|
b87696ac37 | ||
|
|
b1c58f57a7 | ||
|
|
30888742f4 | ||
|
|
71cfaaa689 | ||
|
|
9be0bb19df | ||
|
|
6037f17942 | ||
|
|
ff1ae7f713 | ||
|
|
fe533c9741 | ||
|
|
f24b9b4f87 | ||
|
|
f1a627e8a2 | ||
|
|
b6aa783d80 | ||
|
|
9ba08208d3 | ||
|
|
9bcd750565 | ||
|
|
24ad692572 | ||
|
|
b7a93578e5 | ||
|
|
bacb5925ff | ||
|
|
92a29c157f | ||
|
|
13c7715a75 | ||
|
|
e85eaf6acd | ||
|
|
db92356577 | ||
|
|
fbb62c6d2b | ||
|
|
8c2e5e4964 | ||
|
|
c701eeb59f | ||
|
|
838eae3961 | ||
|
|
071395de6a | ||
|
|
a517343ca3 | ||
|
|
54c87058bf | ||
|
|
d11221f433 | ||
|
|
14330abdc6 | ||
|
|
e023e0d93b | ||
|
|
a6a00fc6a3 | ||
|
|
78fbb10642 | ||
|
|
bb5e2bf86a | ||
|
|
e51e7a0e8d | ||
|
|
39c7b01d3c | ||
|
|
24df77e951 | ||
|
|
44b708b4c4 | ||
|
|
f363aa3a15 | ||
|
|
b0211e7edf | ||
|
|
79af591368 | ||
|
|
014acfa2af | ||
|
|
a23c2a9e7b | ||
|
|
2a233dd31d | ||
|
|
1600707d35 | ||
|
|
cda802ac86 | ||
|
|
0fcb0e17bc | ||
|
|
a7b7f94ae8 | ||
|
|
9d901217c6 | ||
|
|
bb30fff978 | ||
|
|
98cf0145b1 | ||
|
|
72fd127f8c | ||
|
|
245ca04bab | ||
|
|
a0fcbcfa5f | ||
|
|
85fd8bdb01 | ||
|
|
c437bbcde0 | ||
|
|
88c8ff2508 | ||
|
|
a783da80e7 | ||
|
|
2b3bfaa9ce | ||
|
|
84758960db | ||
|
|
90a52694f3 | ||
|
|
4bd171152d | ||
|
|
f582aa6eda | ||
|
|
5b23666e67 | ||
|
|
cbf394574d | ||
|
|
23e1a29fc7 | ||
|
|
eeae6f946d | ||
|
|
cb50dc7f33 | ||
|
|
3b01778450 | ||
|
|
c73e4412b3 | ||
|
|
9ae985b23a | ||
|
|
2d58761993 | ||
|
|
e8a967d960 | ||
|
|
c4826c5941 | ||
|
|
0c3038234d | ||
|
|
040ffb6326 | ||
|
|
5d8642354e | ||
|
|
8fc95a1b11 | ||
|
|
1407cf8588 | ||
|
|
9c9a3b2775 | ||
|
|
324ebb704a | ||
|
|
86fb12b600 | ||
|
|
25655e5794 | ||
|
|
182366c736 | ||
|
|
9ee9918dad | ||
|
|
e7f2aa0fb8 | ||
|
|
cddde51ec5 | ||
|
|
4d018be950 | ||
|
|
66755abff4 | ||
|
|
7fb42d909e | ||
|
|
6a501462f8 | ||
|
|
b964646756 | ||
|
|
23845947c4 | ||
|
|
d09abfa9f7 | ||
|
|
d22a504d11 | ||
|
|
69fe840ec4 | ||
|
|
ac6093d179 | ||
|
|
079183c1a8 | ||
|
|
65fe7d7605 | ||
|
|
db487188b1 | ||
|
|
321c2fd178 | ||
|
|
cb24406da5 | ||
|
|
5d93feb6ad | ||
|
|
93ffd371eb | ||
|
|
3d22d3ae0c | ||
|
|
09830aa0ea | ||
|
|
0607abc3dd | ||
|
|
f6bc783d63 | ||
|
|
939791a129 | ||
|
|
2873d5608b | ||
|
|
87bc705fb5 | ||
|
|
f4a6f936b5 | ||
|
|
4f660cc018 | ||
|
|
901c495482 | ||
|
|
563c273738 | ||
|
|
fc5ec206a7 | ||
|
|
37705a3bc5 | ||
|
|
20abe595ec | ||
|
|
8f92a7efdb | ||
|
|
01b35c3c16 | ||
|
|
18c780a0ff | ||
|
|
c1913c9cf4 | ||
|
|
54a03e20dd | ||
|
|
132ef4295a | ||
|
|
b19126b291 | ||
|
|
740acd6891 | ||
|
|
65c2444e15 | ||
|
|
9faa7e8186 | ||
|
|
e378566060 | ||
|
|
09bc942b47 | ||
|
|
fb550ee620 | ||
|
|
d1268c5921 | ||
|
|
f15cdc7451 | ||
|
|
e378a89bd6 | ||
|
|
afffa3d9b0 | ||
|
|
dae17734ec | ||
|
|
e4e864586c | ||
|
|
3476404912 | ||
|
|
736114f44b | ||
|
|
170be56a74 | ||
|
|
4ad52a8f18 | ||
|
|
1c263d6918 | ||
|
|
2156ccaa4a | ||
|
|
458c2833c0 | ||
|
|
9fc3d32a50 | ||
|
|
9158b8956f | ||
|
|
7bc775d93d | ||
|
|
2e4ca9d1a5 | ||
|
|
e8feb2932f | ||
|
|
e5deed06c0 | ||
|
|
1ee66933c1 | ||
|
|
01c4e04424 | ||
|
|
e494df1a37 | ||
|
|
72872d3d8c | ||
|
|
3c05bda058 | ||
|
|
3b8614a8f6 | ||
|
|
890eee3b47 | ||
|
|
76a437a31b | ||
|
|
872c6d85c0 | ||
|
|
bb2313db28 | ||
|
|
9fd2767200 | ||
|
|
c3c21e3c14 | ||
|
|
79401542f7 | ||
|
|
532179e845 | ||
|
|
d6606d1ea7 | ||
|
|
5dda1d2394 | ||
|
|
1cf2272347 | ||
|
|
49317cddad | ||
|
|
010c0ad0eb | ||
|
|
948aaab4ca | ||
|
|
3cf46fa591 | ||
|
|
0ca7855f67 | ||
|
|
2b9baca4f0 | ||
|
|
e22bb0dc8e | ||
|
|
e326cecf18 | ||
|
|
1d44fc0c49 | ||
|
|
bc50961a74 | ||
|
|
ec4b2742e7 | ||
|
|
c86c5443eb | ||
|
|
1f4bf79d65 | ||
|
|
b6dbf11ed5 | ||
|
|
e83e8f0426 | ||
|
|
ee961599e1 | ||
|
|
d765df2796 | ||
|
|
aa05321262 | ||
|
|
924d74516a | ||
|
|
e80bf802a9 | ||
|
|
abff678866 | ||
|
|
aaa7b44460 | ||
|
|
22dc946a7e | ||
|
|
b71807082c | ||
|
|
db20806710 | ||
|
|
b62ddd5f8b | ||
|
|
e02dc84c1a | ||
|
|
851a2fd72c | ||
|
|
eb7acb5524 | ||
|
|
1d3f94efe2 | ||
|
|
7d058ef86c | ||
|
|
f1560ce035 | ||
|
|
a93992e725 | ||
|
|
3a679e56b2 | ||
|
|
ce04b1aa62 | ||
|
|
7b95f9bf39 | ||
|
|
ba10aed86d | ||
|
|
12e5931a9a | ||
|
|
f77c6973a1 | ||
|
|
f389ca2acc | ||
|
|
bfebe7e927 | ||
|
|
78e670fcf8 | ||
|
|
2d6aadd7e2 | ||
|
|
45125ee573 | ||
|
|
9482c07953 | ||
|
|
3e43e49ffd | ||
|
|
44b7854c84 | ||
|
|
36e9b82080 | ||
|
|
ba8fc71979 | ||
|
|
657ee2d719 | ||
|
|
69384f4fad | ||
|
|
bbb490f6a3 | ||
|
|
a5cb05c45d | ||
|
|
242460cb66 | ||
|
|
af13fbb70f | ||
|
|
b25589c6bb | ||
|
|
4505e8accb | ||
|
|
aa823f8667 | ||
|
|
6c5433c836 | ||
|
|
642696b678 | ||
|
|
45870619f3 | ||
|
|
4681197a58 | ||
|
|
5eed6e2224 | ||
|
|
166dc85bed | ||
|
|
66ccf5ddcf | ||
|
|
8b970da40d | ||
|
|
b19babe5e6 | ||
|
|
55b5a68d72 | ||
|
|
c8ba8c513c | ||
|
|
2c6ba737f8 | ||
|
|
5724b7e292 | ||
|
|
50ee61db4c | ||
|
|
480dd8ffbe | ||
|
|
e6c435b506 | ||
|
|
7194da2167 | ||
|
|
13930cf569 | ||
|
|
cd2cc27af1 | ||
|
|
8e04257bc5 | ||
|
|
78debf246b | ||
|
|
fb481913f0 | ||
|
|
11e3ac62a5 | ||
|
|
21d8e8590b | ||
|
|
656632b776 | ||
|
|
3f10831308 | ||
|
|
1c159c470a | ||
|
|
bef320aa07 | ||
|
|
b85367a608 | ||
|
|
aa5b67add0 | ||
|
|
f76f52df61 | ||
|
|
735b3a710a | ||
|
|
9655c2c7a6 | ||
|
|
33104cdd42 | ||
|
|
711aff9d9d | ||
|
|
d843ac5132 | ||
|
|
84f3b76e1c | ||
|
|
53f6f8ac93 | ||
|
|
4205d79273 | ||
|
|
4082bf9d7c | ||
|
|
604022d40b | ||
|
|
335b1d360b | ||
|
|
3c42657207 | ||
|
|
40ae02c247 | ||
|
|
13eed79c77 | ||
|
|
09858c239b | ||
|
|
a5726ac453 | ||
|
|
640dea4d9d | ||
|
|
8adc20ce35 | ||
|
|
da9a6ac9e7 | ||
|
|
01a37177d1 | ||
|
|
610642c130 | ||
|
|
8b810c7a78 | ||
|
|
f39bf458e5 | ||
|
|
94bfbaa84e | ||
|
|
96a1a59d21 | ||
|
|
a33f178491 | ||
|
|
359b571448 | ||
|
|
596c51087b | ||
|
|
cb05a451c6 | ||
|
|
64c0f5c592 | ||
|
|
fcb890d751 | ||
|
|
ccb6bdca75 | ||
|
|
42ab401fd3 | ||
|
|
85640f1c9d | ||
|
|
4172d7c584 | ||
|
|
6167355309 | ||
|
|
be60924f29 | ||
|
|
c43da352ab | ||
|
|
048ccb2849 | ||
|
|
3286abd82e | ||
|
|
687891238c | ||
|
|
a2f7619860 | ||
|
|
ac12f3926b | ||
|
|
2f1a0a0e2c | ||
|
|
0d8723f8d5 | ||
|
|
27a984fbd3 | ||
|
|
a3ae4c87fd | ||
|
|
ce28d0ca89 | ||
|
|
5b63963573 | ||
|
|
ae455fabd8 | ||
|
|
90027be251 | ||
|
|
7f814c6bf8 | ||
|
|
27de4fe922 | ||
|
|
62a2cd9ed2 | ||
|
|
381d3b8b7d | ||
|
|
d19ac4b66d | ||
|
|
37cda6dc4c | ||
|
|
1bf1428654 | ||
|
|
246381faf2 | ||
|
|
5826407f2a | ||
|
|
5baf510f74 | ||
|
|
039b0c4c9e | ||
|
|
2ffe64ad5c | ||
|
|
bb64c9a355 | ||
|
|
be5dc2321b | ||
|
|
f167433d9c | ||
|
|
e8923fe492 | ||
|
|
2612b99cc7 | ||
|
|
d8286dd56d | ||
|
|
c4048dbdd3 | ||
|
|
f70330a906 | ||
|
|
569ca37d09 | ||
|
|
3275ad701a | ||
|
|
82d4d9a008 | ||
|
|
31c97c2bdf | ||
|
|
5dc0b309ab | ||
|
|
2e3478a593 | ||
|
|
5a1a269f67 | ||
|
|
b34ce04378 | ||
|
|
f67919ae86 | ||
|
|
26e5b5e25d | ||
|
|
367cb10fcf | ||
|
|
1462433370 | ||
|
|
d514b778c4 | ||
|
|
65aa89af1a | ||
|
|
bdc785e976 | ||
|
|
df0715204c | ||
|
|
60ecd60c9a | ||
|
|
bba68342ce | ||
|
|
79f4c1b9a4 | ||
|
|
3e340880a8 | ||
|
|
4fa93bcef4 | ||
|
|
afd9bd3e3c | ||
|
|
5e80a49307 | ||
|
|
d5bec522da | ||
|
|
9451e8d37e | ||
|
|
939b1e4a8c | ||
|
|
a9aa7d07d0 | ||
|
|
63e140eaa7 | ||
|
|
68369ca897 | ||
|
|
c2ff1882ff | ||
|
|
ca983f34f7 | ||
|
|
bb3b817c1e | ||
|
|
6f4fa44c42 | ||
|
|
81d7bd50f5 | ||
|
|
67e53716e0 | ||
|
|
89a1fcf884 | ||
|
|
cefaaa86c7 | ||
|
|
b7616e387e | ||
|
|
b0646f9e98 | ||
|
|
4d73416099 | ||
|
|
24856b6abc | ||
|
|
ec01f52ffa | ||
|
|
1a3641d91b | ||
|
|
adfc54a464 | ||
|
|
eb2fbea621 | ||
|
|
ab21378a2e | ||
|
|
20395189cd | ||
|
|
8cb09719a3 | ||
|
|
39f42c8713 | ||
|
|
cf6beea661 | ||
|
|
bb072000e8 | ||
|
|
f2c073efaa | ||
|
|
0f1deccf86 | ||
|
|
635ba269be | ||
|
|
26fead7ecf | ||
|
|
54979b4350 | ||
|
|
3526f1cd5e | ||
|
|
fc50477082 | ||
|
|
bcc8e9d9c6 | ||
|
|
ecb78b3e0c | ||
|
|
7e0f88b6be | ||
|
|
8105ce6dce | ||
|
|
dc70fbe42d | ||
|
|
5459f68d71 | ||
|
|
8e35263bed | ||
|
|
902f9c7cbd | ||
|
|
39fe235032 | ||
|
|
2c7ae8c29a | ||
|
|
4417c04531 | ||
|
|
4cabbca4ce | ||
|
|
32006aadd8 | ||
|
|
78136edcdc | ||
|
|
14cc7b319f | ||
|
|
b89eef8f82 | ||
|
|
b214cd0dab | ||
|
|
98e3d73e16 | ||
|
|
1a5e6ffb02 | ||
|
|
9d5885b0ab | ||
|
|
c66320b3e4 | ||
|
|
bd1bc1d303 | ||
|
|
9a31d05e24 | ||
|
|
1aedfc992a | ||
|
|
76d166e413 | ||
|
|
a72e269318 | ||
|
|
c3b5ef7600 | ||
|
|
3984b41c87 | ||
|
|
8b0e6035a2 | ||
|
|
ad7021dd6c | ||
|
|
097046ae28 | ||
|
|
b84dc949c8 | ||
|
|
3c43ec206c | ||
|
|
58b07a6f9d | ||
|
|
67fe9d17cb | ||
|
|
e7c5ca8983 | ||
|
|
ef101af8ae | ||
|
|
f1559bdeaf | ||
|
|
f295774d43 | ||
|
|
125146034e | ||
|
|
cd0629fe68 | ||
|
|
ff7df102d9 | ||
|
|
816d6c989c | ||
|
|
8ffe85ad00 | ||
|
|
ace93a175d | ||
|
|
fa0cd61087 | ||
|
|
41251ae558 | ||
|
|
0eef1acbef | ||
|
|
12eb2d0267 | ||
|
|
6ec2b85bad | ||
|
|
6a7a4ba753 | ||
|
|
c7c9901845 | ||
|
|
e3c92bd21e | ||
|
|
6fd2407035 | ||
|
|
6a8ec3eac2 | ||
|
|
bc484ebf06 | ||
|
|
ee40e1a637 | ||
|
|
2158909fc3 | ||
|
|
9e3bcdd135 | ||
|
|
47fad4c2d7 | ||
|
|
ac008f0030 | ||
|
|
1ba91a84ad | ||
|
|
83ee80c045 | ||
|
|
aae6a4c895 | ||
|
|
6bfcce8c7a | ||
|
|
61c33d0ad5 | ||
|
|
a766d8918e | ||
|
|
82d7c6fb3c | ||
|
|
1492698ed3 | ||
|
|
debb9c68c8 | ||
|
|
8db2675b97 | ||
|
|
ea2348ca29 | ||
|
|
78182538d6 | ||
|
|
1c552e79bd | ||
|
|
5edc65d00d | ||
|
|
07ce775189 |
10
.mailmap
10
.mailmap
@@ -1,8 +1,18 @@
|
|||||||
Adrian Grange <agrange@google.com>
|
Adrian Grange <agrange@google.com>
|
||||||
|
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
|
||||||
|
Hangyu Kuang <hkuang@google.com>
|
||||||
|
Jim Bankoski <jimbankoski@google.com>
|
||||||
|
John Koleszar <jkoleszar@google.com>
|
||||||
Johann Koenig <johannkoenig@google.com>
|
Johann Koenig <johannkoenig@google.com>
|
||||||
|
Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
|
||||||
|
Johann Koenig <johannkoenig@google.com> <johannkoenig@dhcp-172-19-7-52.mtv.corp.google.com>
|
||||||
|
Pascal Massimino <pascal.massimino@gmail.com>
|
||||||
|
Sami Pietilä <samipietila@google.com>
|
||||||
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
|
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
|
||||||
|
Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
|
||||||
Tom Finegan <tomfinegan@google.com>
|
Tom Finegan <tomfinegan@google.com>
|
||||||
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
|
||||||
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
|
||||||
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
Alpha Lam <hclam@google.com> <hclam@chromium.org>
|
||||||
Deb Mukherjee <debargha@google.com>
|
Deb Mukherjee <debargha@google.com>
|
||||||
|
Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
|
||||||
|
|||||||
35
AUTHORS
35
AUTHORS
@@ -2,62 +2,97 @@
|
|||||||
# by tools/gen_authors.sh.
|
# by tools/gen_authors.sh.
|
||||||
|
|
||||||
Aaron Watry <awatry@gmail.com>
|
Aaron Watry <awatry@gmail.com>
|
||||||
|
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
|
||||||
Adrian Grange <agrange@google.com>
|
Adrian Grange <agrange@google.com>
|
||||||
|
Ahmad Sharif <asharif@google.com>
|
||||||
|
Alexander Voronov <avoronov@graphics.cs.msu.ru>
|
||||||
Alex Converse <alex.converse@gmail.com>
|
Alex Converse <alex.converse@gmail.com>
|
||||||
Alexis Ballier <aballier@gentoo.org>
|
Alexis Ballier <aballier@gentoo.org>
|
||||||
Alok Ahuja <waveletcoeff@gmail.com>
|
Alok Ahuja <waveletcoeff@gmail.com>
|
||||||
Alpha Lam <hclam@google.com>
|
Alpha Lam <hclam@google.com>
|
||||||
|
A.Mahfoodh <ab.mahfoodh@gmail.com>
|
||||||
|
Ami Fischman <fischman@chromium.org>
|
||||||
Andoni Morales Alastruey <ylatuya@gmail.com>
|
Andoni Morales Alastruey <ylatuya@gmail.com>
|
||||||
Andres Mejia <mcitadel@gmail.com>
|
Andres Mejia <mcitadel@gmail.com>
|
||||||
Aron Rosenberg <arosenberg@logitech.com>
|
Aron Rosenberg <arosenberg@logitech.com>
|
||||||
Attila Nagy <attilanagy@google.com>
|
Attila Nagy <attilanagy@google.com>
|
||||||
|
changjun.yang <changjun.yang@intel.com>
|
||||||
|
chm <chm@rock-chips.com>
|
||||||
|
Christian Duvivier <cduvivier@google.com>
|
||||||
|
Daniel Kang <ddkang@google.com>
|
||||||
Deb Mukherjee <debargha@google.com>
|
Deb Mukherjee <debargha@google.com>
|
||||||
|
Dmitry Kovalev <dkovalev@google.com>
|
||||||
|
Dragan Mrdjan <dmrdjan@mips.com>
|
||||||
|
Erik Niemeyer <erik.a.niemeyer@gmail.com>
|
||||||
Fabio Pedretti <fabio.ped@libero.it>
|
Fabio Pedretti <fabio.ped@libero.it>
|
||||||
Frank Galligan <fgalligan@google.com>
|
Frank Galligan <fgalligan@google.com>
|
||||||
Fredrik Söderquist <fs@opera.com>
|
Fredrik Söderquist <fs@opera.com>
|
||||||
Fritz Koenig <frkoenig@google.com>
|
Fritz Koenig <frkoenig@google.com>
|
||||||
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
|
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
|
||||||
Giuseppe Scrivano <gscrivano@gnu.org>
|
Giuseppe Scrivano <gscrivano@gnu.org>
|
||||||
|
Guillaume Martres <gmartres@google.com>
|
||||||
Guillermo Ballester Valor <gbvalor@gmail.com>
|
Guillermo Ballester Valor <gbvalor@gmail.com>
|
||||||
|
Hangyu Kuang <hkuang@google.com>
|
||||||
Henrik Lundin <hlundin@google.com>
|
Henrik Lundin <hlundin@google.com>
|
||||||
|
Hui Su <huisu@google.com>
|
||||||
|
Ivan Maltz <ivanmaltz@google.com>
|
||||||
James Berry <jamesberry@google.com>
|
James Berry <jamesberry@google.com>
|
||||||
James Zern <jzern@google.com>
|
James Zern <jzern@google.com>
|
||||||
Jan Kratochvil <jan.kratochvil@redhat.com>
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
Janne Salonen <jsalonen@google.com>
|
||||||
Jeff Faust <jfaust@google.com>
|
Jeff Faust <jfaust@google.com>
|
||||||
Jeff Muizelaar <jmuizelaar@mozilla.com>
|
Jeff Muizelaar <jmuizelaar@mozilla.com>
|
||||||
|
Jeff Petkau <jpet@chromium.org>
|
||||||
Jim Bankoski <jimbankoski@google.com>
|
Jim Bankoski <jimbankoski@google.com>
|
||||||
|
Jingning Han <jingning@google.com>
|
||||||
Johann Koenig <johannkoenig@google.com>
|
Johann Koenig <johannkoenig@google.com>
|
||||||
John Koleszar <jkoleszar@google.com>
|
John Koleszar <jkoleszar@google.com>
|
||||||
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
Joshua Bleecher Snyder <josh@treelinelabs.com>
|
||||||
|
Joshua Litt <joshualitt@google.com>
|
||||||
Justin Clift <justin@salasaga.org>
|
Justin Clift <justin@salasaga.org>
|
||||||
Justin Lebar <justin.lebar@gmail.com>
|
Justin Lebar <justin.lebar@gmail.com>
|
||||||
KO Myung-Hun <komh@chollian.net>
|
KO Myung-Hun <komh@chollian.net>
|
||||||
Lou Quillio <louquillio@google.com>
|
Lou Quillio <louquillio@google.com>
|
||||||
Luca Barbato <lu_zero@gentoo.org>
|
Luca Barbato <lu_zero@gentoo.org>
|
||||||
Makoto Kato <makoto.kt@gmail.com>
|
Makoto Kato <makoto.kt@gmail.com>
|
||||||
|
Mans Rullgard <mans@mansr.com>
|
||||||
Marco Paniconi <marpan@google.com>
|
Marco Paniconi <marpan@google.com>
|
||||||
|
Mark Mentovai <mark@chromium.org>
|
||||||
Martin Ettl <ettl.martin78@googlemail.com>
|
Martin Ettl <ettl.martin78@googlemail.com>
|
||||||
|
Martin Storsjo <martin@martin.st>
|
||||||
|
Matthew Heaney <matthewjheaney@chromium.org>
|
||||||
Michael Kohler <michaelkohler@live.com>
|
Michael Kohler <michaelkohler@live.com>
|
||||||
|
Mike Frysinger <vapier@chromium.org>
|
||||||
Mike Hommey <mhommey@mozilla.com>
|
Mike Hommey <mhommey@mozilla.com>
|
||||||
Mikhal Shemer <mikhal@google.com>
|
Mikhal Shemer <mikhal@google.com>
|
||||||
|
Morton Jonuschat <yabawock@gmail.com>
|
||||||
|
Parag Salasakar <img.mips1@gmail.com>
|
||||||
Pascal Massimino <pascal.massimino@gmail.com>
|
Pascal Massimino <pascal.massimino@gmail.com>
|
||||||
Patrik Westin <patrik.westin@gmail.com>
|
Patrik Westin <patrik.westin@gmail.com>
|
||||||
Paul Wilkins <paulwilkins@google.com>
|
Paul Wilkins <paulwilkins@google.com>
|
||||||
Pavol Rusnak <stick@gk2.sk>
|
Pavol Rusnak <stick@gk2.sk>
|
||||||
|
Paweł Hajdan <phajdan@google.com>
|
||||||
Philip Jägenstedt <philipj@opera.com>
|
Philip Jägenstedt <philipj@opera.com>
|
||||||
Priit Laes <plaes@plaes.org>
|
Priit Laes <plaes@plaes.org>
|
||||||
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
|
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
|
||||||
Rafaël Carré <funman@videolan.org>
|
Rafaël Carré <funman@videolan.org>
|
||||||
Ralph Giles <giles@xiph.org>
|
Ralph Giles <giles@xiph.org>
|
||||||
|
Rob Bradford <rob@linux.intel.com>
|
||||||
Ronald S. Bultje <rbultje@google.com>
|
Ronald S. Bultje <rbultje@google.com>
|
||||||
|
Sami Pietilä <samipietila@google.com>
|
||||||
|
Scott Graham <scottmg@chromium.org>
|
||||||
Scott LaVarnway <slavarnway@google.com>
|
Scott LaVarnway <slavarnway@google.com>
|
||||||
|
Shimon Doodkin <helpmepro1@gmail.com>
|
||||||
Stefan Holmer <holmer@google.com>
|
Stefan Holmer <holmer@google.com>
|
||||||
|
Suman Sunkara <sunkaras@google.com>
|
||||||
Taekhyun Kim <takim@nvidia.com>
|
Taekhyun Kim <takim@nvidia.com>
|
||||||
Takanori MATSUURA <t.matsuu@gmail.com>
|
Takanori MATSUURA <t.matsuu@gmail.com>
|
||||||
|
Tamar Levy <tamar.levy@intel.com>
|
||||||
Tero Rintaluoma <teror@google.com>
|
Tero Rintaluoma <teror@google.com>
|
||||||
Thijs Vermeir <thijsvermeir@gmail.com>
|
Thijs Vermeir <thijsvermeir@gmail.com>
|
||||||
Timothy B. Terriberry <tterribe@xiph.org>
|
Timothy B. Terriberry <tterribe@xiph.org>
|
||||||
Tom Finegan <tomfinegan@google.com>
|
Tom Finegan <tomfinegan@google.com>
|
||||||
|
Vignesh Venkatasubramanian <vigneshv@google.com>
|
||||||
Yaowu Xu <yaowu@google.com>
|
Yaowu Xu <yaowu@google.com>
|
||||||
Yunqing Wang <yunqingwang@google.com>
|
Yunqing Wang <yunqingwang@google.com>
|
||||||
Google Inc.
|
Google Inc.
|
||||||
|
|||||||
50
CHANGELOG
50
CHANGELOG
@@ -1,3 +1,53 @@
|
|||||||
|
2013-11-15 v1.3.0 "Forest"
|
||||||
|
This release introduces the VP9 codec in a backward-compatible way.
|
||||||
|
All existing users of VP8 can continue to use the library without
|
||||||
|
modification. However, some VP8 options do not map to VP9 in the same manner.
|
||||||
|
|
||||||
|
The VP9 encoder in this release is not feature complete. Users interested in
|
||||||
|
the encoder are advised to use the git master branch and discuss issues on
|
||||||
|
libvpx mailing lists.
|
||||||
|
|
||||||
|
- Upgrading:
|
||||||
|
This release is ABI and API compatible with Duclair (v1.0.0). Users
|
||||||
|
of older releases should refer to the Upgrading notes in this document
|
||||||
|
for that release.
|
||||||
|
|
||||||
|
- Enhancements:
|
||||||
|
Get rid of bashisms in the main build scripts
|
||||||
|
Added usage info on command line options
|
||||||
|
Add lossless compression mode
|
||||||
|
Dll build of libvpx
|
||||||
|
Add additional Mac OS X targets: 10.7, 10.8 and 10.9 (darwin11-13)
|
||||||
|
Add option to disable documentation
|
||||||
|
configure: add --enable-external-build support
|
||||||
|
make: support V=1 as short form of verbose=yes
|
||||||
|
configure: support mingw-w64
|
||||||
|
configure: support hardfloat armv7 CHOSTS
|
||||||
|
configure: add support for android x86
|
||||||
|
Add estimated completion time to vpxenc
|
||||||
|
Don't exit on decode errors in vpxenc
|
||||||
|
vpxenc: support scaling prior to encoding
|
||||||
|
vpxdec: support scaling output
|
||||||
|
vpxenc: improve progress indicators with --skip
|
||||||
|
msvs: Don't link to winmm.lib
|
||||||
|
Add a new script for producing vcxproj files
|
||||||
|
Produce Visual Studio 10 and 11 project files
|
||||||
|
Produce Windows Phone project files
|
||||||
|
msvs-build: use msbuild for vs >= 2005
|
||||||
|
configure: default configure log to config.log
|
||||||
|
Add encoding option --static-thresh
|
||||||
|
|
||||||
|
- Speed:
|
||||||
|
Miscellaneous speed optimizations for VP8 and VP9.
|
||||||
|
|
||||||
|
- Quality:
|
||||||
|
In general, quality is consistent with the Eider release.
|
||||||
|
|
||||||
|
- Bug Fixes:
|
||||||
|
This release represents approximately a year of engineering effort,
|
||||||
|
and contains multiple bug fixes. Please refer to git history for details.
|
||||||
|
|
||||||
|
|
||||||
2012-12-21 v1.2.0
|
2012-12-21 v1.2.0
|
||||||
This release acts as a checkpoint for a large amount of internal refactoring
|
This release acts as a checkpoint for a large amount of internal refactoring
|
||||||
and testing. It also contains a number of small bugfixes, so all users are
|
and testing. It also contains a number of small bugfixes, so all users are
|
||||||
|
|||||||
3
README
3
README
@@ -64,6 +64,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
armv7-linux-gcc
|
armv7-linux-gcc
|
||||||
armv7-none-rvct
|
armv7-none-rvct
|
||||||
armv7-win32-vs11
|
armv7-win32-vs11
|
||||||
|
armv7-win32-vs12
|
||||||
mips32-linux-gcc
|
mips32-linux-gcc
|
||||||
ppc32-darwin8-gcc
|
ppc32-darwin8-gcc
|
||||||
ppc32-darwin9-gcc
|
ppc32-darwin9-gcc
|
||||||
@@ -91,6 +92,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
x86-win32-vs9
|
x86-win32-vs9
|
||||||
x86-win32-vs10
|
x86-win32-vs10
|
||||||
x86-win32-vs11
|
x86-win32-vs11
|
||||||
|
x86-win32-vs12
|
||||||
x86_64-darwin9-gcc
|
x86_64-darwin9-gcc
|
||||||
x86_64-darwin10-gcc
|
x86_64-darwin10-gcc
|
||||||
x86_64-darwin11-gcc
|
x86_64-darwin11-gcc
|
||||||
@@ -104,6 +106,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
|
|||||||
x86_64-win64-vs9
|
x86_64-win64-vs9
|
||||||
x86_64-win64-vs10
|
x86_64-win64-vs10
|
||||||
x86_64-win64-vs11
|
x86_64-win64-vs11
|
||||||
|
x86_64-win64-vs12
|
||||||
universal-darwin8-gcc
|
universal-darwin8-gcc
|
||||||
universal-darwin9-gcc
|
universal-darwin9-gcc
|
||||||
universal-darwin10-gcc
|
universal-darwin10-gcc
|
||||||
|
|||||||
6
args.h
6
args.h
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef ARGS_H
|
#ifndef ARGS_H_
|
||||||
#define ARGS_H
|
#define ARGS_H_
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
struct arg {
|
struct arg {
|
||||||
@@ -48,4 +48,4 @@ unsigned int arg_parse_uint(const struct arg *arg);
|
|||||||
int arg_parse_int(const struct arg *arg);
|
int arg_parse_int(const struct arg *arg);
|
||||||
struct vpx_rational arg_parse_rational(const struct arg *arg);
|
struct vpx_rational arg_parse_rational(const struct arg *arg);
|
||||||
int arg_parse_enum_or_int(const struct arg *arg);
|
int arg_parse_enum_or_int(const struct arg *arg);
|
||||||
#endif
|
#endif // ARGS_H_
|
||||||
|
|||||||
@@ -114,6 +114,10 @@ $(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
|
|||||||
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
|
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
|
||||||
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
|
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
|
||||||
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
|
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
|
||||||
|
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
|
||||||
|
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
|
||||||
|
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
|
||||||
|
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
|
||||||
|
|
||||||
$(BUILD_PFX)%.c.d: %.c
|
$(BUILD_PFX)%.c.d: %.c
|
||||||
$(if $(quiet),@echo " [DEP] $@")
|
$(if $(quiet),@echo " [DEP] $@")
|
||||||
|
|||||||
@@ -17,6 +17,13 @@
|
|||||||
#
|
#
|
||||||
# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
|
# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
|
||||||
#
|
#
|
||||||
|
|
||||||
|
my $chromium = 0;
|
||||||
|
|
||||||
|
foreach my $arg (@ARGV) {
|
||||||
|
$chromium = 1 if ($arg eq "-chromium");
|
||||||
|
}
|
||||||
|
|
||||||
print "@ This file was created from a .asm file\n";
|
print "@ This file was created from a .asm file\n";
|
||||||
print "@ using the ads2gas_apple.pl script.\n\n";
|
print "@ using the ads2gas_apple.pl script.\n\n";
|
||||||
print "\t.set WIDE_REFERENCE, 0\n";
|
print "\t.set WIDE_REFERENCE, 0\n";
|
||||||
@@ -47,7 +54,7 @@ while (<STDIN>)
|
|||||||
s/@/,:/g;
|
s/@/,:/g;
|
||||||
|
|
||||||
# Comment character
|
# Comment character
|
||||||
s/;/@/g;
|
s/;/ @/g;
|
||||||
|
|
||||||
# Hexadecimal constants prefaced by 0x
|
# Hexadecimal constants prefaced by 0x
|
||||||
s/#&/#0x/g;
|
s/#&/#0x/g;
|
||||||
@@ -188,7 +195,7 @@ while (<STDIN>)
|
|||||||
$trimmed =~ s/,//g;
|
$trimmed =~ s/,//g;
|
||||||
|
|
||||||
# string to array
|
# string to array
|
||||||
@incoming_array = split(/ /, $trimmed);
|
@incoming_array = split(/\s+/, $trimmed);
|
||||||
|
|
||||||
print ".macro @incoming_array[0]\n";
|
print ".macro @incoming_array[0]\n";
|
||||||
|
|
||||||
@@ -210,5 +217,19 @@ while (<STDIN>)
|
|||||||
# s/\$/\\/g; # End macro definition
|
# s/\$/\\/g; # End macro definition
|
||||||
s/MEND/.endm/; # No need to tell it where to stop assembling
|
s/MEND/.endm/; # No need to tell it where to stop assembling
|
||||||
next if /^\s*END\s*$/;
|
next if /^\s*END\s*$/;
|
||||||
|
|
||||||
|
# Clang used by Chromium differs slightly from clang in XCode in what it
|
||||||
|
# will accept in the assembly.
|
||||||
|
if ($chromium) {
|
||||||
|
s/qsubaddx/qsax/i;
|
||||||
|
s/qaddsubx/qasx/i;
|
||||||
|
s/ldrneb/ldrbne/i;
|
||||||
|
s/ldrneh/ldrhne/i;
|
||||||
|
s/(vqshrun\.s16 .*, \#)0$/${1}8/i;
|
||||||
|
|
||||||
|
# http://llvm.org/bugs/show_bug.cgi?id=16022
|
||||||
|
s/\.include/#include/;
|
||||||
|
}
|
||||||
|
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
##
|
##
|
||||||
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||||
##
|
##
|
||||||
@@ -13,20 +13,20 @@
|
|||||||
verbose=0
|
verbose=0
|
||||||
set -- $*
|
set -- $*
|
||||||
for i; do
|
for i; do
|
||||||
if [ "$i" == "-o" ]; then
|
if [ "$i" = "-o" ]; then
|
||||||
on_of=1
|
on_of=1
|
||||||
elif [ "$i" == "-v" ]; then
|
elif [ "$i" = "-v" ]; then
|
||||||
verbose=1
|
verbose=1
|
||||||
elif [ "$i" == "-g" ]; then
|
elif [ "$i" = "-g" ]; then
|
||||||
args="${args} --debug"
|
args="${args} --debug"
|
||||||
elif [ "$on_of" == "1" ]; then
|
elif [ "$on_of" = "1" ]; then
|
||||||
outfile=$i
|
outfile=$i
|
||||||
on_of=0
|
on_of=0
|
||||||
elif [ -f "$i" ]; then
|
elif [ -f "$i" ]; then
|
||||||
infiles="$infiles $i"
|
infiles="$infiles $i"
|
||||||
elif [ "${i:0:2}" == "-l" ]; then
|
elif [ "${i#-l}" != "$i" ]; then
|
||||||
libs="$libs ${i#-l}"
|
libs="$libs ${i#-l}"
|
||||||
elif [ "${i:0:2}" == "-L" ]; then
|
elif [ "${i#-L}" != "$i" ]; then
|
||||||
libpaths="${libpaths} ${i#-L}"
|
libpaths="${libpaths} ${i#-L}"
|
||||||
else
|
else
|
||||||
args="${args} ${i}"
|
args="${args} ${i}"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
##
|
##
|
||||||
## configure.sh
|
## configure.sh
|
||||||
##
|
##
|
||||||
@@ -198,11 +198,11 @@ add_extralibs() {
|
|||||||
#
|
#
|
||||||
# Boolean Manipulation Functions
|
# Boolean Manipulation Functions
|
||||||
#
|
#
|
||||||
enable(){
|
enable_feature(){
|
||||||
set_all yes $*
|
set_all yes $*
|
||||||
}
|
}
|
||||||
|
|
||||||
disable(){
|
disable_feature(){
|
||||||
set_all no $*
|
set_all no $*
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ soft_enable() {
|
|||||||
for var in $*; do
|
for var in $*; do
|
||||||
if ! disabled $var; then
|
if ! disabled $var; then
|
||||||
log_echo " enabling $var"
|
log_echo " enabling $var"
|
||||||
enable $var
|
enable_feature $var
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -228,7 +228,7 @@ soft_disable() {
|
|||||||
for var in $*; do
|
for var in $*; do
|
||||||
if ! enabled $var; then
|
if ! enabled $var; then
|
||||||
log_echo " disabling $var"
|
log_echo " disabling $var"
|
||||||
disable $var
|
disable_feature $var
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -251,10 +251,10 @@ tolower(){
|
|||||||
# Temporary File Functions
|
# Temporary File Functions
|
||||||
#
|
#
|
||||||
source_path=${0%/*}
|
source_path=${0%/*}
|
||||||
enable source_path_used
|
enable_feature source_path_used
|
||||||
if test -z "$source_path" -o "$source_path" = "." ; then
|
if test -z "$source_path" -o "$source_path" = "." ; then
|
||||||
source_path="`pwd`"
|
source_path="`pwd`"
|
||||||
disable source_path_used
|
disable_feature source_path_used
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test ! -z "$TMPDIR" ; then
|
if test ! -z "$TMPDIR" ; then
|
||||||
@@ -264,12 +264,13 @@ elif test ! -z "$TEMPDIR" ; then
|
|||||||
else
|
else
|
||||||
TMPDIRx="/tmp"
|
TMPDIRx="/tmp"
|
||||||
fi
|
fi
|
||||||
TMP_H="${TMPDIRx}/vpx-conf-$$-${RANDOM}.h"
|
RAND=$(awk 'BEGIN { srand(); printf "%d\n",(rand() * 32768)}')
|
||||||
TMP_C="${TMPDIRx}/vpx-conf-$$-${RANDOM}.c"
|
TMP_H="${TMPDIRx}/vpx-conf-$$-${RAND}.h"
|
||||||
TMP_CC="${TMPDIRx}/vpx-conf-$$-${RANDOM}.cc"
|
TMP_C="${TMPDIRx}/vpx-conf-$$-${RAND}.c"
|
||||||
TMP_O="${TMPDIRx}/vpx-conf-$$-${RANDOM}.o"
|
TMP_CC="${TMPDIRx}/vpx-conf-$$-${RAND}.cc"
|
||||||
TMP_X="${TMPDIRx}/vpx-conf-$$-${RANDOM}.x"
|
TMP_O="${TMPDIRx}/vpx-conf-$$-${RAND}.o"
|
||||||
TMP_ASM="${TMPDIRx}/vpx-conf-$$-${RANDOM}.asm"
|
TMP_X="${TMPDIRx}/vpx-conf-$$-${RAND}.x"
|
||||||
|
TMP_ASM="${TMPDIRx}/vpx-conf-$$-${RAND}.asm"
|
||||||
|
|
||||||
clean_temp_files() {
|
clean_temp_files() {
|
||||||
rm -f ${TMP_C} ${TMP_CC} ${TMP_H} ${TMP_O} ${TMP_X} ${TMP_ASM}
|
rm -f ${TMP_C} ${TMP_CC} ${TMP_H} ${TMP_O} ${TMP_X} ${TMP_ASM}
|
||||||
@@ -316,8 +317,8 @@ check_header(){
|
|||||||
header=$1
|
header=$1
|
||||||
shift
|
shift
|
||||||
var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
|
var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||||
disable $var
|
disable_feature $var
|
||||||
check_cpp "$@" <<EOF && enable $var
|
check_cpp "$@" <<EOF && enable_feature $var
|
||||||
#include "$header"
|
#include "$header"
|
||||||
int x;
|
int x;
|
||||||
EOF
|
EOF
|
||||||
@@ -479,7 +480,7 @@ process_common_cmdline() {
|
|||||||
for opt in "$@"; do
|
for opt in "$@"; do
|
||||||
optval="${opt#*=}"
|
optval="${opt#*=}"
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
--child) enable child
|
--child) enable_feature child
|
||||||
;;
|
;;
|
||||||
--log*)
|
--log*)
|
||||||
logging="$optval"
|
logging="$optval"
|
||||||
@@ -491,7 +492,7 @@ process_common_cmdline() {
|
|||||||
;;
|
;;
|
||||||
--target=*) toolchain="${toolchain:-${optval}}"
|
--target=*) toolchain="${toolchain:-${optval}}"
|
||||||
;;
|
;;
|
||||||
--force-target=*) toolchain="${toolchain:-${optval}}"; enable force_toolchain
|
--force-target=*) toolchain="${toolchain:-${optval}}"; enable_feature force_toolchain
|
||||||
;;
|
;;
|
||||||
--cpu)
|
--cpu)
|
||||||
;;
|
;;
|
||||||
@@ -511,7 +512,7 @@ process_common_cmdline() {
|
|||||||
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
|
||||||
die_unknown $opt
|
die_unknown $opt
|
||||||
fi
|
fi
|
||||||
$action $option
|
${action}_feature $option
|
||||||
;;
|
;;
|
||||||
--require-?*)
|
--require-?*)
|
||||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||||
@@ -523,11 +524,11 @@ process_common_cmdline() {
|
|||||||
;;
|
;;
|
||||||
--force-enable-?*|--force-disable-?*)
|
--force-enable-?*|--force-disable-?*)
|
||||||
eval `echo "$opt" | sed 's/--force-/action=/;s/-/ option=/;s/-/_/g'`
|
eval `echo "$opt" | sed 's/--force-/action=/;s/-/ option=/;s/-/_/g'`
|
||||||
$action $option
|
${action}_feature $option
|
||||||
;;
|
;;
|
||||||
--libc=*)
|
--libc=*)
|
||||||
[ -d "${optval}" ] || die "Not a directory: ${optval}"
|
[ -d "${optval}" ] || die "Not a directory: ${optval}"
|
||||||
disable builtin_libc
|
disable_feature builtin_libc
|
||||||
alt_libc="${optval}"
|
alt_libc="${optval}"
|
||||||
;;
|
;;
|
||||||
--as=*)
|
--as=*)
|
||||||
@@ -696,13 +697,13 @@ process_common_toolchain() {
|
|||||||
|
|
||||||
# Mark the specific ISA requested as enabled
|
# Mark the specific ISA requested as enabled
|
||||||
soft_enable ${tgt_isa}
|
soft_enable ${tgt_isa}
|
||||||
enable ${tgt_os}
|
enable_feature ${tgt_os}
|
||||||
enable ${tgt_cc}
|
enable_feature ${tgt_cc}
|
||||||
|
|
||||||
# Enable the architecture family
|
# Enable the architecture family
|
||||||
case ${tgt_isa} in
|
case ${tgt_isa} in
|
||||||
arm*) enable arm;;
|
arm*) enable_feature arm;;
|
||||||
mips*) enable mips;;
|
mips*) enable_feature mips;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# PIC is probably what we want when building shared libs
|
# PIC is probably what we want when building shared libs
|
||||||
@@ -765,7 +766,7 @@ process_common_toolchain() {
|
|||||||
case ${toolchain} in
|
case ${toolchain} in
|
||||||
sparc-solaris-*)
|
sparc-solaris-*)
|
||||||
add_extralibs -lposix4
|
add_extralibs -lposix4
|
||||||
disable fast_unaligned
|
disable_feature fast_unaligned
|
||||||
;;
|
;;
|
||||||
*-solaris-*)
|
*-solaris-*)
|
||||||
add_extralibs -lposix4
|
add_extralibs -lposix4
|
||||||
@@ -790,7 +791,7 @@ process_common_toolchain() {
|
|||||||
;;
|
;;
|
||||||
armv5te)
|
armv5te)
|
||||||
soft_enable edsp
|
soft_enable edsp
|
||||||
disable fast_unaligned
|
disable_feature fast_unaligned
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -805,7 +806,7 @@ process_common_toolchain() {
|
|||||||
arch_int=${arch_int%%te}
|
arch_int=${arch_int%%te}
|
||||||
check_add_asflags --defsym ARCHITECTURE=${arch_int}
|
check_add_asflags --defsym ARCHITECTURE=${arch_int}
|
||||||
tune_cflags="-mtune="
|
tune_cflags="-mtune="
|
||||||
if [ ${tgt_isa} == "armv7" ]; then
|
if [ ${tgt_isa} = "armv7" ]; then
|
||||||
if [ -z "${float_abi}" ]; then
|
if [ -z "${float_abi}" ]; then
|
||||||
check_cpp <<EOF && float_abi=hard || float_abi=softfp
|
check_cpp <<EOF && float_abi=hard || float_abi=softfp
|
||||||
#ifndef __ARM_PCS_VFP
|
#ifndef __ARM_PCS_VFP
|
||||||
@@ -842,8 +843,8 @@ EOF
|
|||||||
asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
|
asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
|
||||||
AS_SFX=.s
|
AS_SFX=.s
|
||||||
msvs_arch_dir=arm-msvs
|
msvs_arch_dir=arm-msvs
|
||||||
disable multithread
|
disable_feature multithread
|
||||||
disable unit_tests
|
disable_feature unit_tests
|
||||||
;;
|
;;
|
||||||
rvct)
|
rvct)
|
||||||
CC=armcc
|
CC=armcc
|
||||||
@@ -855,7 +856,7 @@ EOF
|
|||||||
tune_cflags="--cpu="
|
tune_cflags="--cpu="
|
||||||
tune_asflags="--cpu="
|
tune_asflags="--cpu="
|
||||||
if [ -z "${tune_cpu}" ]; then
|
if [ -z "${tune_cpu}" ]; then
|
||||||
if [ ${tgt_isa} == "armv7" ]; then
|
if [ ${tgt_isa} = "armv7" ]; then
|
||||||
if enabled neon
|
if enabled neon
|
||||||
then
|
then
|
||||||
check_add_cflags --fpu=softvfp+vfpv3
|
check_add_cflags --fpu=softvfp+vfpv3
|
||||||
@@ -880,8 +881,8 @@ EOF
|
|||||||
|
|
||||||
case ${tgt_os} in
|
case ${tgt_os} in
|
||||||
none*)
|
none*)
|
||||||
disable multithread
|
disable_feature multithread
|
||||||
disable os_support
|
disable_feature os_support
|
||||||
;;
|
;;
|
||||||
|
|
||||||
android*)
|
android*)
|
||||||
@@ -913,9 +914,9 @@ EOF
|
|||||||
# Cortex-A8 implementations (NDK Dev Guide)
|
# Cortex-A8 implementations (NDK Dev Guide)
|
||||||
add_ldflags "-Wl,--fix-cortex-a8"
|
add_ldflags "-Wl,--fix-cortex-a8"
|
||||||
|
|
||||||
enable pic
|
enable_feature pic
|
||||||
soft_enable realtime_only
|
soft_enable realtime_only
|
||||||
if [ ${tgt_isa} == "armv7" ]; then
|
if [ ${tgt_isa} = "armv7" ]; then
|
||||||
soft_enable runtime_cpu_detect
|
soft_enable runtime_cpu_detect
|
||||||
fi
|
fi
|
||||||
if enabled runtime_cpu_detect; then
|
if enabled runtime_cpu_detect; then
|
||||||
@@ -924,41 +925,26 @@ EOF
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
darwin*)
|
darwin*)
|
||||||
if [ -z "${sdk_path}" ]; then
|
|
||||||
SDK_PATH=`xcode-select -print-path 2> /dev/null`
|
XCRUN_FIND="xcrun --sdk iphoneos -find"
|
||||||
SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer
|
CXX="$(${XCRUN_FIND} clang++)"
|
||||||
else
|
CC="$(${XCRUN_FIND} clang)"
|
||||||
SDK_PATH=${sdk_path}
|
AR="$(${XCRUN_FIND} ar)"
|
||||||
fi
|
LD="$(${XCRUN_FIND} ld)"
|
||||||
TOOLCHAIN_PATH=${SDK_PATH}/usr/bin
|
AS="$(${XCRUN_FIND} as)"
|
||||||
CXX=${TOOLCHAIN_PATH}/g++
|
STRIP="$(${XCRUN_FIND} strip)"
|
||||||
CC=${TOOLCHAIN_PATH}/gcc
|
NM="$(${XCRUN_FIND} nm)"
|
||||||
AR=${TOOLCHAIN_PATH}/ar
|
RANLIB="$(${XCRUN_FIND} ranlib)"
|
||||||
LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
|
|
||||||
AS=${TOOLCHAIN_PATH}/as
|
|
||||||
STRIP=${TOOLCHAIN_PATH}/strip
|
|
||||||
NM=${TOOLCHAIN_PATH}/nm
|
|
||||||
AS_SFX=.s
|
AS_SFX=.s
|
||||||
|
|
||||||
# ASFLAGS is written here instead of using check_add_asflags
|
# ASFLAGS is written here instead of using check_add_asflags
|
||||||
# because we need to overwrite all of ASFLAGS and purge the
|
# because we need to overwrite all of ASFLAGS and purge the
|
||||||
# options that were put in above
|
# options that were put in above
|
||||||
ASFLAGS="-version -arch ${tgt_isa} -g"
|
ASFLAGS="-arch ${tgt_isa} -g"
|
||||||
|
|
||||||
add_cflags -arch ${tgt_isa}
|
alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)"
|
||||||
add_ldflags -arch_only ${tgt_isa}
|
add_cflags -arch ${tgt_isa} -isysroot ${alt_libc}
|
||||||
|
add_ldflags -arch ${tgt_isa} -ios_version_min 7.0
|
||||||
if [ -z "${alt_libc}" ]; then
|
|
||||||
alt_libc=${SDK_PATH}/SDKs/iPhoneOS6.0.sdk
|
|
||||||
fi
|
|
||||||
|
|
||||||
add_cflags "-isysroot ${alt_libc}"
|
|
||||||
|
|
||||||
# Add the paths for the alternate libc
|
|
||||||
for d in usr/include; do
|
|
||||||
try_dir="${alt_libc}/${d}"
|
|
||||||
[ -d "${try_dir}" ] && add_cflags -I"${try_dir}"
|
|
||||||
done
|
|
||||||
|
|
||||||
for d in lib usr/lib usr/lib/system; do
|
for d in lib usr/lib usr/lib/system; do
|
||||||
try_dir="${alt_libc}/${d}"
|
try_dir="${alt_libc}/${d}"
|
||||||
@@ -969,7 +955,7 @@ EOF
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
linux*)
|
linux*)
|
||||||
enable linux
|
enable_feature linux
|
||||||
if enabled rvct; then
|
if enabled rvct; then
|
||||||
# Check if we have CodeSourcery GCC in PATH. Needed for
|
# Check if we have CodeSourcery GCC in PATH. Needed for
|
||||||
# libraries
|
# libraries
|
||||||
@@ -1000,14 +986,14 @@ EOF
|
|||||||
tune_cflags="-mtune="
|
tune_cflags="-mtune="
|
||||||
if enabled dspr2; then
|
if enabled dspr2; then
|
||||||
check_add_cflags -mips32r2 -mdspr2
|
check_add_cflags -mips32r2 -mdspr2
|
||||||
disable fast_unaligned
|
disable_feature fast_unaligned
|
||||||
fi
|
fi
|
||||||
check_add_cflags -march=${tgt_isa}
|
check_add_cflags -march=${tgt_isa}
|
||||||
check_add_asflags -march=${tgt_isa}
|
check_add_asflags -march=${tgt_isa}
|
||||||
check_add_asflags -KPIC
|
check_add_asflags -KPIC
|
||||||
;;
|
;;
|
||||||
ppc*)
|
ppc*)
|
||||||
enable ppc
|
enable_feature ppc
|
||||||
bits=${tgt_isa##ppc}
|
bits=${tgt_isa##ppc}
|
||||||
link_with_cc=gcc
|
link_with_cc=gcc
|
||||||
setup_gnu_toolchain
|
setup_gnu_toolchain
|
||||||
@@ -1059,9 +1045,11 @@ EOF
|
|||||||
CC=${CC:-icc}
|
CC=${CC:-icc}
|
||||||
LD=${LD:-icc}
|
LD=${LD:-icc}
|
||||||
setup_gnu_toolchain
|
setup_gnu_toolchain
|
||||||
add_cflags -use-msasm -use-asm
|
add_cflags -use-msasm # remove -use-msasm too?
|
||||||
add_ldflags -i-static
|
# add -no-intel-extensions to suppress warning #10237
|
||||||
enabled x86_64 && add_cflags -ipo -no-prec-div -static -xSSE2 -axSSE2
|
# refer to http://software.intel.com/en-us/forums/topic/280199
|
||||||
|
add_ldflags -i-static -no-intel-extensions
|
||||||
|
enabled x86_64 && add_cflags -ipo -static -O3 -no-prec-div
|
||||||
enabled x86_64 && AR=xiar
|
enabled x86_64 && AR=xiar
|
||||||
case ${tune_cpu} in
|
case ${tune_cpu} in
|
||||||
atom*)
|
atom*)
|
||||||
@@ -1088,6 +1076,15 @@ EOF
|
|||||||
# Skip the check by setting AS arbitrarily
|
# Skip the check by setting AS arbitrarily
|
||||||
AS=msvs
|
AS=msvs
|
||||||
msvs_arch_dir=x86-msvs
|
msvs_arch_dir=x86-msvs
|
||||||
|
vc_version=${tgt_cc##vs}
|
||||||
|
case $vc_version in
|
||||||
|
7|8|9|10)
|
||||||
|
echo "${tgt_cc} does not support avx/avx2, disabling....."
|
||||||
|
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 "
|
||||||
|
soft_disable avx
|
||||||
|
soft_disable avx2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -1105,6 +1102,18 @@ EOF
|
|||||||
soft_enable sse4_1
|
soft_enable sse4_1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if enabled gcc && ! disabled avx && ! check_cflags -mavx; then
|
||||||
|
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx "
|
||||||
|
else
|
||||||
|
soft_enable avx
|
||||||
|
fi
|
||||||
|
|
||||||
|
if enabled gcc && ! disabled avx2 && ! check_cflags -mavx2; then
|
||||||
|
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx2 "
|
||||||
|
else
|
||||||
|
soft_enable avx2
|
||||||
|
fi
|
||||||
|
|
||||||
case "${AS}" in
|
case "${AS}" in
|
||||||
auto|"")
|
auto|"")
|
||||||
which nasm >/dev/null 2>&1 && AS=nasm
|
which nasm >/dev/null 2>&1 && AS=nasm
|
||||||
@@ -1155,7 +1164,7 @@ EOF
|
|||||||
;;
|
;;
|
||||||
universal*|*-gcc|generic-gnu)
|
universal*|*-gcc|generic-gnu)
|
||||||
link_with_cc=gcc
|
link_with_cc=gcc
|
||||||
enable gcc
|
enable_feature gcc
|
||||||
setup_gnu_toolchain
|
setup_gnu_toolchain
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1191,7 +1200,7 @@ EOF
|
|||||||
|
|
||||||
# default use_x86inc to yes if pic is no or 64bit or we are not on darwin
|
# default use_x86inc to yes if pic is no or 64bit or we are not on darwin
|
||||||
echo " checking here for x86inc \"${tgt_isa}\" \"$pic\" "
|
echo " checking here for x86inc \"${tgt_isa}\" \"$pic\" "
|
||||||
if [ ${tgt_isa} = x86_64 -o ! "$pic" == "yes" -o ! ${tgt_os:0:6} = darwin ]; then
|
if [ ${tgt_isa} = x86_64 -o ! "$pic" = "yes" -o "${tgt_os#darwin}" = "${tgt_os}" ]; then
|
||||||
soft_enable use_x86inc
|
soft_enable use_x86inc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1204,14 +1213,14 @@ EOF
|
|||||||
enabled linux && check_add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
enabled linux && check_add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
||||||
|
|
||||||
# Check for strip utility variant
|
# Check for strip utility variant
|
||||||
${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable gnu_strip
|
${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable_feature gnu_strip
|
||||||
|
|
||||||
# Try to determine target endianness
|
# Try to determine target endianness
|
||||||
check_cc <<EOF
|
check_cc <<EOF
|
||||||
unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
|
unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
|
||||||
EOF
|
EOF
|
||||||
[ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
|
[ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
|
||||||
grep '4f *32 *42 *45' >/dev/null 2>&1 && enable big_endian
|
grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian
|
||||||
|
|
||||||
# Try to find which inline keywords are supported
|
# Try to find which inline keywords are supported
|
||||||
check_cc <<EOF && INLINE="inline"
|
check_cc <<EOF && INLINE="inline"
|
||||||
@@ -1236,7 +1245,7 @@ EOF
|
|||||||
if enabled dspr2; then
|
if enabled dspr2; then
|
||||||
if enabled big_endian; then
|
if enabled big_endian; then
|
||||||
echo "dspr2 optimizations are available only for little endian platforms"
|
echo "dspr2 optimizations are available only for little endian platforms"
|
||||||
disable dspr2
|
disable_feature dspr2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@@ -1287,8 +1296,8 @@ print_config_h() {
|
|||||||
|
|
||||||
print_webm_license() {
|
print_webm_license() {
|
||||||
local destination=$1
|
local destination=$1
|
||||||
local prefix=$2
|
local prefix="$2"
|
||||||
local suffix=$3
|
local suffix="$3"
|
||||||
shift 3
|
shift 3
|
||||||
cat <<EOF > ${destination}
|
cat <<EOF > ${destination}
|
||||||
${prefix} Copyright (c) 2011 The WebM project authors. All Rights Reserved.${suffix}
|
${prefix} Copyright (c) 2011 The WebM project authors. All Rights Reserved.${suffix}
|
||||||
@@ -1309,7 +1318,7 @@ process_detect() {
|
|||||||
true;
|
true;
|
||||||
}
|
}
|
||||||
|
|
||||||
enable logging
|
enable_feature logging
|
||||||
logfile="config.log"
|
logfile="config.log"
|
||||||
self=$0
|
self=$0
|
||||||
process() {
|
process() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
##
|
##
|
||||||
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||||
##
|
##
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ for opt in "$@"; do
|
|||||||
;;
|
;;
|
||||||
--ver=*) vs_ver="$optval"
|
--ver=*) vs_ver="$optval"
|
||||||
case $optval in
|
case $optval in
|
||||||
[789]|10|11)
|
[789]|10|11|12)
|
||||||
;;
|
;;
|
||||||
*) die Unrecognized Visual Studio Version in $opt
|
*) die Unrecognized Visual Studio Version in $opt
|
||||||
;;
|
;;
|
||||||
@@ -297,12 +297,15 @@ case "${vs_ver:-8}" in
|
|||||||
11) sln_vers="12.00"
|
11) sln_vers="12.00"
|
||||||
sln_vers_str="Visual Studio 2012"
|
sln_vers_str="Visual Studio 2012"
|
||||||
;;
|
;;
|
||||||
|
12) sln_vers="12.00"
|
||||||
|
sln_vers_str="Visual Studio 2013"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
case "${vs_ver:-8}" in
|
case "${vs_ver:-8}" in
|
||||||
[789])
|
[789])
|
||||||
sfx=vcproj
|
sfx=vcproj
|
||||||
;;
|
;;
|
||||||
10|11)
|
10|11|12)
|
||||||
sfx=vcxproj
|
sfx=vcxproj
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Options:
|
|||||||
--name=project_name Name of the project (required)
|
--name=project_name Name of the project (required)
|
||||||
--proj-guid=GUID GUID to use for the project
|
--proj-guid=GUID GUID to use for the project
|
||||||
--module-def=filename File containing export definitions (for DLLs)
|
--module-def=filename File containing export definitions (for DLLs)
|
||||||
--ver=version Version (10,11) of visual studio to generate for
|
--ver=version Version (10,11,12) of visual studio to generate for
|
||||||
--src-path-bare=dir Path to root of source tree
|
--src-path-bare=dir Path to root of source tree
|
||||||
-Ipath/to/include Additional include directories
|
-Ipath/to/include Additional include directories
|
||||||
-DFLAG[=value] Preprocessor macros to define
|
-DFLAG[=value] Preprocessor macros to define
|
||||||
@@ -228,7 +228,7 @@ for opt in "$@"; do
|
|||||||
--ver=*)
|
--ver=*)
|
||||||
vs_ver="$optval"
|
vs_ver="$optval"
|
||||||
case "$optval" in
|
case "$optval" in
|
||||||
10|11)
|
10|11|12)
|
||||||
;;
|
;;
|
||||||
*) die Unrecognized Visual Studio Version in $opt
|
*) die Unrecognized Visual Studio Version in $opt
|
||||||
;;
|
;;
|
||||||
@@ -269,7 +269,7 @@ guid=${guid:-`generate_uuid`}
|
|||||||
asm_use_custom_step=false
|
asm_use_custom_step=false
|
||||||
uses_asm=${uses_asm:-false}
|
uses_asm=${uses_asm:-false}
|
||||||
case "${vs_ver:-11}" in
|
case "${vs_ver:-11}" in
|
||||||
10|11)
|
10|11|12)
|
||||||
asm_use_custom_step=$uses_asm
|
asm_use_custom_step=$uses_asm
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -383,6 +383,20 @@ generate_vcxproj() {
|
|||||||
tag_content PlatformToolset v110
|
tag_content PlatformToolset v110
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if [ "$vs_ver" = "12" ]; then
|
||||||
|
if [ "$plat" = "ARM" ]; then
|
||||||
|
# Setting the wp80 toolchain automatically sets the
|
||||||
|
# WINAPI_FAMILY define, which is required for building
|
||||||
|
# code for arm with the windows headers. Alternatively,
|
||||||
|
# one could add AppContainerApplication=true in the Globals
|
||||||
|
# section and add PrecompiledHeader=NotUsing and
|
||||||
|
# CompileAsWinRT=false in ClCompile and SubSystem=Console
|
||||||
|
# in Link.
|
||||||
|
tag_content PlatformToolset v120_wp80
|
||||||
|
else
|
||||||
|
tag_content PlatformToolset v120
|
||||||
|
fi
|
||||||
|
fi
|
||||||
tag_content CharacterSet Unicode
|
tag_content CharacterSet Unicode
|
||||||
if [ "$config" = "Release" ]; then
|
if [ "$config" = "Release" ]; then
|
||||||
tag_content WholeProgramOptimization true
|
tag_content WholeProgramOptimization true
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ bail:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) {
|
const char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) {
|
||||||
if (elf->bits == 32) {
|
if (elf->bits == 32) {
|
||||||
Elf32_Shdr shdr;
|
Elf32_Shdr shdr;
|
||||||
|
|
||||||
|
|||||||
@@ -290,9 +290,15 @@ static void setup_rtcd_internal(void)
|
|||||||
{
|
{
|
||||||
$(set_function_pointers c $ALL_ARCHS)
|
$(set_function_pointers c $ALL_ARCHS)
|
||||||
#if HAVE_DSPR2
|
#if HAVE_DSPR2
|
||||||
|
#if CONFIG_VP8
|
||||||
void dsputil_static_init();
|
void dsputil_static_init();
|
||||||
dsputil_static_init();
|
dsputil_static_init();
|
||||||
#endif
|
#endif
|
||||||
|
#if CONFIG_VP9
|
||||||
|
void vp9_dsputil_static_init();
|
||||||
|
vp9_dsputil_static_init();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
$(common_bottom)
|
$(common_bottom)
|
||||||
@@ -321,11 +327,11 @@ EOF
|
|||||||
require c
|
require c
|
||||||
case $arch in
|
case $arch in
|
||||||
x86)
|
x86)
|
||||||
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1)
|
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
|
||||||
x86
|
x86
|
||||||
;;
|
;;
|
||||||
x86_64)
|
x86_64)
|
||||||
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1)
|
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
|
||||||
REQUIRES=${REQUIRES:-mmx sse sse2}
|
REQUIRES=${REQUIRES:-mmx sse sse2}
|
||||||
require $(filter $REQUIRES)
|
require $(filter $REQUIRES)
|
||||||
x86
|
x86
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ sub FixThumbInstructions($$)
|
|||||||
# with left shift, addition and a right shift (to restore the
|
# with left shift, addition and a right shift (to restore the
|
||||||
# register to the original value). Currently the right shift
|
# register to the original value). Currently the right shift
|
||||||
# isn't necessary in the code base since the values in these
|
# isn't necessary in the code base since the values in these
|
||||||
# registers aren't used, but doing the shift for consitency.
|
# registers aren't used, but doing the shift for consistency.
|
||||||
# This converts instructions such as "add r12, r12, r5, lsl r4"
|
# This converts instructions such as "add r12, r12, r5, lsl r4"
|
||||||
# into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4".
|
# into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4".
|
||||||
s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g;
|
s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g;
|
||||||
@@ -47,7 +47,7 @@ sub FixThumbInstructions($$)
|
|||||||
# this is used, it's used for two subsequent load instructions,
|
# this is used, it's used for two subsequent load instructions,
|
||||||
# where a hand-written version of it could merge two subsequent
|
# where a hand-written version of it could merge two subsequent
|
||||||
# add and sub instructions.
|
# add and sub instructions.
|
||||||
s/^(\s*)((ldr|str)(ne)?)(\s+)(r\d+),\s*\[(\w+), -([^\]]+)\]/$1sub$4$5$7, $7, $8\n$1$2$5$6, [$7]\n$1add$4$5$7, $7, $8/g;
|
s/^(\s*)((ldr|str|pld)(ne)?)(\s+)(r\d+,\s*)?\[(\w+), -([^\]]+)\]/$1sub$4$5$7, $7, $8\n$1$2$5$6\[$7\]\n$1add$4$5$7, $7, $8/g;
|
||||||
|
|
||||||
# Convert register post indexing to a separate add instruction.
|
# Convert register post indexing to a separate add instruction.
|
||||||
# This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]",
|
# This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
##
|
##
|
||||||
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
||||||
##
|
##
|
||||||
|
|||||||
116
configure
vendored
116
configure
vendored
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
##
|
##
|
||||||
## configure
|
## configure
|
||||||
##
|
##
|
||||||
@@ -24,9 +24,10 @@ Advanced options:
|
|||||||
${toggle_examples} examples
|
${toggle_examples} examples
|
||||||
${toggle_docs} documentation
|
${toggle_docs} documentation
|
||||||
${toggle_unit_tests} unit tests
|
${toggle_unit_tests} unit tests
|
||||||
|
${toggle_decode_perf_tests} build decoder perf tests with unit tests
|
||||||
--libc=PATH path to alternate libc
|
--libc=PATH path to alternate libc
|
||||||
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
|
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
|
||||||
--sdk-path=PATH path to root of sdk (iOS, android builds only)
|
--sdk-path=PATH path to root of sdk (android builds only)
|
||||||
${toggle_fast_unaligned} don't use unaligned accesses, even when
|
${toggle_fast_unaligned} don't use unaligned accesses, even when
|
||||||
supported by hardware [auto]
|
supported by hardware [auto]
|
||||||
${toggle_codec_srcs} in/exclude codec library source code
|
${toggle_codec_srcs} in/exclude codec library source code
|
||||||
@@ -38,6 +39,7 @@ Advanced options:
|
|||||||
${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders)
|
${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders)
|
||||||
${toggle_mem_tracker} track memory usage
|
${toggle_mem_tracker} track memory usage
|
||||||
${toggle_postproc} postprocessing
|
${toggle_postproc} postprocessing
|
||||||
|
${toggle_vp9_postproc} vp9 specific postprocessing
|
||||||
${toggle_multithread} multithreaded encoding and decoding
|
${toggle_multithread} multithreaded encoding and decoding
|
||||||
${toggle_spatial_resampling} spatial sampling (scaling) support
|
${toggle_spatial_resampling} spatial sampling (scaling) support
|
||||||
${toggle_realtime_only} enable this option while building for real-time encoding
|
${toggle_realtime_only} enable this option while building for real-time encoding
|
||||||
@@ -99,6 +101,7 @@ all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
|
|||||||
all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
|
all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
|
||||||
all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
|
all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
|
||||||
all_platforms="${all_platforms} armv7-win32-vs11"
|
all_platforms="${all_platforms} armv7-win32-vs11"
|
||||||
|
all_platforms="${all_platforms} armv7-win32-vs12"
|
||||||
all_platforms="${all_platforms} mips32-linux-gcc"
|
all_platforms="${all_platforms} mips32-linux-gcc"
|
||||||
all_platforms="${all_platforms} ppc32-darwin8-gcc"
|
all_platforms="${all_platforms} ppc32-darwin8-gcc"
|
||||||
all_platforms="${all_platforms} ppc32-darwin9-gcc"
|
all_platforms="${all_platforms} ppc32-darwin9-gcc"
|
||||||
@@ -126,6 +129,7 @@ all_platforms="${all_platforms} x86-win32-vs8"
|
|||||||
all_platforms="${all_platforms} x86-win32-vs9"
|
all_platforms="${all_platforms} x86-win32-vs9"
|
||||||
all_platforms="${all_platforms} x86-win32-vs10"
|
all_platforms="${all_platforms} x86-win32-vs10"
|
||||||
all_platforms="${all_platforms} x86-win32-vs11"
|
all_platforms="${all_platforms} x86-win32-vs11"
|
||||||
|
all_platforms="${all_platforms} x86-win32-vs12"
|
||||||
all_platforms="${all_platforms} x86_64-darwin9-gcc"
|
all_platforms="${all_platforms} x86_64-darwin9-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
all_platforms="${all_platforms} x86_64-darwin10-gcc"
|
||||||
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
all_platforms="${all_platforms} x86_64-darwin11-gcc"
|
||||||
@@ -139,6 +143,7 @@ all_platforms="${all_platforms} x86_64-win64-vs8"
|
|||||||
all_platforms="${all_platforms} x86_64-win64-vs9"
|
all_platforms="${all_platforms} x86_64-win64-vs9"
|
||||||
all_platforms="${all_platforms} x86_64-win64-vs10"
|
all_platforms="${all_platforms} x86_64-win64-vs10"
|
||||||
all_platforms="${all_platforms} x86_64-win64-vs11"
|
all_platforms="${all_platforms} x86_64-win64-vs11"
|
||||||
|
all_platforms="${all_platforms} x86_64-win64-vs12"
|
||||||
all_platforms="${all_platforms} universal-darwin8-gcc"
|
all_platforms="${all_platforms} universal-darwin8-gcc"
|
||||||
all_platforms="${all_platforms} universal-darwin9-gcc"
|
all_platforms="${all_platforms} universal-darwin9-gcc"
|
||||||
all_platforms="${all_platforms} universal-darwin10-gcc"
|
all_platforms="${all_platforms} universal-darwin10-gcc"
|
||||||
@@ -153,7 +158,7 @@ all_targets="libs examples docs"
|
|||||||
|
|
||||||
# all targets available are enabled, by default.
|
# all targets available are enabled, by default.
|
||||||
for t in ${all_targets}; do
|
for t in ${all_targets}; do
|
||||||
[ -f ${source_path}/${t}.mk ] && enable ${t}
|
[ -f ${source_path}/${t}.mk ] && enable_feature ${t}
|
||||||
done
|
done
|
||||||
|
|
||||||
# check installed doxygen version
|
# check installed doxygen version
|
||||||
@@ -164,30 +169,30 @@ if [ ${doxy_major:-0} -ge 1 ]; then
|
|||||||
doxy_minor=${doxy_version%%.*}
|
doxy_minor=${doxy_version%%.*}
|
||||||
doxy_patch=${doxy_version##*.}
|
doxy_patch=${doxy_version##*.}
|
||||||
|
|
||||||
[ $doxy_major -gt 1 ] && enable doxygen
|
[ $doxy_major -gt 1 ] && enable_feature doxygen
|
||||||
[ $doxy_minor -gt 5 ] && enable doxygen
|
[ $doxy_minor -gt 5 ] && enable_feature doxygen
|
||||||
[ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable doxygen
|
[ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# install everything except the sources, by default. sources will have
|
# install everything except the sources, by default. sources will have
|
||||||
# to be enabled when doing dist builds, since that's no longer a common
|
# to be enabled when doing dist builds, since that's no longer a common
|
||||||
# case.
|
# case.
|
||||||
enabled doxygen && php -v >/dev/null 2>&1 && enable install_docs
|
enabled doxygen && php -v >/dev/null 2>&1 && enable_feature install_docs
|
||||||
enable install_bins
|
enable_feature install_bins
|
||||||
enable install_libs
|
enable_feature install_libs
|
||||||
|
|
||||||
enable static
|
enable_feature static
|
||||||
enable optimizations
|
enable_feature optimizations
|
||||||
enable fast_unaligned #allow unaligned accesses, if supported by hw
|
enable_feature fast_unaligned #allow unaligned accesses, if supported by hw
|
||||||
enable md5
|
enable_feature md5
|
||||||
enable spatial_resampling
|
enable_feature spatial_resampling
|
||||||
enable multithread
|
enable_feature multithread
|
||||||
enable os_support
|
enable_feature os_support
|
||||||
enable temporal_denoising
|
enable_feature temporal_denoising
|
||||||
|
|
||||||
[ -d ${source_path}/../include ] && enable alt_tree_layout
|
[ -d ${source_path}/../include ] && enable_feature alt_tree_layout
|
||||||
for d in vp8 vp9; do
|
for d in vp8 vp9; do
|
||||||
[ -d ${source_path}/${d} ] && disable alt_tree_layout;
|
[ -d ${source_path}/${d} ] && disable_feature alt_tree_layout;
|
||||||
done
|
done
|
||||||
|
|
||||||
if ! enabled alt_tree_layout; then
|
if ! enabled alt_tree_layout; then
|
||||||
@@ -200,10 +205,10 @@ else
|
|||||||
[ -f ${source_path}/../include/vpx/vp8dx.h ] && CODECS="${CODECS} vp8_decoder"
|
[ -f ${source_path}/../include/vpx/vp8dx.h ] && CODECS="${CODECS} vp8_decoder"
|
||||||
[ -f ${source_path}/../include/vpx/vp9cx.h ] && CODECS="${CODECS} vp9_encoder"
|
[ -f ${source_path}/../include/vpx/vp9cx.h ] && CODECS="${CODECS} vp9_encoder"
|
||||||
[ -f ${source_path}/../include/vpx/vp9dx.h ] && CODECS="${CODECS} vp9_decoder"
|
[ -f ${source_path}/../include/vpx/vp9dx.h ] && CODECS="${CODECS} vp9_decoder"
|
||||||
[ -f ${source_path}/../include/vpx/vp8cx.h ] || disable vp8_encoder
|
[ -f ${source_path}/../include/vpx/vp8cx.h ] || disable_feature vp8_encoder
|
||||||
[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable vp8_decoder
|
[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable_feature vp8_decoder
|
||||||
[ -f ${source_path}/../include/vpx/vp9cx.h ] || disable vp9_encoder
|
[ -f ${source_path}/../include/vpx/vp9cx.h ] || disable_feature vp9_encoder
|
||||||
[ -f ${source_path}/../include/vpx/vp9dx.h ] || disable vp9_decoder
|
[ -f ${source_path}/../include/vpx/vp9dx.h ] || disable_feature vp9_decoder
|
||||||
|
|
||||||
[ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt
|
[ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt
|
||||||
fi
|
fi
|
||||||
@@ -233,6 +238,8 @@ ARCH_EXT_LIST="
|
|||||||
sse3
|
sse3
|
||||||
ssse3
|
ssse3
|
||||||
sse4_1
|
sse4_1
|
||||||
|
avx
|
||||||
|
avx2
|
||||||
|
|
||||||
altivec
|
altivec
|
||||||
"
|
"
|
||||||
@@ -246,15 +253,17 @@ HAVE_LIST="
|
|||||||
unistd_h
|
unistd_h
|
||||||
"
|
"
|
||||||
EXPERIMENT_LIST="
|
EXPERIMENT_LIST="
|
||||||
oneshotq
|
|
||||||
multiple_arf
|
multiple_arf
|
||||||
non420
|
non420
|
||||||
alpha
|
alpha
|
||||||
interintra
|
|
||||||
filterintra
|
|
||||||
masked_interintra
|
|
||||||
masked_interinter
|
masked_interinter
|
||||||
|
interintra
|
||||||
|
masked_interintra
|
||||||
|
filterintra
|
||||||
|
ext_tx
|
||||||
|
ext_tx_dst32
|
||||||
"
|
"
|
||||||
|
|
||||||
CONFIG_LIST="
|
CONFIG_LIST="
|
||||||
external_build
|
external_build
|
||||||
install_docs
|
install_docs
|
||||||
@@ -283,6 +292,7 @@ CONFIG_LIST="
|
|||||||
dc_recon
|
dc_recon
|
||||||
runtime_cpu_detect
|
runtime_cpu_detect
|
||||||
postproc
|
postproc
|
||||||
|
vp9_postproc
|
||||||
multithread
|
multithread
|
||||||
internal_stats
|
internal_stats
|
||||||
${CODECS}
|
${CODECS}
|
||||||
@@ -300,6 +310,7 @@ CONFIG_LIST="
|
|||||||
postproc_visualizer
|
postproc_visualizer
|
||||||
os_support
|
os_support
|
||||||
unit_tests
|
unit_tests
|
||||||
|
decode_perf_tests
|
||||||
multi_res_encoding
|
multi_res_encoding
|
||||||
temporal_denoising
|
temporal_denoising
|
||||||
experimental
|
experimental
|
||||||
@@ -337,6 +348,7 @@ CMDLINE_SELECT="
|
|||||||
dequant_tokens
|
dequant_tokens
|
||||||
dc_recon
|
dc_recon
|
||||||
postproc
|
postproc
|
||||||
|
vp9_postproc
|
||||||
multithread
|
multithread
|
||||||
internal_stats
|
internal_stats
|
||||||
${CODECS}
|
${CODECS}
|
||||||
@@ -352,6 +364,7 @@ CMDLINE_SELECT="
|
|||||||
small
|
small
|
||||||
postproc_visualizer
|
postproc_visualizer
|
||||||
unit_tests
|
unit_tests
|
||||||
|
decode_perf_tests
|
||||||
multi_res_encoding
|
multi_res_encoding
|
||||||
temporal_denoising
|
temporal_denoising
|
||||||
experimental
|
experimental
|
||||||
@@ -362,12 +375,12 @@ process_cmdline() {
|
|||||||
for opt do
|
for opt do
|
||||||
optval="${opt#*=}"
|
optval="${opt#*=}"
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
--disable-codecs) for c in ${CODECS}; do disable $c; done ;;
|
--disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;;
|
||||||
--enable-?*|--disable-?*)
|
--enable-?*|--disable-?*)
|
||||||
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
|
||||||
if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then
|
||||||
if enabled experimental; then
|
if enabled experimental; then
|
||||||
$action $option
|
${action}_feature $option
|
||||||
else
|
else
|
||||||
log_echo "Ignoring $opt -- not in experimental mode."
|
log_echo "Ignoring $opt -- not in experimental mode."
|
||||||
fi
|
fi
|
||||||
@@ -388,8 +401,8 @@ post_process_cmdline() {
|
|||||||
# If the codec family is enabled, enable all components of that family.
|
# If the codec family is enabled, enable all components of that family.
|
||||||
log_echo "Configuring selected codecs"
|
log_echo "Configuring selected codecs"
|
||||||
for c in ${CODECS}; do
|
for c in ${CODECS}; do
|
||||||
disabled ${c%%_*} && disable ${c}
|
disabled ${c%%_*} && disable_feature ${c}
|
||||||
enabled ${c%%_*} && enable ${c}
|
enabled ${c%%_*} && enable_feature ${c}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Enable all detected codecs, if they haven't been disabled
|
# Enable all detected codecs, if they haven't been disabled
|
||||||
@@ -397,12 +410,12 @@ post_process_cmdline() {
|
|||||||
|
|
||||||
# Enable the codec family if any component of that family is enabled
|
# Enable the codec family if any component of that family is enabled
|
||||||
for c in ${CODECS}; do
|
for c in ${CODECS}; do
|
||||||
enabled $c && enable ${c%_*}
|
enabled $c && enable_feature ${c%_*}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Set the {en,de}coders variable if any algorithm in that class is enabled
|
# Set the {en,de}coders variable if any algorithm in that class is enabled
|
||||||
for c in ${CODECS}; do
|
for c in ${CODECS}; do
|
||||||
enabled ${c} && enable ${c##*_}s
|
enabled ${c} && enable_feature ${c##*_}s
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,7 +436,7 @@ process_targets() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# The write_common_config (config.mk) logic is deferred until after the
|
# The write_common_config (config.mk) logic is deferred until after the
|
||||||
# recursive calls to configure complete, becuase we want our universal
|
# recursive calls to configure complete, because we want our universal
|
||||||
# targets to be executed last.
|
# targets to be executed last.
|
||||||
write_common_config_targets
|
write_common_config_targets
|
||||||
enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk
|
enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk
|
||||||
@@ -442,7 +455,7 @@ process_targets() {
|
|||||||
done
|
done
|
||||||
enabled debug_libs && DIST_DIR="${DIST_DIR}-debug"
|
enabled debug_libs && DIST_DIR="${DIST_DIR}-debug"
|
||||||
enabled codec_srcs && DIST_DIR="${DIST_DIR}-src"
|
enabled codec_srcs && DIST_DIR="${DIST_DIR}-src"
|
||||||
! enabled postproc && DIST_DIR="${DIST_DIR}-nopost"
|
! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost"
|
||||||
! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
|
! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
|
||||||
! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
|
! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
|
||||||
DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
|
DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
|
||||||
@@ -512,13 +525,13 @@ process_detect() {
|
|||||||
fi
|
fi
|
||||||
if [ -z "$CC" ] || enabled external_build; then
|
if [ -z "$CC" ] || enabled external_build; then
|
||||||
echo "Bypassing toolchain for environment detection."
|
echo "Bypassing toolchain for environment detection."
|
||||||
enable external_build
|
enable_feature external_build
|
||||||
check_header() {
|
check_header() {
|
||||||
log fake_check_header "$@"
|
log fake_check_header "$@"
|
||||||
header=$1
|
header=$1
|
||||||
shift
|
shift
|
||||||
var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
|
var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
|
||||||
disable $var
|
disable_feature $var
|
||||||
# Headers common to all environments
|
# Headers common to all environments
|
||||||
case $header in
|
case $header in
|
||||||
stdio.h)
|
stdio.h)
|
||||||
@@ -530,7 +543,7 @@ process_detect() {
|
|||||||
[ -f "${d##-I}/$header" ] && result=true && break
|
[ -f "${d##-I}/$header" ] && result=true && break
|
||||||
done
|
done
|
||||||
${result:-true}
|
${result:-true}
|
||||||
esac && enable $var
|
esac && enable_feature $var
|
||||||
|
|
||||||
# Specialize windows and POSIX environments.
|
# Specialize windows and POSIX environments.
|
||||||
case $toolchain in
|
case $toolchain in
|
||||||
@@ -538,7 +551,7 @@ process_detect() {
|
|||||||
case $header-$toolchain in
|
case $header-$toolchain in
|
||||||
stdint*-gcc) true;;
|
stdint*-gcc) true;;
|
||||||
*) false;;
|
*) false;;
|
||||||
esac && enable $var
|
esac && enable_feature $var
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case $header in
|
case $header in
|
||||||
@@ -547,7 +560,7 @@ process_detect() {
|
|||||||
sys/mman.h) true;;
|
sys/mman.h) true;;
|
||||||
unistd.h) true;;
|
unistd.h) true;;
|
||||||
*) false;;
|
*) false;;
|
||||||
esac && enable $var
|
esac && enable_feature $var
|
||||||
esac
|
esac
|
||||||
enabled $var
|
enabled $var
|
||||||
}
|
}
|
||||||
@@ -565,7 +578,7 @@ EOF
|
|||||||
check_header sys/mman.h
|
check_header sys/mman.h
|
||||||
check_header unistd.h # for sysconf(3) and friends.
|
check_header unistd.h # for sysconf(3) and friends.
|
||||||
|
|
||||||
check_header vpx/vpx_integer.h -I${source_path} && enable vpx_ports
|
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
|
||||||
}
|
}
|
||||||
|
|
||||||
process_toolchain() {
|
process_toolchain() {
|
||||||
@@ -609,7 +622,12 @@ process_toolchain() {
|
|||||||
check_add_cflags -Wuninitialized
|
check_add_cflags -Wuninitialized
|
||||||
check_add_cflags -Wunused-variable
|
check_add_cflags -Wunused-variable
|
||||||
case ${CC} in
|
case ${CC} in
|
||||||
*clang*) ;;
|
*clang*)
|
||||||
|
# libvpx and/or clang have issues with aliasing:
|
||||||
|
# https://code.google.com/p/webm/issues/detail?id=603
|
||||||
|
# work around them until they are fixed
|
||||||
|
check_add_cflags -fno-strict-aliasing
|
||||||
|
;;
|
||||||
*) check_add_cflags -Wunused-but-set-variable ;;
|
*) check_add_cflags -Wunused-but-set-variable ;;
|
||||||
esac
|
esac
|
||||||
enabled extra_warnings || check_add_cflags -Wno-unused-function
|
enabled extra_warnings || check_add_cflags -Wno-unused-function
|
||||||
@@ -647,21 +665,25 @@ process_toolchain() {
|
|||||||
# ccache only really works on gcc toolchains
|
# ccache only really works on gcc toolchains
|
||||||
enabled gcc || soft_disable ccache
|
enabled gcc || soft_disable ccache
|
||||||
if enabled mips; then
|
if enabled mips; then
|
||||||
enable dequant_tokens
|
enable_feature dequant_tokens
|
||||||
enable dc_recon
|
enable_feature dc_recon
|
||||||
|
fi
|
||||||
|
|
||||||
|
if enabled internal_stats; then
|
||||||
|
enable_feature vp9_postproc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable the postbuild target if building for visual studio.
|
# Enable the postbuild target if building for visual studio.
|
||||||
case "$tgt_cc" in
|
case "$tgt_cc" in
|
||||||
vs*) enable msvs
|
vs*) enable_feature msvs
|
||||||
enable solution
|
enable_feature solution
|
||||||
vs_version=${tgt_cc##vs}
|
vs_version=${tgt_cc##vs}
|
||||||
case $vs_version in
|
case $vs_version in
|
||||||
[789])
|
[789])
|
||||||
VCPROJ_SFX=vcproj
|
VCPROJ_SFX=vcproj
|
||||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
|
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
|
||||||
;;
|
;;
|
||||||
10|11)
|
10|11|12)
|
||||||
VCPROJ_SFX=vcxproj
|
VCPROJ_SFX=vcxproj
|
||||||
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
|
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
|
||||||
;;
|
;;
|
||||||
|
|||||||
30
examples.mk
30
examples.mk
@@ -23,7 +23,9 @@ vpxdec.SRCS += md5_utils.c md5_utils.h
|
|||||||
vpxdec.SRCS += vpx_ports/vpx_timer.h
|
vpxdec.SRCS += vpx_ports/vpx_timer.h
|
||||||
vpxdec.SRCS += vpx/vpx_integer.h
|
vpxdec.SRCS += vpx/vpx_integer.h
|
||||||
vpxdec.SRCS += args.c args.h
|
vpxdec.SRCS += args.c args.h
|
||||||
|
vpxdec.SRCS += ivfdec.c ivfdec.h
|
||||||
vpxdec.SRCS += tools_common.c tools_common.h
|
vpxdec.SRCS += tools_common.c tools_common.h
|
||||||
|
vpxdec.SRCS += webmdec.c webmdec.h
|
||||||
vpxdec.SRCS += nestegg/halloc/halloc.h
|
vpxdec.SRCS += nestegg/halloc/halloc.h
|
||||||
vpxdec.SRCS += nestegg/halloc/src/align.h
|
vpxdec.SRCS += nestegg/halloc/src/align.h
|
||||||
vpxdec.SRCS += nestegg/halloc/src/halloc.c
|
vpxdec.SRCS += nestegg/halloc/src/halloc.c
|
||||||
@@ -35,29 +37,31 @@ vpxdec.SRCS += $(LIBYUV_SRCS)
|
|||||||
vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
|
vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
|
||||||
vpxdec.DESCRIPTION = Full featured decoder
|
vpxdec.DESCRIPTION = Full featured decoder
|
||||||
UTILS-$(CONFIG_ENCODERS) += vpxenc.c
|
UTILS-$(CONFIG_ENCODERS) += vpxenc.c
|
||||||
vpxenc.SRCS += args.c args.h y4minput.c y4minput.h
|
vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h
|
||||||
|
vpxenc.SRCS += ivfdec.c ivfdec.h
|
||||||
|
vpxenc.SRCS += ivfenc.c ivfenc.h
|
||||||
vpxenc.SRCS += tools_common.c tools_common.h
|
vpxenc.SRCS += tools_common.c tools_common.h
|
||||||
|
vpxenc.SRCS += warnings.c warnings.h
|
||||||
|
vpxenc.SRCS += webmenc.c webmenc.h
|
||||||
vpxenc.SRCS += vpx_ports/mem_ops.h
|
vpxenc.SRCS += vpx_ports/mem_ops.h
|
||||||
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
|
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
|
||||||
vpxenc.SRCS += vpx_ports/vpx_timer.h
|
vpxenc.SRCS += vpx_ports/vpx_timer.h
|
||||||
vpxenc.SRCS += libmkv/EbmlIDs.h
|
vpxenc.SRCS += vpxstats.c vpxstats.h
|
||||||
vpxenc.SRCS += libmkv/EbmlWriter.c
|
vpxenc.SRCS += third_party/libmkv/EbmlIDs.h
|
||||||
vpxenc.SRCS += libmkv/EbmlWriter.h
|
vpxenc.SRCS += third_party/libmkv/EbmlWriter.c
|
||||||
|
vpxenc.SRCS += third_party/libmkv/EbmlWriter.h
|
||||||
vpxenc.SRCS += $(LIBYUV_SRCS)
|
vpxenc.SRCS += $(LIBYUV_SRCS)
|
||||||
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
|
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
|
||||||
vpxenc.DESCRIPTION = Full featured encoder
|
vpxenc.DESCRIPTION = Full featured encoder
|
||||||
UTILS-$(CONFIG_VP8_ENCODER) += vp8_scalable_patterns.c
|
UTILS-$(CONFIG_VP8_ENCODER) += vp8_scalable_patterns.c
|
||||||
vp8_scalable_patterns.GUID = 0D6A210B-F482-4D6F-8570-4A9C01ACC88C
|
vp8_scalable_patterns.GUID = 0D6A210B-F482-4D6F-8570-4A9C01ACC88C
|
||||||
vp8_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
|
vp8_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
|
||||||
|
UTILS-$(CONFIG_VP9_ENCODER) += vp9_spatial_scalable_encoder.c
|
||||||
# Clean up old ivfenc, ivfdec binaries.
|
vp9_spatial_scalable_encoder.SRCS += args.c args.h
|
||||||
ifeq ($(CONFIG_MSVS),yes)
|
vp9_spatial_scalable_encoder.SRCS += ivfenc.c ivfenc.h
|
||||||
CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfenc.exe)
|
vp9_spatial_scalable_encoder.SRCS += tools_common.c tools_common.h
|
||||||
CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfdec.exe)
|
vp9_spatial_scalable_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
|
||||||
else
|
vp9_spatial_scalable_encoder.DESCRIPTION = Spatial Scalable Encoder
|
||||||
CLEAN-OBJS += ivfenc{.c.o,.c.d,.dox,.exe,}
|
|
||||||
CLEAN-OBJS += ivfdec{.c.o,.c.d,.dox,.exe,}
|
|
||||||
endif
|
|
||||||
|
|
||||||
# XMA example disabled for now, not used in VP8
|
# XMA example disabled for now, not used in VP8
|
||||||
#UTILS-$(CONFIG_DECODERS) += example_xma.c
|
#UTILS-$(CONFIG_DECODERS) += example_xma.c
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
/*
|
/*
|
||||||
@*INTRODUCTION
|
@*INTRODUCTION
|
||||||
*/
|
*/
|
||||||
#include "vpx_config.h"
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#define VPX_CODEC_DISABLE_COMPAT 1
|
#define VPX_CODEC_DISABLE_COMPAT 1
|
||||||
#include "vpx/vpx_decoder.h"
|
#include "./vpx_config.h"
|
||||||
#include "vpx/vp8dx.h"
|
#include "vpx/vp8dx.h"
|
||||||
|
#include "vpx/vpx_decoder.h"
|
||||||
#define interface (vpx_codec_vp8_dx())
|
#define interface (vpx_codec_vp8_dx())
|
||||||
@EXTRA_INCLUDES
|
@EXTRA_INCLUDES
|
||||||
|
|
||||||
|
|||||||
119
ivfdec.c
Normal file
119
ivfdec.c
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "./ivfdec.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int file_is_ivf(struct VpxInputContext *input_ctx) {
|
||||||
|
char raw_hdr[32];
|
||||||
|
int is_ivf = 0;
|
||||||
|
|
||||||
|
// TODO(tomfinegan): This can eventually go away, but for now it's required
|
||||||
|
// because the means by which file types are detected differ in vpxdec and
|
||||||
|
// vpxenc.
|
||||||
|
rewind(input_ctx->file);
|
||||||
|
|
||||||
|
if (fread(raw_hdr, 1, 32, input_ctx->file) == 32) {
|
||||||
|
if (raw_hdr[0] == 'D' && raw_hdr[1] == 'K' &&
|
||||||
|
raw_hdr[2] == 'I' && raw_hdr[3] == 'F') {
|
||||||
|
is_ivf = 1;
|
||||||
|
|
||||||
|
if (mem_get_le16(raw_hdr + 4) != 0) {
|
||||||
|
fprintf(stderr, "Error: Unrecognized IVF version! This file may not"
|
||||||
|
" decode properly.");
|
||||||
|
}
|
||||||
|
|
||||||
|
input_ctx->fourcc = mem_get_le32(raw_hdr + 8);
|
||||||
|
input_ctx->width = mem_get_le16(raw_hdr + 12);
|
||||||
|
input_ctx->height = mem_get_le16(raw_hdr + 14);
|
||||||
|
input_ctx->framerate.numerator = mem_get_le32(raw_hdr + 16);
|
||||||
|
input_ctx->framerate.denominator = mem_get_le32(raw_hdr + 20);
|
||||||
|
|
||||||
|
/* Some versions of vpxenc used 1/(2*fps) for the timebase, so
|
||||||
|
* we can guess the framerate using only the timebase in this
|
||||||
|
* case. Other files would require reading ahead to guess the
|
||||||
|
* timebase, like we do for webm.
|
||||||
|
*/
|
||||||
|
if (input_ctx->framerate.numerator < 1000) {
|
||||||
|
/* Correct for the factor of 2 applied to the timebase in the
|
||||||
|
* encoder.
|
||||||
|
*/
|
||||||
|
if (input_ctx->framerate.numerator & 1)
|
||||||
|
input_ctx->framerate.denominator <<= 1;
|
||||||
|
else
|
||||||
|
input_ctx->framerate.numerator >>= 1;
|
||||||
|
} else {
|
||||||
|
/* Don't know FPS for sure, and don't have readahead code
|
||||||
|
* (yet?), so just default to 30fps.
|
||||||
|
*/
|
||||||
|
input_ctx->framerate.numerator = 30;
|
||||||
|
input_ctx->framerate.denominator = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_ivf) {
|
||||||
|
rewind(input_ctx->file);
|
||||||
|
input_ctx->detect.buf_read = 0;
|
||||||
|
} else {
|
||||||
|
input_ctx->detect.position = 4;
|
||||||
|
}
|
||||||
|
return is_ivf;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ivf_read_frame(struct VpxInputContext *input_ctx,
|
||||||
|
uint8_t **buffer,
|
||||||
|
size_t *bytes_read,
|
||||||
|
size_t *buffer_size) {
|
||||||
|
char raw_header[IVF_FRAME_HDR_SZ] = {0};
|
||||||
|
size_t frame_size = 0;
|
||||||
|
FILE *infile = input_ctx->file;
|
||||||
|
|
||||||
|
if (input_ctx->file_type != FILE_TYPE_IVF)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (fread(raw_header, IVF_FRAME_HDR_SZ, 1, infile) != 1) {
|
||||||
|
if (!feof(infile))
|
||||||
|
warn("Failed to read frame size\n");
|
||||||
|
} else {
|
||||||
|
frame_size = mem_get_le32(raw_header);
|
||||||
|
|
||||||
|
if (frame_size > 256 * 1024 * 1024) {
|
||||||
|
warn("Read invalid frame size (%u)\n", (unsigned int)frame_size);
|
||||||
|
frame_size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (frame_size > *buffer_size) {
|
||||||
|
uint8_t *new_buffer = realloc(*buffer, 2 * frame_size);
|
||||||
|
|
||||||
|
if (new_buffer) {
|
||||||
|
*buffer = new_buffer;
|
||||||
|
*buffer_size = 2 * frame_size;
|
||||||
|
} else {
|
||||||
|
warn("Failed to allocate compressed data buffer\n");
|
||||||
|
frame_size = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!feof(infile)) {
|
||||||
|
if (fread(*buffer, 1, frame_size, infile) != frame_size) {
|
||||||
|
warn("Failed to read full frame\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*bytes_read = frame_size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
30
ivfdec.h
Normal file
30
ivfdec.h
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
#ifndef IVFDEC_H_
|
||||||
|
#define IVFDEC_H_
|
||||||
|
|
||||||
|
#include "./tools_common.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int file_is_ivf(struct VpxInputContext *input);
|
||||||
|
|
||||||
|
int ivf_read_frame(struct VpxInputContext *input,
|
||||||
|
uint8_t **buffer,
|
||||||
|
size_t *bytes_read,
|
||||||
|
size_t *buffer_size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // IVFDEC_H_
|
||||||
62
ivfenc.c
Normal file
62
ivfenc.c
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "./ivfenc.h"
|
||||||
|
|
||||||
|
#include "./tools_common.h"
|
||||||
|
#include "vpx/vpx_encoder.h"
|
||||||
|
#include "vpx_ports/mem_ops.h"
|
||||||
|
|
||||||
|
void ivf_write_file_header(FILE *outfile,
|
||||||
|
const struct vpx_codec_enc_cfg *cfg,
|
||||||
|
unsigned int fourcc,
|
||||||
|
int frame_cnt) {
|
||||||
|
char header[32];
|
||||||
|
|
||||||
|
if (cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS)
|
||||||
|
return;
|
||||||
|
|
||||||
|
header[0] = 'D';
|
||||||
|
header[1] = 'K';
|
||||||
|
header[2] = 'I';
|
||||||
|
header[3] = 'F';
|
||||||
|
mem_put_le16(header + 4, 0); /* version */
|
||||||
|
mem_put_le16(header + 6, 32); /* headersize */
|
||||||
|
mem_put_le32(header + 8, fourcc); /* four CC */
|
||||||
|
mem_put_le16(header + 12, cfg->g_w); /* width */
|
||||||
|
mem_put_le16(header + 14, cfg->g_h); /* height */
|
||||||
|
mem_put_le32(header + 16, cfg->g_timebase.den); /* rate */
|
||||||
|
mem_put_le32(header + 20, cfg->g_timebase.num); /* scale */
|
||||||
|
mem_put_le32(header + 24, frame_cnt); /* length */
|
||||||
|
mem_put_le32(header + 28, 0); /* unused */
|
||||||
|
|
||||||
|
(void) fwrite(header, 1, 32, outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ivf_write_frame_header(FILE *outfile, const struct vpx_codec_cx_pkt *pkt) {
|
||||||
|
char header[12];
|
||||||
|
vpx_codec_pts_t pts;
|
||||||
|
|
||||||
|
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pts = pkt->data.frame.pts;
|
||||||
|
mem_put_le32(header, (int)pkt->data.frame.sz);
|
||||||
|
mem_put_le32(header + 4, pts & 0xFFFFFFFF);
|
||||||
|
mem_put_le32(header + 8, pts >> 32);
|
||||||
|
|
||||||
|
(void) fwrite(header, 1, 12, outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ivf_write_frame_size(FILE *outfile, size_t size) {
|
||||||
|
char header[4];
|
||||||
|
mem_put_le32(header, (int)size);
|
||||||
|
(void) fwrite(header, 1, 4, outfile);
|
||||||
|
}
|
||||||
33
ivfenc.h
Normal file
33
ivfenc.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
#ifndef IVFENC_H_
|
||||||
|
#define IVFENC_H_
|
||||||
|
|
||||||
|
#include "./tools_common.h"
|
||||||
|
|
||||||
|
struct vpx_codec_enc_cfg;
|
||||||
|
struct vpx_codec_cx_pkt;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void ivf_write_file_header(FILE *outfile,
|
||||||
|
const struct vpx_codec_enc_cfg *cfg,
|
||||||
|
uint32_t fourcc,
|
||||||
|
int frame_cnt);
|
||||||
|
void ivf_write_frame_header(FILE *outfile, const struct vpx_codec_cx_pkt *pkt);
|
||||||
|
void ivf_write_frame_size(FILE *outfile, size_t size);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // IVFENC_H_
|
||||||
6
libs.mk
6
libs.mk
@@ -122,6 +122,7 @@ ifeq ($(CONFIG_VP9_ENCODER),yes)
|
|||||||
CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS))
|
CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS))
|
||||||
CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
|
CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
|
||||||
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
|
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
|
||||||
|
INSTALL-LIBS-yes += include/vpx/svc_context.h
|
||||||
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
|
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
|
||||||
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
|
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
|
||||||
CODEC_DOC_SECTIONS += vp9 vp9_encoder
|
CODEC_DOC_SECTIONS += vp9 vp9_encoder
|
||||||
@@ -182,9 +183,8 @@ CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
|
|||||||
|
|
||||||
INSTALL-LIBS-yes += include/vpx/vpx_codec.h
|
INSTALL-LIBS-yes += include/vpx/vpx_codec.h
|
||||||
INSTALL-LIBS-yes += include/vpx/vpx_image.h
|
INSTALL-LIBS-yes += include/vpx/vpx_image.h
|
||||||
|
INSTALL-LIBS-yes += include/vpx/vpx_external_frame_buffer.h
|
||||||
INSTALL-LIBS-yes += include/vpx/vpx_integer.h
|
INSTALL-LIBS-yes += include/vpx/vpx_integer.h
|
||||||
INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_top.h
|
|
||||||
INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.h
|
|
||||||
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
|
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
|
||||||
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
|
INSTALL-LIBS-$(CONFIG_ENCODERS) += include/vpx/vpx_encoder.h
|
||||||
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
|
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
|
||||||
@@ -395,7 +395,7 @@ libvpx_test_srcs.txt:
|
|||||||
@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | sort -u > $@
|
@echo $(LIBVPX_TEST_SRCS) | xargs -n1 echo | sort -u > $@
|
||||||
CLEAN-OBJS += libvpx_test_srcs.txt
|
CLEAN-OBJS += libvpx_test_srcs.txt
|
||||||
|
|
||||||
$(LIBVPX_TEST_DATA):
|
$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
|
||||||
@echo " [DOWNLOAD] $@"
|
@echo " [DOWNLOAD] $@"
|
||||||
$(qexec)trap 'rm -f $@' INT TERM &&\
|
$(qexec)trap 'rm -f $@' INT TERM &&\
|
||||||
curl -L -o $@ $(call libvpx_test_data_url,$(@F))
|
curl -L -o $@ $(call libvpx_test_data_url,$(@F))
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
* Still in the public domain.
|
* Still in the public domain.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MD5_H
|
#ifndef MD5_UTILS_H_
|
||||||
#define MD5_H
|
#define MD5_UTILS_H_
|
||||||
|
|
||||||
#define md5byte unsigned char
|
#define md5byte unsigned char
|
||||||
#define UWORD32 unsigned int
|
#define UWORD32 unsigned int
|
||||||
@@ -38,4 +38,4 @@ void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
|
|||||||
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||||
void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
|
void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
|
||||||
|
|
||||||
#endif /* !MD5_H */
|
#endif // MD5_UTILS_H_
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBVPX_TEST_ACM_RANDOM_H_
|
#ifndef TEST_ACM_RANDOM_H_
|
||||||
#define LIBVPX_TEST_ACM_RANDOM_H_
|
#define TEST_ACM_RANDOM_H_
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
@@ -26,6 +26,11 @@ class ACMRandom {
|
|||||||
void Reset(int seed) {
|
void Reset(int seed) {
|
||||||
random_.Reseed(seed);
|
random_.Reseed(seed);
|
||||||
}
|
}
|
||||||
|
uint16_t Rand16(void) {
|
||||||
|
const uint32_t value =
|
||||||
|
random_.Generate(testing::internal::Random::kMaxRange);
|
||||||
|
return (value >> 16) & 0xffff;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t Rand8(void) {
|
uint8_t Rand8(void) {
|
||||||
const uint32_t value =
|
const uint32_t value =
|
||||||
@@ -38,7 +43,7 @@ class ACMRandom {
|
|||||||
// Returns a random value near 0 or near 255, to better exercise
|
// Returns a random value near 0 or near 255, to better exercise
|
||||||
// saturation behavior.
|
// saturation behavior.
|
||||||
const uint8_t r = Rand8();
|
const uint8_t r = Rand8();
|
||||||
return r <= 128 ? 255 - (r >> 4) : r >> 4;
|
return r < 128 ? r << 4 : r >> 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PseudoUniform(int range) {
|
int PseudoUniform(int range) {
|
||||||
@@ -59,4 +64,4 @@ class ACMRandom {
|
|||||||
|
|
||||||
} // namespace libvpx_test
|
} // namespace libvpx_test
|
||||||
|
|
||||||
#endif // LIBVPX_TEST_ACM_RANDOM_H_
|
#endif // TEST_ACM_RANDOM_H_
|
||||||
|
|||||||
42
test/android/Android.mk
Normal file
42
test/android/Android.mk
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Use of this source code is governed by a BSD-style license
|
||||||
|
# that can be found in the LICENSE file in the root of the source
|
||||||
|
# tree. An additional intellectual property rights grant can be found
|
||||||
|
# in the file PATENTS. All contributing project authors may
|
||||||
|
# be found in the AUTHORS file in the root of the source tree.
|
||||||
|
#
|
||||||
|
# This make file builds vpx_test app for android.
|
||||||
|
# The test app itself runs on the command line through adb shell
|
||||||
|
# The paths are really messed up as the libvpx make file
|
||||||
|
# expects to be made from a parent directory.
|
||||||
|
CUR_WD := $(call my-dir)
|
||||||
|
BINDINGS_DIR := $(CUR_WD)/../../..
|
||||||
|
LOCAL_PATH := $(CUR_WD)/../../..
|
||||||
|
|
||||||
|
#libvpx
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
include $(BINDINGS_DIR)/libvpx/build/make/Android.mk
|
||||||
|
LOCAL_PATH := $(CUR_WD)/../..
|
||||||
|
|
||||||
|
#libgtest
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_ARM_MODE := arm
|
||||||
|
LOCAL_CPP_EXTENSION := .cc
|
||||||
|
LOCAL_MODULE := gtest
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/
|
||||||
|
LOCAL_C_INCLUDES += $(LOCAL_PATH)/third_party/googletest/src/include/
|
||||||
|
LOCAL_SRC_FILES := ./third_party/googletest/src/src/gtest-all.cc
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
#libvpx_test
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_ARM_MODE := arm
|
||||||
|
LOCAL_MODULE := libvpx_test
|
||||||
|
LOCAL_STATIC_LIBRARIES := gtest
|
||||||
|
LOCAL_SHARED_LIBRARIES := vpx
|
||||||
|
include $(LOCAL_PATH)/test/test.mk
|
||||||
|
LOCAL_C_INCLUDES := $(BINDINGS_DIR)
|
||||||
|
FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes)))
|
||||||
|
LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC))
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
32
test/android/README
Normal file
32
test/android/README
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Android.mk will build vpx unittests on android.
|
||||||
|
1) Configure libvpx from the parent directory:
|
||||||
|
./libvpx/configure --target=armv7-android-gcc --enable-external-build \
|
||||||
|
--enable-postproc --disable-install-srcs --enable-multi-res-encoding \
|
||||||
|
--enable-temporal-denoising --disable-unit-tests --disable-install-docs \
|
||||||
|
--disable-examples --disable-runtime-cpu-detect --sdk=$NDK
|
||||||
|
|
||||||
|
2) From the parent directory, invoke ndk-build:
|
||||||
|
NDK_PROJECT_PATH=. ndk-build APP_BUILD_SCRIPT=./libvpx/test/android/Android.mk \
|
||||||
|
APP_ABI=armeabi-v7a APP_PLATFORM=android-18 APP_OPTIM=release \
|
||||||
|
APP_STL=gnustl_static
|
||||||
|
|
||||||
|
Note: Both adb and ndk-build are available prebuilt at:
|
||||||
|
https://chromium.googlesource.com/android_tools
|
||||||
|
|
||||||
|
3) Run get_files.py to download the test files:
|
||||||
|
python get_files.py -i /path/to/test-data.sha1 -o /path/to/put/files \
|
||||||
|
-u http://downloads.webmproject.org/test_data/libvpx
|
||||||
|
|
||||||
|
4) Transfer files to device using adb. Ensure you have proper permissions for
|
||||||
|
the target
|
||||||
|
|
||||||
|
adb push /path/to/test_files /data/local/tmp
|
||||||
|
adb push /path/to/built_libs /data/local/tmp
|
||||||
|
|
||||||
|
NOTE: Built_libs defaults to parent_dir/libs/armeabi-v7a
|
||||||
|
|
||||||
|
5) Run tests:
|
||||||
|
adb shell
|
||||||
|
(on device)
|
||||||
|
cd /data/local/tmp
|
||||||
|
LD_LIBRARY_PATH=. ./vpx_test
|
||||||
118
test/android/get_files.py
Normal file
118
test/android/get_files.py
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
# Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Use of this source code is governed by a BSD-style license
|
||||||
|
# that can be found in the LICENSE file in the root of the source
|
||||||
|
# tree. An additional intellectual property rights grant can be found
|
||||||
|
# in the file PATENTS. All contributing project authors may
|
||||||
|
# be found in the AUTHORS file in the root of the source tree.
|
||||||
|
#
|
||||||
|
# This simple script pulls test files from the webm homepage
|
||||||
|
# It is intelligent enough to only pull files if
|
||||||
|
# 1) File / test_data folder does not exist
|
||||||
|
# 2) SHA mismatch
|
||||||
|
|
||||||
|
import pycurl
|
||||||
|
import csv
|
||||||
|
import hashlib
|
||||||
|
import re
|
||||||
|
import os.path
|
||||||
|
import time
|
||||||
|
import itertools
|
||||||
|
import sys
|
||||||
|
import getopt
|
||||||
|
|
||||||
|
#globals
|
||||||
|
url = ''
|
||||||
|
file_list_path = ''
|
||||||
|
local_resource_path = ''
|
||||||
|
|
||||||
|
# Helper functions:
|
||||||
|
# A simple function which returns the sha hash of a file in hex
|
||||||
|
def get_file_sha(filename):
|
||||||
|
try:
|
||||||
|
sha_hash = hashlib.sha1()
|
||||||
|
with open(filename, 'rb') as file:
|
||||||
|
buf = file.read(HASH_CHUNK)
|
||||||
|
while len(buf) > 0:
|
||||||
|
sha_hash.update(buf)
|
||||||
|
buf = file.read(HASH_CHUNK)
|
||||||
|
return sha_hash.hexdigest()
|
||||||
|
except IOError:
|
||||||
|
print "Error reading " + filename
|
||||||
|
|
||||||
|
# Downloads a file from a url, and then checks the sha against the passed
|
||||||
|
# in sha
|
||||||
|
def download_and_check_sha(url, filename, sha):
|
||||||
|
path = os.path.join(local_resource_path, filename)
|
||||||
|
fp = open(path, "wb")
|
||||||
|
curl = pycurl.Curl()
|
||||||
|
curl.setopt(pycurl.URL, url + "/" + filename)
|
||||||
|
curl.setopt(pycurl.WRITEDATA, fp)
|
||||||
|
curl.perform()
|
||||||
|
curl.close()
|
||||||
|
fp.close()
|
||||||
|
return get_file_sha(path) == sha
|
||||||
|
|
||||||
|
#constants
|
||||||
|
ftp_retries = 3
|
||||||
|
|
||||||
|
SHA_COL = 0
|
||||||
|
NAME_COL = 1
|
||||||
|
EXPECTED_COL = 2
|
||||||
|
HASH_CHUNK = 65536
|
||||||
|
|
||||||
|
# Main script
|
||||||
|
try:
|
||||||
|
opts, args = \
|
||||||
|
getopt.getopt(sys.argv[1:], \
|
||||||
|
"u:i:o:", ["url=", "input_csv=", "output_dir="])
|
||||||
|
except:
|
||||||
|
print 'get_files.py -u <url> -i <input_csv> -o <output_dir>'
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
for opt, arg in opts:
|
||||||
|
if opt == '-u':
|
||||||
|
url = arg
|
||||||
|
elif opt in ("-i", "--input_csv"):
|
||||||
|
file_list_path = os.path.join(arg)
|
||||||
|
elif opt in ("-o", "--output_dir"):
|
||||||
|
local_resource_path = os.path.join(arg)
|
||||||
|
|
||||||
|
if len(sys.argv) != 7:
|
||||||
|
print "Expects two paths and a url!"
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
if not os.path.isdir(local_resource_path):
|
||||||
|
os.makedirs(local_resource_path)
|
||||||
|
|
||||||
|
file_list_csv = open(file_list_path, "rb")
|
||||||
|
|
||||||
|
# Our 'csv' file uses multiple spaces as a delimiter, python's
|
||||||
|
# csv class only uses single character delimiters, so we convert them below
|
||||||
|
file_list_reader = csv.reader((re.sub(' +', ' ', line) \
|
||||||
|
for line in file_list_csv), delimiter = ' ')
|
||||||
|
|
||||||
|
file_shas = []
|
||||||
|
file_names = []
|
||||||
|
|
||||||
|
for row in file_list_reader:
|
||||||
|
if len(row) != EXPECTED_COL:
|
||||||
|
continue
|
||||||
|
file_shas.append(row[SHA_COL])
|
||||||
|
file_names.append(row[NAME_COL])
|
||||||
|
|
||||||
|
file_list_csv.close()
|
||||||
|
|
||||||
|
# Download files, only if they don't already exist and have correct shas
|
||||||
|
for filename, sha in itertools.izip(file_names, file_shas):
|
||||||
|
path = os.path.join(local_resource_path, filename)
|
||||||
|
if os.path.isfile(path) \
|
||||||
|
and get_file_sha(path) == sha:
|
||||||
|
print path + ' exists, skipping'
|
||||||
|
continue
|
||||||
|
for retry in range(0, ftp_retries):
|
||||||
|
print "Downloading " + path
|
||||||
|
if not download_and_check_sha(url, filename, sha):
|
||||||
|
print "Sha does not match, retrying..."
|
||||||
|
else:
|
||||||
|
break
|
||||||
@@ -29,8 +29,8 @@ class BordersTest : public ::libvpx_test::EncoderTest,
|
|||||||
|
|
||||||
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||||
::libvpx_test::Encoder *encoder) {
|
::libvpx_test::Encoder *encoder) {
|
||||||
if ( video->frame() == 1) {
|
if (video->frame() == 1) {
|
||||||
encoder->Control(VP8E_SET_CPUUSED, 0);
|
encoder->Control(VP8E_SET_CPUUSED, 1);
|
||||||
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
|
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
|
||||||
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
|
||||||
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
|
encoder->Control(VP8E_SET_ARNR_STRENGTH, 5);
|
||||||
@@ -67,7 +67,7 @@ TEST_P(BordersTest, TestLowBitrate) {
|
|||||||
|
|
||||||
cfg_.g_lag_in_frames = 25;
|
cfg_.g_lag_in_frames = 25;
|
||||||
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
cfg_.rc_2pass_vbr_minsection_pct = 5;
|
||||||
cfg_.rc_2pass_vbr_minsection_pct = 2000;
|
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
|
||||||
cfg_.rc_target_bitrate = 200;
|
cfg_.rc_target_bitrate = 200;
|
||||||
cfg_.rc_min_quantizer = 40;
|
cfg_.rc_min_quantizer = 40;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#ifndef TEST_CLEAR_SYSTEM_STATE_H_
|
#ifndef TEST_CLEAR_SYSTEM_STATE_H_
|
||||||
#define TEST_CLEAR_SYSTEM_STATE_H_
|
#define TEST_CLEAR_SYSTEM_STATE_H_
|
||||||
|
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#if ARCH_X86 || ARCH_X86_64
|
#if ARCH_X86 || ARCH_X86_64
|
||||||
# include "vpx_ports/x86.h"
|
# include "vpx_ports/x86.h"
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ extern "C" {
|
|||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
|
|
||||||
|
const int kCodecFactoryParam = 0;
|
||||||
|
|
||||||
class CodecFactory {
|
class CodecFactory {
|
||||||
public:
|
public:
|
||||||
CodecFactory() {}
|
CodecFactory() {}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
@@ -43,6 +44,8 @@ struct ConvolveFunctions {
|
|||||||
convolve_fn_t hv8_avg_;
|
convolve_fn_t hv8_avg_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::tr1::tuple<int, int, const ConvolveFunctions*> convolve_param_t;
|
||||||
|
|
||||||
// Reference 8-tap subpixel filter, slightly modified to fit into this test.
|
// Reference 8-tap subpixel filter, slightly modified to fit into this test.
|
||||||
#define VP9_FILTER_WEIGHT 128
|
#define VP9_FILTER_WEIGHT 128
|
||||||
#define VP9_FILTER_SHIFT 7
|
#define VP9_FILTER_SHIFT 7
|
||||||
@@ -168,7 +171,7 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr,
|
|||||||
output_width, output_height);
|
output_width, output_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
|
class ConvolveTest : public ::testing::TestWithParam<convolve_param_t> {
|
||||||
public:
|
public:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
// Force input_ to be unaligned, output to be 16 byte aligned.
|
// Force input_ to be unaligned, output to be 16 byte aligned.
|
||||||
@@ -187,7 +190,7 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const int kDataAlignment = 16;
|
static const int kDataAlignment = 16;
|
||||||
static const int kOuterBlockSize = 128;
|
static const int kOuterBlockSize = 256;
|
||||||
static const int kInputStride = kOuterBlockSize;
|
static const int kInputStride = kOuterBlockSize;
|
||||||
static const int kOutputStride = kOuterBlockSize;
|
static const int kOutputStride = kOuterBlockSize;
|
||||||
static const int kMaxDimension = 64;
|
static const int kMaxDimension = 64;
|
||||||
@@ -224,6 +227,10 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
|
|||||||
input_[i] = prng.Rand8Extremes();
|
input_[i] = prng.Rand8Extremes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetConstantInput(int value) {
|
||||||
|
memset(input_, value, kInputBufferSize);
|
||||||
|
}
|
||||||
|
|
||||||
void CheckGuardBlocks() {
|
void CheckGuardBlocks() {
|
||||||
for (int i = 0; i < kOutputBufferSize; ++i) {
|
for (int i = 0; i < kOutputBufferSize; ++i) {
|
||||||
if (IsIndexInBorder(i))
|
if (IsIndexInBorder(i))
|
||||||
@@ -456,45 +463,86 @@ DECLARE_ALIGNED(256, const int16_t, kChangeFilters[16][8]) = {
|
|||||||
{ 128}
|
{ 128}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* This test exercises the horizontal and vertical filter functions. */
|
||||||
TEST_P(ConvolveTest, ChangeFilterWorks) {
|
TEST_P(ConvolveTest, ChangeFilterWorks) {
|
||||||
uint8_t* const in = input();
|
uint8_t* const in = input();
|
||||||
uint8_t* const out = output();
|
uint8_t* const out = output();
|
||||||
|
|
||||||
|
/* Assume that the first input sample is at the 8/16th position. */
|
||||||
|
const int kInitialSubPelOffset = 8;
|
||||||
|
|
||||||
|
/* Filters are 8-tap, so the first filter tap will be applied to the pixel
|
||||||
|
* at position -3 with respect to the current filtering position. Since
|
||||||
|
* kInitialSubPelOffset is set to 8, we first select sub-pixel filter 8,
|
||||||
|
* which is non-zero only in the last tap. So, applying the filter at the
|
||||||
|
* current input position will result in an output equal to the pixel at
|
||||||
|
* offset +4 (-3 + 7) with respect to the current filtering position.
|
||||||
|
*/
|
||||||
const int kPixelSelected = 4;
|
const int kPixelSelected = 4;
|
||||||
|
|
||||||
|
/* Assume that each output pixel requires us to step on by 17/16th pixels in
|
||||||
|
* the input.
|
||||||
|
*/
|
||||||
|
const int kInputPixelStep = 17;
|
||||||
|
|
||||||
|
/* The filters are setup in such a way that the expected output produces
|
||||||
|
* sets of 8 identical output samples. As the filter position moves to the
|
||||||
|
* next 1/16th pixel position the only active (=128) filter tap moves one
|
||||||
|
* position to the left, resulting in the same input pixel being replicated
|
||||||
|
* in to the output for 8 consecutive samples. After each set of 8 positions
|
||||||
|
* the filters select a different input pixel. kFilterPeriodAdjust below
|
||||||
|
* computes which input pixel is written to the output for a specified
|
||||||
|
* x or y position.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Test the horizontal filter. */
|
||||||
REGISTER_STATE_CHECK(UUT_->h8_(in, kInputStride, out, kOutputStride,
|
REGISTER_STATE_CHECK(UUT_->h8_(in, kInputStride, out, kOutputStride,
|
||||||
kChangeFilters[8], 17, kChangeFilters[4], 16,
|
kChangeFilters[kInitialSubPelOffset],
|
||||||
Width(), Height()));
|
kInputPixelStep, NULL, 0, Width(), Height()));
|
||||||
|
|
||||||
for (int x = 0; x < Width(); ++x) {
|
for (int x = 0; x < Width(); ++x) {
|
||||||
const int kQ4StepAdjust = x >> 4;
|
|
||||||
const int kFilterPeriodAdjust = (x >> 3) << 3;
|
const int kFilterPeriodAdjust = (x >> 3) << 3;
|
||||||
const int ref_x = kQ4StepAdjust + kFilterPeriodAdjust + kPixelSelected;
|
const int ref_x =
|
||||||
ASSERT_EQ(in[ref_x], out[x]) << "x == " << x;
|
kPixelSelected + ((kInitialSubPelOffset
|
||||||
|
+ kFilterPeriodAdjust * kInputPixelStep)
|
||||||
|
>> SUBPEL_BITS);
|
||||||
|
ASSERT_EQ(in[ref_x], out[x]) << "x == " << x << "width = " << Width();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Test the vertical filter. */
|
||||||
REGISTER_STATE_CHECK(UUT_->v8_(in, kInputStride, out, kOutputStride,
|
REGISTER_STATE_CHECK(UUT_->v8_(in, kInputStride, out, kOutputStride,
|
||||||
kChangeFilters[4], 16, kChangeFilters[8], 17,
|
NULL, 0, kChangeFilters[kInitialSubPelOffset],
|
||||||
Width(), Height()));
|
kInputPixelStep, Width(), Height()));
|
||||||
|
|
||||||
for (int y = 0; y < Height(); ++y) {
|
for (int y = 0; y < Height(); ++y) {
|
||||||
const int kQ4StepAdjust = y >> 4;
|
|
||||||
const int kFilterPeriodAdjust = (y >> 3) << 3;
|
const int kFilterPeriodAdjust = (y >> 3) << 3;
|
||||||
const int ref_y = kQ4StepAdjust + kFilterPeriodAdjust + kPixelSelected;
|
const int ref_y =
|
||||||
|
kPixelSelected + ((kInitialSubPelOffset
|
||||||
|
+ kFilterPeriodAdjust * kInputPixelStep)
|
||||||
|
>> SUBPEL_BITS);
|
||||||
ASSERT_EQ(in[ref_y * kInputStride], out[y * kInputStride]) << "y == " << y;
|
ASSERT_EQ(in[ref_y * kInputStride], out[y * kInputStride]) << "y == " << y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Test the horizontal and vertical filters in combination. */
|
||||||
REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
|
REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
|
||||||
kChangeFilters[8], 17, kChangeFilters[8], 17,
|
kChangeFilters[kInitialSubPelOffset],
|
||||||
|
kInputPixelStep,
|
||||||
|
kChangeFilters[kInitialSubPelOffset],
|
||||||
|
kInputPixelStep,
|
||||||
Width(), Height()));
|
Width(), Height()));
|
||||||
|
|
||||||
for (int y = 0; y < Height(); ++y) {
|
for (int y = 0; y < Height(); ++y) {
|
||||||
const int kQ4StepAdjustY = y >> 4;
|
|
||||||
const int kFilterPeriodAdjustY = (y >> 3) << 3;
|
const int kFilterPeriodAdjustY = (y >> 3) << 3;
|
||||||
const int ref_y = kQ4StepAdjustY + kFilterPeriodAdjustY + kPixelSelected;
|
const int ref_y =
|
||||||
|
kPixelSelected + ((kInitialSubPelOffset
|
||||||
|
+ kFilterPeriodAdjustY * kInputPixelStep)
|
||||||
|
>> SUBPEL_BITS);
|
||||||
for (int x = 0; x < Width(); ++x) {
|
for (int x = 0; x < Width(); ++x) {
|
||||||
const int kQ4StepAdjustX = x >> 4;
|
|
||||||
const int kFilterPeriodAdjustX = (x >> 3) << 3;
|
const int kFilterPeriodAdjustX = (x >> 3) << 3;
|
||||||
const int ref_x = kQ4StepAdjustX + kFilterPeriodAdjustX + kPixelSelected;
|
const int ref_x =
|
||||||
|
kPixelSelected + ((kInitialSubPelOffset
|
||||||
|
+ kFilterPeriodAdjustX * kInputPixelStep)
|
||||||
|
>> SUBPEL_BITS);
|
||||||
|
|
||||||
ASSERT_EQ(in[ref_y * kInputStride + ref_x], out[y * kOutputStride + x])
|
ASSERT_EQ(in[ref_y * kInputStride + ref_x], out[y * kOutputStride + x])
|
||||||
<< "x == " << x << ", y == " << y;
|
<< "x == " << x << ", y == " << y;
|
||||||
@@ -502,6 +550,34 @@ TEST_P(ConvolveTest, ChangeFilterWorks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This test exercises that enough rows and columns are filtered with every
|
||||||
|
possible initial fractional positions and scaling steps. */
|
||||||
|
TEST_P(ConvolveTest, CheckScalingFiltering) {
|
||||||
|
uint8_t* const in = input();
|
||||||
|
uint8_t* const out = output();
|
||||||
|
|
||||||
|
SetConstantInput(127);
|
||||||
|
|
||||||
|
for (int frac = 0; frac < 16; ++frac) {
|
||||||
|
for (int step = 1; step <= 32; ++step) {
|
||||||
|
/* Test the horizontal and vertical filters in combination. */
|
||||||
|
REGISTER_STATE_CHECK(UUT_->hv8_(in, kInputStride, out, kOutputStride,
|
||||||
|
vp9_sub_pel_filters_8[frac], step,
|
||||||
|
vp9_sub_pel_filters_8[frac], step,
|
||||||
|
Width(), Height()));
|
||||||
|
|
||||||
|
CheckGuardBlocks();
|
||||||
|
|
||||||
|
for (int y = 0; y < Height(); ++y) {
|
||||||
|
for (int x = 0; x < Width(); ++x) {
|
||||||
|
ASSERT_EQ(in[y * kInputStride + x], out[y * kOutputStride + x])
|
||||||
|
<< "x == " << x << ", y == " << y
|
||||||
|
<< ", frac == " << frac << ", step == " << step;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using std::tr1::make_tuple;
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
@@ -525,6 +601,28 @@ INSTANTIATE_TEST_CASE_P(C, ConvolveTest, ::testing::Values(
|
|||||||
make_tuple(32, 64, &convolve8_c),
|
make_tuple(32, 64, &convolve8_c),
|
||||||
make_tuple(64, 64, &convolve8_c)));
|
make_tuple(64, 64, &convolve8_c)));
|
||||||
|
|
||||||
|
#if HAVE_SSE2
|
||||||
|
const ConvolveFunctions convolve8_sse2(
|
||||||
|
vp9_convolve8_horiz_sse2, vp9_convolve8_avg_horiz_sse2,
|
||||||
|
vp9_convolve8_vert_sse2, vp9_convolve8_avg_vert_sse2,
|
||||||
|
vp9_convolve8_sse2, vp9_convolve8_avg_sse2);
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(SSE2, ConvolveTest, ::testing::Values(
|
||||||
|
make_tuple(4, 4, &convolve8_sse2),
|
||||||
|
make_tuple(8, 4, &convolve8_sse2),
|
||||||
|
make_tuple(4, 8, &convolve8_sse2),
|
||||||
|
make_tuple(8, 8, &convolve8_sse2),
|
||||||
|
make_tuple(16, 8, &convolve8_sse2),
|
||||||
|
make_tuple(8, 16, &convolve8_sse2),
|
||||||
|
make_tuple(16, 16, &convolve8_sse2),
|
||||||
|
make_tuple(32, 16, &convolve8_sse2),
|
||||||
|
make_tuple(16, 32, &convolve8_sse2),
|
||||||
|
make_tuple(32, 32, &convolve8_sse2),
|
||||||
|
make_tuple(64, 32, &convolve8_sse2),
|
||||||
|
make_tuple(32, 64, &convolve8_sse2),
|
||||||
|
make_tuple(64, 64, &convolve8_sse2)));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSSE3
|
#if HAVE_SSSE3
|
||||||
const ConvolveFunctions convolve8_ssse3(
|
const ConvolveFunctions convolve8_ssse3(
|
||||||
vp9_convolve8_horiz_ssse3, vp9_convolve8_avg_horiz_ssse3,
|
vp9_convolve8_horiz_ssse3, vp9_convolve8_avg_horiz_ssse3,
|
||||||
@@ -568,4 +666,26 @@ INSTANTIATE_TEST_CASE_P(NEON, ConvolveTest, ::testing::Values(
|
|||||||
make_tuple(32, 64, &convolve8_neon),
|
make_tuple(32, 64, &convolve8_neon),
|
||||||
make_tuple(64, 64, &convolve8_neon)));
|
make_tuple(64, 64, &convolve8_neon)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_DSPR2
|
||||||
|
const ConvolveFunctions convolve8_dspr2(
|
||||||
|
vp9_convolve8_horiz_dspr2, vp9_convolve8_avg_horiz_dspr2,
|
||||||
|
vp9_convolve8_vert_dspr2, vp9_convolve8_avg_vert_dspr2,
|
||||||
|
vp9_convolve8_dspr2, vp9_convolve8_avg_dspr2);
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(DSPR2, ConvolveTest, ::testing::Values(
|
||||||
|
make_tuple(4, 4, &convolve8_dspr2),
|
||||||
|
make_tuple(8, 4, &convolve8_dspr2),
|
||||||
|
make_tuple(4, 8, &convolve8_dspr2),
|
||||||
|
make_tuple(8, 8, &convolve8_dspr2),
|
||||||
|
make_tuple(16, 8, &convolve8_dspr2),
|
||||||
|
make_tuple(8, 16, &convolve8_dspr2),
|
||||||
|
make_tuple(16, 16, &convolve8_dspr2),
|
||||||
|
make_tuple(32, 16, &convolve8_dspr2),
|
||||||
|
make_tuple(16, 32, &convolve8_dspr2),
|
||||||
|
make_tuple(32, 32, &convolve8_dspr2),
|
||||||
|
make_tuple(64, 32, &convolve8_dspr2),
|
||||||
|
make_tuple(32, 64, &convolve8_dspr2),
|
||||||
|
make_tuple(64, 64, &convolve8_dspr2)));
|
||||||
|
#endif
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -108,5 +108,5 @@ using std::tr1::make_tuple;
|
|||||||
VP9_INSTANTIATE_TEST_CASE(
|
VP9_INSTANTIATE_TEST_CASE(
|
||||||
CpuSpeedTest,
|
CpuSpeedTest,
|
||||||
::testing::Values(::libvpx_test::kTwoPassGood),
|
::testing::Values(::libvpx_test::kTwoPassGood),
|
||||||
::testing::Range(0, 3));
|
::testing::Range(0, 5));
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class DatarateTest : public ::libvpx_test::EncoderTest,
|
|||||||
bits_in_buffer_model_ -= frame_size_in_bits;
|
bits_in_buffer_model_ -= frame_size_in_bits;
|
||||||
|
|
||||||
// Update the running total of bits for end of test datarate checks.
|
// Update the running total of bits for end of test datarate checks.
|
||||||
bits_total_ += frame_size_in_bits ;
|
bits_total_ += frame_size_in_bits;
|
||||||
|
|
||||||
// If first drop not set and we have a drop set it to this time.
|
// If first drop not set and we have a drop set it to this time.
|
||||||
if (!first_drop_ && duration > 1)
|
if (!first_drop_ && duration > 1)
|
||||||
@@ -176,6 +176,160 @@ TEST_P(DatarateTest, ChangingDropFrameThresh) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VP8_INSTANTIATE_TEST_CASE(DatarateTest, ALL_TEST_MODES);
|
class DatarateTestVP9 : public ::libvpx_test::EncoderTest,
|
||||||
|
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
|
||||||
|
public:
|
||||||
|
DatarateTestVP9() : EncoderTest(GET_PARAM(0)) {}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ~DatarateTestVP9() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
InitializeConfig();
|
||||||
|
SetMode(GET_PARAM(1));
|
||||||
|
set_cpu_used_ = GET_PARAM(2);
|
||||||
|
ResetModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void ResetModel() {
|
||||||
|
last_pts_ = 0;
|
||||||
|
bits_in_buffer_model_ = cfg_.rc_target_bitrate * cfg_.rc_buf_initial_sz;
|
||||||
|
frame_number_ = 0;
|
||||||
|
first_drop_ = 0;
|
||||||
|
num_drops_ = 0;
|
||||||
|
bits_total_ = 0;
|
||||||
|
duration_ = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
|
||||||
|
::libvpx_test::Encoder *encoder) {
|
||||||
|
if (video->frame() == 1) {
|
||||||
|
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
|
||||||
|
}
|
||||||
|
const vpx_rational_t tb = video->timebase();
|
||||||
|
timebase_ = static_cast<double>(tb.num) / tb.den;
|
||||||
|
duration_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||||
|
// Time since last timestamp = duration.
|
||||||
|
vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
|
||||||
|
|
||||||
|
// Add to the buffer the bits we'd expect from a constant bitrate server.
|
||||||
|
bits_in_buffer_model_ += duration * timebase_ * cfg_.rc_target_bitrate
|
||||||
|
* 1000;
|
||||||
|
|
||||||
|
// Buffer should not go negative.
|
||||||
|
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
|
||||||
|
<< pkt->data.frame.pts;
|
||||||
|
|
||||||
|
const int frame_size_in_bits = pkt->data.frame.sz * 8;
|
||||||
|
bits_total_ += frame_size_in_bits;
|
||||||
|
|
||||||
|
// If first drop not set and we have a drop set it to this time.
|
||||||
|
if (!first_drop_ && duration > 1)
|
||||||
|
first_drop_ = last_pts_ + 1;
|
||||||
|
|
||||||
|
// Update the number of frame drops.
|
||||||
|
if (duration > 1) {
|
||||||
|
num_drops_+= (duration - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the most recent pts.
|
||||||
|
last_pts_ = pkt->data.frame.pts;
|
||||||
|
++frame_number_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void EndPassHook(void) {
|
||||||
|
if (bits_total_) {
|
||||||
|
duration_ = (last_pts_ + 1) * timebase_;
|
||||||
|
// Effective file datarate:
|
||||||
|
effective_datarate_ = ((bits_total_) / 1000.0) / duration_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vpx_codec_pts_t last_pts_;
|
||||||
|
double timebase_;
|
||||||
|
int frame_number_;
|
||||||
|
int64_t bits_total_;
|
||||||
|
double duration_;
|
||||||
|
double effective_datarate_;
|
||||||
|
int set_cpu_used_;
|
||||||
|
int bits_in_buffer_model_;
|
||||||
|
int first_drop_;
|
||||||
|
int num_drops_;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Check basic rate targeting,
|
||||||
|
TEST_P(DatarateTestVP9, BasicRateTargeting) {
|
||||||
|
cfg_.rc_buf_initial_sz = 500;
|
||||||
|
cfg_.rc_buf_optimal_sz = 500;
|
||||||
|
cfg_.rc_buf_sz = 1000;
|
||||||
|
cfg_.rc_dropframe_thresh = 1;
|
||||||
|
cfg_.rc_min_quantizer = 0;
|
||||||
|
cfg_.rc_max_quantizer = 63;
|
||||||
|
cfg_.rc_end_usage = VPX_CBR;
|
||||||
|
|
||||||
|
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||||
|
30, 1, 0, 140);
|
||||||
|
for (int i = 150; i < 800; i += 200) {
|
||||||
|
cfg_.rc_target_bitrate = i;
|
||||||
|
ResetModel();
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||||
|
ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
|
||||||
|
effective_datarate_ * 0.85)
|
||||||
|
<< " The datarate for the file exceeds the target by too much!";
|
||||||
|
ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
|
||||||
|
effective_datarate_ * 1.15)
|
||||||
|
<< " The datarate for the file missed the target!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that (1) the first dropped frame gets earlier and earlier
|
||||||
|
// as the drop frame threshold is increased, and (2) that the total number of
|
||||||
|
// frame drops does not decrease as we increase frame drop threshold.
|
||||||
|
// Use a lower qp-max to force some frame drops.
|
||||||
|
TEST_P(DatarateTestVP9, ChangingDropFrameThresh) {
|
||||||
|
cfg_.rc_buf_initial_sz = 500;
|
||||||
|
cfg_.rc_buf_optimal_sz = 500;
|
||||||
|
cfg_.rc_buf_sz = 1000;
|
||||||
|
cfg_.rc_undershoot_pct = 20;
|
||||||
|
cfg_.rc_undershoot_pct = 20;
|
||||||
|
cfg_.rc_dropframe_thresh = 10;
|
||||||
|
cfg_.rc_min_quantizer = 0;
|
||||||
|
cfg_.rc_max_quantizer = 50;
|
||||||
|
cfg_.rc_end_usage = VPX_CBR;
|
||||||
|
cfg_.rc_target_bitrate = 200;
|
||||||
|
|
||||||
|
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||||
|
30, 1, 0, 140);
|
||||||
|
|
||||||
|
const int kDropFrameThreshTestStep = 30;
|
||||||
|
int last_drop = 140;
|
||||||
|
int last_num_drops = 0;
|
||||||
|
for (int i = 10; i < 100; i += kDropFrameThreshTestStep) {
|
||||||
|
cfg_.rc_dropframe_thresh = i;
|
||||||
|
ResetModel();
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||||
|
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * 0.85)
|
||||||
|
<< " The datarate for the file is lower than target by too much!";
|
||||||
|
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * 1.15)
|
||||||
|
<< " The datarate for the file is greater than target by too much!";
|
||||||
|
ASSERT_LE(first_drop_, last_drop)
|
||||||
|
<< " The first dropped frame for drop_thresh " << i
|
||||||
|
<< " > first dropped frame for drop_thresh "
|
||||||
|
<< i - kDropFrameThreshTestStep;
|
||||||
|
ASSERT_GE(num_drops_, last_num_drops)
|
||||||
|
<< " The number of dropped frames for drop_thresh " << i
|
||||||
|
<< " < number of dropped frames for drop_thresh "
|
||||||
|
<< i - kDropFrameThreshTestStep;
|
||||||
|
last_drop = first_drop_;
|
||||||
|
last_num_drops = num_drops_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VP8_INSTANTIATE_TEST_CASE(DatarateTest, ALL_TEST_MODES);
|
||||||
|
VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9,
|
||||||
|
::testing::Values(::libvpx_test::kOnePassGood),
|
||||||
|
::testing::Range(1, 5));
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -13,15 +13,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx_ports/mem.h"
|
#include "test/acm_random.h"
|
||||||
|
#include "test/clear_system_state.h"
|
||||||
|
#include "test/register_state_check.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "vp9_rtcd.h"
|
#include "./vp9_rtcd.h"
|
||||||
void vp9_short_idct16x16_add_c(short *input, uint8_t *output, int pitch);
|
void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *output, int pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "acm_random.h"
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
@@ -31,12 +32,13 @@ namespace {
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
static int round(double x) {
|
static int round(double x) {
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
return (int)ceil(x - 0.5);
|
return static_cast<int>(ceil(x - 0.5));
|
||||||
else
|
else
|
||||||
return (int)floor(x + 0.5);
|
return static_cast<int>(floor(x + 0.5));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const int kNumCoeffs = 256;
|
||||||
const double PI = 3.1415926535898;
|
const double PI = 3.1415926535898;
|
||||||
void reference2_16x16_idct_2d(double *input, double *output) {
|
void reference2_16x16_idct_2d(double *input, double *output) {
|
||||||
double x;
|
double x;
|
||||||
@@ -45,7 +47,9 @@ void reference2_16x16_idct_2d(double *input, double *output) {
|
|||||||
double s = 0;
|
double s = 0;
|
||||||
for (int i = 0; i < 16; ++i) {
|
for (int i = 0; i < 16; ++i) {
|
||||||
for (int j = 0; j < 16; ++j) {
|
for (int j = 0; j < 16; ++j) {
|
||||||
x=cos(PI*j*(l+0.5)/16.0)*cos(PI*i*(k+0.5)/16.0)*input[i*16+j]/256;
|
x = cos(PI * j * (l + 0.5) / 16.0) *
|
||||||
|
cos(PI * i * (k + 0.5) / 16.0) *
|
||||||
|
input[i * 16 + j] / 256;
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
x *= sqrt(2.0);
|
x *= sqrt(2.0);
|
||||||
if (j != 0)
|
if (j != 0)
|
||||||
@@ -59,23 +63,23 @@ void reference2_16x16_idct_2d(double *input, double *output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const double C1 = 0.995184726672197;
|
const double C1 = 0.995184726672197;
|
||||||
static const double C2 = 0.98078528040323;
|
const double C2 = 0.98078528040323;
|
||||||
static const double C3 = 0.956940335732209;
|
const double C3 = 0.956940335732209;
|
||||||
static const double C4 = 0.923879532511287;
|
const double C4 = 0.923879532511287;
|
||||||
static const double C5 = 0.881921264348355;
|
const double C5 = 0.881921264348355;
|
||||||
static const double C6 = 0.831469612302545;
|
const double C6 = 0.831469612302545;
|
||||||
static const double C7 = 0.773010453362737;
|
const double C7 = 0.773010453362737;
|
||||||
static const double C8 = 0.707106781186548;
|
const double C8 = 0.707106781186548;
|
||||||
static const double C9 = 0.634393284163646;
|
const double C9 = 0.634393284163646;
|
||||||
static const double C10 = 0.555570233019602;
|
const double C10 = 0.555570233019602;
|
||||||
static const double C11 = 0.471396736825998;
|
const double C11 = 0.471396736825998;
|
||||||
static const double C12 = 0.38268343236509;
|
const double C12 = 0.38268343236509;
|
||||||
static const double C13 = 0.290284677254462;
|
const double C13 = 0.290284677254462;
|
||||||
static const double C14 = 0.195090322016128;
|
const double C14 = 0.195090322016128;
|
||||||
static const double C15 = 0.098017140329561;
|
const double C15 = 0.098017140329561;
|
||||||
|
|
||||||
static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
||||||
double step[16];
|
double step[16];
|
||||||
double intermediate[16];
|
double intermediate[16];
|
||||||
double temp1, temp2;
|
double temp1, temp2;
|
||||||
@@ -108,36 +112,36 @@ static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
|||||||
output[6] = step[1] - step[6];
|
output[6] = step[1] - step[6];
|
||||||
output[7] = step[0] - step[7];
|
output[7] = step[0] - step[7];
|
||||||
|
|
||||||
temp1 = step[ 8]*C7;
|
temp1 = step[ 8] * C7;
|
||||||
temp2 = step[15]*C9;
|
temp2 = step[15] * C9;
|
||||||
output[ 8] = temp1 + temp2;
|
output[ 8] = temp1 + temp2;
|
||||||
|
|
||||||
temp1 = step[ 9]*C11;
|
temp1 = step[ 9] * C11;
|
||||||
temp2 = step[14]*C5;
|
temp2 = step[14] * C5;
|
||||||
output[ 9] = temp1 - temp2;
|
output[ 9] = temp1 - temp2;
|
||||||
|
|
||||||
temp1 = step[10]*C3;
|
temp1 = step[10] * C3;
|
||||||
temp2 = step[13]*C13;
|
temp2 = step[13] * C13;
|
||||||
output[10] = temp1 + temp2;
|
output[10] = temp1 + temp2;
|
||||||
|
|
||||||
temp1 = step[11]*C15;
|
temp1 = step[11] * C15;
|
||||||
temp2 = step[12]*C1;
|
temp2 = step[12] * C1;
|
||||||
output[11] = temp1 - temp2;
|
output[11] = temp1 - temp2;
|
||||||
|
|
||||||
temp1 = step[11]*C1;
|
temp1 = step[11] * C1;
|
||||||
temp2 = step[12]*C15;
|
temp2 = step[12] * C15;
|
||||||
output[12] = temp2 + temp1;
|
output[12] = temp2 + temp1;
|
||||||
|
|
||||||
temp1 = step[10]*C13;
|
temp1 = step[10] * C13;
|
||||||
temp2 = step[13]*C3;
|
temp2 = step[13] * C3;
|
||||||
output[13] = temp2 - temp1;
|
output[13] = temp2 - temp1;
|
||||||
|
|
||||||
temp1 = step[ 9]*C5;
|
temp1 = step[ 9] * C5;
|
||||||
temp2 = step[14]*C11;
|
temp2 = step[14] * C11;
|
||||||
output[14] = temp2 + temp1;
|
output[14] = temp2 + temp1;
|
||||||
|
|
||||||
temp1 = step[ 8]*C9;
|
temp1 = step[ 8] * C9;
|
||||||
temp2 = step[15]*C7;
|
temp2 = step[15] * C7;
|
||||||
output[15] = temp2 - temp1;
|
output[15] = temp2 - temp1;
|
||||||
|
|
||||||
// step 3
|
// step 3
|
||||||
@@ -146,20 +150,20 @@ static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
|||||||
step[ 2] = output[1] - output[2];
|
step[ 2] = output[1] - output[2];
|
||||||
step[ 3] = output[0] - output[3];
|
step[ 3] = output[0] - output[3];
|
||||||
|
|
||||||
temp1 = output[4]*C14;
|
temp1 = output[4] * C14;
|
||||||
temp2 = output[7]*C2;
|
temp2 = output[7] * C2;
|
||||||
step[ 4] = temp1 + temp2;
|
step[ 4] = temp1 + temp2;
|
||||||
|
|
||||||
temp1 = output[5]*C10;
|
temp1 = output[5] * C10;
|
||||||
temp2 = output[6]*C6;
|
temp2 = output[6] * C6;
|
||||||
step[ 5] = temp1 + temp2;
|
step[ 5] = temp1 + temp2;
|
||||||
|
|
||||||
temp1 = output[5]*C6;
|
temp1 = output[5] * C6;
|
||||||
temp2 = output[6]*C10;
|
temp2 = output[6] * C10;
|
||||||
step[ 6] = temp2 - temp1;
|
step[ 6] = temp2 - temp1;
|
||||||
|
|
||||||
temp1 = output[4]*C2;
|
temp1 = output[4] * C2;
|
||||||
temp2 = output[7]*C14;
|
temp2 = output[7] * C14;
|
||||||
step[ 7] = temp2 - temp1;
|
step[ 7] = temp2 - temp1;
|
||||||
|
|
||||||
step[ 8] = output[ 8] + output[11];
|
step[ 8] = output[ 8] + output[11];
|
||||||
@@ -176,18 +180,18 @@ static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
|||||||
output[ 0] = (step[ 0] + step[ 1]);
|
output[ 0] = (step[ 0] + step[ 1]);
|
||||||
output[ 8] = (step[ 0] - step[ 1]);
|
output[ 8] = (step[ 0] - step[ 1]);
|
||||||
|
|
||||||
temp1 = step[2]*C12;
|
temp1 = step[2] * C12;
|
||||||
temp2 = step[3]*C4;
|
temp2 = step[3] * C4;
|
||||||
temp1 = temp1 + temp2;
|
temp1 = temp1 + temp2;
|
||||||
output[ 4] = 2*(temp1*C8);
|
output[ 4] = 2*(temp1 * C8);
|
||||||
|
|
||||||
temp1 = step[2]*C4;
|
temp1 = step[2] * C4;
|
||||||
temp2 = step[3]*C12;
|
temp2 = step[3] * C12;
|
||||||
temp1 = temp2 - temp1;
|
temp1 = temp2 - temp1;
|
||||||
output[12] = 2*(temp1*C8);
|
output[12] = 2 * (temp1 * C8);
|
||||||
|
|
||||||
output[ 2] = 2*((step[4] + step[ 5])*C8);
|
output[ 2] = 2 * ((step[4] + step[ 5]) * C8);
|
||||||
output[14] = 2*((step[7] - step[ 6])*C8);
|
output[14] = 2 * ((step[7] - step[ 6]) * C8);
|
||||||
|
|
||||||
temp1 = step[4] - step[5];
|
temp1 = step[4] - step[5];
|
||||||
temp2 = step[6] + step[7];
|
temp2 = step[6] + step[7];
|
||||||
@@ -197,17 +201,17 @@ static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
|||||||
intermediate[8] = step[8] + step[14];
|
intermediate[8] = step[8] + step[14];
|
||||||
intermediate[9] = step[9] + step[15];
|
intermediate[9] = step[9] + step[15];
|
||||||
|
|
||||||
temp1 = intermediate[8]*C12;
|
temp1 = intermediate[8] * C12;
|
||||||
temp2 = intermediate[9]*C4;
|
temp2 = intermediate[9] * C4;
|
||||||
temp1 = temp1 - temp2;
|
temp1 = temp1 - temp2;
|
||||||
output[3] = 2*(temp1*C8);
|
output[3] = 2 * (temp1 * C8);
|
||||||
|
|
||||||
temp1 = intermediate[8]*C4;
|
temp1 = intermediate[8] * C4;
|
||||||
temp2 = intermediate[9]*C12;
|
temp2 = intermediate[9] * C12;
|
||||||
temp1 = temp2 + temp1;
|
temp1 = temp2 + temp1;
|
||||||
output[13] = 2*(temp1*C8);
|
output[13] = 2 * (temp1 * C8);
|
||||||
|
|
||||||
output[ 9] = 2*((step[10] + step[11])*C8);
|
output[ 9] = 2 * ((step[10] + step[11]) * C8);
|
||||||
|
|
||||||
intermediate[11] = step[10] - step[11];
|
intermediate[11] = step[10] - step[11];
|
||||||
intermediate[12] = step[12] + step[13];
|
intermediate[12] = step[12] + step[13];
|
||||||
@@ -218,207 +222,307 @@ static void butterfly_16x16_dct_1d(double input[16], double output[16]) {
|
|||||||
output[15] = (intermediate[11] + intermediate[12]);
|
output[15] = (intermediate[11] + intermediate[12]);
|
||||||
output[ 1] = -(intermediate[11] - intermediate[12]);
|
output[ 1] = -(intermediate[11] - intermediate[12]);
|
||||||
|
|
||||||
output[ 7] = 2*(intermediate[13]*C8);
|
output[ 7] = 2 * (intermediate[13] * C8);
|
||||||
|
|
||||||
temp1 = intermediate[14]*C12;
|
temp1 = intermediate[14] * C12;
|
||||||
temp2 = intermediate[15]*C4;
|
temp2 = intermediate[15] * C4;
|
||||||
temp1 = temp1 - temp2;
|
temp1 = temp1 - temp2;
|
||||||
output[11] = -2*(temp1*C8);
|
output[11] = -2 * (temp1 * C8);
|
||||||
|
|
||||||
temp1 = intermediate[14]*C4;
|
temp1 = intermediate[14] * C4;
|
||||||
temp2 = intermediate[15]*C12;
|
temp2 = intermediate[15] * C12;
|
||||||
temp1 = temp2 + temp1;
|
temp1 = temp2 + temp1;
|
||||||
output[ 5] = 2*(temp1*C8);
|
output[ 5] = 2 * (temp1 * C8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reference_16x16_dct_1d(double in[16], double out[16]) {
|
void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
|
||||||
const double kPi = 3.141592653589793238462643383279502884;
|
|
||||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
|
||||||
for (int k = 0; k < 16; k++) {
|
|
||||||
out[k] = 0.0;
|
|
||||||
for (int n = 0; n < 16; n++)
|
|
||||||
out[k] += in[n]*cos(kPi*(2*n+1)*k/32.0);
|
|
||||||
if (k == 0)
|
|
||||||
out[k] = out[k]*kInvSqrt2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void reference_16x16_dct_2d(int16_t input[16*16], double output[16*16]) {
|
|
||||||
// First transform columns
|
// First transform columns
|
||||||
for (int i = 0; i < 16; ++i) {
|
for (int i = 0; i < 16; ++i) {
|
||||||
double temp_in[16], temp_out[16];
|
double temp_in[16], temp_out[16];
|
||||||
for (int j = 0; j < 16; ++j)
|
for (int j = 0; j < 16; ++j)
|
||||||
temp_in[j] = input[j*16 + i];
|
temp_in[j] = input[j * 16 + i];
|
||||||
butterfly_16x16_dct_1d(temp_in, temp_out);
|
butterfly_16x16_dct_1d(temp_in, temp_out);
|
||||||
for (int j = 0; j < 16; ++j)
|
for (int j = 0; j < 16; ++j)
|
||||||
output[j*16 + i] = temp_out[j];
|
output[j * 16 + i] = temp_out[j];
|
||||||
}
|
}
|
||||||
// Then transform rows
|
// Then transform rows
|
||||||
for (int i = 0; i < 16; ++i) {
|
for (int i = 0; i < 16; ++i) {
|
||||||
double temp_in[16], temp_out[16];
|
double temp_in[16], temp_out[16];
|
||||||
for (int j = 0; j < 16; ++j)
|
for (int j = 0; j < 16; ++j)
|
||||||
temp_in[j] = output[j + i*16];
|
temp_in[j] = output[j + i * 16];
|
||||||
butterfly_16x16_dct_1d(temp_in, temp_out);
|
butterfly_16x16_dct_1d(temp_in, temp_out);
|
||||||
// Scale by some magic number
|
// Scale by some magic number
|
||||||
for (int j = 0; j < 16; ++j)
|
for (int j = 0; j < 16; ++j)
|
||||||
output[j + i*16] = temp_out[j]/2;
|
output[j + i * 16] = temp_out[j]/2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void fdct16x16(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride);
|
||||||
int stride, int /*tx_type*/) {
|
typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride);
|
||||||
vp9_short_fdct16x16_c(in, out, stride);
|
typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
|
||||||
}
|
int tx_type);
|
||||||
void idct16x16_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
|
||||||
int stride, int /*tx_type*/) {
|
int tx_type);
|
||||||
vp9_short_idct16x16_add_c(out, dst, stride >> 1);
|
|
||||||
}
|
typedef std::tr1::tuple<fdct_t, idct_t, int> dct_16x16_param_t;
|
||||||
void fht16x16(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
typedef std::tr1::tuple<fht_t, iht_t, int> ht_16x16_param_t;
|
||||||
int stride, int tx_type) {
|
|
||||||
// FIXME(jingning): need to test both SSE2 and c
|
void fdct16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
#if HAVE_SSE2
|
vp9_fdct16x16_c(in, out, stride);
|
||||||
vp9_short_fht16x16_sse2(in, out, stride >> 1, tx_type);
|
|
||||||
#else
|
|
||||||
vp9_short_fht16x16_c(in, out, stride >> 1, tx_type);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void iht16x16_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type) {
|
|
||||||
vp9_short_iht16x16_add_c(out, dst, stride >> 1, tx_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FwdTrans16x16Test : public ::testing::TestWithParam<int> {
|
void fht16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
|
vp9_short_fht16x16_c(in, out, stride, tx_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Trans16x16TestBase {
|
||||||
public:
|
public:
|
||||||
virtual ~FwdTrans16x16Test() {}
|
virtual ~Trans16x16TestBase() {}
|
||||||
|
|
||||||
virtual void SetUp() {
|
|
||||||
tx_type_ = GetParam();
|
|
||||||
if (tx_type_ == 0) {
|
|
||||||
fwd_txfm = fdct16x16;
|
|
||||||
inv_txfm = idct16x16_add;
|
|
||||||
} else {
|
|
||||||
fwd_txfm = fht16x16;
|
|
||||||
inv_txfm = iht16x16_add;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void RunFwdTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
virtual void RunFwdTxfm(int16_t *in, int16_t *out, int stride) = 0;
|
||||||
int stride, int tx_type) {
|
|
||||||
(*fwd_txfm)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
void RunInvTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type) {
|
|
||||||
(*inv_txfm)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
int tx_type_;
|
virtual void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) = 0;
|
||||||
void (*fwd_txfm)(int16_t*, int16_t*, uint8_t*, int, int);
|
|
||||||
void (*inv_txfm)(int16_t*, int16_t*, uint8_t*, int, int);
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(FwdTrans16x16Test, AccuracyCheck) {
|
void RunAccuracyCheck() {
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
int max_error = 0;
|
uint32_t max_error = 0;
|
||||||
double total_error = 0;
|
int64_t total_error = 0;
|
||||||
const int count_test_block = 10000;
|
const int count_test_block = 10000;
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 256);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 256);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 256);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 256);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
for (int j = 0; j < 256; ++j) {
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
src[j] = rnd.Rand8();
|
src[j] = rnd.Rand8();
|
||||||
dst[j] = rnd.Rand8();
|
dst[j] = rnd.Rand8();
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
test_input_block[j] = src[j] - dst[j];
|
test_input_block[j] = src[j] - dst[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
const int pitch = 32;
|
REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
|
||||||
RunFwdTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
test_temp_block, pitch_));
|
||||||
RunInvTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 256; ++j) {
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const uint32_t diff = dst[j] - src[j];
|
||||||
const int error = diff * diff;
|
const uint32_t error = diff * diff;
|
||||||
if (max_error < error)
|
if (max_error < error)
|
||||||
max_error = error;
|
max_error = error;
|
||||||
total_error += error;
|
total_error += error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_GE(1, max_error)
|
EXPECT_GE(1u, max_error)
|
||||||
<< "Error: 16x16 FHT/IHT has an individual round trip error > 1";
|
<< "Error: 16x16 FHT/IHT has an individual round trip error > 1";
|
||||||
|
|
||||||
EXPECT_GE(count_test_block , total_error)
|
EXPECT_GE(count_test_block , total_error)
|
||||||
<< "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
|
<< "Error: 16x16 FHT/IHT has average round trip error > 1 per block";
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(FwdTrans16x16Test, CoeffSizeCheck) {
|
void RunCoeffCheck() {
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
const int count_test_block = 1000;
|
const int count_test_block = 1000;
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, 256);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, 256);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, 256);
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, output_extreme_block, 256);
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 256);
|
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
// Initialize a test block with input range [-255, 255].
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 256; ++j) {
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
|
||||||
|
fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
|
||||||
|
REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
|
||||||
|
|
||||||
|
// The minimum quant value is 4.
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunMemCheck() {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
|
input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
for (int j = 0; j < 256; ++j)
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
input_extreme_block[j] = 255;
|
input_extreme_block[j] = 255;
|
||||||
|
if (i == 1)
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_extreme_block[j] = -255;
|
||||||
|
|
||||||
const int pitch = 32;
|
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
|
||||||
RunFwdTxfm(input_block, output_block, dst, pitch, tx_type_);
|
REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
|
||||||
RunFwdTxfm(input_extreme_block, output_extreme_block, dst, pitch, tx_type_);
|
output_block, pitch_));
|
||||||
|
|
||||||
// The minimum quant value is 4.
|
// The minimum quant value is 4.
|
||||||
for (int j = 0; j < 256; ++j) {
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
||||||
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_block[j]))
|
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_block[j]))
|
||||||
<< "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
|
<< "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
|
||||||
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_extreme_block[j]))
|
|
||||||
<< "Error: 16x16 FDCT extreme has coefficient larger "
|
|
||||||
<< "than 4*DCT_MAX_VALUE";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(VP9, FwdTrans16x16Test, ::testing::Range(0, 4));
|
void RunInvAccuracyCheck() {
|
||||||
|
|
||||||
TEST(VP9Idct16x16Test, AccuracyCheck) {
|
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
const int count_test_block = 1000;
|
const int count_test_block = 1000;
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
|
||||||
int16_t in[256], coeff[256];
|
DECLARE_ALIGNED_ARRAY(16, int16_t, coeff, kNumCoeffs);
|
||||||
uint8_t dst[256], src[256];
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
double out_r[256];
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
for (int j = 0; j < 256; ++j) {
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
double out_r[kNumCoeffs];
|
||||||
|
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
src[j] = rnd.Rand8();
|
src[j] = rnd.Rand8();
|
||||||
dst[j] = rnd.Rand8();
|
dst[j] = rnd.Rand8();
|
||||||
}
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
for (int j = 0; j < 256; ++j)
|
|
||||||
in[j] = src[j] - dst[j];
|
in[j] = src[j] - dst[j];
|
||||||
|
}
|
||||||
|
|
||||||
reference_16x16_dct_2d(in, out_r);
|
reference_16x16_dct_2d(in, out_r);
|
||||||
for (int j = 0; j < 256; j++)
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
coeff[j] = round(out_r[j]);
|
coeff[j] = round(out_r[j]);
|
||||||
vp9_short_idct16x16_add_c(coeff, dst, 16);
|
|
||||||
for (int j = 0; j < 256; ++j) {
|
REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
|
||||||
const int diff = dst[j] - src[j];
|
|
||||||
const int error = diff * diff;
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
EXPECT_GE(1, error)
|
const uint32_t diff = dst[j] - src[j];
|
||||||
|
const uint32_t error = diff * diff;
|
||||||
|
EXPECT_GE(1u, error)
|
||||||
<< "Error: 16x16 IDCT has error " << error
|
<< "Error: 16x16 IDCT has error " << error
|
||||||
<< " at index " << j;
|
<< " at index " << j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
int pitch_;
|
||||||
|
int tx_type_;
|
||||||
|
fht_t fwd_txfm_ref;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Trans16x16DCT
|
||||||
|
: public Trans16x16TestBase,
|
||||||
|
public ::testing::TestWithParam<dct_16x16_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~Trans16x16DCT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 16;
|
||||||
|
fwd_txfm_ref = fdct16x16_ref;
|
||||||
|
}
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride);
|
||||||
|
}
|
||||||
|
void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride);
|
||||||
|
}
|
||||||
|
|
||||||
|
fdct_t fwd_txfm_;
|
||||||
|
idct_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(Trans16x16DCT, AccuracyCheck) {
|
||||||
|
RunAccuracyCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans16x16DCT, CoeffCheck) {
|
||||||
|
RunCoeffCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans16x16DCT, MemCheck) {
|
||||||
|
RunMemCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans16x16DCT, InvAccuracyCheck) {
|
||||||
|
RunInvAccuracyCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Trans16x16HT
|
||||||
|
: public Trans16x16TestBase,
|
||||||
|
public ::testing::TestWithParam<ht_16x16_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~Trans16x16HT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 16;
|
||||||
|
fwd_txfm_ref = fht16x16_ref;
|
||||||
|
}
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride, tx_type_);
|
||||||
|
}
|
||||||
|
void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride, tx_type_);
|
||||||
|
}
|
||||||
|
|
||||||
|
fht_t fwd_txfm_;
|
||||||
|
iht_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(Trans16x16HT, AccuracyCheck) {
|
||||||
|
RunAccuracyCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans16x16HT, CoeffCheck) {
|
||||||
|
RunCoeffCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans16x16HT, MemCheck) {
|
||||||
|
RunMemCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, Trans16x16DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, Trans16x16HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 0),
|
||||||
|
make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 1),
|
||||||
|
make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 2),
|
||||||
|
make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 3)));
|
||||||
|
|
||||||
|
#if HAVE_SSE2
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, Trans16x16DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct16x16_sse2,
|
||||||
|
&vp9_idct16x16_256_add_sse2, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, Trans16x16HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0),
|
||||||
|
make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1),
|
||||||
|
make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2),
|
||||||
|
make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3)));
|
||||||
|
#endif
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -13,15 +13,17 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "test/acm_random.h"
|
||||||
|
#include "test/clear_system_state.h"
|
||||||
|
#include "test/register_state_check.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#include "./vpx_config.h"
|
||||||
#include "vp9/common/vp9_entropy.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
#include "./vp9_rtcd.h"
|
#include "./vp9_rtcd.h"
|
||||||
void vp9_short_fdct32x32_c(int16_t *input, int16_t *out, int pitch);
|
|
||||||
void vp9_short_idct32x32_add_c(short *input, uint8_t *output, int pitch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "test/acm_random.h"
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
@@ -30,35 +32,15 @@ namespace {
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
static int round(double x) {
|
static int round(double x) {
|
||||||
if (x < 0)
|
if (x < 0)
|
||||||
return (int)ceil(x - 0.5);
|
return static_cast<int>(ceil(x - 0.5));
|
||||||
else
|
else
|
||||||
return (int)floor(x + 0.5);
|
return static_cast<int>(floor(x + 0.5));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const double kPi = 3.141592653589793238462643383279502884;
|
const int kNumCoeffs = 1024;
|
||||||
static void reference2_32x32_idct_2d(double *input, double *output) {
|
const double kPi = 3.141592653589793238462643383279502884;
|
||||||
double x;
|
void reference_32x32_dct_1d(const double in[32], double out[32], int stride) {
|
||||||
for (int l = 0; l < 32; ++l) {
|
|
||||||
for (int k = 0; k < 32; ++k) {
|
|
||||||
double s = 0;
|
|
||||||
for (int i = 0; i < 32; ++i) {
|
|
||||||
for (int j = 0; j < 32; ++j) {
|
|
||||||
x = cos(kPi * j * (l + 0.5) / 32.0) *
|
|
||||||
cos(kPi * i * (k + 0.5) / 32.0) * input[i * 32 + j] / 1024;
|
|
||||||
if (i != 0)
|
|
||||||
x *= sqrt(2.0);
|
|
||||||
if (j != 0)
|
|
||||||
x *= sqrt(2.0);
|
|
||||||
s += x;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
output[k * 32 + l] = s / 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void reference_32x32_dct_1d(double in[32], double out[32], int stride) {
|
|
||||||
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
const double kInvSqrt2 = 0.707106781186547524400844362104;
|
||||||
for (int k = 0; k < 32; k++) {
|
for (int k = 0; k < 32; k++) {
|
||||||
out[k] = 0.0;
|
out[k] = 0.0;
|
||||||
@@ -69,7 +51,8 @@ static void reference_32x32_dct_1d(double in[32], double out[32], int stride) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reference_32x32_dct_2d(int16_t input[32*32], double output[32*32]) {
|
void reference_32x32_dct_2d(const int16_t input[kNumCoeffs],
|
||||||
|
double output[kNumCoeffs]) {
|
||||||
// First transform columns
|
// First transform columns
|
||||||
for (int i = 0; i < 32; ++i) {
|
for (int i = 0; i < 32; ++i) {
|
||||||
double temp_in[32], temp_out[32];
|
double temp_in[32], temp_out[32];
|
||||||
@@ -91,27 +74,166 @@ static void reference_32x32_dct_2d(int16_t input[32*32], double output[32*32]) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9Idct32x32Test, AccuracyCheck) {
|
typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride);
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride);
|
||||||
const int count_test_block = 1000;
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
int16_t in[1024], coeff[1024];
|
|
||||||
uint8_t dst[1024], src[1024];
|
|
||||||
double out_r[1024];
|
|
||||||
|
|
||||||
for (int j = 0; j < 1024; ++j) {
|
typedef std::tr1::tuple<fwd_txfm_t, inv_txfm_t, int> trans_32x32_param_t;
|
||||||
|
|
||||||
|
class Trans32x32Test : public ::testing::TestWithParam<trans_32x32_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~Trans32x32Test() {}
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
version_ = GET_PARAM(2); // 0: high precision forward transform
|
||||||
|
// 1: low precision version for rd loop
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int version_;
|
||||||
|
fwd_txfm_t fwd_txfm_;
|
||||||
|
inv_txfm_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(Trans32x32Test, AccuracyCheck) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
uint32_t max_error = 0;
|
||||||
|
int64_t total_error = 0;
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
src[j] = rnd.Rand8();
|
src[j] = rnd.Rand8();
|
||||||
dst[j] = rnd.Rand8();
|
dst[j] = rnd.Rand8();
|
||||||
|
test_input_block[j] = src[j] - dst[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
REGISTER_STATE_CHECK(fwd_txfm_(test_input_block, test_temp_block, 32));
|
||||||
|
REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32));
|
||||||
|
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
const uint32_t diff = dst[j] - src[j];
|
||||||
|
const uint32_t error = diff * diff;
|
||||||
|
if (max_error < error)
|
||||||
|
max_error = error;
|
||||||
|
total_error += error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version_ == 1) {
|
||||||
|
max_error /= 2;
|
||||||
|
total_error /= 45;
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPECT_GE(1u, max_error)
|
||||||
|
<< "Error: 32x32 FDCT/IDCT has an individual round-trip error > 1";
|
||||||
|
|
||||||
|
EXPECT_GE(count_test_block, total_error)
|
||||||
|
<< "Error: 32x32 FDCT/IDCT has average round-trip error > 1 per block";
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans32x32Test, CoeffCheck) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
|
||||||
|
const int stride = 32;
|
||||||
|
vp9_fdct32x32_c(input_block, output_ref_block, stride);
|
||||||
|
REGISTER_STATE_CHECK(fwd_txfm_(input_block, output_block, stride));
|
||||||
|
|
||||||
|
if (version_ == 0) {
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j])
|
||||||
|
<< "Error: 32x32 FDCT versions have mismatched coefficients";
|
||||||
|
} else {
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
EXPECT_GE(6, abs(output_block[j] - output_ref_block[j]))
|
||||||
|
<< "Error: 32x32 FDCT rd has mismatched coefficients";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans32x32Test, MemCheck) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 2000;
|
||||||
|
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
// Initialize a test block with input range [-255, 255].
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 1024; ++j)
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
input_extreme_block[j] = rnd.Rand8() & 1 ? 255 : -255;
|
||||||
|
}
|
||||||
|
if (i == 0)
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_extreme_block[j] = 255;
|
||||||
|
if (i == 1)
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_extreme_block[j] = -255;
|
||||||
|
|
||||||
|
const int stride = 32;
|
||||||
|
vp9_fdct32x32_c(input_extreme_block, output_ref_block, stride);
|
||||||
|
REGISTER_STATE_CHECK(fwd_txfm_(input_extreme_block, output_block, stride));
|
||||||
|
|
||||||
|
// The minimum quant value is 4.
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
if (version_ == 0) {
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j])
|
||||||
|
<< "Error: 32x32 FDCT versions have mismatched coefficients";
|
||||||
|
} else {
|
||||||
|
EXPECT_GE(6, abs(output_block[j] - output_ref_block[j]))
|
||||||
|
<< "Error: 32x32 FDCT rd has mismatched coefficients";
|
||||||
|
}
|
||||||
|
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_ref_block[j]))
|
||||||
|
<< "Error: 32x32 FDCT C has coefficient larger than 4*DCT_MAX_VALUE";
|
||||||
|
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_block[j]))
|
||||||
|
<< "Error: 32x32 FDCT has coefficient larger than "
|
||||||
|
<< "4*DCT_MAX_VALUE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans32x32Test, InverseAccuracy) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, coeff, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
double out_r[kNumCoeffs];
|
||||||
|
|
||||||
|
// Initialize a test block with input range [-255, 255]
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
src[j] = rnd.Rand8();
|
||||||
|
dst[j] = rnd.Rand8();
|
||||||
in[j] = src[j] - dst[j];
|
in[j] = src[j] - dst[j];
|
||||||
|
}
|
||||||
|
|
||||||
reference_32x32_dct_2d(in, out_r);
|
reference_32x32_dct_2d(in, out_r);
|
||||||
for (int j = 0; j < 1024; j++)
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
coeff[j] = round(out_r[j]);
|
coeff[j] = round(out_r[j]);
|
||||||
vp9_short_idct32x32_add_c(coeff, dst, 32);
|
REGISTER_STATE_CHECK(inv_txfm_(coeff, dst, 32));
|
||||||
for (int j = 0; j < 1024; ++j) {
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const int diff = dst[j] - src[j];
|
||||||
const int error = diff * diff;
|
const int error = diff * diff;
|
||||||
EXPECT_GE(1, error)
|
EXPECT_GE(1, error)
|
||||||
@@ -121,72 +243,31 @@ TEST(VP9Idct32x32Test, AccuracyCheck) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9Fdct32x32Test, AccuracyCheck) {
|
using std::tr1::make_tuple;
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
||||||
unsigned int max_error = 0;
|
|
||||||
int64_t total_error = 0;
|
|
||||||
const int count_test_block = 1000;
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
int16_t test_input_block[1024];
|
|
||||||
int16_t test_temp_block[1024];
|
|
||||||
uint8_t dst[1024], src[1024];
|
|
||||||
|
|
||||||
for (int j = 0; j < 1024; ++j) {
|
INSTANTIATE_TEST_CASE_P(
|
||||||
src[j] = rnd.Rand8();
|
C, Trans32x32Test,
|
||||||
dst[j] = rnd.Rand8();
|
::testing::Values(
|
||||||
}
|
make_tuple(&vp9_fdct32x32_c, &vp9_idct32x32_1024_add_c, 0),
|
||||||
// Initialize a test block with input range [-255, 255].
|
make_tuple(&vp9_fdct32x32_rd_c, &vp9_idct32x32_1024_add_c, 1)));
|
||||||
for (int j = 0; j < 1024; ++j)
|
|
||||||
test_input_block[j] = src[j] - dst[j];
|
|
||||||
|
|
||||||
const int pitch = 64;
|
#if HAVE_SSE2
|
||||||
vp9_short_fdct32x32_c(test_input_block, test_temp_block, pitch);
|
INSTANTIATE_TEST_CASE_P(
|
||||||
vp9_short_idct32x32_add_c(test_temp_block, dst, 32);
|
SSE2, Trans32x32Test,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct32x32_sse2,
|
||||||
|
&vp9_idct32x32_1024_add_sse2, 0),
|
||||||
|
make_tuple(&vp9_fdct32x32_rd_sse2,
|
||||||
|
&vp9_idct32x32_1024_add_sse2, 1)));
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int j = 0; j < 1024; ++j) {
|
#if HAVE_AVX2
|
||||||
const unsigned diff = dst[j] - src[j];
|
INSTANTIATE_TEST_CASE_P(
|
||||||
const unsigned error = diff * diff;
|
AVX2, Trans32x32Test,
|
||||||
if (max_error < error)
|
::testing::Values(
|
||||||
max_error = error;
|
make_tuple(&vp9_fdct32x32_avx2,
|
||||||
total_error += error;
|
&vp9_idct32x32_1024_add_sse2, 0),
|
||||||
}
|
make_tuple(&vp9_fdct32x32_rd_avx2,
|
||||||
}
|
&vp9_idct32x32_1024_add_sse2, 1)));
|
||||||
|
#endif
|
||||||
EXPECT_GE(1u, max_error)
|
|
||||||
<< "Error: 32x32 FDCT/IDCT has an individual roundtrip error > 1";
|
|
||||||
|
|
||||||
EXPECT_GE(count_test_block, total_error)
|
|
||||||
<< "Error: 32x32 FDCT/IDCT has average roundtrip error > 1 per block";
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(VP9Fdct32x32Test, CoeffSizeCheck) {
|
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
||||||
const int count_test_block = 1000;
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
int16_t input_block[1024], input_extreme_block[1024];
|
|
||||||
int16_t output_block[1024], output_extreme_block[1024];
|
|
||||||
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
for (int j = 0; j < 1024; ++j) {
|
|
||||||
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
|
||||||
input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
|
|
||||||
}
|
|
||||||
if (i == 0)
|
|
||||||
for (int j = 0; j < 1024; ++j)
|
|
||||||
input_extreme_block[j] = 255;
|
|
||||||
|
|
||||||
const int pitch = 64;
|
|
||||||
vp9_short_fdct32x32_c(input_block, output_block, pitch);
|
|
||||||
vp9_short_fdct32x32_c(input_extreme_block, output_extreme_block, pitch);
|
|
||||||
|
|
||||||
// The minimum quant value is 4.
|
|
||||||
for (int j = 0; j < 1024; ++j) {
|
|
||||||
EXPECT_GE(4*DCT_MAX_VALUE, abs(output_block[j]))
|
|
||||||
<< "Error: 32x32 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
|
|
||||||
EXPECT_GE(4*DCT_MAX_VALUE, abs(output_extreme_block[j]))
|
|
||||||
<< "Error: 32x32 FDCT extreme has coefficient larger than "
|
|
||||||
"4*DCT_MAX_VALUE";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
105
test/decode_perf_test.cc
Normal file
105
test/decode_perf_test.cc
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "test/codec_factory.h"
|
||||||
|
#include "test/decode_test_driver.h"
|
||||||
|
#include "test/ivf_video_source.h"
|
||||||
|
#include "test/md5_helper.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
#include "test/webm_video_source.h"
|
||||||
|
#include "vpx_ports/vpx_timer.h"
|
||||||
|
#include "./vpx_version.h"
|
||||||
|
|
||||||
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
#define VIDEO_NAME 0
|
||||||
|
#define THREADS 1
|
||||||
|
|
||||||
|
const double kUsecsInSec = 1000000.0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
DecodePerfTest takes a tuple of filename + number of threads to decode with
|
||||||
|
*/
|
||||||
|
typedef std::tr1::tuple<const char *const, unsigned> decode_perf_param_t;
|
||||||
|
|
||||||
|
const decode_perf_param_t kVP9DecodePerfVectors[] = {
|
||||||
|
make_tuple("vp90-2-bbb_426x240_tile_1x1_180kbps.webm", 1),
|
||||||
|
make_tuple("vp90-2-bbb_640x360_tile_1x2_337kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-bbb_854x480_tile_1x2_651kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm", 1),
|
||||||
|
make_tuple("vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-sintel_426x182_tile_1x1_171kbps.webm", 1),
|
||||||
|
make_tuple("vp90-2-sintel_640x272_tile_1x2_318kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-sintel_854x364_tile_1x2_621kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-tos_426x178_tile_1x1_181kbps.webm", 1),
|
||||||
|
make_tuple("vp90-2-tos_640x266_tile_1x2_336kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-tos_854x356_tile_1x2_656kbps.webm", 2),
|
||||||
|
make_tuple("vp90-2-tos_1280x534_tile_1x4_1306kbps.webm", 4),
|
||||||
|
make_tuple("vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm", 4),
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
In order to reflect real world performance as much as possible, Perf tests
|
||||||
|
*DO NOT* do any correctness checks. Please run them alongside correctness
|
||||||
|
tests to ensure proper codec integrity. Furthermore, in this test we
|
||||||
|
deliberately limit the amount of system calls we make to avoid OS
|
||||||
|
preemption.
|
||||||
|
|
||||||
|
TODO(joshualitt) create a more detailed perf measurement test to collect
|
||||||
|
power/temp/min max frame decode times/etc
|
||||||
|
*/
|
||||||
|
|
||||||
|
class DecodePerfTest : public ::testing::TestWithParam<decode_perf_param_t> {
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(DecodePerfTest, PerfTest) {
|
||||||
|
const char *const video_name = GET_PARAM(VIDEO_NAME);
|
||||||
|
const unsigned threads = GET_PARAM(THREADS);
|
||||||
|
|
||||||
|
libvpx_test::WebMVideoSource video(video_name);
|
||||||
|
video.Init();
|
||||||
|
|
||||||
|
vpx_codec_dec_cfg_t cfg = {0};
|
||||||
|
cfg.threads = threads;
|
||||||
|
libvpx_test::VP9Decoder decoder(cfg, 0);
|
||||||
|
|
||||||
|
vpx_usec_timer t;
|
||||||
|
vpx_usec_timer_start(&t);
|
||||||
|
|
||||||
|
for (video.Begin(); video.cxdata() != NULL; video.Next()) {
|
||||||
|
decoder.DecodeFrame(video.cxdata(), video.frame_size());
|
||||||
|
}
|
||||||
|
|
||||||
|
vpx_usec_timer_mark(&t);
|
||||||
|
const double elapsed_secs = double(vpx_usec_timer_elapsed(&t))
|
||||||
|
/ kUsecsInSec;
|
||||||
|
const unsigned frames = video.frame_number();
|
||||||
|
const double fps = double(frames) / elapsed_secs;
|
||||||
|
|
||||||
|
printf("{\n");
|
||||||
|
printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP);
|
||||||
|
printf("\t\"videoName\" : \"%s\",\n", video_name);
|
||||||
|
printf("\t\"threadCount\" : %u,\n", threads);
|
||||||
|
printf("\t\"decodeTimeSecs\" : %f,\n", elapsed_secs);
|
||||||
|
printf("\t\"totalFrames\" : %u,\n", frames);
|
||||||
|
printf("\t\"framesPerSecond\" : %f\n", fps);
|
||||||
|
printf("}\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest,
|
||||||
|
::testing::ValuesIn(kVP9DecodePerfVectors));
|
||||||
|
|
||||||
|
} // namespace
|
||||||
@@ -30,6 +30,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video) {
|
|||||||
|
|
||||||
// Decode frames.
|
// Decode frames.
|
||||||
for (video->Begin(); video->cxdata(); video->Next()) {
|
for (video->Begin(); video->cxdata(); video->Next()) {
|
||||||
|
PreDecodeFrameHook(*video, decoder);
|
||||||
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
|
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
|
||||||
video->frame_size());
|
video->frame_size());
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
|
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#define TEST_DECODE_TEST_DRIVER_H_
|
#define TEST_DECODE_TEST_DRIVER_H_
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "vpx/vpx_decoder.h"
|
#include "vpx/vpx_decoder.h"
|
||||||
|
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
@@ -36,9 +36,8 @@ class DxDataIterator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Provides a simplified interface to manage one video decoding.
|
// Provides a simplified interface to manage one video decoding.
|
||||||
//
|
// Similar to Encoder class, the exact services should be added
|
||||||
// TODO: similar to Encoder class, the exact services should be
|
// as more tests are added.
|
||||||
// added as more tests are added.
|
|
||||||
class Decoder {
|
class Decoder {
|
||||||
public:
|
public:
|
||||||
Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
|
Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
|
||||||
@@ -77,6 +76,16 @@ class Decoder {
|
|||||||
return detail ? detail : vpx_codec_error(&decoder_);
|
return detail ? detail : vpx_codec_error(&decoder_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Passes the external frame buffer information to libvpx.
|
||||||
|
vpx_codec_err_t SetExternalFrameBuffers(
|
||||||
|
vpx_codec_frame_buffer_t *fb_list, int fb_count,
|
||||||
|
vpx_realloc_frame_buffer_cb_fn_t cb, void *user_priv) {
|
||||||
|
InitOnce();
|
||||||
|
return vpx_codec_set_frame_buffers(&decoder_,
|
||||||
|
fb_list, fb_count,
|
||||||
|
cb, user_priv);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual const vpx_codec_iface_t* CodecInterface() const = 0;
|
virtual const vpx_codec_iface_t* CodecInterface() const = 0;
|
||||||
|
|
||||||
@@ -102,6 +111,10 @@ class DecoderTest {
|
|||||||
// Main decoding loop
|
// Main decoding loop
|
||||||
virtual void RunLoop(CompressedVideoSource *video);
|
virtual void RunLoop(CompressedVideoSource *video);
|
||||||
|
|
||||||
|
// Hook to be called before decompressing every frame.
|
||||||
|
virtual void PreDecodeFrameHook(const CompressedVideoSource& video,
|
||||||
|
Decoder *decoder) {}
|
||||||
|
|
||||||
// Hook to be called on every decompressed frame.
|
// Hook to be called on every decompressed frame.
|
||||||
virtual void DecompressedFrameHook(const vpx_image_t& img,
|
virtual void DecompressedFrameHook(const vpx_image_t& img,
|
||||||
const unsigned int frame_number) {}
|
const unsigned int frame_number) {}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
#include "test/encode_test_driver.h"
|
#include "test/encode_test_driver.h"
|
||||||
#include "test/decode_test_driver.h"
|
#include "test/decode_test_driver.h"
|
||||||
@@ -114,17 +114,17 @@ static bool compare_img(const vpx_image_t *img1,
|
|||||||
const unsigned int height_y = img1->d_h;
|
const unsigned int height_y = img1->d_h;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < height_y; ++i)
|
for (i = 0; i < height_y; ++i)
|
||||||
match = ( memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
|
match = (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
|
||||||
img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
|
img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
|
||||||
width_y) == 0) && match;
|
width_y) == 0) && match;
|
||||||
const unsigned int width_uv = (img1->d_w + 1) >> 1;
|
const unsigned int width_uv = (img1->d_w + 1) >> 1;
|
||||||
const unsigned int height_uv = (img1->d_h + 1) >> 1;
|
const unsigned int height_uv = (img1->d_h + 1) >> 1;
|
||||||
for (i = 0; i < height_uv; ++i)
|
for (i = 0; i < height_uv; ++i)
|
||||||
match = ( memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
|
match = (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
|
||||||
img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
|
img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
|
||||||
width_uv) == 0) && match;
|
width_uv) == 0) && match;
|
||||||
for (i = 0; i < height_uv; ++i)
|
for (i = 0; i < height_uv; ++i)
|
||||||
match = ( memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
|
match = (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
|
||||||
img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
|
img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
|
||||||
width_uv) == 0) && match;
|
width_uv) == 0) && match;
|
||||||
return match;
|
return match;
|
||||||
@@ -158,7 +158,7 @@ void EncoderTest::RunLoop(VideoSource *video) {
|
|||||||
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0);
|
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, 0);
|
||||||
bool again;
|
bool again;
|
||||||
for (again = true, video->Begin(); again; video->Next()) {
|
for (again = true, video->Begin(); again; video->Next()) {
|
||||||
again = video->img() != NULL;
|
again = (video->img() != NULL);
|
||||||
|
|
||||||
PreEncodeFrameHook(video);
|
PreEncodeFrameHook(video);
|
||||||
PreEncodeFrameHook(video, encoder);
|
PreEncodeFrameHook(video, encoder);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
@@ -62,7 +62,7 @@ class ErrorResilienceTest : public ::libvpx_test::EncoderTest,
|
|||||||
if (droppable_nframes_ > 0 &&
|
if (droppable_nframes_ > 0 &&
|
||||||
(cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
|
(cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
|
||||||
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
|
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
|
||||||
if (droppable_frames_[i] == nframes_) {
|
if (droppable_frames_[i] == video->frame()) {
|
||||||
std::cout << " Encoding droppable frame: "
|
std::cout << " Encoding droppable frame: "
|
||||||
<< droppable_frames_[i] << "\n";
|
<< droppable_frames_[i] << "\n";
|
||||||
frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST |
|
frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST |
|
||||||
@@ -148,7 +148,7 @@ TEST_P(ErrorResilienceTest, OnVersusOff) {
|
|||||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||||
cfg_.g_timebase = timebase;
|
cfg_.g_timebase = timebase;
|
||||||
cfg_.rc_target_bitrate = 2000;
|
cfg_.rc_target_bitrate = 2000;
|
||||||
cfg_.g_lag_in_frames = 25;
|
cfg_.g_lag_in_frames = 10;
|
||||||
|
|
||||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
|
|
||||||
@@ -179,6 +179,9 @@ TEST_P(ErrorResilienceTest, DropFramesWithoutRecovery) {
|
|||||||
const vpx_rational timebase = { 33333333, 1000000000 };
|
const vpx_rational timebase = { 33333333, 1000000000 };
|
||||||
cfg_.g_timebase = timebase;
|
cfg_.g_timebase = timebase;
|
||||||
cfg_.rc_target_bitrate = 500;
|
cfg_.rc_target_bitrate = 500;
|
||||||
|
// FIXME(debargha): Fix this to work for any lag.
|
||||||
|
// Currently this test only works for lag = 0
|
||||||
|
cfg_.g_lag_in_frames = 0;
|
||||||
|
|
||||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
|
|
||||||
|
|||||||
322
test/external_frame_buffer_test.cc
Normal file
322
test/external_frame_buffer_test.cc
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "test/codec_factory.h"
|
||||||
|
#include "test/decode_test_driver.h"
|
||||||
|
#include "test/ivf_video_source.h"
|
||||||
|
#include "test/md5_helper.h"
|
||||||
|
#include "test/test_vectors.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
#include "test/webm_video_source.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
const int kVideoNameParam = 1;
|
||||||
|
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
|
||||||
|
|
||||||
|
// Callback used by libvpx to request the application to allocate a frame
|
||||||
|
// buffer of at least |new_size| in bytes.
|
||||||
|
int realloc_vp9_frame_buffer(void *user_priv, size_t new_size,
|
||||||
|
vpx_codec_frame_buffer_t *fb) {
|
||||||
|
(void)user_priv;
|
||||||
|
if (fb == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
delete [] fb->data;
|
||||||
|
fb->data = new uint8_t[new_size];
|
||||||
|
fb->size = new_size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callback will not allocate data for frame buffer.
|
||||||
|
int zero_realloc_vp9_frame_buffer(void *user_priv, size_t new_size,
|
||||||
|
vpx_codec_frame_buffer_t *fb) {
|
||||||
|
(void)user_priv;
|
||||||
|
if (fb == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
delete [] fb->data;
|
||||||
|
fb->data = NULL;
|
||||||
|
fb->size = new_size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Callback will allocate one less byte.
|
||||||
|
int one_less_byte_realloc_vp9_frame_buffer(void *user_priv, size_t new_size,
|
||||||
|
vpx_codec_frame_buffer_t *fb) {
|
||||||
|
(void)user_priv;
|
||||||
|
if (fb == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
delete [] fb->data;
|
||||||
|
|
||||||
|
const size_t error_size = new_size - 1;
|
||||||
|
fb->data = new uint8_t[error_size];
|
||||||
|
fb->size = error_size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Class for testing passing in external frame buffers to libvpx.
|
||||||
|
class ExternalFrameBufferMD5Test
|
||||||
|
: public ::libvpx_test::DecoderTest,
|
||||||
|
public ::libvpx_test::CodecTestWithParam<const char*> {
|
||||||
|
protected:
|
||||||
|
ExternalFrameBufferMD5Test()
|
||||||
|
: DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
|
||||||
|
md5_file_(NULL),
|
||||||
|
num_buffers_(0),
|
||||||
|
frame_buffers_(NULL) {}
|
||||||
|
|
||||||
|
virtual ~ExternalFrameBufferMD5Test() {
|
||||||
|
for (int i = 0; i < num_buffers_; ++i) {
|
||||||
|
delete [] frame_buffers_[i].data;
|
||||||
|
}
|
||||||
|
delete [] frame_buffers_;
|
||||||
|
|
||||||
|
if (md5_file_ != NULL)
|
||||||
|
fclose(md5_file_);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void PreDecodeFrameHook(
|
||||||
|
const libvpx_test::CompressedVideoSource &video,
|
||||||
|
libvpx_test::Decoder *decoder) {
|
||||||
|
if (num_buffers_ > 0 && video.frame_number() == 0) {
|
||||||
|
// Have libvpx use frame buffers we create.
|
||||||
|
frame_buffers_ = new vpx_codec_frame_buffer_t[num_buffers_];
|
||||||
|
memset(frame_buffers_, 0, sizeof(frame_buffers_[0]) * num_buffers_);
|
||||||
|
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK,
|
||||||
|
decoder->SetExternalFrameBuffers(
|
||||||
|
frame_buffers_, num_buffers_,
|
||||||
|
realloc_vp9_frame_buffer, NULL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void OpenMD5File(const std::string &md5_file_name_) {
|
||||||
|
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
|
||||||
|
ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
|
||||||
|
<< md5_file_name_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DecompressedFrameHook(const vpx_image_t &img,
|
||||||
|
const unsigned int frame_number) {
|
||||||
|
ASSERT_TRUE(md5_file_ != NULL);
|
||||||
|
char expected_md5[33];
|
||||||
|
char junk[128];
|
||||||
|
|
||||||
|
// Read correct md5 checksums.
|
||||||
|
const int res = fscanf(md5_file_, "%s %s", expected_md5, junk);
|
||||||
|
ASSERT_NE(EOF, res) << "Read md5 data failed";
|
||||||
|
expected_md5[32] = '\0';
|
||||||
|
|
||||||
|
::libvpx_test::MD5 md5_res;
|
||||||
|
md5_res.Add(&img);
|
||||||
|
const char *const actual_md5 = md5_res.Get();
|
||||||
|
|
||||||
|
// Check md5 match.
|
||||||
|
ASSERT_STREQ(expected_md5, actual_md5)
|
||||||
|
<< "Md5 checksums don't match: frame number = " << frame_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_num_buffers(int num_buffers) { num_buffers_ = num_buffers; }
|
||||||
|
int num_buffers() const { return num_buffers_; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
FILE *md5_file_;
|
||||||
|
int num_buffers_;
|
||||||
|
vpx_codec_frame_buffer_t *frame_buffers_;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ExternalFrameBufferTest : public ::testing::Test {
|
||||||
|
protected:
|
||||||
|
ExternalFrameBufferTest()
|
||||||
|
: video_(NULL),
|
||||||
|
decoder_(NULL),
|
||||||
|
num_buffers_(0),
|
||||||
|
frame_buffers_(NULL) {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
|
||||||
|
video_->Init();
|
||||||
|
video_->Begin();
|
||||||
|
|
||||||
|
vpx_codec_dec_cfg_t cfg = {0};
|
||||||
|
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() {
|
||||||
|
for (int i = 0; i < num_buffers_; ++i) {
|
||||||
|
delete [] frame_buffers_[i].data;
|
||||||
|
}
|
||||||
|
delete [] frame_buffers_;
|
||||||
|
delete decoder_;
|
||||||
|
delete video_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Passes the external frame buffer information to libvpx.
|
||||||
|
vpx_codec_err_t SetExternalFrameBuffers(
|
||||||
|
int num_buffers,
|
||||||
|
vpx_realloc_frame_buffer_cb_fn_t cb) {
|
||||||
|
if (num_buffers > 0) {
|
||||||
|
num_buffers_ = num_buffers;
|
||||||
|
|
||||||
|
// Have libvpx use frame buffers we create.
|
||||||
|
frame_buffers_ = new vpx_codec_frame_buffer_t[num_buffers_];
|
||||||
|
memset(frame_buffers_, 0, sizeof(frame_buffers_[0]) * num_buffers_);
|
||||||
|
}
|
||||||
|
|
||||||
|
return decoder_->SetExternalFrameBuffers(frame_buffers_, num_buffers_,
|
||||||
|
cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pass Null frame buffer list to libvpx.
|
||||||
|
vpx_codec_err_t SetNullFrameBuffers(
|
||||||
|
int num_buffers,
|
||||||
|
vpx_realloc_frame_buffer_cb_fn_t cb) {
|
||||||
|
return decoder_->SetExternalFrameBuffers(NULL, num_buffers,
|
||||||
|
cb, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
vpx_codec_err_t DecodeOneFrame() {
|
||||||
|
const vpx_codec_err_t res =
|
||||||
|
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
|
||||||
|
if (res == VPX_CODEC_OK)
|
||||||
|
video_->Next();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
vpx_codec_err_t DecodeRemainingFrames() {
|
||||||
|
for (; video_->cxdata(); video_->Next()) {
|
||||||
|
const vpx_codec_err_t res =
|
||||||
|
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
|
||||||
|
if (res != VPX_CODEC_OK)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
libvpx_test::DxDataIterator dec_iter = decoder_->GetDxData();
|
||||||
|
const vpx_image_t *img = NULL;
|
||||||
|
|
||||||
|
// Get decompressed data
|
||||||
|
while ((img = dec_iter.Next())) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return VPX_CODEC_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
libvpx_test::WebMVideoSource *video_;
|
||||||
|
libvpx_test::VP9Decoder *decoder_;
|
||||||
|
int num_buffers_;
|
||||||
|
vpx_codec_frame_buffer_t *frame_buffers_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// This test runs through the set of test vectors, and decodes them.
|
||||||
|
// Libvpx will call into the application to allocate a frame buffer when
|
||||||
|
// needed. The md5 checksums are computed for each frame in the video file.
|
||||||
|
// If md5 checksums match the correct md5 data, then the test is passed.
|
||||||
|
// Otherwise, the test failed.
|
||||||
|
TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
|
||||||
|
const std::string filename = GET_PARAM(kVideoNameParam);
|
||||||
|
libvpx_test::CompressedVideoSource *video = NULL;
|
||||||
|
|
||||||
|
// Number of buffers equals number of possible reference buffers(8), plus
|
||||||
|
// one working buffer, plus four jitter buffers.
|
||||||
|
const int num_buffers = 13;
|
||||||
|
set_num_buffers(num_buffers);
|
||||||
|
|
||||||
|
#if CONFIG_VP8_DECODER
|
||||||
|
// Tell compiler we are not using kVP8TestVectors.
|
||||||
|
(void)libvpx_test::kVP8TestVectors;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Open compressed video file.
|
||||||
|
if (filename.substr(filename.length() - 3, 3) == "ivf") {
|
||||||
|
video = new libvpx_test::IVFVideoSource(filename);
|
||||||
|
} else if (filename.substr(filename.length() - 4, 4) == "webm") {
|
||||||
|
video = new libvpx_test::WebMVideoSource(filename);
|
||||||
|
}
|
||||||
|
video->Init();
|
||||||
|
|
||||||
|
// Construct md5 file name.
|
||||||
|
const std::string md5_filename = filename + ".md5";
|
||||||
|
OpenMD5File(md5_filename);
|
||||||
|
|
||||||
|
// Decode frame, and check the md5 matching.
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
|
delete video;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, NineFrameBuffers) {
|
||||||
|
// Minimum number of external frame buffers for VP9 is
|
||||||
|
// #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS.
|
||||||
|
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK,
|
||||||
|
SetExternalFrameBuffers(num_buffers, realloc_vp9_frame_buffer));
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, EightJitterBuffers) {
|
||||||
|
// Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
|
||||||
|
// #VPX_MAXIMUM_WORK_BUFFERS + eight jitter buffers.
|
||||||
|
const int jitter_buffers = 8;
|
||||||
|
const int num_buffers =
|
||||||
|
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK,
|
||||||
|
SetExternalFrameBuffers(num_buffers, realloc_vp9_frame_buffer));
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, NotEnoughBuffers) {
|
||||||
|
// Minimum number of external frame buffers for VP9 is
|
||||||
|
// #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS. Set one less.
|
||||||
|
const int num_buffers =
|
||||||
|
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS - 1;
|
||||||
|
ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||||
|
SetExternalFrameBuffers(num_buffers, realloc_vp9_frame_buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, NullFrameBufferList) {
|
||||||
|
// Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
|
||||||
|
// #VPX_MAXIMUM_WORK_BUFFERS + four jitter buffers.
|
||||||
|
const int jitter_buffers = 4;
|
||||||
|
const int num_buffers =
|
||||||
|
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
|
||||||
|
ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
|
||||||
|
SetNullFrameBuffers(num_buffers, realloc_vp9_frame_buffer));
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, NullRealloc) {
|
||||||
|
// Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
|
||||||
|
// #VPX_MAXIMUM_WORK_BUFFERS + four jitter buffers.
|
||||||
|
const int jitter_buffers = 4;
|
||||||
|
const int num_buffers =
|
||||||
|
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK,
|
||||||
|
SetExternalFrameBuffers(num_buffers,
|
||||||
|
zero_realloc_vp9_frame_buffer));
|
||||||
|
ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(ExternalFrameBufferTest, ReallocOneLessByte) {
|
||||||
|
// Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
|
||||||
|
// #VPX_MAXIMUM_WORK_BUFFERS + four jitter buffers.
|
||||||
|
const int jitter_buffers = 4;
|
||||||
|
const int num_buffers =
|
||||||
|
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK,
|
||||||
|
SetExternalFrameBuffers(num_buffers,
|
||||||
|
one_less_byte_realloc_vp9_frame_buffer));
|
||||||
|
ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
|
||||||
|
}
|
||||||
|
|
||||||
|
VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
|
||||||
|
::testing::ValuesIn(libvpx_test::kVP9TestVectors));
|
||||||
|
} // namespace
|
||||||
@@ -13,178 +13,291 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "test/acm_random.h"
|
||||||
|
#include "test/clear_system_state.h"
|
||||||
|
#include "test/register_state_check.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp9_rtcd.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
|
void vp9_idct4x4_16_add_c(const int16_t *input, uint8_t *output, int pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "acm_random.h"
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_ports/mem.h"
|
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void fdct4x4(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
const int kNumCoeffs = 16;
|
||||||
int stride, int /*tx_type*/) {
|
typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride);
|
||||||
vp9_short_fdct4x4_c(in, out, stride);
|
typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride);
|
||||||
}
|
typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
|
||||||
void idct4x4_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
int tx_type);
|
||||||
int stride, int /*tx_type*/) {
|
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
|
||||||
vp9_short_idct4x4_add_c(out, dst, stride >> 1);
|
int tx_type);
|
||||||
}
|
|
||||||
void fht4x4(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
typedef std::tr1::tuple<fdct_t, idct_t, int> dct_4x4_param_t;
|
||||||
int stride, int tx_type) {
|
typedef std::tr1::tuple<fht_t, iht_t, int> ht_4x4_param_t;
|
||||||
vp9_short_fht4x4_c(in, out, stride >> 1, tx_type);
|
|
||||||
}
|
void fdct4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
void iht4x4_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
vp9_fdct4x4_c(in, out, stride);
|
||||||
int stride, int tx_type) {
|
|
||||||
vp9_short_iht4x4_add_c(out, dst, stride >> 1, tx_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FwdTrans4x4Test : public ::testing::TestWithParam<int> {
|
void fht4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
|
vp9_short_fht4x4_c(in, out, stride, tx_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Trans4x4TestBase {
|
||||||
public:
|
public:
|
||||||
virtual ~FwdTrans4x4Test() {}
|
virtual ~Trans4x4TestBase() {}
|
||||||
virtual void SetUp() {
|
|
||||||
tx_type_ = GetParam();
|
|
||||||
if (tx_type_ == 0) {
|
|
||||||
fwd_txfm_ = fdct4x4;
|
|
||||||
inv_txfm_ = idct4x4_add;
|
|
||||||
} else {
|
|
||||||
fwd_txfm_ = fht4x4;
|
|
||||||
inv_txfm_ = iht4x4_add;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void RunFwdTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
virtual void RunFwdTxfm(const int16_t *in, int16_t *out, int stride) = 0;
|
||||||
int stride, int tx_type) {
|
|
||||||
(*fwd_txfm_)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunInvTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
virtual void RunInvTxfm(const int16_t *out, uint8_t *dst, int stride) = 0;
|
||||||
int stride, int tx_type) {
|
|
||||||
(*inv_txfm_)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
int tx_type_;
|
void RunAccuracyCheck() {
|
||||||
void (*fwd_txfm_)(int16_t *in, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type);
|
|
||||||
void (*inv_txfm_)(int16_t *in, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type);
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(FwdTrans4x4Test, SignBiasCheck) {
|
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16);
|
uint32_t max_error = 0;
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_output_block, 16);
|
int64_t total_error = 0;
|
||||||
const int pitch = 8;
|
const int count_test_block = 10000;
|
||||||
int count_sign_block[16][2];
|
|
||||||
const int count_test_block = 1000000;
|
|
||||||
|
|
||||||
memset(count_sign_block, 0, sizeof(count_sign_block));
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 16; ++j)
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
test_input_block[j] = rnd.Rand8() - rnd.Rand8();
|
|
||||||
|
|
||||||
RunFwdTxfm(test_input_block, test_output_block, NULL, pitch, tx_type_);
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
if (test_output_block[j] < 0)
|
|
||||||
++count_sign_block[j][0];
|
|
||||||
else if (test_output_block[j] > 0)
|
|
||||||
++count_sign_block[j][1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
const bool bias_acceptable = (abs(count_sign_block[j][0] -
|
|
||||||
count_sign_block[j][1]) < 10000);
|
|
||||||
EXPECT_TRUE(bias_acceptable)
|
|
||||||
<< "Error: 4x4 FDCT/FHT has a sign bias > 1%"
|
|
||||||
<< " for input range [-255, 255] at index " << j
|
|
||||||
<< " tx_type " << tx_type_;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(count_sign_block, 0, sizeof(count_sign_block));
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
// Initialize a test block with input range [-15, 15].
|
|
||||||
for (int j = 0; j < 16; ++j)
|
|
||||||
test_input_block[j] = (rnd.Rand8() >> 4) - (rnd.Rand8() >> 4);
|
|
||||||
|
|
||||||
RunFwdTxfm(test_input_block, test_output_block, NULL, pitch, tx_type_);
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
if (test_output_block[j] < 0)
|
|
||||||
++count_sign_block[j][0];
|
|
||||||
else if (test_output_block[j] > 0)
|
|
||||||
++count_sign_block[j][1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
const bool bias_acceptable = (abs(count_sign_block[j][0] -
|
|
||||||
count_sign_block[j][1]) < 100000);
|
|
||||||
EXPECT_TRUE(bias_acceptable)
|
|
||||||
<< "Error: 4x4 FDCT/FHT has a sign bias > 10%"
|
|
||||||
<< " for input range [-15, 15] at index " << j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(FwdTrans4x4Test, RoundTripErrorCheck) {
|
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
|
||||||
|
|
||||||
int max_error = 0;
|
|
||||||
double total_error = 0;
|
|
||||||
const int count_test_block = 1000000;
|
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 16);
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 16);
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 16);
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 16);
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
src[j] = rnd.Rand8();
|
src[j] = rnd.Rand8();
|
||||||
dst[j] = rnd.Rand8();
|
dst[j] = rnd.Rand8();
|
||||||
}
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
for (int j = 0; j < 16; ++j)
|
|
||||||
test_input_block[j] = src[j] - dst[j];
|
test_input_block[j] = src[j] - dst[j];
|
||||||
|
|
||||||
const int pitch = 8;
|
|
||||||
RunFwdTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
|
||||||
if(test_temp_block[j] > 0) {
|
|
||||||
test_temp_block[j] += 2;
|
|
||||||
test_temp_block[j] /= 4;
|
|
||||||
test_temp_block[j] *= 4;
|
|
||||||
} else {
|
|
||||||
test_temp_block[j] -= 2;
|
|
||||||
test_temp_block[j] /= 4;
|
|
||||||
test_temp_block[j] *= 4;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// inverse transform and reconstruct the pixel block
|
REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
|
||||||
RunInvTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
test_temp_block, pitch_));
|
||||||
|
REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 16; ++j) {
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const uint32_t diff = dst[j] - src[j];
|
||||||
const int error = diff * diff;
|
const uint32_t error = diff * diff;
|
||||||
if (max_error < error)
|
if (max_error < error)
|
||||||
max_error = error;
|
max_error = error;
|
||||||
total_error += error;
|
total_error += error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPECT_GE(1, max_error)
|
|
||||||
<< "Error: FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1";
|
|
||||||
|
|
||||||
EXPECT_GE(count_test_block, total_error)
|
EXPECT_GE(1u, max_error)
|
||||||
<< "Error: FDCT/IDCT or FHT/IHT has average "
|
<< "Error: 4x4 FHT/IHT has an individual round trip error > 1";
|
||||||
<< "roundtrip error > 1 per block";
|
|
||||||
|
EXPECT_GE(count_test_block , total_error)
|
||||||
|
<< "Error: 4x4 FHT/IHT has average round trip error > 1 per block";
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunCoeffCheck() {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 5000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
|
||||||
|
fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
|
||||||
|
REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
|
||||||
|
|
||||||
|
// The minimum quant value is 4.
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunMemCheck() {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 5000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_ref_block, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, output_block, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
input_extreme_block[j] = rnd.Rand8() % 2 ? 255 : -255;
|
||||||
|
}
|
||||||
|
if (i == 0)
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_extreme_block[j] = 255;
|
||||||
|
if (i == 1)
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j)
|
||||||
|
input_extreme_block[j] = -255;
|
||||||
|
|
||||||
|
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
|
||||||
|
REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
|
||||||
|
output_block, pitch_));
|
||||||
|
|
||||||
|
// The minimum quant value is 4.
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
EXPECT_EQ(output_block[j], output_ref_block[j]);
|
||||||
|
EXPECT_GE(4 * DCT_MAX_VALUE, abs(output_block[j]))
|
||||||
|
<< "Error: 16x16 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunInvAccuracyCheck() {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, coeff, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
src[j] = rnd.Rand8();
|
||||||
|
dst[j] = rnd.Rand8();
|
||||||
|
in[j] = src[j] - dst[j];
|
||||||
|
}
|
||||||
|
|
||||||
|
fwd_txfm_ref(in, coeff, pitch_, tx_type_);
|
||||||
|
|
||||||
|
REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
|
||||||
|
|
||||||
|
for (int j = 0; j < kNumCoeffs; ++j) {
|
||||||
|
const uint32_t diff = dst[j] - src[j];
|
||||||
|
const uint32_t error = diff * diff;
|
||||||
|
EXPECT_GE(1u, error)
|
||||||
|
<< "Error: 16x16 IDCT has error " << error
|
||||||
|
<< " at index " << j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int pitch_;
|
||||||
|
int tx_type_;
|
||||||
|
fht_t fwd_txfm_ref;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Trans4x4DCT
|
||||||
|
: public Trans4x4TestBase,
|
||||||
|
public ::testing::TestWithParam<dct_4x4_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~Trans4x4DCT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 4;
|
||||||
|
fwd_txfm_ref = fdct4x4_ref;
|
||||||
|
}
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(const int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride);
|
||||||
|
}
|
||||||
|
void RunInvTxfm(const int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride);
|
||||||
|
}
|
||||||
|
|
||||||
|
fdct_t fwd_txfm_;
|
||||||
|
idct_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(Trans4x4DCT, AccuracyCheck) {
|
||||||
|
RunAccuracyCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(VP9, FwdTrans4x4Test, ::testing::Range(0, 4));
|
TEST_P(Trans4x4DCT, CoeffCheck) {
|
||||||
|
RunCoeffCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans4x4DCT, MemCheck) {
|
||||||
|
RunMemCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans4x4DCT, InvAccuracyCheck) {
|
||||||
|
RunInvAccuracyCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
class Trans4x4HT
|
||||||
|
: public Trans4x4TestBase,
|
||||||
|
public ::testing::TestWithParam<ht_4x4_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~Trans4x4HT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 4;
|
||||||
|
fwd_txfm_ref = fht4x4_ref;
|
||||||
|
}
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(const int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride, tx_type_);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunInvTxfm(const int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride, tx_type_);
|
||||||
|
}
|
||||||
|
|
||||||
|
fht_t fwd_txfm_;
|
||||||
|
iht_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(Trans4x4HT, AccuracyCheck) {
|
||||||
|
RunAccuracyCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans4x4HT, CoeffCheck) {
|
||||||
|
RunCoeffCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans4x4HT, MemCheck) {
|
||||||
|
RunMemCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(Trans4x4HT, InvAccuracyCheck) {
|
||||||
|
RunInvAccuracyCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, Trans4x4DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, Trans4x4HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 0),
|
||||||
|
make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 1),
|
||||||
|
make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 2),
|
||||||
|
make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 3)));
|
||||||
|
|
||||||
|
#if HAVE_SSE2
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, Trans4x4DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct4x4_sse2,
|
||||||
|
&vp9_idct4x4_16_add_sse2, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, Trans4x4HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0),
|
||||||
|
make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1),
|
||||||
|
make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2),
|
||||||
|
make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3)));
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -13,76 +13,51 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx_ports/mem.h"
|
#include "test/acm_random.h"
|
||||||
|
#include "test/clear_system_state.h"
|
||||||
|
#include "test/register_state_check.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp9_rtcd.h"
|
#include "vp9/common/vp9_entropy.h"
|
||||||
void vp9_short_idct8x8_add_c(short *input, uint8_t *output, int pitch);
|
#include "./vp9_rtcd.h"
|
||||||
|
void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *output, int pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "acm_random.h"
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void fdct8x8(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
typedef void (*fdct_t)(const int16_t *in, int16_t *out, int stride);
|
||||||
int stride, int /*tx_type*/) {
|
typedef void (*idct_t)(const int16_t *in, uint8_t *out, int stride);
|
||||||
vp9_short_fdct8x8_c(in, out, stride);
|
typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
|
||||||
}
|
int tx_type);
|
||||||
void idct8x8_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
|
||||||
int stride, int /*tx_type*/) {
|
int tx_type);
|
||||||
vp9_short_idct8x8_add_c(out, dst, stride >> 1);
|
|
||||||
}
|
typedef std::tr1::tuple<fdct_t, idct_t, int> dct_8x8_param_t;
|
||||||
void fht8x8(int16_t *in, int16_t *out, uint8_t* /*dst*/,
|
typedef std::tr1::tuple<fht_t, iht_t, int> ht_8x8_param_t;
|
||||||
int stride, int tx_type) {
|
|
||||||
// TODO(jingning): need to refactor this to test both _c and _sse2 functions,
|
void fdct8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
// when we have all inverse dct functions done sse2.
|
vp9_fdct8x8_c(in, out, stride);
|
||||||
#if HAVE_SSE2
|
|
||||||
vp9_short_fht8x8_sse2(in, out, stride >> 1, tx_type);
|
|
||||||
#else
|
|
||||||
vp9_short_fht8x8_c(in, out, stride >> 1, tx_type);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void iht8x8_add(int16_t* /*in*/, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type) {
|
|
||||||
vp9_short_iht8x8_add_c(out, dst, stride >> 1, tx_type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class FwdTrans8x8Test : public ::testing::TestWithParam<int> {
|
void fht8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
|
||||||
|
vp9_short_fht8x8_c(in, out, stride, tx_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
class FwdTrans8x8TestBase {
|
||||||
public:
|
public:
|
||||||
virtual ~FwdTrans8x8Test() {}
|
virtual ~FwdTrans8x8TestBase() {}
|
||||||
virtual void SetUp() {
|
|
||||||
tx_type_ = GetParam();
|
|
||||||
if (tx_type_ == 0) {
|
|
||||||
fwd_txfm = fdct8x8;
|
|
||||||
inv_txfm = idct8x8_add;
|
|
||||||
} else {
|
|
||||||
fwd_txfm = fht8x8;
|
|
||||||
inv_txfm = iht8x8_add;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void RunFwdTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
virtual void RunFwdTxfm(int16_t *in, int16_t *out, int stride) = 0;
|
||||||
int stride, int tx_type) {
|
virtual void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) = 0;
|
||||||
(*fwd_txfm)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
void RunInvTxfm(int16_t *in, int16_t *out, uint8_t *dst,
|
|
||||||
int stride, int tx_type) {
|
|
||||||
(*inv_txfm)(in, out, dst, stride, tx_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
int tx_type_;
|
void RunSignBiasCheck() {
|
||||||
void (*fwd_txfm)(int16_t*, int16_t*, uint8_t*, int, int);
|
|
||||||
void (*inv_txfm)(int16_t*, int16_t*, uint8_t*, int, int);
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(FwdTrans8x8Test, SignBiasCheck) {
|
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_output_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_output_block, 64);
|
||||||
const int pitch = 16;
|
|
||||||
int count_sign_block[64][2];
|
int count_sign_block[64][2];
|
||||||
const int count_test_block = 100000;
|
const int count_test_block = 100000;
|
||||||
|
|
||||||
@@ -92,8 +67,8 @@ TEST_P(FwdTrans8x8Test, SignBiasCheck) {
|
|||||||
// Initialize a test block with input range [-255, 255].
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 64; ++j)
|
for (int j = 0; j < 64; ++j)
|
||||||
test_input_block[j] = rnd.Rand8() - rnd.Rand8();
|
test_input_block[j] = rnd.Rand8() - rnd.Rand8();
|
||||||
|
REGISTER_STATE_CHECK(
|
||||||
RunFwdTxfm(test_input_block, test_output_block, NULL, pitch, tx_type_);
|
RunFwdTxfm(test_input_block, test_output_block, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
if (test_output_block[j] < 0)
|
if (test_output_block[j] < 0)
|
||||||
@@ -121,8 +96,8 @@ TEST_P(FwdTrans8x8Test, SignBiasCheck) {
|
|||||||
// Initialize a test block with input range [-15, 15].
|
// Initialize a test block with input range [-15, 15].
|
||||||
for (int j = 0; j < 64; ++j)
|
for (int j = 0; j < 64; ++j)
|
||||||
test_input_block[j] = (rnd.Rand8() >> 4) - (rnd.Rand8() >> 4);
|
test_input_block[j] = (rnd.Rand8() >> 4) - (rnd.Rand8() >> 4);
|
||||||
|
REGISTER_STATE_CHECK(
|
||||||
RunFwdTxfm(test_input_block, test_output_block, NULL, pitch, tx_type_);
|
RunFwdTxfm(test_input_block, test_output_block, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
if (test_output_block[j] < 0)
|
if (test_output_block[j] < 0)
|
||||||
@@ -143,31 +118,30 @@ TEST_P(FwdTrans8x8Test, SignBiasCheck) {
|
|||||||
<< " count1: " << count_sign_block[j][1]
|
<< " count1: " << count_sign_block[j][1]
|
||||||
<< " diff: " << diff;
|
<< " diff: " << diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) {
|
void RunRoundTripErrorCheck() {
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
int max_error = 0;
|
int max_error = 0;
|
||||||
double total_error = 0;
|
int total_error = 0;
|
||||||
const int count_test_block = 100000;
|
const int count_test_block = 100000;
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
src[j] = rnd.Rand8();
|
src[j] = rnd.Rand8();
|
||||||
dst[j] = rnd.Rand8();
|
dst[j] = rnd.Rand8();
|
||||||
}
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
for (int j = 0; j < 64; ++j)
|
|
||||||
test_input_block[j] = src[j] - dst[j];
|
test_input_block[j] = src[j] - dst[j];
|
||||||
|
}
|
||||||
|
|
||||||
const int pitch = 16;
|
REGISTER_STATE_CHECK(
|
||||||
RunFwdTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
|
||||||
for (int j = 0; j < 64; ++j){
|
for (int j = 0; j < 64; ++j) {
|
||||||
if(test_temp_block[j] > 0) {
|
if (test_temp_block[j] > 0) {
|
||||||
test_temp_block[j] += 2;
|
test_temp_block[j] += 2;
|
||||||
test_temp_block[j] /= 4;
|
test_temp_block[j] /= 4;
|
||||||
test_temp_block[j] *= 4;
|
test_temp_block[j] *= 4;
|
||||||
@@ -177,7 +151,8 @@ TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) {
|
|||||||
test_temp_block[j] *= 4;
|
test_temp_block[j] *= 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RunInvTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
REGISTER_STATE_CHECK(
|
||||||
|
RunInvTxfm(test_temp_block, dst, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const int diff = dst[j] - src[j];
|
||||||
@@ -189,35 +164,36 @@ TEST_P(FwdTrans8x8Test, RoundTripErrorCheck) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_GE(1, max_error)
|
EXPECT_GE(1, max_error)
|
||||||
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual roundtrip error > 1";
|
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual"
|
||||||
|
<< " roundtrip error > 1";
|
||||||
|
|
||||||
EXPECT_GE(count_test_block/5, total_error)
|
EXPECT_GE(count_test_block/5, total_error)
|
||||||
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
|
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
|
||||||
"error > 1/5 per block";
|
<< "error > 1/5 per block";
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_P(FwdTrans8x8Test, ExtremalCheck) {
|
void RunExtremalCheck() {
|
||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
int max_error = 0;
|
int max_error = 0;
|
||||||
double total_error = 0;
|
int total_error = 0;
|
||||||
const int count_test_block = 100000;
|
const int count_test_block = 100000;
|
||||||
for (int i = 0; i < count_test_block; ++i) {
|
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64);
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_temp_block, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
|
||||||
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
|
||||||
|
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// Initialize a test block with input range [-255, 255].
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
src[j] = rnd.Rand8() % 2 ? 255 : 0;
|
src[j] = rnd.Rand8() % 2 ? 255 : 0;
|
||||||
dst[j] = src[j] > 0 ? 0 : 255;
|
dst[j] = src[j] > 0 ? 0 : 255;
|
||||||
}
|
|
||||||
// Initialize a test block with input range [-255, 255].
|
|
||||||
for (int j = 0; j < 64; ++j)
|
|
||||||
test_input_block[j] = src[j] - dst[j];
|
test_input_block[j] = src[j] - dst[j];
|
||||||
|
}
|
||||||
|
|
||||||
const int pitch = 16;
|
REGISTER_STATE_CHECK(
|
||||||
RunFwdTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
|
||||||
RunInvTxfm(test_input_block, test_temp_block, dst, pitch, tx_type_);
|
REGISTER_STATE_CHECK(
|
||||||
|
RunInvTxfm(test_temp_block, dst, pitch_));
|
||||||
|
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const int diff = dst[j] - src[j];
|
||||||
@@ -228,14 +204,125 @@ TEST_P(FwdTrans8x8Test, ExtremalCheck) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EXPECT_GE(1, max_error)
|
EXPECT_GE(1, max_error)
|
||||||
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has an"
|
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has"
|
||||||
<< " individual roundtrip error > 1";
|
<< "an individual roundtrip error > 1";
|
||||||
|
|
||||||
EXPECT_GE(count_test_block/5, total_error)
|
EXPECT_GE(count_test_block/5, total_error)
|
||||||
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average"
|
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average"
|
||||||
<< " roundtrip error > 1/5 per block";
|
<< " roundtrip error > 1/5 per block";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int pitch_;
|
||||||
|
int tx_type_;
|
||||||
|
fht_t fwd_txfm_ref;
|
||||||
|
};
|
||||||
|
|
||||||
|
class FwdTrans8x8DCT
|
||||||
|
: public FwdTrans8x8TestBase,
|
||||||
|
public ::testing::TestWithParam<dct_8x8_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~FwdTrans8x8DCT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 8;
|
||||||
|
fwd_txfm_ref = fdct8x8_ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride);
|
||||||
|
}
|
||||||
|
void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride);
|
||||||
|
}
|
||||||
|
|
||||||
|
fdct_t fwd_txfm_;
|
||||||
|
idct_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(FwdTrans8x8DCT, SignBiasCheck) {
|
||||||
|
RunSignBiasCheck();
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(VP9, FwdTrans8x8Test, ::testing::Range(0, 4));
|
TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) {
|
||||||
|
RunRoundTripErrorCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(FwdTrans8x8DCT, ExtremalCheck) {
|
||||||
|
RunExtremalCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
class FwdTrans8x8HT
|
||||||
|
: public FwdTrans8x8TestBase,
|
||||||
|
public ::testing::TestWithParam<ht_8x8_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~FwdTrans8x8HT() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
fwd_txfm_ = GET_PARAM(0);
|
||||||
|
inv_txfm_ = GET_PARAM(1);
|
||||||
|
tx_type_ = GET_PARAM(2);
|
||||||
|
pitch_ = 8;
|
||||||
|
fwd_txfm_ref = fht8x8_ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void RunFwdTxfm(int16_t *in, int16_t *out, int stride) {
|
||||||
|
fwd_txfm_(in, out, stride, tx_type_);
|
||||||
|
}
|
||||||
|
void RunInvTxfm(int16_t *out, uint8_t *dst, int stride) {
|
||||||
|
inv_txfm_(out, dst, stride, tx_type_);
|
||||||
|
}
|
||||||
|
|
||||||
|
fht_t fwd_txfm_;
|
||||||
|
iht_t inv_txfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(FwdTrans8x8HT, SignBiasCheck) {
|
||||||
|
RunSignBiasCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) {
|
||||||
|
RunRoundTripErrorCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(FwdTrans8x8HT, ExtremalCheck) {
|
||||||
|
RunExtremalCheck();
|
||||||
|
}
|
||||||
|
|
||||||
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, FwdTrans8x8DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, FwdTrans8x8HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 0),
|
||||||
|
make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 1),
|
||||||
|
make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 2),
|
||||||
|
make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 3)));
|
||||||
|
|
||||||
|
#if HAVE_SSE2
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, FwdTrans8x8DCT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0)));
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, FwdTrans8x8HT,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0),
|
||||||
|
make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1),
|
||||||
|
make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2),
|
||||||
|
make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3)));
|
||||||
|
#endif
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#define TEST_I420_VIDEO_SOURCE_H_
|
#define TEST_I420_VIDEO_SOURCE_H_
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "test/video_source.h"
|
#include "test/video_source.h"
|
||||||
|
|
||||||
@@ -34,7 +35,6 @@ class I420VideoSource : public VideoSource {
|
|||||||
height_(0),
|
height_(0),
|
||||||
framerate_numerator_(rate_numerator),
|
framerate_numerator_(rate_numerator),
|
||||||
framerate_denominator_(rate_denominator) {
|
framerate_denominator_(rate_denominator) {
|
||||||
|
|
||||||
// This initializes raw_sz_, width_, height_ and allocates an img.
|
// This initializes raw_sz_, width_, height_ and allocates an img.
|
||||||
SetSize(width, height);
|
SetSize(width, height);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@
|
|||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp9_rtcd.h"
|
#include "./vp9_rtcd.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
@@ -27,10 +27,10 @@ namespace {
|
|||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
static int round(double x) {
|
static int round(double x) {
|
||||||
if(x < 0)
|
if (x < 0)
|
||||||
return (int)ceil(x - 0.5);
|
return static_cast<int>(ceil(x - 0.5));
|
||||||
else
|
else
|
||||||
return (int)floor(x + 0.5);
|
return static_cast<int>(floor(x + 0.5));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ TEST(VP9Idct8x8Test, AccuracyCheck) {
|
|||||||
reference_dct_2d(input, output_r);
|
reference_dct_2d(input, output_r);
|
||||||
for (int j = 0; j < 64; ++j)
|
for (int j = 0; j < 64; ++j)
|
||||||
coeff[j] = round(output_r[j]);
|
coeff[j] = round(output_r[j]);
|
||||||
vp9_short_idct8x8_add_c(coeff, dst, 8);
|
vp9_idct8x8_64_add_c(coeff, dst, 8);
|
||||||
for (int j = 0; j < 64; ++j) {
|
for (int j = 0; j < 64; ++j) {
|
||||||
const int diff = dst[j] - src[j];
|
const int diff = dst[j] - src[j];
|
||||||
const int error = diff * diff;
|
const int error = diff * diff;
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ extern "C" {
|
|||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr,
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
|
typedef void (*idct_fn_t)(int16_t *input, unsigned char *pred_ptr,
|
||||||
int pred_stride, unsigned char *dst_ptr,
|
int pred_stride, unsigned char *dst_ptr,
|
||||||
int dst_stride);
|
int dst_stride);
|
||||||
namespace {
|
namespace {
|
||||||
@@ -34,7 +36,7 @@ class IDCTTest : public ::testing::TestWithParam<idct_fn_t> {
|
|||||||
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
idct_fn_t UUT;
|
idct_fn_t UUT;
|
||||||
short input[16];
|
int16_t input[16];
|
||||||
unsigned char output[256];
|
unsigned char output[256];
|
||||||
unsigned char predict[256];
|
unsigned char predict[256];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
#include "vp8/common/blockd.h"
|
#include "vp8/common/blockd.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
}
|
}
|
||||||
@@ -34,13 +34,17 @@ class IntraPredBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetupMacroblock(uint8_t *data, int block_size, int stride,
|
void SetupMacroblock(MACROBLOCKD *mbptr,
|
||||||
|
MODE_INFO *miptr,
|
||||||
|
uint8_t *data,
|
||||||
|
int block_size,
|
||||||
|
int stride,
|
||||||
int num_planes) {
|
int num_planes) {
|
||||||
memset(&mb_, 0, sizeof(mb_));
|
mbptr_ = mbptr;
|
||||||
memset(&mi_, 0, sizeof(mi_));
|
miptr_ = miptr;
|
||||||
mb_.up_available = 1;
|
mbptr_->up_available = 1;
|
||||||
mb_.left_available = 1;
|
mbptr_->left_available = 1;
|
||||||
mb_.mode_info_context = &mi_;
|
mbptr_->mode_info_context = miptr_;
|
||||||
stride_ = stride;
|
stride_ = stride;
|
||||||
block_size_ = block_size;
|
block_size_ = block_size;
|
||||||
num_planes_ = num_planes;
|
num_planes_ = num_planes;
|
||||||
@@ -63,14 +67,14 @@ class IntraPredBase {
|
|||||||
virtual void Predict(MB_PREDICTION_MODE mode) = 0;
|
virtual void Predict(MB_PREDICTION_MODE mode) = 0;
|
||||||
|
|
||||||
void SetLeftUnavailable() {
|
void SetLeftUnavailable() {
|
||||||
mb_.left_available = 0;
|
mbptr_->left_available = 0;
|
||||||
for (int p = 0; p < num_planes_; p++)
|
for (int p = 0; p < num_planes_; p++)
|
||||||
for (int i = -1; i < block_size_; ++i)
|
for (int i = -1; i < block_size_; ++i)
|
||||||
data_ptr_[p][stride_ * i - 1] = 129;
|
data_ptr_[p][stride_ * i - 1] = 129;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetTopUnavailable() {
|
void SetTopUnavailable() {
|
||||||
mb_.up_available = 0;
|
mbptr_->up_available = 0;
|
||||||
for (int p = 0; p < num_planes_; p++)
|
for (int p = 0; p < num_planes_; p++)
|
||||||
memset(&data_ptr_[p][-1 - stride_], 127, block_size_ + 2);
|
memset(&data_ptr_[p][-1 - stride_], 127, block_size_ + 2);
|
||||||
}
|
}
|
||||||
@@ -96,19 +100,19 @@ class IntraPredBase {
|
|||||||
for (int p = 0; p < num_planes_; p++) {
|
for (int p = 0; p < num_planes_; p++) {
|
||||||
// calculate expected DC
|
// calculate expected DC
|
||||||
int expected;
|
int expected;
|
||||||
if (mb_.up_available || mb_.left_available) {
|
if (mbptr_->up_available || mbptr_->left_available) {
|
||||||
int sum = 0, shift = BlockSizeLog2Min1() + mb_.up_available +
|
int sum = 0, shift = BlockSizeLog2Min1() + mbptr_->up_available +
|
||||||
mb_.left_available;
|
mbptr_->left_available;
|
||||||
if (mb_.up_available)
|
if (mbptr_->up_available)
|
||||||
for (int x = 0; x < block_size_; x++)
|
for (int x = 0; x < block_size_; x++)
|
||||||
sum += data_ptr_[p][x - stride_];
|
sum += data_ptr_[p][x - stride_];
|
||||||
if (mb_.left_available)
|
if (mbptr_->left_available)
|
||||||
for (int y = 0; y < block_size_; y++)
|
for (int y = 0; y < block_size_; y++)
|
||||||
sum += data_ptr_[p][y * stride_ - 1];
|
sum += data_ptr_[p][y * stride_ - 1];
|
||||||
expected = (sum + (1 << (shift - 1))) >> shift;
|
expected = (sum + (1 << (shift - 1))) >> shift;
|
||||||
} else
|
} else {
|
||||||
expected = 0x80;
|
expected = 0x80;
|
||||||
|
}
|
||||||
// check that all subsequent lines are equal to the first
|
// check that all subsequent lines are equal to the first
|
||||||
for (int y = 1; y < block_size_; ++y)
|
for (int y = 1; y < block_size_; ++y)
|
||||||
ASSERT_EQ(0, memcmp(data_ptr_[p], &data_ptr_[p][y * stride_],
|
ASSERT_EQ(0, memcmp(data_ptr_[p], &data_ptr_[p][y * stride_],
|
||||||
@@ -209,8 +213,8 @@ class IntraPredBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MACROBLOCKD mb_;
|
MACROBLOCKD *mbptr_;
|
||||||
MODE_INFO mi_;
|
MODE_INFO *miptr_;
|
||||||
uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used
|
uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used
|
||||||
int stride_;
|
int stride_;
|
||||||
int block_size_;
|
int block_size_;
|
||||||
@@ -228,12 +232,18 @@ class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>,
|
|||||||
protected IntraPredBase {
|
protected IntraPredBase {
|
||||||
public:
|
public:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
|
mb_ = reinterpret_cast<MACROBLOCKD*>(
|
||||||
|
vpx_memalign(32, sizeof(MACROBLOCKD)));
|
||||||
|
mi_ = reinterpret_cast<MODE_INFO*>(
|
||||||
|
vpx_memalign(32, sizeof(MODE_INFO)));
|
||||||
data_array_ = reinterpret_cast<uint8_t*>(
|
data_array_ = reinterpret_cast<uint8_t*>(
|
||||||
vpx_memalign(kDataAlignment, kDataBufferSize));
|
vpx_memalign(kDataAlignment, kDataBufferSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TearDownTestCase() {
|
static void TearDownTestCase() {
|
||||||
vpx_free(data_array_);
|
vpx_free(data_array_);
|
||||||
|
vpx_free(mi_);
|
||||||
|
vpx_free(mb_);
|
||||||
data_array_ = NULL;
|
data_array_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,12 +260,12 @@ class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>,
|
|||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
pred_fn_ = GetParam();
|
pred_fn_ = GetParam();
|
||||||
SetupMacroblock(data_array_, kBlockSize, kStride, 1);
|
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Predict(MB_PREDICTION_MODE mode) {
|
virtual void Predict(MB_PREDICTION_MODE mode) {
|
||||||
mb_.mode_info_context->mbmi.mode = mode;
|
mbptr_->mode_info_context->mbmi.mode = mode;
|
||||||
REGISTER_STATE_CHECK(pred_fn_(&mb_,
|
REGISTER_STATE_CHECK(pred_fn_(mbptr_,
|
||||||
data_ptr_[0] - kStride,
|
data_ptr_[0] - kStride,
|
||||||
data_ptr_[0] - 1, kStride,
|
data_ptr_[0] - 1, kStride,
|
||||||
data_ptr_[0], kStride));
|
data_ptr_[0], kStride));
|
||||||
@@ -263,8 +273,12 @@ class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>,
|
|||||||
|
|
||||||
intra_pred_y_fn_t pred_fn_;
|
intra_pred_y_fn_t pred_fn_;
|
||||||
static uint8_t* data_array_;
|
static uint8_t* data_array_;
|
||||||
|
static MACROBLOCKD * mb_;
|
||||||
|
static MODE_INFO *mi_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MACROBLOCKD* IntraPredYTest::mb_ = NULL;
|
||||||
|
MODE_INFO* IntraPredYTest::mi_ = NULL;
|
||||||
uint8_t* IntraPredYTest::data_array_ = NULL;
|
uint8_t* IntraPredYTest::data_array_ = NULL;
|
||||||
|
|
||||||
TEST_P(IntraPredYTest, IntraPredTests) {
|
TEST_P(IntraPredYTest, IntraPredTests) {
|
||||||
@@ -299,12 +313,18 @@ class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>,
|
|||||||
protected IntraPredBase {
|
protected IntraPredBase {
|
||||||
public:
|
public:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
|
mb_ = reinterpret_cast<MACROBLOCKD*>(
|
||||||
|
vpx_memalign(32, sizeof(MACROBLOCKD)));
|
||||||
|
mi_ = reinterpret_cast<MODE_INFO*>(
|
||||||
|
vpx_memalign(32, sizeof(MODE_INFO)));
|
||||||
data_array_ = reinterpret_cast<uint8_t*>(
|
data_array_ = reinterpret_cast<uint8_t*>(
|
||||||
vpx_memalign(kDataAlignment, kDataBufferSize));
|
vpx_memalign(kDataAlignment, kDataBufferSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TearDownTestCase() {
|
static void TearDownTestCase() {
|
||||||
vpx_free(data_array_);
|
vpx_free(data_array_);
|
||||||
|
vpx_free(mi_);
|
||||||
|
vpx_free(mb_);
|
||||||
data_array_ = NULL;
|
data_array_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,12 +342,12 @@ class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>,
|
|||||||
|
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
pred_fn_ = GetParam();
|
pred_fn_ = GetParam();
|
||||||
SetupMacroblock(data_array_, kBlockSize, kStride, 2);
|
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void Predict(MB_PREDICTION_MODE mode) {
|
virtual void Predict(MB_PREDICTION_MODE mode) {
|
||||||
mb_.mode_info_context->mbmi.uv_mode = mode;
|
mbptr_->mode_info_context->mbmi.uv_mode = mode;
|
||||||
pred_fn_(&mb_, data_ptr_[0] - kStride, data_ptr_[1] - kStride,
|
pred_fn_(mbptr_, data_ptr_[0] - kStride, data_ptr_[1] - kStride,
|
||||||
data_ptr_[0] - 1, data_ptr_[1] - 1, kStride,
|
data_ptr_[0] - 1, data_ptr_[1] - 1, kStride,
|
||||||
data_ptr_[0], data_ptr_[1], kStride);
|
data_ptr_[0], data_ptr_[1], kStride);
|
||||||
}
|
}
|
||||||
@@ -340,8 +360,12 @@ class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>,
|
|||||||
// We use 9 lines so we have one line above us for top-prediction.
|
// We use 9 lines so we have one line above us for top-prediction.
|
||||||
// [0] = U, [1] = V
|
// [0] = U, [1] = V
|
||||||
static uint8_t* data_array_;
|
static uint8_t* data_array_;
|
||||||
|
static MACROBLOCKD* mb_;
|
||||||
|
static MODE_INFO* mi_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MACROBLOCKD* IntraPredUVTest::mb_ = NULL;
|
||||||
|
MODE_INFO* IntraPredUVTest::mi_ = NULL;
|
||||||
uint8_t* IntraPredUVTest::data_array_ = NULL;
|
uint8_t* IntraPredUVTest::data_array_ = NULL;
|
||||||
|
|
||||||
TEST_P(IntraPredUVTest, IntraPredTests) {
|
TEST_P(IntraPredUVTest, IntraPredTests) {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ static unsigned int MemGetLe32(const uint8_t *mem) {
|
|||||||
// so that we can do actual file decodes.
|
// so that we can do actual file decodes.
|
||||||
class IVFVideoSource : public CompressedVideoSource {
|
class IVFVideoSource : public CompressedVideoSource {
|
||||||
public:
|
public:
|
||||||
IVFVideoSource(const std::string &file_name)
|
explicit IVFVideoSource(const std::string &file_name)
|
||||||
: file_name_(file_name),
|
: file_name_(file_name),
|
||||||
input_file_(NULL),
|
input_file_(NULL),
|
||||||
compressed_frame_buf_(NULL),
|
compressed_frame_buf_(NULL),
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ TEST_P(KeyframeTest, TestAutoKeyframe) {
|
|||||||
// Verify that keyframes match the file keyframes in the file.
|
// Verify that keyframes match the file keyframes in the file.
|
||||||
for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
|
for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
|
||||||
iter != kf_pts_list_.end(); ++iter) {
|
iter != kf_pts_list_.end(); ++iter) {
|
||||||
|
|
||||||
if (deadline_ == VPX_DL_REALTIME && *iter > 0)
|
if (deadline_ == VPX_DL_REALTIME && *iter > 0)
|
||||||
EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame "
|
EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame "
|
||||||
<< *iter;
|
<< *iter;
|
||||||
|
|||||||
207
test/lru_frame_buffer_test.cc
Normal file
207
test/lru_frame_buffer_test.cc
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "test/codec_factory.h"
|
||||||
|
#include "test/decode_test_driver.h"
|
||||||
|
#include "test/ivf_video_source.h"
|
||||||
|
#include "test/md5_helper.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
#include "test/webm_video_source.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
const int kVideoNameParam = 1;
|
||||||
|
|
||||||
|
const char *kLRUTestVectors[] = {
|
||||||
|
"vp90-2-02-size-lf-1920x1080.webm",
|
||||||
|
"vp90-2-05-resize.ivf",
|
||||||
|
};
|
||||||
|
|
||||||
|
// Callback used by libvpx to request the application to allocate a frame
|
||||||
|
// buffer of at least |new_size| in bytes.
|
||||||
|
int realloc_vp9_frame_buffer(void *user_priv, size_t new_size,
|
||||||
|
vpx_codec_frame_buffer_t *fb) {
|
||||||
|
(void)user_priv;
|
||||||
|
if (fb == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
delete [] fb->data;
|
||||||
|
fb->data = new uint8_t[new_size];
|
||||||
|
fb->size = new_size;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Class for testing libvpx is using the least recently
|
||||||
|
// used frame buffer when a new buffer is requested.
|
||||||
|
class LRUFrameBufferTest
|
||||||
|
: public ::libvpx_test::DecoderTest,
|
||||||
|
public ::libvpx_test::CodecTestWithParam<const char*> {
|
||||||
|
protected:
|
||||||
|
struct FrameBufferMD5Sum {
|
||||||
|
int frame_buffer_index;
|
||||||
|
vpx_image_t img;
|
||||||
|
std::string md5;
|
||||||
|
};
|
||||||
|
|
||||||
|
LRUFrameBufferTest()
|
||||||
|
: DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
|
||||||
|
num_buffers_(0),
|
||||||
|
num_jitter_buffers_(0),
|
||||||
|
frame_buffers_(NULL) {}
|
||||||
|
|
||||||
|
virtual ~LRUFrameBufferTest() {
|
||||||
|
for (int i = 0; i < num_buffers_; ++i) {
|
||||||
|
delete [] frame_buffers_[i].data;
|
||||||
|
}
|
||||||
|
delete [] frame_buffers_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void PreDecodeFrameHook(
|
||||||
|
const libvpx_test::CompressedVideoSource &video,
|
||||||
|
libvpx_test::Decoder *decoder) {
|
||||||
|
// Use external buffers for testing jitter buffers.
|
||||||
|
if (num_jitter_buffers_ > 0 && video.frame_number() == 0) {
|
||||||
|
const int max_reference_buffers = 8;
|
||||||
|
|
||||||
|
// Add 1 for a work buffer.
|
||||||
|
num_buffers_ = max_reference_buffers + 1 + num_jitter_buffers_;
|
||||||
|
|
||||||
|
// Have libvpx use frame buffers we create.
|
||||||
|
frame_buffers_ = new vpx_codec_frame_buffer_t[num_buffers_];
|
||||||
|
memset(frame_buffers_, 0, sizeof(frame_buffers_[0]) * num_buffers_);
|
||||||
|
|
||||||
|
decoder->SetExternalFrameBuffers(frame_buffers_, num_buffers_,
|
||||||
|
realloc_vp9_frame_buffer, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn on frame buffer LRU cache.
|
||||||
|
decoder->Control(VP9D_SET_FRAME_BUFFER_LRU_CACHE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DecompressedFrameHook(const vpx_image_t &img,
|
||||||
|
const unsigned int frame_number) {
|
||||||
|
const uint32_t ximg_y_plane = 0;
|
||||||
|
const uint8_t *const y_buffer = img.planes[ximg_y_plane];
|
||||||
|
|
||||||
|
// Find which external buffer contains the y_buffer.
|
||||||
|
int i = 0;
|
||||||
|
for (i = 0; i < num_buffers_; ++i) {
|
||||||
|
if (y_buffer >= frame_buffers_[i].data &&
|
||||||
|
y_buffer < (frame_buffers_[i].data + frame_buffers_[i].size)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameBufferMD5Sum fb_md5;
|
||||||
|
fb_md5.frame_buffer_index = i;
|
||||||
|
fb_md5.img = img;
|
||||||
|
|
||||||
|
libvpx_test::MD5 md5;
|
||||||
|
md5.Add(&img);
|
||||||
|
fb_md5.md5 = md5.Get();
|
||||||
|
jitter_buffer_md5_sums_.push(fb_md5);
|
||||||
|
|
||||||
|
// Check to see if any of the reconstructed image changed.
|
||||||
|
if (jitter_buffer_md5_sums_.size() >
|
||||||
|
static_cast<size_t>(num_jitter_buffers_)) {
|
||||||
|
fb_md5 = jitter_buffer_md5_sums_.front();
|
||||||
|
|
||||||
|
libvpx_test::MD5 md5;
|
||||||
|
md5.Add(&fb_md5.img);
|
||||||
|
const std::string check_str = md5.Get();
|
||||||
|
|
||||||
|
ASSERT_EQ(fb_md5.md5, check_str);
|
||||||
|
jitter_buffer_md5_sums_.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
libvpx_test::CompressedVideoSource *OpenCompressedFile(
|
||||||
|
const std::string &filename) {
|
||||||
|
if (filename.substr(filename.length() - 3, 3) == "ivf") {
|
||||||
|
return new libvpx_test::IVFVideoSource(filename);
|
||||||
|
} else if (filename.substr(filename.length() - 4, 4) == "webm") {
|
||||||
|
return new libvpx_test::WebMVideoSource(filename);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_num_jitter_buffers(int num_buffers) {
|
||||||
|
num_jitter_buffers_ = num_buffers;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Total number of external frame buffers.
|
||||||
|
int num_buffers_;
|
||||||
|
int num_jitter_buffers_;
|
||||||
|
|
||||||
|
// External frame buffers used by libvpx.
|
||||||
|
vpx_codec_frame_buffer_t *frame_buffers_;
|
||||||
|
|
||||||
|
// Save the md5 checksums for later comparison.
|
||||||
|
std::queue<FrameBufferMD5Sum> jitter_buffer_md5_sums_;
|
||||||
|
};
|
||||||
|
|
||||||
|
// This test runs through a set of test vectors, and decodes them.
|
||||||
|
// Libvpx will call into the application to allocate a frame buffer when
|
||||||
|
// needed. The md5 checksums are computed for each frame after it is
|
||||||
|
// decoded and stored to be checked later. After a jitter frame buffer
|
||||||
|
// has expired, the md5 checksum is computed again for the expired jitter
|
||||||
|
// buffer frame and checked against the md5 checksum after the frame was
|
||||||
|
// decoded. If md5 checksums match, then the test is passed. Otherwise,
|
||||||
|
// the test failed.
|
||||||
|
TEST_P(LRUFrameBufferTest, CheckLRUOneJitterBuffer) {
|
||||||
|
const std::string filename = GET_PARAM(kVideoNameParam);
|
||||||
|
|
||||||
|
set_num_jitter_buffers(1);
|
||||||
|
|
||||||
|
libvpx_test::CompressedVideoSource *const video =
|
||||||
|
OpenCompressedFile(filename);
|
||||||
|
video->Init();
|
||||||
|
|
||||||
|
// Decode frame, and check the md5 matching.
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
|
delete video;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(LRUFrameBufferTest, CheckLRUFourJitterBuffers) {
|
||||||
|
const std::string filename = GET_PARAM(kVideoNameParam);
|
||||||
|
|
||||||
|
set_num_jitter_buffers(4);
|
||||||
|
|
||||||
|
libvpx_test::CompressedVideoSource *const video =
|
||||||
|
OpenCompressedFile(filename);
|
||||||
|
video->Init();
|
||||||
|
|
||||||
|
// Decode frame, and check the md5 matching.
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
|
delete video;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_P(LRUFrameBufferTest, CheckLRUEightJitterBuffers) {
|
||||||
|
const std::string filename = GET_PARAM(kVideoNameParam);
|
||||||
|
|
||||||
|
set_num_jitter_buffers(8);
|
||||||
|
|
||||||
|
libvpx_test::CompressedVideoSource *const video =
|
||||||
|
OpenCompressedFile(filename);
|
||||||
|
video->Init();
|
||||||
|
|
||||||
|
// Decode frame, and check the md5 matching.
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
|
||||||
|
delete video;
|
||||||
|
}
|
||||||
|
|
||||||
|
VP9_INSTANTIATE_TEST_CASE(LRUFrameBufferTest,
|
||||||
|
::testing::ValuesIn(kLRUTestVectors));
|
||||||
|
} // namespace
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBVPX_TEST_MD5_HELPER_H_
|
#ifndef TEST_MD5_HELPER_H_
|
||||||
#define LIBVPX_TEST_MD5_HELPER_H_
|
#define TEST_MD5_HELPER_H_
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "./md5_utils.h"
|
#include "./md5_utils.h"
|
||||||
@@ -25,9 +25,15 @@ class MD5 {
|
|||||||
|
|
||||||
void Add(const vpx_image_t *img) {
|
void Add(const vpx_image_t *img) {
|
||||||
for (int plane = 0; plane < 3; ++plane) {
|
for (int plane = 0; plane < 3; ++plane) {
|
||||||
uint8_t *buf = img->planes[plane];
|
const uint8_t *buf = img->planes[plane];
|
||||||
const int h = plane ? (img->d_h + 1) >> 1 : img->d_h;
|
// Calculate the width and height to do the md5 check. For the chroma
|
||||||
const int w = plane ? (img->d_w + 1) >> 1 : img->d_w;
|
// plane, we never want to round down and thus skip a pixel so if
|
||||||
|
// we are shifting by 1 (chroma_shift) we add 1 before doing the shift.
|
||||||
|
// This works only for chroma_shift of 0 and 1.
|
||||||
|
const int h = plane ? (img->d_h + img->y_chroma_shift) >>
|
||||||
|
img->y_chroma_shift : img->d_h;
|
||||||
|
const int w = plane ? (img->d_w + img->x_chroma_shift) >>
|
||||||
|
img->x_chroma_shift : img->d_w;
|
||||||
|
|
||||||
for (int y = 0; y < h; ++y) {
|
for (int y = 0; y < h; ++y) {
|
||||||
MD5Update(&md5_, buf, w);
|
MD5Update(&md5_, buf, w);
|
||||||
@@ -61,4 +67,4 @@ class MD5 {
|
|||||||
|
|
||||||
} // namespace libvpx_test
|
} // namespace libvpx_test
|
||||||
|
|
||||||
#endif // LIBVPX_TEST_MD5_HELPER_H_
|
#endif // TEST_MD5_HELPER_H_
|
||||||
|
|||||||
172
test/partial_idct_test.cc
Normal file
172
test/partial_idct_test.cc
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "test/acm_random.h"
|
||||||
|
#include "test/clear_system_state.h"
|
||||||
|
#include "test/register_state_check.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "./vp9_rtcd.h"
|
||||||
|
#include "vp9/common/vp9_blockd.h"
|
||||||
|
#include "vp9/common/vp9_scan.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride);
|
||||||
|
typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride);
|
||||||
|
typedef std::tr1::tuple<inv_txfm_t,
|
||||||
|
inv_txfm_t,
|
||||||
|
TX_SIZE, int> partial_itxfm_param_t;
|
||||||
|
const int kMaxNumCoeffs = 1024;
|
||||||
|
class PartialIDctTest : public ::testing::TestWithParam<partial_itxfm_param_t> {
|
||||||
|
public:
|
||||||
|
virtual ~PartialIDctTest() {}
|
||||||
|
virtual void SetUp() {
|
||||||
|
full_itxfm_ = GET_PARAM(0);
|
||||||
|
partial_itxfm_ = GET_PARAM(1);
|
||||||
|
tx_size_ = GET_PARAM(2);
|
||||||
|
last_nonzero_ = GET_PARAM(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() { libvpx_test::ClearSystemState(); }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int last_nonzero_;
|
||||||
|
TX_SIZE tx_size_;
|
||||||
|
inv_txfm_t full_itxfm_;
|
||||||
|
inv_txfm_t partial_itxfm_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_P(PartialIDctTest, ResultsMatch) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
int size;
|
||||||
|
switch (tx_size_) {
|
||||||
|
case TX_4X4:
|
||||||
|
size = 4;
|
||||||
|
break;
|
||||||
|
case TX_8X8:
|
||||||
|
size = 8;
|
||||||
|
break;
|
||||||
|
case TX_16X16:
|
||||||
|
size = 16;
|
||||||
|
break;
|
||||||
|
case TX_32X32:
|
||||||
|
size = 32;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
FAIL() << "Wrong Size!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_coef_block1, kMaxNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, int16_t, test_coef_block2, kMaxNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs);
|
||||||
|
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs);
|
||||||
|
const int count_test_block = 1000;
|
||||||
|
const int max_coeff = 32766 / 4;
|
||||||
|
const int block_size = size * size;
|
||||||
|
int max_error = 0;
|
||||||
|
for (int i = 0; i < count_test_block; ++i) {
|
||||||
|
// clear out destination buffer
|
||||||
|
memset(dst1, 0, sizeof(*dst1) * block_size);
|
||||||
|
memset(dst2, 0, sizeof(*dst2) * block_size);
|
||||||
|
memset(test_coef_block1, 0, sizeof(*test_coef_block1) * block_size);
|
||||||
|
memset(test_coef_block2, 0, sizeof(*test_coef_block2) * block_size);
|
||||||
|
int max_energy_leftover = max_coeff * max_coeff;
|
||||||
|
for (int j = 0; j < last_nonzero_; ++j) {
|
||||||
|
int16_t coef = static_cast<int16_t>(sqrt(max_energy_leftover) *
|
||||||
|
(rnd.Rand16() - 32768) / 65536);
|
||||||
|
max_energy_leftover -= coef * coef;
|
||||||
|
if (max_energy_leftover < 0) {
|
||||||
|
max_energy_leftover = 0;
|
||||||
|
coef = 0;
|
||||||
|
}
|
||||||
|
test_coef_block1[vp9_default_scan_orders[tx_size_].scan[j]] = coef;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy(test_coef_block2, test_coef_block1,
|
||||||
|
sizeof(*test_coef_block2) * block_size);
|
||||||
|
|
||||||
|
REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size));
|
||||||
|
REGISTER_STATE_CHECK(partial_itxfm_(test_coef_block2, dst2, size));
|
||||||
|
|
||||||
|
for (int j = 0; j < block_size; ++j) {
|
||||||
|
const int diff = dst1[j] - dst2[j];
|
||||||
|
const int error = diff * diff;
|
||||||
|
if (max_error < error)
|
||||||
|
max_error = error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPECT_EQ(0, max_error)
|
||||||
|
<< "Error: partial inverse transform produces different results";
|
||||||
|
}
|
||||||
|
using std::tr1::make_tuple;
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
C, PartialIDctTest,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(vp9_idct32x32_1024_add_c,
|
||||||
|
vp9_idct32x32_34_add_c,
|
||||||
|
TX_32X32, 34),
|
||||||
|
make_tuple(vp9_idct32x32_1024_add_c,
|
||||||
|
vp9_idct32x32_1_add_c,
|
||||||
|
TX_32X32, 1),
|
||||||
|
make_tuple(vp9_idct16x16_256_add_c,
|
||||||
|
vp9_idct16x16_10_add_c,
|
||||||
|
TX_16X16, 10),
|
||||||
|
make_tuple(vp9_idct16x16_256_add_c,
|
||||||
|
vp9_idct16x16_1_add_c,
|
||||||
|
TX_16X16, 1),
|
||||||
|
make_tuple(vp9_idct8x8_64_add_c,
|
||||||
|
vp9_idct8x8_10_add_c,
|
||||||
|
TX_8X8, 10),
|
||||||
|
make_tuple(vp9_idct8x8_64_add_c,
|
||||||
|
vp9_idct8x8_1_add_c,
|
||||||
|
TX_8X8, 1),
|
||||||
|
make_tuple(vp9_idct4x4_16_add_c,
|
||||||
|
vp9_idct4x4_1_add_c,
|
||||||
|
TX_4X4, 1)));
|
||||||
|
#if HAVE_SSE2
|
||||||
|
INSTANTIATE_TEST_CASE_P(
|
||||||
|
SSE2, PartialIDctTest,
|
||||||
|
::testing::Values(
|
||||||
|
make_tuple(vp9_idct32x32_1024_add_c,
|
||||||
|
vp9_idct32x32_34_add_sse2,
|
||||||
|
TX_32X32, 34),
|
||||||
|
make_tuple(vp9_idct32x32_1024_add_c,
|
||||||
|
vp9_idct32x32_1_add_sse2,
|
||||||
|
TX_32X32, 1),
|
||||||
|
make_tuple(vp9_idct16x16_256_add_c,
|
||||||
|
vp9_idct16x16_10_add_sse2,
|
||||||
|
TX_16X16, 10),
|
||||||
|
make_tuple(vp9_idct16x16_256_add_c,
|
||||||
|
vp9_idct16x16_1_add_sse2,
|
||||||
|
TX_16X16, 1),
|
||||||
|
make_tuple(vp9_idct8x8_64_add_c,
|
||||||
|
vp9_idct8x8_10_add_sse2,
|
||||||
|
TX_8X8, 10),
|
||||||
|
make_tuple(vp9_idct8x8_64_add_c,
|
||||||
|
vp9_idct8x8_1_add_sse2,
|
||||||
|
TX_8X8, 1),
|
||||||
|
make_tuple(vp9_idct4x4_16_add_c,
|
||||||
|
vp9_idct4x4_1_add_sse2,
|
||||||
|
TX_4X4, 1)));
|
||||||
|
#endif
|
||||||
|
} // namespace
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,8 @@ TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) {
|
|||||||
// Pointers to top-left pixel of block in the input and output images.
|
// Pointers to top-left pixel of block in the input and output images.
|
||||||
uint8_t *const src_image_ptr = src_image + (input_stride << 1);
|
uint8_t *const src_image_ptr = src_image + (input_stride << 1);
|
||||||
uint8_t *const dst_image_ptr = dst_image + 8;
|
uint8_t *const dst_image_ptr = dst_image + 8;
|
||||||
uint8_t *const flimits = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width));
|
uint8_t *const flimits =
|
||||||
|
reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width));
|
||||||
(void)vpx_memset(flimits, 255, block_width);
|
(void)vpx_memset(flimits, 255, block_width);
|
||||||
|
|
||||||
// Initialize pixels in the input:
|
// Initialize pixels in the input:
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LIBVPX_TEST_REGISTER_STATE_CHECK_H_
|
#ifndef TEST_REGISTER_STATE_CHECK_H_
|
||||||
#define LIBVPX_TEST_REGISTER_STATE_CHECK_H_
|
#define TEST_REGISTER_STATE_CHECK_H_
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
|
|
||||||
@@ -92,4 +92,4 @@ class RegisterStateCheck {};
|
|||||||
|
|
||||||
#endif // _WIN64
|
#endif // _WIN64
|
||||||
|
|
||||||
#endif // LIBVPX_TEST_REGISTER_STATE_CHECK_H_
|
#endif // TEST_REGISTER_STATE_CHECK_H_
|
||||||
|
|||||||
@@ -16,8 +16,68 @@
|
|||||||
#include "test/video_source.h"
|
#include "test/video_source.h"
|
||||||
#include "test/util.h"
|
#include "test/util.h"
|
||||||
|
|
||||||
|
// Enable(1) or Disable(0) writing of the compressed bitstream.
|
||||||
|
#define WRITE_COMPRESSED_STREAM 0
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
static void mem_put_le16(char *const mem, const unsigned int val) {
|
||||||
|
mem[0] = val;
|
||||||
|
mem[1] = val >> 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void mem_put_le32(char *const mem, const unsigned int val) {
|
||||||
|
mem[0] = val;
|
||||||
|
mem[1] = val >> 8;
|
||||||
|
mem[2] = val >> 16;
|
||||||
|
mem[3] = val >> 24;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void write_ivf_file_header(const vpx_codec_enc_cfg_t *const cfg,
|
||||||
|
int frame_cnt, FILE *const outfile) {
|
||||||
|
char header[32];
|
||||||
|
|
||||||
|
header[0] = 'D';
|
||||||
|
header[1] = 'K';
|
||||||
|
header[2] = 'I';
|
||||||
|
header[3] = 'F';
|
||||||
|
mem_put_le16(header + 4, 0); /* version */
|
||||||
|
mem_put_le16(header + 6, 32); /* headersize */
|
||||||
|
mem_put_le32(header + 8, 0x30395056); /* fourcc (vp9) */
|
||||||
|
mem_put_le16(header + 12, cfg->g_w); /* width */
|
||||||
|
mem_put_le16(header + 14, cfg->g_h); /* height */
|
||||||
|
mem_put_le32(header + 16, cfg->g_timebase.den); /* rate */
|
||||||
|
mem_put_le32(header + 20, cfg->g_timebase.num); /* scale */
|
||||||
|
mem_put_le32(header + 24, frame_cnt); /* length */
|
||||||
|
mem_put_le32(header + 28, 0); /* unused */
|
||||||
|
|
||||||
|
(void)fwrite(header, 1, 32, outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void write_ivf_frame_size(FILE *const outfile, const size_t size) {
|
||||||
|
char header[4];
|
||||||
|
mem_put_le32(header, static_cast<unsigned int>(size));
|
||||||
|
(void)fwrite(header, 1, 4, outfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void write_ivf_frame_header(const vpx_codec_cx_pkt_t *const pkt,
|
||||||
|
FILE *const outfile) {
|
||||||
|
char header[12];
|
||||||
|
vpx_codec_pts_t pts;
|
||||||
|
|
||||||
|
if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pts = pkt->data.frame.pts;
|
||||||
|
mem_put_le32(header, static_cast<unsigned int>(pkt->data.frame.sz));
|
||||||
|
mem_put_le32(header + 4, pts & 0xFFFFFFFF);
|
||||||
|
mem_put_le32(header + 8, pts >> 32);
|
||||||
|
|
||||||
|
(void)fwrite(header, 1, 12, outfile);
|
||||||
|
}
|
||||||
|
#endif // WRITE_COMPRESSED_STREAM
|
||||||
|
|
||||||
const unsigned int kInitialWidth = 320;
|
const unsigned int kInitialWidth = 320;
|
||||||
const unsigned int kInitialHeight = 240;
|
const unsigned int kInitialHeight = 240;
|
||||||
|
|
||||||
@@ -42,6 +102,8 @@ class ResizingVideoSource : public ::libvpx_test::DummyVideoSource {
|
|||||||
limit_ = 60;
|
limit_ = 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~ResizingVideoSource() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void Next() {
|
virtual void Next() {
|
||||||
++frame_;
|
++frame_;
|
||||||
@@ -56,6 +118,8 @@ class ResizeTest : public ::libvpx_test::EncoderTest,
|
|||||||
protected:
|
protected:
|
||||||
ResizeTest() : EncoderTest(GET_PARAM(0)) {}
|
ResizeTest() : EncoderTest(GET_PARAM(0)) {}
|
||||||
|
|
||||||
|
virtual ~ResizeTest() {}
|
||||||
|
|
||||||
struct FrameInfo {
|
struct FrameInfo {
|
||||||
FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)
|
FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)
|
||||||
: pts(_pts), w(_w), h(_h) {}
|
: pts(_pts), w(_w), h(_h) {}
|
||||||
@@ -95,17 +159,47 @@ TEST_P(ResizeTest, TestExternalResizeWorks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const unsigned int kStepDownFrame = 3;
|
||||||
|
const unsigned int kStepUpFrame = 6;
|
||||||
|
|
||||||
class ResizeInternalTest : public ResizeTest {
|
class ResizeInternalTest : public ResizeTest {
|
||||||
protected:
|
protected:
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
ResizeInternalTest()
|
||||||
|
: ResizeTest(),
|
||||||
|
frame0_psnr_(0.0),
|
||||||
|
outfile_(NULL),
|
||||||
|
out_frames_(0) {}
|
||||||
|
#else
|
||||||
ResizeInternalTest() : ResizeTest(), frame0_psnr_(0.0) {}
|
ResizeInternalTest() : ResizeTest(), frame0_psnr_(0.0) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual ~ResizeInternalTest() {}
|
||||||
|
|
||||||
|
virtual void BeginPassHook(unsigned int /*pass*/) {
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
outfile_ = fopen("vp90-2-05-resize.ivf", "wb");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void EndPassHook() {
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
if (outfile_) {
|
||||||
|
if (!fseek(outfile_, 0, SEEK_SET))
|
||||||
|
write_ivf_file_header(&cfg_, out_frames_, outfile_);
|
||||||
|
fclose(outfile_);
|
||||||
|
outfile_ = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
|
||||||
libvpx_test::Encoder *encoder) {
|
libvpx_test::Encoder *encoder) {
|
||||||
if (video->frame() == 3) {
|
if (video->frame() == kStepDownFrame) {
|
||||||
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
struct vpx_scaling_mode mode = {VP8E_FOURFIVE, VP8E_THREEFIVE};
|
||||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||||
}
|
}
|
||||||
if (video->frame() == 6) {
|
if (video->frame() == kStepUpFrame) {
|
||||||
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
|
struct vpx_scaling_mode mode = {VP8E_NORMAL, VP8E_NORMAL};
|
||||||
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
encoder->Control(VP8E_SET_SCALEMODE, &mode);
|
||||||
}
|
}
|
||||||
@@ -114,24 +208,49 @@ class ResizeInternalTest : public ResizeTest {
|
|||||||
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
|
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||||
if (!frame0_psnr_)
|
if (!frame0_psnr_)
|
||||||
frame0_psnr_ = pkt->data.psnr.psnr[0];
|
frame0_psnr_ = pkt->data.psnr.psnr[0];
|
||||||
EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 1.0);
|
EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 1.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
++out_frames_;
|
||||||
|
|
||||||
|
// Write initial file header if first frame.
|
||||||
|
if (pkt->data.frame.pts == 0)
|
||||||
|
write_ivf_file_header(&cfg_, 0, outfile_);
|
||||||
|
|
||||||
|
// Write frame header and data.
|
||||||
|
write_ivf_frame_header(pkt, outfile_);
|
||||||
|
(void)fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz, outfile_);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
double frame0_psnr_;
|
double frame0_psnr_;
|
||||||
|
#if WRITE_COMPRESSED_STREAM
|
||||||
|
FILE *outfile_;
|
||||||
|
unsigned int out_frames_;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
|
||||||
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||||
30, 1, 0, 10);
|
30, 1, 0, 10);
|
||||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
|
|
||||||
// q picked such that initial keyframe on this clip is ~30dB PSNR
|
// q picked such that initial keyframe on this clip is ~30dB PSNR
|
||||||
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
cfg_.rc_min_quantizer = cfg_.rc_max_quantizer = 48;
|
||||||
|
|
||||||
|
// If the number of frames being encoded is smaller than g_lag_in_frames
|
||||||
|
// the encoded frame is unavailable using the current API. Comparing
|
||||||
|
// frames to detect mismatch would then not be possible. Set
|
||||||
|
// g_lag_in_frames = 0 to get around this.
|
||||||
|
cfg_.g_lag_in_frames = 0;
|
||||||
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||||
|
|
||||||
for (std::vector<FrameInfo>::iterator info = frame_info_list_.begin();
|
for (std::vector<FrameInfo>::iterator info = frame_info_list_.begin();
|
||||||
info != frame_info_list_.end(); ++info) {
|
info != frame_info_list_.end(); ++info) {
|
||||||
const vpx_codec_pts_t pts = info->pts;
|
const vpx_codec_pts_t pts = info->pts;
|
||||||
if (pts >= 3 && pts < 6) {
|
if (pts >= kStepDownFrame && pts < kStepUpFrame) {
|
||||||
ASSERT_EQ(282U, info->w) << "Frame " << pts << " had unexpected width";
|
ASSERT_EQ(282U, info->w) << "Frame " << pts << " had unexpected width";
|
||||||
ASSERT_EQ(173U, info->h) << "Frame " << pts << " had unexpected height";
|
ASSERT_EQ(173U, info->h) << "Frame " << pts << " had unexpected height";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ extern "C" {
|
|||||||
#include "./vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#if CONFIG_VP8_ENCODER
|
#if CONFIG_VP8_ENCODER
|
||||||
#include "./vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
//#include "vp8/common/blockd.h"
|
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
#include "./vp9_rtcd.h"
|
#include "./vp9_rtcd.h"
|
||||||
|
|||||||
@@ -17,15 +17,19 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "test/acm_random.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp8/encoder/onyx_int.h"
|
#include "vp8/encoder/onyx_int.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using libvpx_test::ACMRandom;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
TEST(Vp8RoiMapTest, ParameterCheck) {
|
TEST(Vp8RoiMapTest, ParameterCheck) {
|
||||||
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
int delta_q[MAX_MB_SEGMENTS] = { -2, -25, 0, 31 };
|
int delta_q[MAX_MB_SEGMENTS] = { -2, -25, 0, 31 };
|
||||||
int delta_lf[MAX_MB_SEGMENTS] = { -2, -25, 0, 31 };
|
int delta_lf[MAX_MB_SEGMENTS] = { -2, -25, 0, 31 };
|
||||||
unsigned int threshold[MAX_MB_SEGMENTS] = { 0, 100, 200, 300 };
|
unsigned int threshold[MAX_MB_SEGMENTS] = { 0, 100, 200, 300 };
|
||||||
@@ -121,10 +125,10 @@ TEST(Vp8RoiMapTest, ParameterCheck) {
|
|||||||
for (int i = 0; i < 1000; ++i) {
|
for (int i = 0; i < 1000; ++i) {
|
||||||
int rand_deltas[4];
|
int rand_deltas[4];
|
||||||
int deltas_valid;
|
int deltas_valid;
|
||||||
rand_deltas[0] = (rand() % 160) - 80;
|
rand_deltas[0] = rnd(160) - 80;
|
||||||
rand_deltas[1] = (rand() % 160) - 80;
|
rand_deltas[1] = rnd(160) - 80;
|
||||||
rand_deltas[2] = (rand() % 160) - 80;
|
rand_deltas[2] = rnd(160) - 80;
|
||||||
rand_deltas[3] = (rand() % 160) - 80;
|
rand_deltas[3] = rnd(160) - 80;
|
||||||
|
|
||||||
deltas_valid = ((abs(rand_deltas[0]) <= 63) &&
|
deltas_valid = ((abs(rand_deltas[0]) <= 63) &&
|
||||||
(abs(rand_deltas[1]) <= 63) &&
|
(abs(rand_deltas[1]) <= 63) &&
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
* tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -32,7 +32,10 @@ typedef void (*sixtap_predict_fn_t)(uint8_t *src_ptr,
|
|||||||
uint8_t *dst_ptr,
|
uint8_t *dst_ptr,
|
||||||
int dst_pitch);
|
int dst_pitch);
|
||||||
|
|
||||||
class SixtapPredictTest : public PARAMS(int, int, sixtap_predict_fn_t) {
|
typedef std::tr1::tuple<int, int, sixtap_predict_fn_t> sixtap_predict_param_t;
|
||||||
|
|
||||||
|
class SixtapPredictTest
|
||||||
|
: public ::testing::TestWithParam<sixtap_predict_param_t> {
|
||||||
public:
|
public:
|
||||||
static void SetUpTestCase() {
|
static void SetUpTestCase() {
|
||||||
src_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kSrcSize));
|
src_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kSrcSize));
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
#include "test/clear_system_state.h"
|
#include "test/clear_system_state.h"
|
||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
#include "vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
#include "vp8/common/blockd.h"
|
#include "vp8/common/blockd.h"
|
||||||
#include "vp8/encoder/block.h"
|
#include "vp8/encoder/block.h"
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
@@ -51,7 +51,7 @@ TEST_P(SubtractBlockTest, SimpleSubtract) {
|
|||||||
bd.predictor = reinterpret_cast<unsigned char*>(
|
bd.predictor = reinterpret_cast<unsigned char*>(
|
||||||
vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*bd.predictor)));
|
vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*bd.predictor)));
|
||||||
|
|
||||||
for(int i = 0; kSrcStride[i] > 0; ++i) {
|
for (int i = 0; kSrcStride[i] > 0; ++i) {
|
||||||
// start at block0
|
// start at block0
|
||||||
be.src = 0;
|
be.src = 0;
|
||||||
be.base_src = &source;
|
be.base_src = &source;
|
||||||
|
|||||||
337
test/svc_test.cc
Normal file
337
test/svc_test.cc
Normal file
@@ -0,0 +1,337 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
#include "test/codec_factory.h"
|
||||||
|
#include "test/decode_test_driver.h"
|
||||||
|
#include "test/i420_video_source.h"
|
||||||
|
#include "vpx/svc_context.h"
|
||||||
|
#include "vpx/vp8cx.h"
|
||||||
|
#include "vpx/vpx_encoder.h"
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
|
using libvpx_test::CodecFactory;
|
||||||
|
using libvpx_test::Decoder;
|
||||||
|
using libvpx_test::VP9CodecFactory;
|
||||||
|
|
||||||
|
class SvcTest : public ::testing::Test {
|
||||||
|
protected:
|
||||||
|
static const uint32_t kWidth = 352;
|
||||||
|
static const uint32_t kHeight = 288;
|
||||||
|
|
||||||
|
SvcTest()
|
||||||
|
: codec_iface_(0),
|
||||||
|
test_file_name_("hantro_collage_w352h288.yuv"),
|
||||||
|
codec_initialized_(false),
|
||||||
|
decoder_(0) {
|
||||||
|
memset(&svc_, 0, sizeof(svc_));
|
||||||
|
memset(&codec_, 0, sizeof(codec_));
|
||||||
|
memset(&codec_enc_, 0, sizeof(codec_enc_));
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~SvcTest() {}
|
||||||
|
|
||||||
|
virtual void SetUp() {
|
||||||
|
svc_.encoding_mode = INTER_LAYER_PREDICTION_IP;
|
||||||
|
svc_.log_level = SVC_LOG_DEBUG;
|
||||||
|
svc_.log_print = 0;
|
||||||
|
|
||||||
|
codec_iface_ = vpx_codec_vp9_cx();
|
||||||
|
const vpx_codec_err_t res =
|
||||||
|
vpx_codec_enc_config_default(codec_iface_, &codec_enc_, 0);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
|
||||||
|
codec_enc_.g_w = kWidth;
|
||||||
|
codec_enc_.g_h = kHeight;
|
||||||
|
codec_enc_.g_timebase.num = 1;
|
||||||
|
codec_enc_.g_timebase.den = 60;
|
||||||
|
codec_enc_.kf_min_dist = 100;
|
||||||
|
codec_enc_.kf_max_dist = 100;
|
||||||
|
|
||||||
|
vpx_codec_dec_cfg_t dec_cfg = {0};
|
||||||
|
VP9CodecFactory codec_factory;
|
||||||
|
decoder_ = codec_factory.CreateDecoder(dec_cfg, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void TearDown() {
|
||||||
|
vpx_svc_release(&svc_);
|
||||||
|
delete(decoder_);
|
||||||
|
if (codec_initialized_) vpx_codec_destroy(&codec_);
|
||||||
|
}
|
||||||
|
|
||||||
|
SvcContext svc_;
|
||||||
|
vpx_codec_ctx_t codec_;
|
||||||
|
struct vpx_codec_enc_cfg codec_enc_;
|
||||||
|
vpx_codec_iface_t *codec_iface_;
|
||||||
|
std::string test_file_name_;
|
||||||
|
bool codec_initialized_;
|
||||||
|
Decoder *decoder_;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SvcInit) {
|
||||||
|
// test missing parameters
|
||||||
|
vpx_codec_err_t res = vpx_svc_init(NULL, &codec_, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
res = vpx_svc_init(&svc_, NULL, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, NULL, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, codec_iface_, NULL);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
svc_.spatial_layers = 6; // too many layers
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
svc_.spatial_layers = 0; // use default layers
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
EXPECT_EQ(VPX_SS_DEFAULT_LAYERS, svc_.spatial_layers);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, InitTwoLayers) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_svc_set_scale_factors(&svc_, "4/16,16*16"); // invalid scale values
|
||||||
|
vpx_codec_err_t res = vpx_svc_init(&svc_, &codec_, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
vpx_svc_set_scale_factors(&svc_, "4/16,16/16"); // valid scale values
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, codec_iface_, &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, InvalidOptions) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_options(&svc_, NULL);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_options(&svc_, "not-an-option=1");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetLayersOption) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_options(&svc_, "layers=3");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
EXPECT_EQ(3, svc_.spatial_layers);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetEncodingMode) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_options(&svc_, "encoding-mode=alt-ip");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
EXPECT_EQ(ALT_INTER_LAYER_PREDICTION_IP, svc_.encoding_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetMultipleOptions) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_options(&svc_, "layers=2 encoding-mode=ip");
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
EXPECT_EQ(2, svc_.spatial_layers);
|
||||||
|
EXPECT_EQ(INTER_LAYER_PREDICTION_IP, svc_.encoding_mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetScaleFactorsOption) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_codec_err_t res =
|
||||||
|
vpx_svc_set_options(&svc_, "scale-factors=not-scale-factors");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_options(&svc_, "scale-factors=1/3,2/3");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetQuantizersOption) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_options(&svc_, "quantizers=not-quantizers");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
vpx_svc_set_options(&svc_, "quantizers=40,45");
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetQuantizers) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_quantizers(NULL, "40,30");
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_quantizers(&svc_, NULL);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
res = vpx_svc_set_quantizers(&svc_, "40");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_quantizers(&svc_, "40,30");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, SetScaleFactors) {
|
||||||
|
vpx_codec_err_t res = vpx_svc_set_scale_factors(NULL, "4/16,16/16");
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_scale_factors(&svc_, NULL);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
res = vpx_svc_set_scale_factors(&svc_, "4/16");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test that decoder can handle an SVC frame as the first frame in a sequence.
|
||||||
|
TEST_F(SvcTest, FirstFrameHasLayers) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
|
||||||
|
vpx_svc_set_quantizers(&svc_, "40,30");
|
||||||
|
|
||||||
|
vpx_codec_err_t res =
|
||||||
|
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
|
||||||
|
libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
|
||||||
|
codec_enc_.g_timebase.den,
|
||||||
|
codec_enc_.g_timebase.num, 0, 30);
|
||||||
|
video.Begin();
|
||||||
|
|
||||||
|
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
|
||||||
|
video.duration(), VPX_DL_REALTIME);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
|
||||||
|
const vpx_codec_err_t res_dec = decoder_->DecodeFrame(
|
||||||
|
static_cast<const uint8_t *>(vpx_svc_get_buffer(&svc_)),
|
||||||
|
vpx_svc_get_frame_size(&svc_));
|
||||||
|
|
||||||
|
// this test fails with a decoder error
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, EncodeThreeFrames) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
|
||||||
|
vpx_svc_set_quantizers(&svc_, "40,30");
|
||||||
|
|
||||||
|
vpx_codec_err_t res =
|
||||||
|
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
|
||||||
|
libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
|
||||||
|
codec_enc_.g_timebase.den,
|
||||||
|
codec_enc_.g_timebase.num, 0, 30);
|
||||||
|
// FRAME 0
|
||||||
|
video.Begin();
|
||||||
|
// This frame is a keyframe.
|
||||||
|
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
|
||||||
|
video.duration(), VPX_DL_REALTIME);
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res);
|
||||||
|
EXPECT_EQ(1, vpx_svc_is_keyframe(&svc_));
|
||||||
|
|
||||||
|
vpx_codec_err_t res_dec = decoder_->DecodeFrame(
|
||||||
|
static_cast<const uint8_t *>(vpx_svc_get_buffer(&svc_)),
|
||||||
|
vpx_svc_get_frame_size(&svc_));
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
|
||||||
|
|
||||||
|
// FRAME 1
|
||||||
|
video.Next();
|
||||||
|
// This is a P-frame.
|
||||||
|
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
|
||||||
|
video.duration(), VPX_DL_REALTIME);
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res);
|
||||||
|
EXPECT_EQ(0, vpx_svc_is_keyframe(&svc_));
|
||||||
|
|
||||||
|
res_dec = decoder_->DecodeFrame(
|
||||||
|
static_cast<const uint8_t *>(vpx_svc_get_buffer(&svc_)),
|
||||||
|
vpx_svc_get_frame_size(&svc_));
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
|
||||||
|
|
||||||
|
// FRAME 2
|
||||||
|
video.Next();
|
||||||
|
// This is a P-frame.
|
||||||
|
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
|
||||||
|
video.duration(), VPX_DL_REALTIME);
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res);
|
||||||
|
EXPECT_EQ(0, vpx_svc_is_keyframe(&svc_));
|
||||||
|
|
||||||
|
res_dec = decoder_->DecodeFrame(
|
||||||
|
static_cast<const uint8_t *>(vpx_svc_get_buffer(&svc_)),
|
||||||
|
vpx_svc_get_frame_size(&svc_));
|
||||||
|
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SvcTest, GetLayerResolution) {
|
||||||
|
svc_.spatial_layers = 2;
|
||||||
|
vpx_svc_set_scale_factors(&svc_, "4/16,8/16");
|
||||||
|
vpx_svc_set_quantizers(&svc_, "40,30");
|
||||||
|
|
||||||
|
vpx_codec_err_t res =
|
||||||
|
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
codec_initialized_ = true;
|
||||||
|
|
||||||
|
// ensure that requested layer is a valid layer
|
||||||
|
uint32_t layer_width, layer_height;
|
||||||
|
res = vpx_svc_get_layer_resolution(&svc_, svc_.spatial_layers,
|
||||||
|
&layer_width, &layer_height);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_get_layer_resolution(NULL, 0, &layer_width, &layer_height);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_get_layer_resolution(&svc_, 0, NULL, &layer_height);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_get_layer_resolution(&svc_, 0, &layer_width, NULL);
|
||||||
|
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
|
||||||
|
|
||||||
|
res = vpx_svc_get_layer_resolution(&svc_, 0, &layer_width, &layer_height);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
EXPECT_EQ(kWidth * 4 / 16, layer_width);
|
||||||
|
EXPECT_EQ(kHeight * 4 / 16, layer_height);
|
||||||
|
|
||||||
|
res = vpx_svc_get_layer_resolution(&svc_, 1, &layer_width, &layer_height);
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res);
|
||||||
|
EXPECT_EQ(kWidth * 8 / 16, layer_width);
|
||||||
|
EXPECT_EQ(kHeight * 8 / 16, layer_height);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
@@ -61,6 +61,7 @@ c87599cbecd72d4cd4f7ace3313b7a6bc6eb8163 vp80-05-sharpness-1438.ivf
|
|||||||
aff51d865c2621b60510459244ea83e958e4baed vp80-05-sharpness-1439.ivf
|
aff51d865c2621b60510459244ea83e958e4baed vp80-05-sharpness-1439.ivf
|
||||||
da386e72b19b5485a6af199c5eb60ef25e510dd1 vp80-05-sharpness-1440.ivf
|
da386e72b19b5485a6af199c5eb60ef25e510dd1 vp80-05-sharpness-1440.ivf
|
||||||
6759a095203d96ccd267ce09b1b050b8cc4c2f1f vp80-05-sharpness-1443.ivf
|
6759a095203d96ccd267ce09b1b050b8cc4c2f1f vp80-05-sharpness-1443.ivf
|
||||||
|
b95d3cc1d0df991e63e150a801710a72f20d9ba0 vp80-06-smallsize.ivf
|
||||||
db55ec7fd02c864ba996ff060b25b1e08611330b vp80-00-comprehensive-001.ivf.md5
|
db55ec7fd02c864ba996ff060b25b1e08611330b vp80-00-comprehensive-001.ivf.md5
|
||||||
29db0ad011cba1e45f856d5623cd38dac3e3bf19 vp80-00-comprehensive-002.ivf.md5
|
29db0ad011cba1e45f856d5623cd38dac3e3bf19 vp80-00-comprehensive-002.ivf.md5
|
||||||
e84f258f69e173e7d68f8f8c037a0a3766902182 vp80-00-comprehensive-003.ivf.md5
|
e84f258f69e173e7d68f8f8c037a0a3766902182 vp80-00-comprehensive-003.ivf.md5
|
||||||
@@ -122,6 +123,7 @@ f95eb6214571434f1f73ab7833b9ccdf47588020 vp80-03-segmentation-1437.ivf.md5
|
|||||||
086c56378df81b6cee264d7540a7b8f2b405c7a4 vp80-05-sharpness-1439.ivf.md5
|
086c56378df81b6cee264d7540a7b8f2b405c7a4 vp80-05-sharpness-1439.ivf.md5
|
||||||
d32dc2c4165eb266ea4c23c14a45459b363def32 vp80-05-sharpness-1440.ivf.md5
|
d32dc2c4165eb266ea4c23c14a45459b363def32 vp80-05-sharpness-1440.ivf.md5
|
||||||
8c69dc3d8e563f56ffab5ad1e400d9e689dd23df vp80-05-sharpness-1443.ivf.md5
|
8c69dc3d8e563f56ffab5ad1e400d9e689dd23df vp80-05-sharpness-1443.ivf.md5
|
||||||
|
d6f246df012c241b5fa6c1345019a3703d85c419 vp80-06-smallsize.ivf.md5
|
||||||
ce881e567fe1d0fbcb2d3e9e6281a1a8d74d82e0 vp90-2-00-quantizer-00.webm
|
ce881e567fe1d0fbcb2d3e9e6281a1a8d74d82e0 vp90-2-00-quantizer-00.webm
|
||||||
ac5eda33407d0521c7afca43a63fd305c0cd9d13 vp90-2-00-quantizer-00.webm.md5
|
ac5eda33407d0521c7afca43a63fd305c0cd9d13 vp90-2-00-quantizer-00.webm.md5
|
||||||
2ca0463f2cfb93d25d7dded174db70b7cb87cb48 vp90-2-00-quantizer-01.webm
|
2ca0463f2cfb93d25d7dded174db70b7cb87cb48 vp90-2-00-quantizer-01.webm
|
||||||
@@ -520,3 +522,54 @@ d17bc08eedfc60c4c23d576a6c964a21bf854d1f vp90-2-03-size-226x202.webm
|
|||||||
83c6d8f2969b759e10e5c6542baca1265c874c29 vp90-2-03-size-226x224.webm.md5
|
83c6d8f2969b759e10e5c6542baca1265c874c29 vp90-2-03-size-226x224.webm.md5
|
||||||
fe0af2ee47b1e5f6a66db369e2d7e9d870b38dce vp90-2-03-size-226x226.webm
|
fe0af2ee47b1e5f6a66db369e2d7e9d870b38dce vp90-2-03-size-226x226.webm
|
||||||
94ad19b8b699cea105e2ff18f0df2afd7242bcf7 vp90-2-03-size-226x226.webm.md5
|
94ad19b8b699cea105e2ff18f0df2afd7242bcf7 vp90-2-03-size-226x226.webm.md5
|
||||||
|
b6524e4084d15b5d0caaa3d3d1368db30cbee69c vp90-2-03-deltaq.webm
|
||||||
|
65f45ec9a55537aac76104818278e0978f94a678 vp90-2-03-deltaq.webm.md5
|
||||||
|
4dbb87494c7f565ffc266c98d17d0d8c7a5c5aba vp90-2-05-resize.ivf
|
||||||
|
7f6d8879336239a43dbb6c9f13178cb11cf7ed09 vp90-2-05-resize.ivf.md5
|
||||||
|
bf61ddc1f716eba58d4c9837d4e91031d9ce4ffe vp90-2-06-bilinear.webm
|
||||||
|
f6235f937552e11d8eb331ec55da6b3aa596b9ac vp90-2-06-bilinear.webm.md5
|
||||||
|
495256cfd123fe777b2c0406862ed8468a1f4677 vp91-2-04-yv444.webm
|
||||||
|
65e3a7ffef61ab340d9140f335ecc49125970c2c vp91-2-04-yv444.webm.md5
|
||||||
|
0c83a1e414fde3bccd6dc451bbaee68e59974c76 vp90-2-07-frame_parallel.webm
|
||||||
|
e5c2c9fb383e5bf3b563480adaeba5b7e3475ecd vp90-2-07-frame_parallel.webm.md5
|
||||||
|
086c7edcffd699ae7d99d710fd7e53b18910ca5b vp90-2-08-tile_1x2_frame_parallel.webm
|
||||||
|
e981ecaabb29a80e0cbc1f4002384965ce8e95bb vp90-2-08-tile_1x2_frame_parallel.webm.md5
|
||||||
|
ed79be026a6f28646c5825da1c12d1fbc70f96a4 vp90-2-08-tile_1x2.webm
|
||||||
|
45b404e025841c9750895fc1a9f6bd384fe6a315 vp90-2-08-tile_1x2.webm.md5
|
||||||
|
cf8ea970c776797aae71dac8317ea926d9431cab vp90-2-08-tile_1x4_frame_parallel.webm
|
||||||
|
a481fbea465010b57af5a19ebf6d4a5cfe5b9278 vp90-2-08-tile_1x4_frame_parallel.webm.md5
|
||||||
|
0203ec456277a01aec401e7fb6c72c9a7e5e3f9d vp90-2-08-tile_1x4.webm
|
||||||
|
c9b237dfcc01c1b414fbcaa481d014a906ef7998 vp90-2-08-tile_1x4.webm.md5
|
||||||
|
20c75157e91ab41f82f70ffa73d5d01df8469287 vp90-2-08-tile-4x4.webm
|
||||||
|
ae7451810247fd13975cc257aa0301ff17102255 vp90-2-08-tile-4x4.webm.md5
|
||||||
|
2ec6e15422ac7a61af072dc5f27fcaf1942ce116 vp90-2-08-tile-4x1.webm
|
||||||
|
0094f5ee5e46345017c30e0aa4835b550212d853 vp90-2-08-tile-4x1.webm.md5
|
||||||
|
edea45dac4a3c2e5372339f8851d24c9bef803d6 vp90-2-09-subpixel-00.ivf
|
||||||
|
5428efc4bf92191faedf4a727fcd1d94966a7abc vp90-2-09-subpixel-00.ivf.md5
|
||||||
|
8cdd435d89029987ee196896e21520e5f879f04d vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
|
||||||
|
091b373aa2ecb59aa5c647affd5bcafcc7547364 vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
|
||||||
|
87ee28032b0963a44b73a850fcc816a6dc83efbb vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
|
||||||
|
c6ce25c4bfd4bdfc2932b70428e3dfe11210ec4f vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
|
||||||
|
2064bdb22aa71c2691e0469fb62e8087a43f08f8 vp90-2-bbb_426x240_tile_1x1_180kbps.webm
|
||||||
|
8080eda22694910162f0996e8a962612f381a57f vp90-2-bbb_640x360_tile_1x2_337kbps.webm
|
||||||
|
a484b335c27ea189c0f0d77babea4a510ce12d50 vp90-2-bbb_854x480_tile_1x2_651kbps.webm
|
||||||
|
3eacf1f006250be4cc5c92a7ef146e385ee62653 vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
|
||||||
|
217f089a16447490823127b36ce0d945522accfd vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
|
||||||
|
eedb3c641e60dacbe082491a16df529a5c9187df vp90-2-sintel_426x182_tile_1x1_171kbps.webm
|
||||||
|
cb7e4955af183dff33bcba0c837f0922ab066400 vp90-2-sintel_640x272_tile_1x2_318kbps.webm
|
||||||
|
48613f9380e2580002f8a09d6e412ea4e89a52b9 vp90-2-sintel_854x364_tile_1x2_621kbps.webm
|
||||||
|
990a91f24dd284562d21d714ae773dff5452cad8 vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
|
||||||
|
b6dd558c90bca466b4bcbd03b3371648186465a7 vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
|
||||||
|
1a9c2914ba932a38f0a143efc1ad0e318e78888b vp90-2-tos_426x178_tile_1x1_181kbps.webm
|
||||||
|
a3d2b09f24debad4747a1b3066f572be4273bced vp90-2-tos_640x266_tile_1x2_336kbps.webm
|
||||||
|
c64b03b5c090e6888cb39685c31f00a6b79fa45c vp90-2-tos_854x356_tile_1x2_656kbps.webm
|
||||||
|
0e7cd4135b231c9cea8d76c19f9e84b6fd77acec vp90-2-08-tile_1x8_frame_parallel.webm
|
||||||
|
c9b6850af28579b031791066457f4cb40df6e1c7 vp90-2-08-tile_1x8_frame_parallel.webm.md5
|
||||||
|
e448b6e83490bca0f8d58b4f4b1126a17baf4b0c vp90-2-08-tile_1x8.webm
|
||||||
|
5e524165f0397e6141d914f4f0a66267d7658376 vp90-2-08-tile_1x8.webm.md5
|
||||||
|
a34e14923d6d17b1144254d8187d7f85b700a63c vp90-2-02-size-lf-1920x1080.webm
|
||||||
|
e3b28ddcfaeb37fb4d132b93f92642a9ad17c22d vp90-2-02-size-lf-1920x1080.webm.md5
|
||||||
|
d48c5db1b0f8e60521a7c749696b8067886033a3 vp90-2-09-aq2.webm
|
||||||
|
84c1599298aac78f2fc05ae2274575d10569dfa0 vp90-2-09-aq2.webm.md5
|
||||||
|
55fc55ed73d578ed60fad05692579873f8bad758 vp90-2-09-lf_deltas.webm
|
||||||
|
54638c38009198c38c8f3b25c182b709b6c1fd2e vp90-2-09-lf_deltas.webm.md5
|
||||||
|
|||||||
88
test/test.mk
88
test/test.mk
@@ -7,6 +7,8 @@ LIBVPX_TEST_SRCS-yes += codec_factory.h
|
|||||||
LIBVPX_TEST_SRCS-yes += test_libvpx.cc
|
LIBVPX_TEST_SRCS-yes += test_libvpx.cc
|
||||||
LIBVPX_TEST_SRCS-yes += util.h
|
LIBVPX_TEST_SRCS-yes += util.h
|
||||||
LIBVPX_TEST_SRCS-yes += video_source.h
|
LIBVPX_TEST_SRCS-yes += video_source.h
|
||||||
|
LIBVPX_TEST_SRCS-yes += test_vectors.h
|
||||||
|
LIBVPX_TEST_SRCS-yes += test_vectors.cc
|
||||||
|
|
||||||
##
|
##
|
||||||
## BLACK BOX TESTS
|
## BLACK BOX TESTS
|
||||||
@@ -24,7 +26,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += error_resilience_test.cc
|
|||||||
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h
|
LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += resize_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += resize_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_lossless_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_lossless_test.cc
|
||||||
|
|
||||||
@@ -32,6 +34,8 @@ LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../md5_utils.h ../md5_utils.c
|
|||||||
LIBVPX_TEST_SRCS-yes += decode_test_driver.cc
|
LIBVPX_TEST_SRCS-yes += decode_test_driver.cc
|
||||||
LIBVPX_TEST_SRCS-yes += decode_test_driver.h
|
LIBVPX_TEST_SRCS-yes += decode_test_driver.h
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
|
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
|
||||||
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += external_frame_buffer_test.cc
|
||||||
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += lru_frame_buffer_test.cc
|
||||||
|
|
||||||
## WebM Parsing
|
## WebM Parsing
|
||||||
NESTEGG_SRCS += ../nestegg/halloc/halloc.h
|
NESTEGG_SRCS += ../nestegg/halloc/halloc.h
|
||||||
@@ -44,6 +48,10 @@ LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(NESTEGG_SRCS)
|
|||||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h
|
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h
|
||||||
|
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += test_vector_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += test_vector_test.cc
|
||||||
|
# Currently we only support decoder perf tests for vp9
|
||||||
|
ifeq ($(CONFIG_DECODE_PERF_TESTS)$(CONFIG_VP9_DECODER), yesyes)
|
||||||
|
LIBVPX_TEST_SRCS-yes += decode_perf_test.cc
|
||||||
|
endif
|
||||||
|
|
||||||
##
|
##
|
||||||
## WHITE BOX TESTS
|
## WHITE BOX TESTS
|
||||||
@@ -84,6 +92,7 @@ LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
|
|||||||
|
|
||||||
# IDCT test currently depends on FDCT function
|
# IDCT test currently depends on FDCT function
|
||||||
LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
|
LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
|
||||||
|
LIBVPX_TEST_SRCS-yes += partial_idct_test.cc
|
||||||
LIBVPX_TEST_SRCS-yes += superframe_test.cc
|
LIBVPX_TEST_SRCS-yes += superframe_test.cc
|
||||||
LIBVPX_TEST_SRCS-yes += tile_independence_test.cc
|
LIBVPX_TEST_SRCS-yes += tile_independence_test.cc
|
||||||
endif
|
endif
|
||||||
@@ -96,6 +105,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
|
|||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
|
||||||
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_test.cc
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_test.cc
|
||||||
|
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_test.cc
|
||||||
|
|
||||||
endif # VP9
|
endif # VP9
|
||||||
|
|
||||||
@@ -170,6 +180,7 @@ LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf
|
|||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf.md5
|
||||||
@@ -231,6 +242,7 @@ LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf.md5
|
|||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-01.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-01.webm
|
||||||
@@ -501,6 +513,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm
|
|||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x198.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x198.webm
|
||||||
@@ -629,3 +643,75 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm
|
|||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm
|
||||||
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm.md5
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm.md5
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_DECODE_PERF_TESTS),yes)
|
||||||
|
# BBB VP9 streams
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_426x240_tile_1x1_180kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_640x360_tile_1x2_337kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_854x480_tile_1x2_651kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
|
||||||
|
#Sintel VP9 streams
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-sintel_426x182_tile_1x1_171kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-sintel_640x272_tile_1x2_318kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-sintel_854x364_tile_1x2_621kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
|
||||||
|
# TOS VP9 streams
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-tos_426x178_tile_1x1_181kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-tos_640x266_tile_1x2_336kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-tos_854x356_tile_1x2_656kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
|
||||||
|
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
|
||||||
|
vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
|
||||||
|
endif # CONFIG_DECODE_PERF_TESTS
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#if ARCH_X86 || ARCH_X86_64
|
#if ARCH_X86 || ARCH_X86_64
|
||||||
#include "vpx_ports/x86.h"
|
#include "vpx_ports/x86.h"
|
||||||
@@ -22,8 +22,10 @@ extern void vp9_rtcd();
|
|||||||
}
|
}
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
|
|
||||||
static void append_gtest_filter(const char *str) {
|
static void append_negative_gtest_filter(const char *str) {
|
||||||
std::string filter = ::testing::FLAGS_gtest_filter;
|
std::string filter = ::testing::FLAGS_gtest_filter;
|
||||||
|
// Negative patterns begin with one '-' followed by a ':' separated list.
|
||||||
|
if (filter.find('-') == std::string::npos) filter += '-';
|
||||||
filter += str;
|
filter += str;
|
||||||
::testing::FLAGS_gtest_filter = filter;
|
::testing::FLAGS_gtest_filter = filter;
|
||||||
}
|
}
|
||||||
@@ -34,21 +36,27 @@ int main(int argc, char **argv) {
|
|||||||
#if ARCH_X86 || ARCH_X86_64
|
#if ARCH_X86 || ARCH_X86_64
|
||||||
const int simd_caps = x86_simd_caps();
|
const int simd_caps = x86_simd_caps();
|
||||||
if (!(simd_caps & HAS_MMX))
|
if (!(simd_caps & HAS_MMX))
|
||||||
append_gtest_filter(":-MMX/*");
|
append_negative_gtest_filter(":-MMX/*");
|
||||||
if (!(simd_caps & HAS_SSE))
|
if (!(simd_caps & HAS_SSE))
|
||||||
append_gtest_filter(":-SSE/*");
|
append_negative_gtest_filter(":-SSE/*");
|
||||||
if (!(simd_caps & HAS_SSE2))
|
if (!(simd_caps & HAS_SSE2))
|
||||||
append_gtest_filter(":-SSE2/*");
|
append_negative_gtest_filter(":-SSE2/*");
|
||||||
if (!(simd_caps & HAS_SSE3))
|
if (!(simd_caps & HAS_SSE3))
|
||||||
append_gtest_filter(":-SSE3/*");
|
append_negative_gtest_filter(":-SSE3/*");
|
||||||
if (!(simd_caps & HAS_SSSE3))
|
if (!(simd_caps & HAS_SSSE3))
|
||||||
append_gtest_filter(":-SSSE3/*");
|
append_negative_gtest_filter(":-SSSE3/*");
|
||||||
if (!(simd_caps & HAS_SSE4_1))
|
if (!(simd_caps & HAS_SSE4_1))
|
||||||
append_gtest_filter(":-SSE4_1/*");
|
append_negative_gtest_filter(":-SSE4_1/*");
|
||||||
|
if (!(simd_caps & HAS_AVX))
|
||||||
|
append_negative_gtest_filter(":AVX/*");
|
||||||
|
if (!(simd_caps & HAS_AVX2))
|
||||||
|
append_negative_gtest_filter(":AVX2/*");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !CONFIG_SHARED
|
#if !CONFIG_SHARED
|
||||||
/* Shared library builds don't support whitebox tests that exercise internal symbols. */
|
// Shared library builds don't support whitebox tests
|
||||||
|
// that exercise internal symbols.
|
||||||
|
|
||||||
#if CONFIG_VP8
|
#if CONFIG_VP8
|
||||||
vp8_rtcd();
|
vp8_rtcd();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
@@ -15,153 +15,15 @@
|
|||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
#include "test/decode_test_driver.h"
|
#include "test/decode_test_driver.h"
|
||||||
#include "test/ivf_video_source.h"
|
#include "test/ivf_video_source.h"
|
||||||
#include "test/webm_video_source.h"
|
|
||||||
#include "test/util.h"
|
|
||||||
#include "test/md5_helper.h"
|
#include "test/md5_helper.h"
|
||||||
|
#include "test/test_vectors.h"
|
||||||
|
#include "test/util.h"
|
||||||
|
#include "test/webm_video_source.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#if CONFIG_VP8_DECODER
|
|
||||||
const char *kVP8TestVectors[] = {
|
|
||||||
"vp80-00-comprehensive-001.ivf",
|
|
||||||
"vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
|
|
||||||
"vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
|
|
||||||
"vp80-00-comprehensive-006.ivf", "vp80-00-comprehensive-007.ivf",
|
|
||||||
"vp80-00-comprehensive-008.ivf", "vp80-00-comprehensive-009.ivf",
|
|
||||||
"vp80-00-comprehensive-010.ivf", "vp80-00-comprehensive-011.ivf",
|
|
||||||
"vp80-00-comprehensive-012.ivf", "vp80-00-comprehensive-013.ivf",
|
|
||||||
"vp80-00-comprehensive-014.ivf", "vp80-00-comprehensive-015.ivf",
|
|
||||||
"vp80-00-comprehensive-016.ivf", "vp80-00-comprehensive-017.ivf",
|
|
||||||
"vp80-00-comprehensive-018.ivf", "vp80-01-intra-1400.ivf",
|
|
||||||
"vp80-01-intra-1411.ivf", "vp80-01-intra-1416.ivf",
|
|
||||||
"vp80-01-intra-1417.ivf", "vp80-02-inter-1402.ivf",
|
|
||||||
"vp80-02-inter-1412.ivf", "vp80-02-inter-1418.ivf",
|
|
||||||
"vp80-02-inter-1424.ivf", "vp80-03-segmentation-01.ivf",
|
|
||||||
"vp80-03-segmentation-02.ivf", "vp80-03-segmentation-03.ivf",
|
|
||||||
"vp80-03-segmentation-04.ivf", "vp80-03-segmentation-1401.ivf",
|
|
||||||
"vp80-03-segmentation-1403.ivf", "vp80-03-segmentation-1407.ivf",
|
|
||||||
"vp80-03-segmentation-1408.ivf", "vp80-03-segmentation-1409.ivf",
|
|
||||||
"vp80-03-segmentation-1410.ivf", "vp80-03-segmentation-1413.ivf",
|
|
||||||
"vp80-03-segmentation-1414.ivf", "vp80-03-segmentation-1415.ivf",
|
|
||||||
"vp80-03-segmentation-1425.ivf", "vp80-03-segmentation-1426.ivf",
|
|
||||||
"vp80-03-segmentation-1427.ivf", "vp80-03-segmentation-1432.ivf",
|
|
||||||
"vp80-03-segmentation-1435.ivf", "vp80-03-segmentation-1436.ivf",
|
|
||||||
"vp80-03-segmentation-1437.ivf", "vp80-03-segmentation-1441.ivf",
|
|
||||||
"vp80-03-segmentation-1442.ivf", "vp80-04-partitions-1404.ivf",
|
|
||||||
"vp80-04-partitions-1405.ivf", "vp80-04-partitions-1406.ivf",
|
|
||||||
"vp80-05-sharpness-1428.ivf", "vp80-05-sharpness-1429.ivf",
|
|
||||||
"vp80-05-sharpness-1430.ivf", "vp80-05-sharpness-1431.ivf",
|
|
||||||
"vp80-05-sharpness-1433.ivf", "vp80-05-sharpness-1434.ivf",
|
|
||||||
"vp80-05-sharpness-1438.ivf", "vp80-05-sharpness-1439.ivf",
|
|
||||||
"vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf"
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
#if CONFIG_VP9_DECODER
|
|
||||||
const char *kVP9TestVectors[] = {
|
|
||||||
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
|
|
||||||
"vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
|
|
||||||
"vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
|
|
||||||
"vp90-2-00-quantizer-06.webm", "vp90-2-00-quantizer-07.webm",
|
|
||||||
"vp90-2-00-quantizer-08.webm", "vp90-2-00-quantizer-09.webm",
|
|
||||||
"vp90-2-00-quantizer-10.webm", "vp90-2-00-quantizer-11.webm",
|
|
||||||
"vp90-2-00-quantizer-12.webm", "vp90-2-00-quantizer-13.webm",
|
|
||||||
"vp90-2-00-quantizer-14.webm", "vp90-2-00-quantizer-15.webm",
|
|
||||||
"vp90-2-00-quantizer-16.webm", "vp90-2-00-quantizer-17.webm",
|
|
||||||
"vp90-2-00-quantizer-18.webm", "vp90-2-00-quantizer-19.webm",
|
|
||||||
"vp90-2-00-quantizer-20.webm", "vp90-2-00-quantizer-21.webm",
|
|
||||||
"vp90-2-00-quantizer-22.webm", "vp90-2-00-quantizer-23.webm",
|
|
||||||
"vp90-2-00-quantizer-24.webm", "vp90-2-00-quantizer-25.webm",
|
|
||||||
"vp90-2-00-quantizer-26.webm", "vp90-2-00-quantizer-27.webm",
|
|
||||||
"vp90-2-00-quantizer-28.webm", "vp90-2-00-quantizer-29.webm",
|
|
||||||
"vp90-2-00-quantizer-30.webm", "vp90-2-00-quantizer-31.webm",
|
|
||||||
"vp90-2-00-quantizer-32.webm", "vp90-2-00-quantizer-33.webm",
|
|
||||||
"vp90-2-00-quantizer-34.webm", "vp90-2-00-quantizer-35.webm",
|
|
||||||
"vp90-2-00-quantizer-36.webm", "vp90-2-00-quantizer-37.webm",
|
|
||||||
"vp90-2-00-quantizer-38.webm", "vp90-2-00-quantizer-39.webm",
|
|
||||||
"vp90-2-00-quantizer-40.webm", "vp90-2-00-quantizer-41.webm",
|
|
||||||
"vp90-2-00-quantizer-42.webm", "vp90-2-00-quantizer-43.webm",
|
|
||||||
"vp90-2-00-quantizer-44.webm", "vp90-2-00-quantizer-45.webm",
|
|
||||||
"vp90-2-00-quantizer-46.webm", "vp90-2-00-quantizer-47.webm",
|
|
||||||
"vp90-2-00-quantizer-48.webm", "vp90-2-00-quantizer-49.webm",
|
|
||||||
"vp90-2-00-quantizer-50.webm", "vp90-2-00-quantizer-51.webm",
|
|
||||||
"vp90-2-00-quantizer-52.webm", "vp90-2-00-quantizer-53.webm",
|
|
||||||
"vp90-2-00-quantizer-54.webm", "vp90-2-00-quantizer-55.webm",
|
|
||||||
"vp90-2-00-quantizer-56.webm", "vp90-2-00-quantizer-57.webm",
|
|
||||||
"vp90-2-00-quantizer-58.webm", "vp90-2-00-quantizer-59.webm",
|
|
||||||
"vp90-2-00-quantizer-60.webm", "vp90-2-00-quantizer-61.webm",
|
|
||||||
"vp90-2-00-quantizer-62.webm", "vp90-2-00-quantizer-63.webm",
|
|
||||||
"vp90-2-01-sharpness-1.webm", "vp90-2-01-sharpness-2.webm",
|
|
||||||
"vp90-2-01-sharpness-3.webm", "vp90-2-01-sharpness-4.webm",
|
|
||||||
"vp90-2-01-sharpness-5.webm", "vp90-2-01-sharpness-6.webm",
|
|
||||||
"vp90-2-01-sharpness-7.webm", "vp90-2-02-size-08x08.webm",
|
|
||||||
"vp90-2-02-size-08x10.webm", "vp90-2-02-size-08x16.webm",
|
|
||||||
"vp90-2-02-size-08x18.webm", "vp90-2-02-size-08x32.webm",
|
|
||||||
"vp90-2-02-size-08x34.webm", "vp90-2-02-size-08x64.webm",
|
|
||||||
"vp90-2-02-size-08x66.webm", "vp90-2-02-size-10x08.webm",
|
|
||||||
"vp90-2-02-size-10x10.webm", "vp90-2-02-size-10x16.webm",
|
|
||||||
"vp90-2-02-size-10x18.webm", "vp90-2-02-size-10x32.webm",
|
|
||||||
"vp90-2-02-size-10x34.webm", "vp90-2-02-size-10x64.webm",
|
|
||||||
"vp90-2-02-size-10x66.webm", "vp90-2-02-size-16x08.webm",
|
|
||||||
"vp90-2-02-size-16x10.webm", "vp90-2-02-size-16x16.webm",
|
|
||||||
"vp90-2-02-size-16x18.webm", "vp90-2-02-size-16x32.webm",
|
|
||||||
"vp90-2-02-size-16x34.webm", "vp90-2-02-size-16x64.webm",
|
|
||||||
"vp90-2-02-size-16x66.webm", "vp90-2-02-size-18x08.webm",
|
|
||||||
"vp90-2-02-size-18x10.webm", "vp90-2-02-size-18x16.webm",
|
|
||||||
"vp90-2-02-size-18x18.webm", "vp90-2-02-size-18x32.webm",
|
|
||||||
"vp90-2-02-size-18x34.webm", "vp90-2-02-size-18x64.webm",
|
|
||||||
"vp90-2-02-size-18x66.webm", "vp90-2-02-size-32x08.webm",
|
|
||||||
"vp90-2-02-size-32x10.webm", "vp90-2-02-size-32x16.webm",
|
|
||||||
"vp90-2-02-size-32x18.webm", "vp90-2-02-size-32x32.webm",
|
|
||||||
"vp90-2-02-size-32x34.webm", "vp90-2-02-size-32x64.webm",
|
|
||||||
"vp90-2-02-size-32x66.webm", "vp90-2-02-size-34x08.webm",
|
|
||||||
"vp90-2-02-size-34x10.webm", "vp90-2-02-size-34x16.webm",
|
|
||||||
"vp90-2-02-size-34x18.webm", "vp90-2-02-size-34x32.webm",
|
|
||||||
"vp90-2-02-size-34x34.webm", "vp90-2-02-size-34x64.webm",
|
|
||||||
"vp90-2-02-size-34x66.webm", "vp90-2-02-size-64x08.webm",
|
|
||||||
"vp90-2-02-size-64x10.webm", "vp90-2-02-size-64x16.webm",
|
|
||||||
"vp90-2-02-size-64x18.webm", "vp90-2-02-size-64x32.webm",
|
|
||||||
"vp90-2-02-size-64x34.webm", "vp90-2-02-size-64x64.webm",
|
|
||||||
"vp90-2-02-size-64x66.webm", "vp90-2-02-size-66x08.webm",
|
|
||||||
"vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
|
|
||||||
"vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
|
|
||||||
"vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
|
|
||||||
"vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.webm",
|
|
||||||
"vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
|
|
||||||
"vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
|
|
||||||
"vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
|
|
||||||
"vp90-2-03-size-196x226.webm", "vp90-2-03-size-198x196.webm",
|
|
||||||
"vp90-2-03-size-198x198.webm", "vp90-2-03-size-198x200.webm",
|
|
||||||
"vp90-2-03-size-198x202.webm", "vp90-2-03-size-198x208.webm",
|
|
||||||
"vp90-2-03-size-198x210.webm", "vp90-2-03-size-198x224.webm",
|
|
||||||
"vp90-2-03-size-198x226.webm", "vp90-2-03-size-200x196.webm",
|
|
||||||
"vp90-2-03-size-200x198.webm", "vp90-2-03-size-200x200.webm",
|
|
||||||
"vp90-2-03-size-200x202.webm", "vp90-2-03-size-200x208.webm",
|
|
||||||
"vp90-2-03-size-200x210.webm", "vp90-2-03-size-200x224.webm",
|
|
||||||
"vp90-2-03-size-200x226.webm", "vp90-2-03-size-202x196.webm",
|
|
||||||
"vp90-2-03-size-202x198.webm", "vp90-2-03-size-202x200.webm",
|
|
||||||
"vp90-2-03-size-202x202.webm", "vp90-2-03-size-202x208.webm",
|
|
||||||
"vp90-2-03-size-202x210.webm", "vp90-2-03-size-202x224.webm",
|
|
||||||
"vp90-2-03-size-202x226.webm", "vp90-2-03-size-208x196.webm",
|
|
||||||
"vp90-2-03-size-208x198.webm", "vp90-2-03-size-208x200.webm",
|
|
||||||
"vp90-2-03-size-208x202.webm", "vp90-2-03-size-208x208.webm",
|
|
||||||
"vp90-2-03-size-208x210.webm", "vp90-2-03-size-208x224.webm",
|
|
||||||
"vp90-2-03-size-208x226.webm", "vp90-2-03-size-210x196.webm",
|
|
||||||
"vp90-2-03-size-210x198.webm", "vp90-2-03-size-210x200.webm",
|
|
||||||
"vp90-2-03-size-210x202.webm", "vp90-2-03-size-210x208.webm",
|
|
||||||
"vp90-2-03-size-210x210.webm", "vp90-2-03-size-210x224.webm",
|
|
||||||
"vp90-2-03-size-210x226.webm", "vp90-2-03-size-224x196.webm",
|
|
||||||
"vp90-2-03-size-224x198.webm", "vp90-2-03-size-224x200.webm",
|
|
||||||
"vp90-2-03-size-224x202.webm", "vp90-2-03-size-224x208.webm",
|
|
||||||
"vp90-2-03-size-224x210.webm", "vp90-2-03-size-224x224.webm",
|
|
||||||
"vp90-2-03-size-224x226.webm", "vp90-2-03-size-226x196.webm",
|
|
||||||
"vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
|
|
||||||
"vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
|
|
||||||
"vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
|
|
||||||
"vp90-2-03-size-226x226.webm"
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class TestVectorTest : public ::libvpx_test::DecoderTest,
|
class TestVectorTest : public ::libvpx_test::DecoderTest,
|
||||||
public ::libvpx_test::CodecTestWithParam<const char*> {
|
public ::libvpx_test::CodecTestWithParam<const char*> {
|
||||||
@@ -229,8 +91,8 @@ TEST_P(TestVectorTest, MD5Match) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VP8_INSTANTIATE_TEST_CASE(TestVectorTest,
|
VP8_INSTANTIATE_TEST_CASE(TestVectorTest,
|
||||||
::testing::ValuesIn(kVP8TestVectors));
|
::testing::ValuesIn(libvpx_test::kVP8TestVectors));
|
||||||
VP9_INSTANTIATE_TEST_CASE(TestVectorTest,
|
VP9_INSTANTIATE_TEST_CASE(TestVectorTest,
|
||||||
::testing::ValuesIn(kVP9TestVectors));
|
::testing::ValuesIn(libvpx_test::kVP9TestVectors));
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
169
test/test_vectors.cc
Normal file
169
test/test_vectors.cc
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "test/test_vectors.h"
|
||||||
|
|
||||||
|
namespace libvpx_test {
|
||||||
|
|
||||||
|
#if CONFIG_VP8_DECODER
|
||||||
|
const char *kVP8TestVectors[kNumVp8TestVectors] = {
|
||||||
|
"vp80-00-comprehensive-001.ivf",
|
||||||
|
"vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
|
||||||
|
"vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
|
||||||
|
"vp80-00-comprehensive-006.ivf", "vp80-00-comprehensive-007.ivf",
|
||||||
|
"vp80-00-comprehensive-008.ivf", "vp80-00-comprehensive-009.ivf",
|
||||||
|
"vp80-00-comprehensive-010.ivf", "vp80-00-comprehensive-011.ivf",
|
||||||
|
"vp80-00-comprehensive-012.ivf", "vp80-00-comprehensive-013.ivf",
|
||||||
|
"vp80-00-comprehensive-014.ivf", "vp80-00-comprehensive-015.ivf",
|
||||||
|
"vp80-00-comprehensive-016.ivf", "vp80-00-comprehensive-017.ivf",
|
||||||
|
"vp80-00-comprehensive-018.ivf", "vp80-01-intra-1400.ivf",
|
||||||
|
"vp80-01-intra-1411.ivf", "vp80-01-intra-1416.ivf",
|
||||||
|
"vp80-01-intra-1417.ivf", "vp80-02-inter-1402.ivf",
|
||||||
|
"vp80-02-inter-1412.ivf", "vp80-02-inter-1418.ivf",
|
||||||
|
"vp80-02-inter-1424.ivf", "vp80-03-segmentation-01.ivf",
|
||||||
|
"vp80-03-segmentation-02.ivf", "vp80-03-segmentation-03.ivf",
|
||||||
|
"vp80-03-segmentation-04.ivf", "vp80-03-segmentation-1401.ivf",
|
||||||
|
"vp80-03-segmentation-1403.ivf", "vp80-03-segmentation-1407.ivf",
|
||||||
|
"vp80-03-segmentation-1408.ivf", "vp80-03-segmentation-1409.ivf",
|
||||||
|
"vp80-03-segmentation-1410.ivf", "vp80-03-segmentation-1413.ivf",
|
||||||
|
"vp80-03-segmentation-1414.ivf", "vp80-03-segmentation-1415.ivf",
|
||||||
|
"vp80-03-segmentation-1425.ivf", "vp80-03-segmentation-1426.ivf",
|
||||||
|
"vp80-03-segmentation-1427.ivf", "vp80-03-segmentation-1432.ivf",
|
||||||
|
"vp80-03-segmentation-1435.ivf", "vp80-03-segmentation-1436.ivf",
|
||||||
|
"vp80-03-segmentation-1437.ivf", "vp80-03-segmentation-1441.ivf",
|
||||||
|
"vp80-03-segmentation-1442.ivf", "vp80-04-partitions-1404.ivf",
|
||||||
|
"vp80-04-partitions-1405.ivf", "vp80-04-partitions-1406.ivf",
|
||||||
|
"vp80-05-sharpness-1428.ivf", "vp80-05-sharpness-1429.ivf",
|
||||||
|
"vp80-05-sharpness-1430.ivf", "vp80-05-sharpness-1431.ivf",
|
||||||
|
"vp80-05-sharpness-1433.ivf", "vp80-05-sharpness-1434.ivf",
|
||||||
|
"vp80-05-sharpness-1438.ivf", "vp80-05-sharpness-1439.ivf",
|
||||||
|
"vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf",
|
||||||
|
"vp80-06-smallsize.ivf"
|
||||||
|
};
|
||||||
|
#endif // CONFIG_VP8_DECODER
|
||||||
|
#if CONFIG_VP9_DECODER
|
||||||
|
const char *kVP9TestVectors[kNumVp9TestVectors] = {
|
||||||
|
"vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
|
||||||
|
"vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
|
||||||
|
"vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
|
||||||
|
"vp90-2-00-quantizer-06.webm", "vp90-2-00-quantizer-07.webm",
|
||||||
|
"vp90-2-00-quantizer-08.webm", "vp90-2-00-quantizer-09.webm",
|
||||||
|
"vp90-2-00-quantizer-10.webm", "vp90-2-00-quantizer-11.webm",
|
||||||
|
"vp90-2-00-quantizer-12.webm", "vp90-2-00-quantizer-13.webm",
|
||||||
|
"vp90-2-00-quantizer-14.webm", "vp90-2-00-quantizer-15.webm",
|
||||||
|
"vp90-2-00-quantizer-16.webm", "vp90-2-00-quantizer-17.webm",
|
||||||
|
"vp90-2-00-quantizer-18.webm", "vp90-2-00-quantizer-19.webm",
|
||||||
|
"vp90-2-00-quantizer-20.webm", "vp90-2-00-quantizer-21.webm",
|
||||||
|
"vp90-2-00-quantizer-22.webm", "vp90-2-00-quantizer-23.webm",
|
||||||
|
"vp90-2-00-quantizer-24.webm", "vp90-2-00-quantizer-25.webm",
|
||||||
|
"vp90-2-00-quantizer-26.webm", "vp90-2-00-quantizer-27.webm",
|
||||||
|
"vp90-2-00-quantizer-28.webm", "vp90-2-00-quantizer-29.webm",
|
||||||
|
"vp90-2-00-quantizer-30.webm", "vp90-2-00-quantizer-31.webm",
|
||||||
|
"vp90-2-00-quantizer-32.webm", "vp90-2-00-quantizer-33.webm",
|
||||||
|
"vp90-2-00-quantizer-34.webm", "vp90-2-00-quantizer-35.webm",
|
||||||
|
"vp90-2-00-quantizer-36.webm", "vp90-2-00-quantizer-37.webm",
|
||||||
|
"vp90-2-00-quantizer-38.webm", "vp90-2-00-quantizer-39.webm",
|
||||||
|
"vp90-2-00-quantizer-40.webm", "vp90-2-00-quantizer-41.webm",
|
||||||
|
"vp90-2-00-quantizer-42.webm", "vp90-2-00-quantizer-43.webm",
|
||||||
|
"vp90-2-00-quantizer-44.webm", "vp90-2-00-quantizer-45.webm",
|
||||||
|
"vp90-2-00-quantizer-46.webm", "vp90-2-00-quantizer-47.webm",
|
||||||
|
"vp90-2-00-quantizer-48.webm", "vp90-2-00-quantizer-49.webm",
|
||||||
|
"vp90-2-00-quantizer-50.webm", "vp90-2-00-quantizer-51.webm",
|
||||||
|
"vp90-2-00-quantizer-52.webm", "vp90-2-00-quantizer-53.webm",
|
||||||
|
"vp90-2-00-quantizer-54.webm", "vp90-2-00-quantizer-55.webm",
|
||||||
|
"vp90-2-00-quantizer-56.webm", "vp90-2-00-quantizer-57.webm",
|
||||||
|
"vp90-2-00-quantizer-58.webm", "vp90-2-00-quantizer-59.webm",
|
||||||
|
"vp90-2-00-quantizer-60.webm", "vp90-2-00-quantizer-61.webm",
|
||||||
|
"vp90-2-00-quantizer-62.webm", "vp90-2-00-quantizer-63.webm",
|
||||||
|
"vp90-2-01-sharpness-1.webm", "vp90-2-01-sharpness-2.webm",
|
||||||
|
"vp90-2-01-sharpness-3.webm", "vp90-2-01-sharpness-4.webm",
|
||||||
|
"vp90-2-01-sharpness-5.webm", "vp90-2-01-sharpness-6.webm",
|
||||||
|
"vp90-2-01-sharpness-7.webm", "vp90-2-02-size-08x08.webm",
|
||||||
|
"vp90-2-02-size-08x10.webm", "vp90-2-02-size-08x16.webm",
|
||||||
|
"vp90-2-02-size-08x18.webm", "vp90-2-02-size-08x32.webm",
|
||||||
|
"vp90-2-02-size-08x34.webm", "vp90-2-02-size-08x64.webm",
|
||||||
|
"vp90-2-02-size-08x66.webm", "vp90-2-02-size-10x08.webm",
|
||||||
|
"vp90-2-02-size-10x10.webm", "vp90-2-02-size-10x16.webm",
|
||||||
|
"vp90-2-02-size-10x18.webm", "vp90-2-02-size-10x32.webm",
|
||||||
|
"vp90-2-02-size-10x34.webm", "vp90-2-02-size-10x64.webm",
|
||||||
|
"vp90-2-02-size-10x66.webm", "vp90-2-02-size-16x08.webm",
|
||||||
|
"vp90-2-02-size-16x10.webm", "vp90-2-02-size-16x16.webm",
|
||||||
|
"vp90-2-02-size-16x18.webm", "vp90-2-02-size-16x32.webm",
|
||||||
|
"vp90-2-02-size-16x34.webm", "vp90-2-02-size-16x64.webm",
|
||||||
|
"vp90-2-02-size-16x66.webm", "vp90-2-02-size-18x08.webm",
|
||||||
|
"vp90-2-02-size-18x10.webm", "vp90-2-02-size-18x16.webm",
|
||||||
|
"vp90-2-02-size-18x18.webm", "vp90-2-02-size-18x32.webm",
|
||||||
|
"vp90-2-02-size-18x34.webm", "vp90-2-02-size-18x64.webm",
|
||||||
|
"vp90-2-02-size-18x66.webm", "vp90-2-02-size-32x08.webm",
|
||||||
|
"vp90-2-02-size-32x10.webm", "vp90-2-02-size-32x16.webm",
|
||||||
|
"vp90-2-02-size-32x18.webm", "vp90-2-02-size-32x32.webm",
|
||||||
|
"vp90-2-02-size-32x34.webm", "vp90-2-02-size-32x64.webm",
|
||||||
|
"vp90-2-02-size-32x66.webm", "vp90-2-02-size-34x08.webm",
|
||||||
|
"vp90-2-02-size-34x10.webm", "vp90-2-02-size-34x16.webm",
|
||||||
|
"vp90-2-02-size-34x18.webm", "vp90-2-02-size-34x32.webm",
|
||||||
|
"vp90-2-02-size-34x34.webm", "vp90-2-02-size-34x64.webm",
|
||||||
|
"vp90-2-02-size-34x66.webm", "vp90-2-02-size-64x08.webm",
|
||||||
|
"vp90-2-02-size-64x10.webm", "vp90-2-02-size-64x16.webm",
|
||||||
|
"vp90-2-02-size-64x18.webm", "vp90-2-02-size-64x32.webm",
|
||||||
|
"vp90-2-02-size-64x34.webm", "vp90-2-02-size-64x64.webm",
|
||||||
|
"vp90-2-02-size-64x66.webm", "vp90-2-02-size-66x08.webm",
|
||||||
|
"vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
|
||||||
|
"vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
|
||||||
|
"vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
|
||||||
|
"vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.webm",
|
||||||
|
"vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
|
||||||
|
"vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
|
||||||
|
"vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
|
||||||
|
"vp90-2-03-size-196x226.webm", "vp90-2-03-size-198x196.webm",
|
||||||
|
"vp90-2-03-size-198x198.webm", "vp90-2-03-size-198x200.webm",
|
||||||
|
"vp90-2-03-size-198x202.webm", "vp90-2-03-size-198x208.webm",
|
||||||
|
"vp90-2-03-size-198x210.webm", "vp90-2-03-size-198x224.webm",
|
||||||
|
"vp90-2-03-size-198x226.webm", "vp90-2-03-size-200x196.webm",
|
||||||
|
"vp90-2-03-size-200x198.webm", "vp90-2-03-size-200x200.webm",
|
||||||
|
"vp90-2-03-size-200x202.webm", "vp90-2-03-size-200x208.webm",
|
||||||
|
"vp90-2-03-size-200x210.webm", "vp90-2-03-size-200x224.webm",
|
||||||
|
"vp90-2-03-size-200x226.webm", "vp90-2-03-size-202x196.webm",
|
||||||
|
"vp90-2-03-size-202x198.webm", "vp90-2-03-size-202x200.webm",
|
||||||
|
"vp90-2-03-size-202x202.webm", "vp90-2-03-size-202x208.webm",
|
||||||
|
"vp90-2-03-size-202x210.webm", "vp90-2-03-size-202x224.webm",
|
||||||
|
"vp90-2-03-size-202x226.webm", "vp90-2-03-size-208x196.webm",
|
||||||
|
"vp90-2-03-size-208x198.webm", "vp90-2-03-size-208x200.webm",
|
||||||
|
"vp90-2-03-size-208x202.webm", "vp90-2-03-size-208x208.webm",
|
||||||
|
"vp90-2-03-size-208x210.webm", "vp90-2-03-size-208x224.webm",
|
||||||
|
"vp90-2-03-size-208x226.webm", "vp90-2-03-size-210x196.webm",
|
||||||
|
"vp90-2-03-size-210x198.webm", "vp90-2-03-size-210x200.webm",
|
||||||
|
"vp90-2-03-size-210x202.webm", "vp90-2-03-size-210x208.webm",
|
||||||
|
"vp90-2-03-size-210x210.webm", "vp90-2-03-size-210x224.webm",
|
||||||
|
"vp90-2-03-size-210x226.webm", "vp90-2-03-size-224x196.webm",
|
||||||
|
"vp90-2-03-size-224x198.webm", "vp90-2-03-size-224x200.webm",
|
||||||
|
"vp90-2-03-size-224x202.webm", "vp90-2-03-size-224x208.webm",
|
||||||
|
"vp90-2-03-size-224x210.webm", "vp90-2-03-size-224x224.webm",
|
||||||
|
"vp90-2-03-size-224x226.webm", "vp90-2-03-size-226x196.webm",
|
||||||
|
"vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
|
||||||
|
"vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
|
||||||
|
"vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
|
||||||
|
"vp90-2-03-size-226x226.webm", "vp90-2-03-deltaq.webm",
|
||||||
|
"vp90-2-05-resize.ivf", "vp90-2-06-bilinear.webm",
|
||||||
|
"vp90-2-07-frame_parallel.webm",
|
||||||
|
"vp90-2-08-tile_1x2_frame_parallel.webm", "vp90-2-08-tile_1x2.webm",
|
||||||
|
"vp90-2-08-tile_1x4_frame_parallel.webm", "vp90-2-08-tile_1x4.webm",
|
||||||
|
"vp90-2-08-tile_1x8_frame_parallel.webm", "vp90-2-08-tile_1x8.webm",
|
||||||
|
"vp90-2-08-tile-4x4.webm", "vp90-2-08-tile-4x1.webm",
|
||||||
|
"vp90-2-09-subpixel-00.ivf",
|
||||||
|
"vp90-2-02-size-lf-1920x1080.webm",
|
||||||
|
"vp90-2-09-aq2.webm",
|
||||||
|
"vp90-2-09-lf_deltas.webm",
|
||||||
|
#if CONFIG_NON420
|
||||||
|
"vp91-2-04-yv444.webm"
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#endif // CONFIG_VP9_DECODER
|
||||||
|
|
||||||
|
} // namespace libvpx_test
|
||||||
35
test/test_vectors.h
Normal file
35
test/test_vectors.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Use of this source code is governed by a BSD-style license
|
||||||
|
* that can be found in the LICENSE file in the root of the source
|
||||||
|
* tree. An additional intellectual property rights grant can be found
|
||||||
|
* in the file PATENTS. All contributing project authors may
|
||||||
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef TEST_TEST_VECTORS_H_
|
||||||
|
#define TEST_TEST_VECTORS_H_
|
||||||
|
|
||||||
|
#include "./vpx_config.h"
|
||||||
|
|
||||||
|
namespace libvpx_test {
|
||||||
|
|
||||||
|
#if CONFIG_VP8_DECODER
|
||||||
|
const int kNumVp8TestVectors = 62;
|
||||||
|
extern const char *kVP8TestVectors[kNumVp8TestVectors];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_VP9_DECODER
|
||||||
|
#if CONFIG_NON420
|
||||||
|
const int kNumVp9TestVectors = 216;
|
||||||
|
#else
|
||||||
|
const int kNumVp9TestVectors = 215;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern const char *kVP9TestVectors[kNumVp9TestVectors];
|
||||||
|
#endif // CONFIG_VP9_DECODER
|
||||||
|
|
||||||
|
} // namespace libvpx_test
|
||||||
|
|
||||||
|
#endif // TEST_TEST_VECTORS_H_
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include "vpx/vpx_image.h"
|
#include "vpx/vpx_image.h"
|
||||||
|
|
||||||
// Macros
|
// Macros
|
||||||
#define PARAMS(...) ::testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >
|
|
||||||
#define GET_PARAM(k) std::tr1::get< k >(GetParam())
|
#define GET_PARAM(k) std::tr1::get< k >(GetParam())
|
||||||
|
|
||||||
static double compute_psnr(const vpx_image_t *img1,
|
static double compute_psnr(const vpx_image_t *img1,
|
||||||
|
|||||||
@@ -16,16 +16,16 @@
|
|||||||
#include "test/register_state_check.h"
|
#include "test/register_state_check.h"
|
||||||
|
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
#include "vpx_config.h"
|
#include "./vpx_config.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vpx_mem/vpx_mem.h"
|
#include "vpx_mem/vpx_mem.h"
|
||||||
#if CONFIG_VP8_ENCODER
|
#if CONFIG_VP8_ENCODER
|
||||||
# include "vp8/common/variance.h"
|
# include "vp8/common/variance.h"
|
||||||
# include "vp8_rtcd.h"
|
# include "./vp8_rtcd.h"
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_VP9_ENCODER
|
#if CONFIG_VP9_ENCODER
|
||||||
# include "vp9/encoder/vp9_variance.h"
|
# include "vp9/encoder/vp9_variance.h"
|
||||||
# include "vp9_rtcd.h"
|
# include "./vp9_rtcd.h"
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
@@ -78,37 +78,9 @@ static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
|
|||||||
return sse - (((int64_t) se * se) >> (l2w + l2h));
|
return sse - (((int64_t) se * se) >> (l2w + l2h));
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int subpel_avg_variance_ref(const uint8_t *ref,
|
|
||||||
const uint8_t *src,
|
|
||||||
const uint8_t *second_pred,
|
|
||||||
int l2w, int l2h,
|
|
||||||
int xoff, int yoff,
|
|
||||||
unsigned int *sse_ptr) {
|
|
||||||
int se = 0;
|
|
||||||
unsigned int sse = 0;
|
|
||||||
const int w = 1 << l2w, h = 1 << l2h;
|
|
||||||
for (int y = 0; y < h; y++) {
|
|
||||||
for (int x = 0; x < w; x++) {
|
|
||||||
// bilinear interpolation at a 16th pel step
|
|
||||||
const int a1 = ref[(w + 1) * (y + 0) + x + 0];
|
|
||||||
const int a2 = ref[(w + 1) * (y + 0) + x + 1];
|
|
||||||
const int b1 = ref[(w + 1) * (y + 1) + x + 0];
|
|
||||||
const int b2 = ref[(w + 1) * (y + 1) + x + 1];
|
|
||||||
const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
|
|
||||||
const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
|
|
||||||
const int r = a + (((b - a) * yoff + 8) >> 4);
|
|
||||||
int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
|
|
||||||
se += diff;
|
|
||||||
sse += diff * diff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*sse_ptr = sse;
|
|
||||||
return sse - (((int64_t) se * se) >> (l2w + l2h));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename VarianceFunctionType>
|
template<typename VarianceFunctionType>
|
||||||
class VarianceTest :
|
class VarianceTest
|
||||||
public ::testing::TestWithParam<tuple<int, int, VarianceFunctionType> > {
|
: public ::testing::TestWithParam<tuple<int, int, VarianceFunctionType> > {
|
||||||
public:
|
public:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
const tuple<int, int, VarianceFunctionType>& params = this->GetParam();
|
const tuple<int, int, VarianceFunctionType>& params = this->GetParam();
|
||||||
@@ -190,9 +162,39 @@ void VarianceTest<VarianceFunctionType>::OneQuarterTest() {
|
|||||||
EXPECT_EQ(expected, var);
|
EXPECT_EQ(expected, var);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_VP9_ENCODER
|
||||||
|
|
||||||
|
unsigned int subpel_avg_variance_ref(const uint8_t *ref,
|
||||||
|
const uint8_t *src,
|
||||||
|
const uint8_t *second_pred,
|
||||||
|
int l2w, int l2h,
|
||||||
|
int xoff, int yoff,
|
||||||
|
unsigned int *sse_ptr) {
|
||||||
|
int se = 0;
|
||||||
|
unsigned int sse = 0;
|
||||||
|
const int w = 1 << l2w, h = 1 << l2h;
|
||||||
|
for (int y = 0; y < h; y++) {
|
||||||
|
for (int x = 0; x < w; x++) {
|
||||||
|
// bilinear interpolation at a 16th pel step
|
||||||
|
const int a1 = ref[(w + 1) * (y + 0) + x + 0];
|
||||||
|
const int a2 = ref[(w + 1) * (y + 0) + x + 1];
|
||||||
|
const int b1 = ref[(w + 1) * (y + 1) + x + 0];
|
||||||
|
const int b2 = ref[(w + 1) * (y + 1) + x + 1];
|
||||||
|
const int a = a1 + (((a2 - a1) * xoff + 8) >> 4);
|
||||||
|
const int b = b1 + (((b2 - b1) * xoff + 8) >> 4);
|
||||||
|
const int r = a + (((b - a) * yoff + 8) >> 4);
|
||||||
|
int diff = ((r + second_pred[w * y + x] + 1) >> 1) - src[w * y + x];
|
||||||
|
se += diff;
|
||||||
|
sse += diff * diff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*sse_ptr = sse;
|
||||||
|
return sse - (((int64_t) se * se) >> (l2w + l2h));
|
||||||
|
}
|
||||||
|
|
||||||
template<typename SubpelVarianceFunctionType>
|
template<typename SubpelVarianceFunctionType>
|
||||||
class SubpelVarianceTest :
|
class SubpelVarianceTest
|
||||||
public ::testing::TestWithParam<tuple<int, int,
|
: public ::testing::TestWithParam<tuple<int, int,
|
||||||
SubpelVarianceFunctionType> > {
|
SubpelVarianceFunctionType> > {
|
||||||
public:
|
public:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
@@ -280,6 +282,8 @@ void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // CONFIG_VP9_ENCODER
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// VP8 test cases.
|
// VP8 test cases.
|
||||||
|
|
||||||
|
|||||||
@@ -18,16 +18,35 @@
|
|||||||
|
|
||||||
namespace libvpx_test {
|
namespace libvpx_test {
|
||||||
|
|
||||||
static FILE *OpenTestDataFile(const std::string& file_name) {
|
// Helper macros to ensure LIBVPX_TEST_DATA_PATH is a quoted string.
|
||||||
std::string path_to_source = file_name;
|
// These are undefined right below GetDataPath
|
||||||
const char *kDataPath = getenv("LIBVPX_TEST_DATA_PATH");
|
// NOTE: LIBVPX_TEST_DATA_PATH MUST NOT be a quoted string before
|
||||||
|
// Stringification or the GetDataPath will fail at runtime
|
||||||
|
#define TO_STRING(S) #S
|
||||||
|
#define STRINGIFY(S) TO_STRING(S)
|
||||||
|
|
||||||
if (kDataPath) {
|
// A simple function to encapsulate cross platform retrieval of test data path
|
||||||
path_to_source = kDataPath;
|
static std::string GetDataPath() {
|
||||||
path_to_source += "/";
|
const char *const data_path = getenv("LIBVPX_TEST_DATA_PATH");
|
||||||
path_to_source += file_name;
|
if (data_path == NULL) {
|
||||||
|
#ifdef LIBVPX_TEST_DATA_PATH
|
||||||
|
// In some environments, we cannot set environment variables
|
||||||
|
// Instead, we set the data path by using a preprocessor symbol
|
||||||
|
// which can be set from make files
|
||||||
|
return STRINGIFY(LIBVPX_TEST_DATA_PATH);
|
||||||
|
#else
|
||||||
|
return ".";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
return data_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Undefining stringification macros because they are not used elsewhere
|
||||||
|
#undef TO_STRING
|
||||||
|
#undef STRINGIFY
|
||||||
|
|
||||||
|
static FILE *OpenTestDataFile(const std::string& file_name) {
|
||||||
|
const std::string path_to_source = GetDataPath() + "/" + file_name;
|
||||||
return fopen(path_to_source.c_str(), "rb");
|
return fopen(path_to_source.c_str(), "rb");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "vp8/encoder/boolhuff.h"
|
|
||||||
#include "vp8/decoder/dboolhuff.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@@ -24,6 +20,11 @@ extern "C" {
|
|||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "vp8/encoder/boolhuff.h"
|
||||||
|
#include "vp8/decoder/dboolhuff.h"
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int num_tests = 10;
|
const int num_tests = 10;
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ void encrypt_buffer(uint8_t *buffer, int size) {
|
|||||||
|
|
||||||
void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
|
void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
|
||||||
uint8_t *output, int count) {
|
uint8_t *output, int count) {
|
||||||
int offset = input - (uint8_t *)decrypt_state;
|
int offset = input - reinterpret_cast<uint8_t *>(decrypt_state);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
output[i] = input[i] ^ secret_key[(offset + i) & 15];
|
output[i] = input[i] ^ secret_key[(offset + i) & 15];
|
||||||
}
|
}
|
||||||
@@ -58,10 +59,10 @@ TEST(VP8, TestBitIO) {
|
|||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
for (int n = 0; n < num_tests; ++n) {
|
for (int n = 0; n < num_tests; ++n) {
|
||||||
for (int method = 0; method <= 7; ++method) { // we generate various proba
|
for (int method = 0; method <= 7; ++method) { // we generate various proba
|
||||||
const int bits_to_test = 1000;
|
const int kBitsToTest = 1000;
|
||||||
uint8_t probas[bits_to_test];
|
uint8_t probas[kBitsToTest];
|
||||||
|
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
const int parity = i & 1;
|
const int parity = i & 1;
|
||||||
probas[i] =
|
probas[i] =
|
||||||
(method == 0) ? 0 : (method == 1) ? 255 :
|
(method == 0) ? 0 : (method == 1) ? 255 :
|
||||||
@@ -76,14 +77,14 @@ TEST(VP8, TestBitIO) {
|
|||||||
}
|
}
|
||||||
for (int bit_method = 0; bit_method <= 3; ++bit_method) {
|
for (int bit_method = 0; bit_method <= 3; ++bit_method) {
|
||||||
const int random_seed = 6432;
|
const int random_seed = 6432;
|
||||||
const int buffer_size = 10000;
|
const int kBufferSize = 10000;
|
||||||
ACMRandom bit_rnd(random_seed);
|
ACMRandom bit_rnd(random_seed);
|
||||||
BOOL_CODER bw;
|
BOOL_CODER bw;
|
||||||
uint8_t bw_buffer[buffer_size];
|
uint8_t bw_buffer[kBufferSize];
|
||||||
vp8_start_encode(&bw, bw_buffer, bw_buffer + buffer_size);
|
vp8_start_encode(&bw, bw_buffer, bw_buffer + kBufferSize);
|
||||||
|
|
||||||
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
if (bit_method == 2) {
|
if (bit_method == 2) {
|
||||||
bit = (i & 1);
|
bit = (i & 1);
|
||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
@@ -98,19 +99,20 @@ TEST(VP8, TestBitIO) {
|
|||||||
#if CONFIG_DECRYPT
|
#if CONFIG_DECRYPT
|
||||||
encrypt_buffer(bw_buffer, buffer_size);
|
encrypt_buffer(bw_buffer, buffer_size);
|
||||||
vp8dx_start_decode(&br, bw_buffer, buffer_size,
|
vp8dx_start_decode(&br, bw_buffer, buffer_size,
|
||||||
test_decrypt_cb, (void *)bw_buffer);
|
test_decrypt_cb,
|
||||||
|
reinterpret_cast<void *>(bw_buffer));
|
||||||
#else
|
#else
|
||||||
vp8dx_start_decode(&br, bw_buffer, buffer_size, NULL, NULL);
|
vp8dx_start_decode(&br, bw_buffer, kBufferSize, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
bit_rnd.Reset(random_seed);
|
bit_rnd.Reset(random_seed);
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
if (bit_method == 2) {
|
if (bit_method == 2) {
|
||||||
bit = (i & 1);
|
bit = (i & 1);
|
||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
bit = bit_rnd(2);
|
bit = bit_rnd(2);
|
||||||
}
|
}
|
||||||
GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
|
GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
|
||||||
<< "pos: "<< i << " / " << bits_to_test
|
<< "pos: "<< i << " / " << kBitsToTest
|
||||||
<< " bit_method: " << bit_method
|
<< " bit_method: " << bit_method
|
||||||
<< " method: " << method;
|
<< " method: " << method;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ const uint8_t test_key[16] = {
|
|||||||
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
|
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
|
||||||
};
|
};
|
||||||
|
|
||||||
void encrypt_buffer(const uint8_t *src, uint8_t *dst, int size, int offset = 0) {
|
void encrypt_buffer(const uint8_t *src, uint8_t *dst,
|
||||||
|
int size, int offset = 0) {
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
dst[i] = src[i] ^ test_key[(offset + i) & 15];
|
dst[i] = src[i] ^ test_key[(offset + i) & 15];
|
||||||
}
|
}
|
||||||
@@ -34,7 +35,8 @@ void encrypt_buffer(const uint8_t *src, uint8_t *dst, int size, int offset = 0)
|
|||||||
|
|
||||||
void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
|
void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
|
||||||
uint8_t *output, int count) {
|
uint8_t *output, int count) {
|
||||||
encrypt_buffer(input, output, count, input - (uint8_t *)decrypt_state);
|
encrypt_buffer(input, output, count,
|
||||||
|
input - reinterpret_cast<uint8_t *>(decrypt_state));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
* tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
@@ -16,16 +15,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "vp8_rtcd.h"
|
#include "./vp8_rtcd.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "test/acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const int cospi8sqrt2minus1 = 20091;
|
const int cospi8sqrt2minus1 = 20091;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ extern "C" {
|
|||||||
#include "vp9/decoder/vp9_dboolhuff.h"
|
#include "vp9/decoder/vp9_dboolhuff.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "acm_random.h"
|
#include "test/acm_random.h"
|
||||||
#include "vpx/vpx_integer.h"
|
#include "vpx/vpx_integer.h"
|
||||||
|
|
||||||
using libvpx_test::ACMRandom;
|
using libvpx_test::ACMRandom;
|
||||||
@@ -32,10 +32,10 @@ TEST(VP9, TestBitIO) {
|
|||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
for (int n = 0; n < num_tests; ++n) {
|
for (int n = 0; n < num_tests; ++n) {
|
||||||
for (int method = 0; method <= 7; ++method) { // we generate various proba
|
for (int method = 0; method <= 7; ++method) { // we generate various proba
|
||||||
const int bits_to_test = 1000;
|
const int kBitsToTest = 1000;
|
||||||
uint8_t probas[bits_to_test];
|
uint8_t probas[kBitsToTest];
|
||||||
|
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
const int parity = i & 1;
|
const int parity = i & 1;
|
||||||
probas[i] =
|
probas[i] =
|
||||||
(method == 0) ? 0 : (method == 1) ? 255 :
|
(method == 0) ? 0 : (method == 1) ? 255 :
|
||||||
@@ -50,14 +50,14 @@ TEST(VP9, TestBitIO) {
|
|||||||
}
|
}
|
||||||
for (int bit_method = 0; bit_method <= 3; ++bit_method) {
|
for (int bit_method = 0; bit_method <= 3; ++bit_method) {
|
||||||
const int random_seed = 6432;
|
const int random_seed = 6432;
|
||||||
const int buffer_size = 10000;
|
const int kBufferSize = 10000;
|
||||||
ACMRandom bit_rnd(random_seed);
|
ACMRandom bit_rnd(random_seed);
|
||||||
vp9_writer bw;
|
vp9_writer bw;
|
||||||
uint8_t bw_buffer[buffer_size];
|
uint8_t bw_buffer[kBufferSize];
|
||||||
vp9_start_encode(&bw, bw_buffer);
|
vp9_start_encode(&bw, bw_buffer);
|
||||||
|
|
||||||
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
if (bit_method == 2) {
|
if (bit_method == 2) {
|
||||||
bit = (i & 1);
|
bit = (i & 1);
|
||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
@@ -72,16 +72,16 @@ TEST(VP9, TestBitIO) {
|
|||||||
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
|
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
|
||||||
|
|
||||||
vp9_reader br;
|
vp9_reader br;
|
||||||
vp9_reader_init(&br, bw_buffer, buffer_size);
|
vp9_reader_init(&br, bw_buffer, kBufferSize);
|
||||||
bit_rnd.Reset(random_seed);
|
bit_rnd.Reset(random_seed);
|
||||||
for (int i = 0; i < bits_to_test; ++i) {
|
for (int i = 0; i < kBitsToTest; ++i) {
|
||||||
if (bit_method == 2) {
|
if (bit_method == 2) {
|
||||||
bit = (i & 1);
|
bit = (i & 1);
|
||||||
} else if (bit_method == 3) {
|
} else if (bit_method == 3) {
|
||||||
bit = bit_rnd(2);
|
bit = bit_rnd(2);
|
||||||
}
|
}
|
||||||
GTEST_ASSERT_EQ(vp9_read(&br, probas[i]), bit)
|
GTEST_ASSERT_EQ(vp9_read(&br, probas[i]), bit)
|
||||||
<< "pos: " << i << " / " << bits_to_test
|
<< "pos: " << i << " / " << kBitsToTest
|
||||||
<< " bit_method: " << bit_method
|
<< " bit_method: " << bit_method
|
||||||
<< " method: " << method;
|
<< " method: " << method;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2012 The WebM project authors. All Rights Reserved.
|
* Copyright (c) 2013 The WebM project authors. All Rights Reserved.
|
||||||
|
*
|
||||||
Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
tree. An additional intellectual property rights grant can be found
|
* tree. An additional intellectual property rights grant can be found
|
||||||
in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
@@ -35,7 +35,7 @@ class LossLessTest : public ::libvpx_test::EncoderTest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void BeginPassHook(unsigned int /*pass*/) {
|
virtual void BeginPassHook(unsigned int /*pass*/) {
|
||||||
psnr_ = 0.0;
|
psnr_ = kMaxPsnr;
|
||||||
nframes_ = 0;
|
nframes_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,9 +65,9 @@ TEST_P(LossLessTest, TestLossLessEncoding) {
|
|||||||
init_flags_ = VPX_CODEC_USE_PSNR;
|
init_flags_ = VPX_CODEC_USE_PSNR;
|
||||||
|
|
||||||
// intentionally changed the dimension for better testing coverage
|
// intentionally changed the dimension for better testing coverage
|
||||||
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 356, 284,
|
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
|
||||||
timebase.den, timebase.num, 0, 30);
|
timebase.den, timebase.num, 0, 10);
|
||||||
|
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
|
||||||
const double psnr_lossless = GetMinPsnr();
|
const double psnr_lossless = GetMinPsnr();
|
||||||
EXPECT_GE(psnr_lossless, kMaxPsnr);
|
EXPECT_GE(psnr_lossless, kMaxPsnr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
|
|||||||
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
ACMRandom rnd(ACMRandom::DeterministicSeed());
|
||||||
|
|
||||||
// FIXME(rbultje) split in its own file
|
// FIXME(rbultje) split in its own file
|
||||||
for (BLOCK_SIZE_TYPE bsize = BLOCK_4X4; bsize < BLOCK_SIZE_TYPES;
|
for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES;
|
||||||
bsize = static_cast<BLOCK_SIZE_TYPE>(static_cast<int>(bsize) + 1)) {
|
bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) {
|
||||||
const int block_width = 4 << b_width_log2(bsize);
|
const int block_width = 4 * num_4x4_blocks_wide_lookup[bsize];
|
||||||
const int block_height = 4 << b_height_log2(bsize);
|
const int block_height = 4 * num_4x4_blocks_high_lookup[bsize];
|
||||||
int16_t *diff = reinterpret_cast<int16_t *>(
|
int16_t *diff = reinterpret_cast<int16_t *>(
|
||||||
vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2));
|
vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2));
|
||||||
uint8_t *pred = reinterpret_cast<uint8_t *>(
|
uint8_t *pred = reinterpret_cast<uint8_t *>(
|
||||||
|
|||||||
@@ -8,17 +8,20 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "vp9/decoder/vp9_thread.h"
|
#include <string>
|
||||||
|
|
||||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||||
#include "test/codec_factory.h"
|
#include "test/codec_factory.h"
|
||||||
#include "test/decode_test_driver.h"
|
#include "test/decode_test_driver.h"
|
||||||
#include "test/md5_helper.h"
|
#include "test/md5_helper.h"
|
||||||
#include "test/webm_video_source.h"
|
#include "test/webm_video_source.h"
|
||||||
|
#include "vp9/decoder/vp9_thread.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class VP9WorkerThreadTest : public ::testing::Test {
|
using std::string;
|
||||||
|
|
||||||
|
class VP9WorkerThreadTest : public ::testing::TestWithParam<bool> {
|
||||||
protected:
|
protected:
|
||||||
virtual ~VP9WorkerThreadTest() {}
|
virtual ~VP9WorkerThreadTest() {}
|
||||||
virtual void SetUp() {
|
virtual void SetUp() {
|
||||||
@@ -38,11 +41,11 @@ int ThreadHook(void* data, void* return_value) {
|
|||||||
return *reinterpret_cast<int*>(return_value);
|
return *reinterpret_cast<int*>(return_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VP9WorkerThreadTest, HookSuccess) {
|
TEST_P(VP9WorkerThreadTest, HookSuccess) {
|
||||||
EXPECT_TRUE(vp9_worker_sync(&worker_)); // should be a no-op.
|
EXPECT_NE(vp9_worker_sync(&worker_), 0); // should be a no-op.
|
||||||
|
|
||||||
for (int i = 0; i < 2; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
EXPECT_TRUE(vp9_worker_reset(&worker_));
|
EXPECT_NE(vp9_worker_reset(&worker_), 0);
|
||||||
|
|
||||||
int hook_data = 0;
|
int hook_data = 0;
|
||||||
int return_value = 1; // return successfully from the hook
|
int return_value = 1; // return successfully from the hook
|
||||||
@@ -50,17 +53,22 @@ TEST_F(VP9WorkerThreadTest, HookSuccess) {
|
|||||||
worker_.data1 = &hook_data;
|
worker_.data1 = &hook_data;
|
||||||
worker_.data2 = &return_value;
|
worker_.data2 = &return_value;
|
||||||
|
|
||||||
|
const bool synchronous = GetParam();
|
||||||
|
if (synchronous) {
|
||||||
|
vp9_worker_execute(&worker_);
|
||||||
|
} else {
|
||||||
vp9_worker_launch(&worker_);
|
vp9_worker_launch(&worker_);
|
||||||
EXPECT_TRUE(vp9_worker_sync(&worker_));
|
}
|
||||||
|
EXPECT_NE(vp9_worker_sync(&worker_), 0);
|
||||||
EXPECT_FALSE(worker_.had_error);
|
EXPECT_FALSE(worker_.had_error);
|
||||||
EXPECT_EQ(5, hook_data);
|
EXPECT_EQ(5, hook_data);
|
||||||
|
|
||||||
EXPECT_TRUE(vp9_worker_sync(&worker_)); // should be a no-op.
|
EXPECT_NE(vp9_worker_sync(&worker_), 0); // should be a no-op.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(VP9WorkerThreadTest, HookFailure) {
|
TEST_P(VP9WorkerThreadTest, HookFailure) {
|
||||||
EXPECT_TRUE(vp9_worker_reset(&worker_));
|
EXPECT_NE(vp9_worker_reset(&worker_), 0);
|
||||||
|
|
||||||
int hook_data = 0;
|
int hook_data = 0;
|
||||||
int return_value = 0; // return failure from the hook
|
int return_value = 0; // return failure from the hook
|
||||||
@@ -68,32 +76,44 @@ TEST_F(VP9WorkerThreadTest, HookFailure) {
|
|||||||
worker_.data1 = &hook_data;
|
worker_.data1 = &hook_data;
|
||||||
worker_.data2 = &return_value;
|
worker_.data2 = &return_value;
|
||||||
|
|
||||||
|
const bool synchronous = GetParam();
|
||||||
|
if (synchronous) {
|
||||||
|
vp9_worker_execute(&worker_);
|
||||||
|
} else {
|
||||||
vp9_worker_launch(&worker_);
|
vp9_worker_launch(&worker_);
|
||||||
|
}
|
||||||
EXPECT_FALSE(vp9_worker_sync(&worker_));
|
EXPECT_FALSE(vp9_worker_sync(&worker_));
|
||||||
EXPECT_TRUE(worker_.had_error);
|
EXPECT_EQ(1, worker_.had_error);
|
||||||
|
|
||||||
// Ensure _reset() clears the error and _launch() can be called again.
|
// Ensure _reset() clears the error and _launch() can be called again.
|
||||||
return_value = 1;
|
return_value = 1;
|
||||||
EXPECT_TRUE(vp9_worker_reset(&worker_));
|
EXPECT_NE(vp9_worker_reset(&worker_), 0);
|
||||||
EXPECT_FALSE(worker_.had_error);
|
EXPECT_FALSE(worker_.had_error);
|
||||||
vp9_worker_launch(&worker_);
|
vp9_worker_launch(&worker_);
|
||||||
EXPECT_TRUE(vp9_worker_sync(&worker_));
|
EXPECT_NE(vp9_worker_sync(&worker_), 0);
|
||||||
EXPECT_FALSE(worker_.had_error);
|
EXPECT_FALSE(worker_.had_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(VP9DecodeMTTest, MTDecode) {
|
// -----------------------------------------------------------------------------
|
||||||
libvpx_test::WebMVideoSource video("vp90-2-03-size-226x226.webm");
|
// Multi-threaded decode tests
|
||||||
|
|
||||||
|
// Decodes |filename| with |num_threads|. Returns the md5 of the decoded frames.
|
||||||
|
string DecodeFile(const string& filename, int num_threads) {
|
||||||
|
libvpx_test::WebMVideoSource video(filename);
|
||||||
video.Init();
|
video.Init();
|
||||||
|
|
||||||
vpx_codec_dec_cfg_t cfg = {0};
|
vpx_codec_dec_cfg_t cfg = {0};
|
||||||
cfg.threads = 2;
|
cfg.threads = num_threads;
|
||||||
libvpx_test::VP9Decoder decoder(cfg, 0);
|
libvpx_test::VP9Decoder decoder(cfg, 0);
|
||||||
|
|
||||||
libvpx_test::MD5 md5;
|
libvpx_test::MD5 md5;
|
||||||
for (video.Begin(); video.cxdata(); video.Next()) {
|
for (video.Begin(); video.cxdata(); video.Next()) {
|
||||||
const vpx_codec_err_t res =
|
const vpx_codec_err_t res =
|
||||||
decoder.DecodeFrame(video.cxdata(), video.frame_size());
|
decoder.DecodeFrame(video.cxdata(), video.frame_size());
|
||||||
ASSERT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
|
if (res != VPX_CODEC_OK) {
|
||||||
|
EXPECT_EQ(VPX_CODEC_OK, res) << decoder.DecodeError();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
|
libvpx_test::DxDataIterator dec_iter = decoder.GetDxData();
|
||||||
const vpx_image_t *img = NULL;
|
const vpx_image_t *img = NULL;
|
||||||
@@ -103,7 +123,36 @@ TEST(VP9DecodeMTTest, MTDecode) {
|
|||||||
md5.Add(img);
|
md5.Add(img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPECT_STREQ("b35a1b707b28e82be025d960aba039bc", md5.Get());
|
return string(md5.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(VP9DecodeMTTest, MTDecode) {
|
||||||
|
// no tiles or frame parallel; this exercises loop filter threading.
|
||||||
|
EXPECT_STREQ("b35a1b707b28e82be025d960aba039bc",
|
||||||
|
DecodeFile("vp90-2-03-size-226x226.webm", 2).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(VP9DecodeMTTest, MTDecode2) {
|
||||||
|
static const struct {
|
||||||
|
const char *name;
|
||||||
|
const char *expected_md5;
|
||||||
|
} files[] = {
|
||||||
|
{ "vp90-2-08-tile_1x2_frame_parallel.webm",
|
||||||
|
"68ede6abd66bae0a2edf2eb9232241b6" },
|
||||||
|
{ "vp90-2-08-tile_1x4_frame_parallel.webm",
|
||||||
|
"368ebc6ebf3a5e478d85b2c3149b2848" },
|
||||||
|
{ "vp90-2-08-tile_1x8_frame_parallel.webm",
|
||||||
|
"17e439da2388aff3a0f69cb22579c6c1" },
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int i = 0; i < static_cast<int>(sizeof(files) / sizeof(files[0])); ++i) {
|
||||||
|
for (int t = 2; t <= 8; ++t) {
|
||||||
|
EXPECT_STREQ(files[i].expected_md5, DecodeFile(files[i].name, t).c_str())
|
||||||
|
<< "threads = " << t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_CASE_P(Synchronous, VP9WorkerThreadTest, ::testing::Bool());
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -90,9 +90,13 @@ class WebMVideoSource : public CompressedVideoSource {
|
|||||||
virtual ~WebMVideoSource() {
|
virtual ~WebMVideoSource() {
|
||||||
if (input_file_)
|
if (input_file_)
|
||||||
fclose(input_file_);
|
fclose(input_file_);
|
||||||
if (nestegg_ctx_)
|
if (nestegg_ctx_ != NULL) {
|
||||||
|
if (pkt_ != NULL) {
|
||||||
|
nestegg_free_packet(pkt_);
|
||||||
|
}
|
||||||
nestegg_destroy(nestegg_ctx_);
|
nestegg_destroy(nestegg_ctx_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void Init() {
|
virtual void Init() {
|
||||||
}
|
}
|
||||||
@@ -136,8 +140,10 @@ class WebMVideoSource : public CompressedVideoSource {
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
/* End of this packet, get another. */
|
/* End of this packet, get another. */
|
||||||
if (pkt_)
|
if (pkt_ != NULL) {
|
||||||
nestegg_free_packet(pkt_);
|
nestegg_free_packet(pkt_);
|
||||||
|
pkt_ = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
int again = nestegg_read_packet(nestegg_ctx_, &pkt_);
|
int again = nestegg_read_packet(nestegg_ctx_, &pkt_);
|
||||||
ASSERT_GE(again, 0) << "nestegg_read_packet failed";
|
ASSERT_GE(again, 0) << "nestegg_read_packet failed";
|
||||||
|
|||||||
2
third_party/googletest/README.webm
vendored
2
third_party/googletest/README.webm
vendored
@@ -1,5 +1,5 @@
|
|||||||
URL: http://code.google.com/p/googletest/
|
URL: http://code.google.com/p/googletest/
|
||||||
Version: 1.6.0
|
Version: 1.7.0
|
||||||
License: BSD
|
License: BSD
|
||||||
License File: COPYING
|
License File: COPYING
|
||||||
|
|
||||||
|
|||||||
27
third_party/googletest/src/CHANGES
vendored
27
third_party/googletest/src/CHANGES
vendored
@@ -1,3 +1,30 @@
|
|||||||
|
Changes for 1.7.0:
|
||||||
|
|
||||||
|
* New feature: death tests are supported on OpenBSD and in iOS
|
||||||
|
simulator now.
|
||||||
|
* New feature: Google Test now implements a protocol to allow
|
||||||
|
a test runner to detect that a test program has exited
|
||||||
|
prematurely and report it as a failure (before it would be
|
||||||
|
falsely reported as a success if the exit code is 0).
|
||||||
|
* New feature: Test::RecordProperty() can now be used outside of the
|
||||||
|
lifespan of a test method, in which case it will be attributed to
|
||||||
|
the current test case or the test program in the XML report.
|
||||||
|
* New feature (potentially breaking): --gtest_list_tests now prints
|
||||||
|
the type parameters and value parameters for each test.
|
||||||
|
* Improvement: char pointers and char arrays are now escaped properly
|
||||||
|
in failure messages.
|
||||||
|
* Improvement: failure summary in XML reports now includes file and
|
||||||
|
line information.
|
||||||
|
* Improvement: the <testsuites> XML element now has a timestamp attribute.
|
||||||
|
* Improvement: When --gtest_filter is specified, XML report now doesn't
|
||||||
|
contain information about tests that are filtered out.
|
||||||
|
* Fixed the bug where long --gtest_filter flag values are truncated in
|
||||||
|
death tests.
|
||||||
|
* Potentially breaking change: RUN_ALL_TESTS() is now implemented as a
|
||||||
|
function instead of a macro in order to work better with Clang.
|
||||||
|
* Compatibility fixes with C++ 11 and various platforms.
|
||||||
|
* Bug/warning fixes.
|
||||||
|
|
||||||
Changes for 1.6.0:
|
Changes for 1.6.0:
|
||||||
|
|
||||||
* New feature: ADD_FAILURE_AT() for reporting a test failure at the
|
* New feature: ADD_FAILURE_AT() for reporting a test failure at the
|
||||||
|
|||||||
240
third_party/googletest/src/CMakeLists.txt
vendored
240
third_party/googletest/src/CMakeLists.txt
vendored
@@ -1,240 +0,0 @@
|
|||||||
########################################################################
|
|
||||||
# CMake build script for Google Test.
|
|
||||||
#
|
|
||||||
# To run the tests for Google Test itself on Linux, use 'make test' or
|
|
||||||
# ctest. You can select which tests to run using 'ctest -R regex'.
|
|
||||||
# For more options, run 'ctest --help'.
|
|
||||||
|
|
||||||
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
|
|
||||||
# make it prominent in the GUI.
|
|
||||||
option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
|
|
||||||
|
|
||||||
# When other libraries are using a shared version of runtime libraries,
|
|
||||||
# Google Test also has to use one.
|
|
||||||
option(
|
|
||||||
gtest_force_shared_crt
|
|
||||||
"Use shared (DLL) run-time lib even when Google Test is built as static lib."
|
|
||||||
OFF)
|
|
||||||
|
|
||||||
option(gtest_build_tests "Build all of gtest's own tests." OFF)
|
|
||||||
|
|
||||||
option(gtest_build_samples "Build gtest's sample programs." OFF)
|
|
||||||
|
|
||||||
option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
|
|
||||||
|
|
||||||
# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
|
|
||||||
include(cmake/hermetic_build.cmake OPTIONAL)
|
|
||||||
|
|
||||||
if (COMMAND pre_project_set_up_hermetic_build)
|
|
||||||
pre_project_set_up_hermetic_build()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
#
|
|
||||||
# Project-wide settings
|
|
||||||
|
|
||||||
# Name of the project.
|
|
||||||
#
|
|
||||||
# CMake files in this project can refer to the root source directory
|
|
||||||
# as ${gtest_SOURCE_DIR} and to the root binary directory as
|
|
||||||
# ${gtest_BINARY_DIR}.
|
|
||||||
# Language "C" is required for find_package(Threads).
|
|
||||||
project(gtest CXX C)
|
|
||||||
cmake_minimum_required(VERSION 2.6.2)
|
|
||||||
|
|
||||||
if (COMMAND set_up_hermetic_build)
|
|
||||||
set_up_hermetic_build()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Define helper functions and macros used by Google Test.
|
|
||||||
include(cmake/internal_utils.cmake)
|
|
||||||
|
|
||||||
config_compiler_and_linker() # Defined in internal_utils.cmake.
|
|
||||||
|
|
||||||
# Where Google Test's .h files can be found.
|
|
||||||
include_directories(
|
|
||||||
${gtest_SOURCE_DIR}/include
|
|
||||||
${gtest_SOURCE_DIR})
|
|
||||||
|
|
||||||
# Where Google Test's libraries can be found.
|
|
||||||
link_directories(${gtest_BINARY_DIR}/src)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
#
|
|
||||||
# Defines the gtest & gtest_main libraries. User tests should link
|
|
||||||
# with one of them.
|
|
||||||
|
|
||||||
# Google Test libraries. We build them using more strict warnings than what
|
|
||||||
# are used for other targets, to ensure that gtest can be compiled by a user
|
|
||||||
# aggressive about warnings.
|
|
||||||
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
|
|
||||||
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
|
|
||||||
target_link_libraries(gtest_main gtest)
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
#
|
|
||||||
# Samples on how to link user tests with gtest or gtest_main.
|
|
||||||
#
|
|
||||||
# They are not built by default. To build them, set the
|
|
||||||
# gtest_build_samples option to ON. You can do it by running ccmake
|
|
||||||
# or specifying the -Dbuild_gtest_samples=ON flag when running cmake.
|
|
||||||
|
|
||||||
if (gtest_build_samples)
|
|
||||||
cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
|
|
||||||
cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
|
|
||||||
cxx_executable(sample3_unittest samples gtest_main)
|
|
||||||
cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
|
|
||||||
cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
|
|
||||||
cxx_executable(sample6_unittest samples gtest_main)
|
|
||||||
cxx_executable(sample7_unittest samples gtest_main)
|
|
||||||
cxx_executable(sample8_unittest samples gtest_main)
|
|
||||||
cxx_executable(sample9_unittest samples gtest)
|
|
||||||
cxx_executable(sample10_unittest samples gtest)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
#
|
|
||||||
# Google Test's own tests.
|
|
||||||
#
|
|
||||||
# You can skip this section if you aren't interested in testing
|
|
||||||
# Google Test itself.
|
|
||||||
#
|
|
||||||
# The tests are not built by default. To build them, set the
|
|
||||||
# gtest_build_tests option to ON. You can do it by running ccmake
|
|
||||||
# or specifying the -Dgtest_build_tests=ON flag when running cmake.
|
|
||||||
|
|
||||||
if (gtest_build_tests)
|
|
||||||
# This must be set in the root directory for the tests to be run by
|
|
||||||
# 'make test' or ctest.
|
|
||||||
enable_testing()
|
|
||||||
|
|
||||||
############################################################
|
|
||||||
# C++ tests built with standard compiler flags.
|
|
||||||
|
|
||||||
cxx_test(gtest-death-test_test gtest_main)
|
|
||||||
cxx_test(gtest_environment_test gtest)
|
|
||||||
cxx_test(gtest-filepath_test gtest_main)
|
|
||||||
cxx_test(gtest-linked_ptr_test gtest_main)
|
|
||||||
cxx_test(gtest-listener_test gtest_main)
|
|
||||||
cxx_test(gtest_main_unittest gtest_main)
|
|
||||||
cxx_test(gtest-message_test gtest_main)
|
|
||||||
cxx_test(gtest_no_test_unittest gtest)
|
|
||||||
cxx_test(gtest-options_test gtest_main)
|
|
||||||
cxx_test(gtest-param-test_test gtest
|
|
||||||
test/gtest-param-test2_test.cc)
|
|
||||||
cxx_test(gtest-port_test gtest_main)
|
|
||||||
cxx_test(gtest_pred_impl_unittest gtest_main)
|
|
||||||
cxx_test(gtest-printers_test gtest_main)
|
|
||||||
cxx_test(gtest_prod_test gtest_main
|
|
||||||
test/production.cc)
|
|
||||||
cxx_test(gtest_repeat_test gtest)
|
|
||||||
cxx_test(gtest_sole_header_test gtest_main)
|
|
||||||
cxx_test(gtest_stress_test gtest)
|
|
||||||
cxx_test(gtest-test-part_test gtest_main)
|
|
||||||
cxx_test(gtest_throw_on_failure_ex_test gtest)
|
|
||||||
cxx_test(gtest-typed-test_test gtest_main
|
|
||||||
test/gtest-typed-test2_test.cc)
|
|
||||||
cxx_test(gtest_unittest gtest_main)
|
|
||||||
cxx_test(gtest-unittest-api_test gtest)
|
|
||||||
|
|
||||||
############################################################
|
|
||||||
# C++ tests built with non-standard compiler flags.
|
|
||||||
|
|
||||||
cxx_library(gtest_no_exception "${cxx_no_exception}"
|
|
||||||
src/gtest-all.cc)
|
|
||||||
cxx_library(gtest_main_no_exception "${cxx_no_exception}"
|
|
||||||
src/gtest-all.cc src/gtest_main.cc)
|
|
||||||
cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
|
|
||||||
src/gtest-all.cc src/gtest_main.cc)
|
|
||||||
|
|
||||||
cxx_test_with_flags(gtest-death-test_ex_nocatch_test
|
|
||||||
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
|
|
||||||
gtest test/gtest-death-test_ex_test.cc)
|
|
||||||
cxx_test_with_flags(gtest-death-test_ex_catch_test
|
|
||||||
"${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
|
|
||||||
gtest test/gtest-death-test_ex_test.cc)
|
|
||||||
|
|
||||||
cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
|
|
||||||
gtest_main_no_rtti test/gtest_unittest.cc)
|
|
||||||
|
|
||||||
cxx_shared_library(gtest_dll "${cxx_default}"
|
|
||||||
src/gtest-all.cc src/gtest_main.cc)
|
|
||||||
|
|
||||||
cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
|
|
||||||
gtest_dll test/gtest_all_test.cc)
|
|
||||||
set_target_properties(gtest_dll_test_
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
|
|
||||||
|
|
||||||
if (NOT MSVC OR NOT MSVC_VERSION EQUAL 1600)
|
|
||||||
# The C++ Standard specifies tuple_element<int, class>.
|
|
||||||
# Yet MSVC 10's <utility> declares tuple_element<size_t, class>.
|
|
||||||
# That declaration conflicts with our own standard-conforming
|
|
||||||
# tuple implementation. Therefore using our own tuple with
|
|
||||||
# MSVC 10 doesn't compile.
|
|
||||||
cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
|
|
||||||
src/gtest-all.cc src/gtest_main.cc)
|
|
||||||
|
|
||||||
cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
|
|
||||||
gtest_main_use_own_tuple test/gtest-tuple_test.cc)
|
|
||||||
|
|
||||||
cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
|
|
||||||
gtest_main_use_own_tuple
|
|
||||||
test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
############################################################
|
|
||||||
# Python tests.
|
|
||||||
|
|
||||||
cxx_executable(gtest_break_on_failure_unittest_ test gtest)
|
|
||||||
py_test(gtest_break_on_failure_unittest)
|
|
||||||
|
|
||||||
cxx_executable_with_flags(
|
|
||||||
gtest_catch_exceptions_no_ex_test_
|
|
||||||
"${cxx_no_exception}"
|
|
||||||
gtest_main_no_exception
|
|
||||||
test/gtest_catch_exceptions_test_.cc)
|
|
||||||
cxx_executable_with_flags(
|
|
||||||
gtest_catch_exceptions_ex_test_
|
|
||||||
"${cxx_exception}"
|
|
||||||
gtest_main
|
|
||||||
test/gtest_catch_exceptions_test_.cc)
|
|
||||||
py_test(gtest_catch_exceptions_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_color_test_ test gtest)
|
|
||||||
py_test(gtest_color_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_env_var_test_ test gtest)
|
|
||||||
py_test(gtest_env_var_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_filter_unittest_ test gtest)
|
|
||||||
py_test(gtest_filter_unittest)
|
|
||||||
|
|
||||||
cxx_executable(gtest_help_test_ test gtest_main)
|
|
||||||
py_test(gtest_help_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_list_tests_unittest_ test gtest)
|
|
||||||
py_test(gtest_list_tests_unittest)
|
|
||||||
|
|
||||||
cxx_executable(gtest_output_test_ test gtest)
|
|
||||||
py_test(gtest_output_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_shuffle_test_ test gtest)
|
|
||||||
py_test(gtest_shuffle_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
|
|
||||||
set_target_properties(gtest_throw_on_failure_test_
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "${cxx_no_exception}")
|
|
||||||
py_test(gtest_throw_on_failure_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_uninitialized_test_ test gtest)
|
|
||||||
py_test(gtest_uninitialized_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
|
|
||||||
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
|
|
||||||
py_test(gtest_xml_outfiles_test)
|
|
||||||
|
|
||||||
cxx_executable(gtest_xml_output_unittest_ test gtest)
|
|
||||||
py_test(gtest_xml_output_unittest)
|
|
||||||
endif()
|
|
||||||
302
third_party/googletest/src/Makefile.am
vendored
302
third_party/googletest/src/Makefile.am
vendored
@@ -1,302 +0,0 @@
|
|||||||
# Automake file
|
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
|
||||||
|
|
||||||
# Nonstandard package files for distribution
|
|
||||||
EXTRA_DIST = \
|
|
||||||
CHANGES \
|
|
||||||
CONTRIBUTORS \
|
|
||||||
include/gtest/gtest-param-test.h.pump \
|
|
||||||
include/gtest/internal/gtest-param-util-generated.h.pump \
|
|
||||||
include/gtest/internal/gtest-tuple.h.pump \
|
|
||||||
include/gtest/internal/gtest-type-util.h.pump \
|
|
||||||
make/Makefile \
|
|
||||||
scripts/fuse_gtest_files.py \
|
|
||||||
scripts/gen_gtest_pred_impl.py \
|
|
||||||
scripts/pump.py \
|
|
||||||
scripts/test/Makefile
|
|
||||||
|
|
||||||
# gtest source files that we don't compile directly. They are
|
|
||||||
# #included by gtest-all.cc.
|
|
||||||
GTEST_SRC = \
|
|
||||||
src/gtest-death-test.cc \
|
|
||||||
src/gtest-filepath.cc \
|
|
||||||
src/gtest-internal-inl.h \
|
|
||||||
src/gtest-port.cc \
|
|
||||||
src/gtest-printers.cc \
|
|
||||||
src/gtest-test-part.cc \
|
|
||||||
src/gtest-typed-test.cc \
|
|
||||||
src/gtest.cc
|
|
||||||
|
|
||||||
EXTRA_DIST += $(GTEST_SRC)
|
|
||||||
|
|
||||||
# Sample files that we don't compile.
|
|
||||||
EXTRA_DIST += \
|
|
||||||
samples/prime_tables.h \
|
|
||||||
samples/sample2_unittest.cc \
|
|
||||||
samples/sample3_unittest.cc \
|
|
||||||
samples/sample4_unittest.cc \
|
|
||||||
samples/sample5_unittest.cc \
|
|
||||||
samples/sample6_unittest.cc \
|
|
||||||
samples/sample7_unittest.cc \
|
|
||||||
samples/sample8_unittest.cc \
|
|
||||||
samples/sample9_unittest.cc
|
|
||||||
|
|
||||||
# C++ test files that we don't compile directly.
|
|
||||||
EXTRA_DIST += \
|
|
||||||
test/gtest-death-test_ex_test.cc \
|
|
||||||
test/gtest-death-test_test.cc \
|
|
||||||
test/gtest-filepath_test.cc \
|
|
||||||
test/gtest-linked_ptr_test.cc \
|
|
||||||
test/gtest-listener_test.cc \
|
|
||||||
test/gtest-message_test.cc \
|
|
||||||
test/gtest-options_test.cc \
|
|
||||||
test/gtest-param-test2_test.cc \
|
|
||||||
test/gtest-param-test2_test.cc \
|
|
||||||
test/gtest-param-test_test.cc \
|
|
||||||
test/gtest-param-test_test.cc \
|
|
||||||
test/gtest-param-test_test.h \
|
|
||||||
test/gtest-port_test.cc \
|
|
||||||
test/gtest-printers_test.cc \
|
|
||||||
test/gtest-test-part_test.cc \
|
|
||||||
test/gtest-tuple_test.cc \
|
|
||||||
test/gtest-typed-test2_test.cc \
|
|
||||||
test/gtest-typed-test_test.cc \
|
|
||||||
test/gtest-typed-test_test.h \
|
|
||||||
test/gtest-unittest-api_test.cc \
|
|
||||||
test/gtest_break_on_failure_unittest_.cc \
|
|
||||||
test/gtest_catch_exceptions_test_.cc \
|
|
||||||
test/gtest_color_test_.cc \
|
|
||||||
test/gtest_env_var_test_.cc \
|
|
||||||
test/gtest_environment_test.cc \
|
|
||||||
test/gtest_filter_unittest_.cc \
|
|
||||||
test/gtest_help_test_.cc \
|
|
||||||
test/gtest_list_tests_unittest_.cc \
|
|
||||||
test/gtest_main_unittest.cc \
|
|
||||||
test/gtest_no_test_unittest.cc \
|
|
||||||
test/gtest_output_test_.cc \
|
|
||||||
test/gtest_pred_impl_unittest.cc \
|
|
||||||
test/gtest_prod_test.cc \
|
|
||||||
test/gtest_repeat_test.cc \
|
|
||||||
test/gtest_shuffle_test_.cc \
|
|
||||||
test/gtest_sole_header_test.cc \
|
|
||||||
test/gtest_stress_test.cc \
|
|
||||||
test/gtest_throw_on_failure_ex_test.cc \
|
|
||||||
test/gtest_throw_on_failure_test_.cc \
|
|
||||||
test/gtest_uninitialized_test_.cc \
|
|
||||||
test/gtest_unittest.cc \
|
|
||||||
test/gtest_unittest.cc \
|
|
||||||
test/gtest_xml_outfile1_test_.cc \
|
|
||||||
test/gtest_xml_outfile2_test_.cc \
|
|
||||||
test/gtest_xml_output_unittest_.cc \
|
|
||||||
test/production.cc \
|
|
||||||
test/production.h
|
|
||||||
|
|
||||||
# Python tests that we don't run.
|
|
||||||
EXTRA_DIST += \
|
|
||||||
test/gtest_break_on_failure_unittest.py \
|
|
||||||
test/gtest_catch_exceptions_test.py \
|
|
||||||
test/gtest_color_test.py \
|
|
||||||
test/gtest_env_var_test.py \
|
|
||||||
test/gtest_filter_unittest.py \
|
|
||||||
test/gtest_help_test.py \
|
|
||||||
test/gtest_list_tests_unittest.py \
|
|
||||||
test/gtest_output_test.py \
|
|
||||||
test/gtest_output_test_golden_lin.txt \
|
|
||||||
test/gtest_shuffle_test.py \
|
|
||||||
test/gtest_test_utils.py \
|
|
||||||
test/gtest_throw_on_failure_test.py \
|
|
||||||
test/gtest_uninitialized_test.py \
|
|
||||||
test/gtest_xml_outfiles_test.py \
|
|
||||||
test/gtest_xml_output_unittest.py \
|
|
||||||
test/gtest_xml_test_utils.py
|
|
||||||
|
|
||||||
# CMake script
|
|
||||||
EXTRA_DIST += \
|
|
||||||
CMakeLists.txt \
|
|
||||||
cmake/internal_utils.cmake
|
|
||||||
|
|
||||||
# MSVC project files
|
|
||||||
EXTRA_DIST += \
|
|
||||||
msvc/gtest-md.sln \
|
|
||||||
msvc/gtest-md.vcproj \
|
|
||||||
msvc/gtest.sln \
|
|
||||||
msvc/gtest.vcproj \
|
|
||||||
msvc/gtest_main-md.vcproj \
|
|
||||||
msvc/gtest_main.vcproj \
|
|
||||||
msvc/gtest_prod_test-md.vcproj \
|
|
||||||
msvc/gtest_prod_test.vcproj \
|
|
||||||
msvc/gtest_unittest-md.vcproj \
|
|
||||||
msvc/gtest_unittest.vcproj
|
|
||||||
|
|
||||||
# xcode project files
|
|
||||||
EXTRA_DIST += \
|
|
||||||
xcode/Config/DebugProject.xcconfig \
|
|
||||||
xcode/Config/FrameworkTarget.xcconfig \
|
|
||||||
xcode/Config/General.xcconfig \
|
|
||||||
xcode/Config/ReleaseProject.xcconfig \
|
|
||||||
xcode/Config/StaticLibraryTarget.xcconfig \
|
|
||||||
xcode/Config/TestTarget.xcconfig \
|
|
||||||
xcode/Resources/Info.plist \
|
|
||||||
xcode/Scripts/runtests.sh \
|
|
||||||
xcode/Scripts/versiongenerate.py \
|
|
||||||
xcode/gtest.xcodeproj/project.pbxproj
|
|
||||||
|
|
||||||
# xcode sample files
|
|
||||||
EXTRA_DIST += \
|
|
||||||
xcode/Samples/FrameworkSample/Info.plist \
|
|
||||||
xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \
|
|
||||||
xcode/Samples/FrameworkSample/runtests.sh \
|
|
||||||
xcode/Samples/FrameworkSample/widget.cc \
|
|
||||||
xcode/Samples/FrameworkSample/widget.h \
|
|
||||||
xcode/Samples/FrameworkSample/widget_test.cc
|
|
||||||
|
|
||||||
# C++Builder project files
|
|
||||||
EXTRA_DIST += \
|
|
||||||
codegear/gtest.cbproj \
|
|
||||||
codegear/gtest.groupproj \
|
|
||||||
codegear/gtest_all.cc \
|
|
||||||
codegear/gtest_link.cc \
|
|
||||||
codegear/gtest_main.cbproj \
|
|
||||||
codegear/gtest_unittest.cbproj
|
|
||||||
|
|
||||||
# Distribute and install M4 macro
|
|
||||||
m4datadir = $(datadir)/aclocal
|
|
||||||
m4data_DATA = m4/gtest.m4
|
|
||||||
EXTRA_DIST += $(m4data_DATA)
|
|
||||||
|
|
||||||
# We define the global AM_CPPFLAGS as everything we compile includes from these
|
|
||||||
# directories.
|
|
||||||
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include
|
|
||||||
|
|
||||||
# Modifies compiler and linker flags for pthreads compatibility.
|
|
||||||
if HAVE_PTHREADS
|
|
||||||
AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
|
|
||||||
AM_LIBS = @PTHREAD_LIBS@
|
|
||||||
else
|
|
||||||
AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Build rules for libraries.
|
|
||||||
lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la
|
|
||||||
|
|
||||||
lib_libgtest_la_SOURCES = src/gtest-all.cc
|
|
||||||
|
|
||||||
pkginclude_HEADERS = \
|
|
||||||
include/gtest/gtest-death-test.h \
|
|
||||||
include/gtest/gtest-message.h \
|
|
||||||
include/gtest/gtest-param-test.h \
|
|
||||||
include/gtest/gtest-printers.h \
|
|
||||||
include/gtest/gtest-spi.h \
|
|
||||||
include/gtest/gtest-test-part.h \
|
|
||||||
include/gtest/gtest-typed-test.h \
|
|
||||||
include/gtest/gtest.h \
|
|
||||||
include/gtest/gtest_pred_impl.h \
|
|
||||||
include/gtest/gtest_prod.h
|
|
||||||
|
|
||||||
pkginclude_internaldir = $(pkgincludedir)/internal
|
|
||||||
pkginclude_internal_HEADERS = \
|
|
||||||
include/gtest/internal/gtest-death-test-internal.h \
|
|
||||||
include/gtest/internal/gtest-filepath.h \
|
|
||||||
include/gtest/internal/gtest-internal.h \
|
|
||||||
include/gtest/internal/gtest-linked_ptr.h \
|
|
||||||
include/gtest/internal/gtest-param-util-generated.h \
|
|
||||||
include/gtest/internal/gtest-param-util.h \
|
|
||||||
include/gtest/internal/gtest-port.h \
|
|
||||||
include/gtest/internal/gtest-string.h \
|
|
||||||
include/gtest/internal/gtest-tuple.h \
|
|
||||||
include/gtest/internal/gtest-type-util.h
|
|
||||||
|
|
||||||
lib_libgtest_main_la_SOURCES = src/gtest_main.cc
|
|
||||||
lib_libgtest_main_la_LIBADD = lib/libgtest.la
|
|
||||||
|
|
||||||
# Bulid rules for samples and tests. Automake's naming for some of
|
|
||||||
# these variables isn't terribly obvious, so this is a brief
|
|
||||||
# reference:
|
|
||||||
#
|
|
||||||
# TESTS -- Programs run automatically by "make check"
|
|
||||||
# check_PROGRAMS -- Programs built by "make check" but not necessarily run
|
|
||||||
|
|
||||||
noinst_LTLIBRARIES = samples/libsamples.la
|
|
||||||
|
|
||||||
samples_libsamples_la_SOURCES = \
|
|
||||||
samples/sample1.cc \
|
|
||||||
samples/sample1.h \
|
|
||||||
samples/sample2.cc \
|
|
||||||
samples/sample2.h \
|
|
||||||
samples/sample3-inl.h \
|
|
||||||
samples/sample4.cc \
|
|
||||||
samples/sample4.h
|
|
||||||
|
|
||||||
TESTS=
|
|
||||||
TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
|
|
||||||
GTEST_BUILD_DIR="$(top_builddir)/test"
|
|
||||||
check_PROGRAMS=
|
|
||||||
|
|
||||||
# A simple sample on using gtest.
|
|
||||||
TESTS += samples/sample1_unittest
|
|
||||||
check_PROGRAMS += samples/sample1_unittest
|
|
||||||
samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc
|
|
||||||
samples_sample1_unittest_LDADD = lib/libgtest_main.la \
|
|
||||||
lib/libgtest.la \
|
|
||||||
samples/libsamples.la
|
|
||||||
|
|
||||||
# Another sample. It also verifies that libgtest works.
|
|
||||||
TESTS += samples/sample10_unittest
|
|
||||||
check_PROGRAMS += samples/sample10_unittest
|
|
||||||
samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
|
|
||||||
samples_sample10_unittest_LDADD = lib/libgtest.la
|
|
||||||
|
|
||||||
# This tests most constructs of gtest and verifies that libgtest_main
|
|
||||||
# and libgtest work.
|
|
||||||
TESTS += test/gtest_all_test
|
|
||||||
check_PROGRAMS += test/gtest_all_test
|
|
||||||
test_gtest_all_test_SOURCES = test/gtest_all_test.cc
|
|
||||||
test_gtest_all_test_LDADD = lib/libgtest_main.la \
|
|
||||||
lib/libgtest.la
|
|
||||||
|
|
||||||
# Tests that fused gtest files compile and work.
|
|
||||||
FUSED_GTEST_SRC = \
|
|
||||||
fused-src/gtest/gtest-all.cc \
|
|
||||||
fused-src/gtest/gtest.h \
|
|
||||||
fused-src/gtest/gtest_main.cc
|
|
||||||
|
|
||||||
TESTS += test/fused_gtest_test
|
|
||||||
check_PROGRAMS += test/fused_gtest_test
|
|
||||||
test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \
|
|
||||||
samples/sample1.cc samples/sample1_unittest.cc
|
|
||||||
test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src"
|
|
||||||
|
|
||||||
# Build rules for putting fused Google Test files into the distribution
|
|
||||||
# package. The user can also create those files by manually running
|
|
||||||
# scripts/fuse_gtest_files.py.
|
|
||||||
$(test_fused_gtest_test_SOURCES): fused-gtest
|
|
||||||
|
|
||||||
fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
|
|
||||||
$(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \
|
|
||||||
scripts/fuse_gtest_files.py
|
|
||||||
mkdir -p "$(srcdir)/fused-src"
|
|
||||||
chmod -R u+w "$(srcdir)/fused-src"
|
|
||||||
rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc"
|
|
||||||
rm -f "$(srcdir)/fused-src/gtest/gtest.h"
|
|
||||||
"$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src"
|
|
||||||
cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/"
|
|
||||||
|
|
||||||
maintainer-clean-local:
|
|
||||||
rm -rf "$(srcdir)/fused-src"
|
|
||||||
|
|
||||||
# Death tests may produce core dumps in the build directory. In case
|
|
||||||
# this happens, clean them to keep distcleancheck happy.
|
|
||||||
CLEANFILES = core
|
|
||||||
|
|
||||||
# Disables 'make install' as installing a compiled version of Google
|
|
||||||
# Test can lead to undefined behavior due to violation of the
|
|
||||||
# One-Definition Rule.
|
|
||||||
|
|
||||||
install-exec-local:
|
|
||||||
echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
|
|
||||||
false
|
|
||||||
|
|
||||||
install-data-local:
|
|
||||||
echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
|
|
||||||
false
|
|
||||||
31
third_party/googletest/src/README
vendored
31
third_party/googletest/src/README
vendored
@@ -119,21 +119,22 @@ and Xcode) to compile
|
|||||||
|
|
||||||
${GTEST_DIR}/src/gtest-all.cc
|
${GTEST_DIR}/src/gtest-all.cc
|
||||||
|
|
||||||
with
|
with ${GTEST_DIR}/include in the system header search path and ${GTEST_DIR}
|
||||||
|
in the normal header search path. Assuming a Linux-like system and gcc,
|
||||||
${GTEST_DIR}/include and ${GTEST_DIR}
|
|
||||||
|
|
||||||
in the header search path. Assuming a Linux-like system and gcc,
|
|
||||||
something like the following will do:
|
something like the following will do:
|
||||||
|
|
||||||
g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
|
g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
|
||||||
|
-pthread -c ${GTEST_DIR}/src/gtest-all.cc
|
||||||
ar -rv libgtest.a gtest-all.o
|
ar -rv libgtest.a gtest-all.o
|
||||||
|
|
||||||
Next, you should compile your test source file with
|
(We need -pthread as Google Test uses threads.)
|
||||||
${GTEST_DIR}/include in the header search path, and link it with gtest
|
|
||||||
and any other necessary libraries:
|
|
||||||
|
|
||||||
g++ -I${GTEST_DIR}/include path/to/your_test.cc libgtest.a -o your_test
|
Next, you should compile your test source file with
|
||||||
|
${GTEST_DIR}/include in the system header search path, and link it
|
||||||
|
with gtest and any other necessary libraries:
|
||||||
|
|
||||||
|
g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \
|
||||||
|
-o your_test
|
||||||
|
|
||||||
As an example, the make/ directory contains a Makefile that you can
|
As an example, the make/ directory contains a Makefile that you can
|
||||||
use to build Google Test on systems where GNU make is available
|
use to build Google Test on systems where GNU make is available
|
||||||
@@ -217,6 +218,16 @@ default build location. See the "xcodebuild" man page for more
|
|||||||
information about building different configurations and building in
|
information about building different configurations and building in
|
||||||
different locations.
|
different locations.
|
||||||
|
|
||||||
|
If you wish to use the Google Test Xcode project with Xcode 4.x and
|
||||||
|
above, you need to either:
|
||||||
|
* update the SDK configuration options in xcode/Config/General.xconfig.
|
||||||
|
Comment options SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION. If
|
||||||
|
you choose this route you lose the ability to target earlier versions
|
||||||
|
of MacOS X.
|
||||||
|
* Install an SDK for an earlier version. This doesn't appear to be
|
||||||
|
supported by Apple, but has been reported to work
|
||||||
|
(http://stackoverflow.com/questions/5378518).
|
||||||
|
|
||||||
Tweaking Google Test
|
Tweaking Google Test
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1,216 +0,0 @@
|
|||||||
# Defines functions and macros useful for building Google Test and
|
|
||||||
# Google Mock.
|
|
||||||
#
|
|
||||||
# Note:
|
|
||||||
#
|
|
||||||
# - This file will be run twice when building Google Mock (once via
|
|
||||||
# Google Test's CMakeLists.txt, and once via Google Mock's).
|
|
||||||
# Therefore it shouldn't have any side effects other than defining
|
|
||||||
# the functions and macros.
|
|
||||||
#
|
|
||||||
# - The functions/macros defined in this file may depend on Google
|
|
||||||
# Test and Google Mock's option() definitions, and thus must be
|
|
||||||
# called *after* the options have been defined.
|
|
||||||
|
|
||||||
# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.
|
|
||||||
#
|
|
||||||
# This must be a macro(), as inside a function string() can only
|
|
||||||
# update variables in the function scope.
|
|
||||||
macro(fix_default_compiler_settings_)
|
|
||||||
if (MSVC)
|
|
||||||
# For MSVC, CMake sets certain flags to defaults we want to override.
|
|
||||||
# This replacement code is taken from sample in the CMake Wiki at
|
|
||||||
# http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace.
|
|
||||||
foreach (flag_var
|
|
||||||
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
|
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
|
|
||||||
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
|
|
||||||
# When Google Test is built as a shared library, it should also use
|
|
||||||
# shared runtime libraries. Otherwise, it may end up with multiple
|
|
||||||
# copies of runtime library data in different modules, resulting in
|
|
||||||
# hard-to-find crashes. When it is built as a static library, it is
|
|
||||||
# preferable to use CRT as static libraries, as we don't have to rely
|
|
||||||
# on CRT DLLs being available. CMake always defaults to using shared
|
|
||||||
# CRT libraries, so we override that default here.
|
|
||||||
string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# We prefer more strict warning checking for building Google Test.
|
|
||||||
# Replaces /W3 with /W4 in defaults.
|
|
||||||
string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Defines the compiler/linker flags used to build Google Test and
|
|
||||||
# Google Mock. You can tweak these definitions to suit your need. A
|
|
||||||
# variable's value is empty before it's explicitly assigned to.
|
|
||||||
macro(config_compiler_and_linker)
|
|
||||||
if (NOT gtest_disable_pthreads)
|
|
||||||
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
|
|
||||||
find_package(Threads)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
fix_default_compiler_settings_()
|
|
||||||
if (MSVC)
|
|
||||||
# Newlines inside flags variables break CMake's NMake generator.
|
|
||||||
# TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
|
|
||||||
set(cxx_base_flags "-GS -W4 -WX -wd4127 -wd4251 -wd4275 -nologo -J -Zi")
|
|
||||||
set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")
|
|
||||||
set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")
|
|
||||||
set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
|
|
||||||
set(cxx_no_exception_flags "-D_HAS_EXCEPTIONS=0")
|
|
||||||
set(cxx_no_rtti_flags "-GR-")
|
|
||||||
elseif (CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
set(cxx_base_flags "-Wall -Wshadow")
|
|
||||||
set(cxx_exception_flags "-fexceptions")
|
|
||||||
set(cxx_no_exception_flags "-fno-exceptions")
|
|
||||||
# Until version 4.3.2, GCC doesn't define a macro to indicate
|
|
||||||
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
|
|
||||||
# explicitly.
|
|
||||||
set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
|
|
||||||
set(cxx_strict_flags "-Wextra")
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
|
|
||||||
set(cxx_exception_flags "-features=except")
|
|
||||||
# Sun Pro doesn't provide macros to indicate whether exceptions and
|
|
||||||
# RTTI are enabled, so we define GTEST_HAS_* explicitly.
|
|
||||||
set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")
|
|
||||||
set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR
|
|
||||||
CMAKE_CXX_COMPILER_ID STREQUAL "XL")
|
|
||||||
# CMake 2.8 changes Visual Age's compiler ID to "XL".
|
|
||||||
set(cxx_exception_flags "-qeh")
|
|
||||||
set(cxx_no_exception_flags "-qnoeh")
|
|
||||||
# Until version 9.0, Visual Age doesn't define a macro to indicate
|
|
||||||
# whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
|
|
||||||
# explicitly.
|
|
||||||
set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
|
|
||||||
set(cxx_base_flags "-AA -mt")
|
|
||||||
set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")
|
|
||||||
set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")
|
|
||||||
# RTTI can not be disabled in HP aCC compiler.
|
|
||||||
set(cxx_no_rtti_flags "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed.
|
|
||||||
set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1")
|
|
||||||
else()
|
|
||||||
set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For building gtest's own tests and samples.
|
|
||||||
set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}")
|
|
||||||
set(cxx_no_exception
|
|
||||||
"${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
|
|
||||||
set(cxx_default "${cxx_exception}")
|
|
||||||
set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
|
|
||||||
set(cxx_use_own_tuple "${cxx_default} -DGTEST_USE_OWN_TR1_TUPLE=1")
|
|
||||||
|
|
||||||
# For building the gtest libraries.
|
|
||||||
set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
# Defines the gtest & gtest_main libraries. User tests should link
|
|
||||||
# with one of them.
|
|
||||||
function(cxx_library_with_type name type cxx_flags)
|
|
||||||
# type can be either STATIC or SHARED to denote a static or shared library.
|
|
||||||
# ARGN refers to additional arguments after 'cxx_flags'.
|
|
||||||
add_library(${name} ${type} ${ARGN})
|
|
||||||
set_target_properties(${name}
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "${cxx_flags}")
|
|
||||||
if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
|
|
||||||
set_target_properties(${name}
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
|
|
||||||
endif()
|
|
||||||
if (CMAKE_USE_PTHREADS_INIT)
|
|
||||||
target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
########################################################################
|
|
||||||
#
|
|
||||||
# Helper functions for creating build targets.
|
|
||||||
|
|
||||||
function(cxx_shared_library name cxx_flags)
|
|
||||||
cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(cxx_library name cxx_flags)
|
|
||||||
cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# cxx_executable_with_flags(name cxx_flags libs srcs...)
|
|
||||||
#
|
|
||||||
# creates a named C++ executable that depends on the given libraries and
|
|
||||||
# is built from the given source files with the given compiler flags.
|
|
||||||
function(cxx_executable_with_flags name cxx_flags libs)
|
|
||||||
add_executable(${name} ${ARGN})
|
|
||||||
if (cxx_flags)
|
|
||||||
set_target_properties(${name}
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "${cxx_flags}")
|
|
||||||
endif()
|
|
||||||
if (BUILD_SHARED_LIBS)
|
|
||||||
set_target_properties(${name}
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
|
|
||||||
endif()
|
|
||||||
# To support mixing linking in static and dynamic libraries, link each
|
|
||||||
# library in with an extra call to target_link_libraries.
|
|
||||||
foreach (lib "${libs}")
|
|
||||||
target_link_libraries(${name} ${lib})
|
|
||||||
endforeach()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# cxx_executable(name dir lib srcs...)
|
|
||||||
#
|
|
||||||
# creates a named target that depends on the given libs and is built
|
|
||||||
# from the given source files. dir/name.cc is implicitly included in
|
|
||||||
# the source file list.
|
|
||||||
function(cxx_executable name dir libs)
|
|
||||||
cxx_executable_with_flags(
|
|
||||||
${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE.
|
|
||||||
find_package(PythonInterp)
|
|
||||||
|
|
||||||
# cxx_test_with_flags(name cxx_flags libs srcs...)
|
|
||||||
#
|
|
||||||
# creates a named C++ test that depends on the given libs and is built
|
|
||||||
# from the given source files with the given compiler flags.
|
|
||||||
function(cxx_test_with_flags name cxx_flags libs)
|
|
||||||
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
|
|
||||||
add_test(${name} ${name})
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# cxx_test(name libs srcs...)
|
|
||||||
#
|
|
||||||
# creates a named test target that depends on the given libs and is
|
|
||||||
# built from the given source files. Unlike cxx_test_with_flags,
|
|
||||||
# test/name.cc is already implicitly included in the source file list.
|
|
||||||
function(cxx_test name libs)
|
|
||||||
cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
|
|
||||||
"test/${name}.cc" ${ARGN})
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# py_test(name)
|
|
||||||
#
|
|
||||||
# creates a Python test with the given name whose main module is in
|
|
||||||
# test/name.py. It does nothing if Python is not installed.
|
|
||||||
function(py_test name)
|
|
||||||
# We are not supporting Python tests on Linux yet as they consider
|
|
||||||
# all Linux environments to be google3 and try to use google3 features.
|
|
||||||
if (PYTHONINTERP_FOUND)
|
|
||||||
# ${CMAKE_BINARY_DIR} is known at configuration time, so we can
|
|
||||||
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
|
|
||||||
# only at ctest runtime (by calling ctest -c <Configuration>), so
|
|
||||||
# we have to escape $ to delay variable substitution here.
|
|
||||||
add_test(${name}
|
|
||||||
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
|
|
||||||
--build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
138
third_party/googletest/src/codegear/gtest.cbproj
vendored
138
third_party/googletest/src/codegear/gtest.cbproj
vendored
@@ -1,138 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{bca37a72-5b07-46cf-b44e-89f8e06451a2}</ProjectGuid>
|
|
||||||
<Config Condition="'$(Config)'==''">Release</Config>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_1>true</Cfg_1>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_2>true</Cfg_2>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Base)'!=''">
|
|
||||||
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
|
||||||
<OutputExt>lib</OutputExt>
|
|
||||||
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
|
|
||||||
<Defines>NO_STRICT</Defines>
|
|
||||||
<DynamicRTL>true</DynamicRTL>
|
|
||||||
<UsePackages>true</UsePackages>
|
|
||||||
<ProjectType>CppStaticLibrary</ProjectType>
|
|
||||||
<BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
|
|
||||||
<PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;dclZipForged11.bpi;vclZipForged11.bpi;GR32_BDS2006.bpi;GR32_DSGN_BDS2006.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi;CExceptionExpert11.bpi</PackageImports>
|
|
||||||
<BCC_wpar>false</BCC_wpar>
|
|
||||||
<IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</IncludePath>
|
|
||||||
<AllPackageLibs>rtl.lib;vcl.lib</AllPackageLibs>
|
|
||||||
<TLIB_PageSize>32</TLIB_PageSize>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</ILINK_LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
|
||||||
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
|
|
||||||
<DCC_Optimize>false</DCC_Optimize>
|
|
||||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
|
||||||
<Defines>_DEBUG;$(Defines)</Defines>
|
|
||||||
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
|
|
||||||
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
|
|
||||||
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
|
|
||||||
<BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
|
|
||||||
<DCC_Define>DEBUG</DCC_Define>
|
|
||||||
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
|
|
||||||
<IntermediateOutputDir>Debug</IntermediateOutputDir>
|
|
||||||
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
|
|
||||||
<BCC_StackFrames>true</BCC_StackFrames>
|
|
||||||
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>Full</TASM_Debugging>
|
|
||||||
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
|
||||||
<Defines>NDEBUG;$(Defines)</Defines>
|
|
||||||
<IntermediateOutputDir>Release</IntermediateOutputDir>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>None</TASM_Debugging>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ProjectExtensions>
|
|
||||||
<Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
|
|
||||||
<Borland.ProjectType>CppStaticLibrary</Borland.ProjectType>
|
|
||||||
<BorlandProject>
|
|
||||||
<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
|
|
||||||
|
|
||||||
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
|
|
||||||
</Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\src;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">1</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines><HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Count">1</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item0">32</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item1">16</HistoryLists_hlTLIB_PageSize></HistoryLists_hlTLIB_PageSize></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="..\include\gtest\gtest-death-test.h">
|
|
||||||
<BuildOrder>3</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest-message.h">
|
|
||||||
<BuildOrder>4</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest-param-test.h">
|
|
||||||
<BuildOrder>5</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest-spi.h">
|
|
||||||
<BuildOrder>6</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest-test-part.h">
|
|
||||||
<BuildOrder>7</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest-typed-test.h">
|
|
||||||
<BuildOrder>8</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest.h">
|
|
||||||
<BuildOrder>0</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest_pred_impl.h">
|
|
||||||
<BuildOrder>1</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\gtest_prod.h">
|
|
||||||
<BuildOrder>2</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-death-test-internal.h">
|
|
||||||
<BuildOrder>9</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-filepath.h">
|
|
||||||
<BuildOrder>10</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-internal.h">
|
|
||||||
<BuildOrder>11</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-linked_ptr.h">
|
|
||||||
<BuildOrder>12</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-param-util-generated.h">
|
|
||||||
<BuildOrder>14</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-param-util.h">
|
|
||||||
<BuildOrder>13</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-port.h">
|
|
||||||
<BuildOrder>15</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-string.h">
|
|
||||||
<BuildOrder>16</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<None Include="..\include\gtest\internal\gtest-type-util.h">
|
|
||||||
<BuildOrder>17</BuildOrder>
|
|
||||||
</None>
|
|
||||||
<CppCompile Include="gtest_all.cc">
|
|
||||||
<BuildOrder>18</BuildOrder>
|
|
||||||
</CppCompile>
|
|
||||||
<BuildConfiguration Include="Debug">
|
|
||||||
<Key>Cfg_1</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
<BuildConfiguration Include="Release">
|
|
||||||
<Key>Cfg_2</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{c1d923e0-6cba-4332-9b6f-3420acbf5091}</ProjectGuid>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup />
|
|
||||||
<ItemGroup>
|
|
||||||
<Projects Include="gtest.cbproj" />
|
|
||||||
<Projects Include="gtest_main.cbproj" />
|
|
||||||
<Projects Include="gtest_unittest.cbproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ProjectExtensions>
|
|
||||||
<Borland.Personality>Default.Personality</Borland.Personality>
|
|
||||||
<Borland.ProjectType />
|
|
||||||
<BorlandProject>
|
|
||||||
<BorlandProject xmlns=""><Default.Personality></Default.Personality></BorlandProject></BorlandProject>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<Target Name="gtest">
|
|
||||||
<MSBuild Projects="gtest.cbproj" Targets="" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest:Clean">
|
|
||||||
<MSBuild Projects="gtest.cbproj" Targets="Clean" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest:Make">
|
|
||||||
<MSBuild Projects="gtest.cbproj" Targets="Make" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_main">
|
|
||||||
<MSBuild Projects="gtest_main.cbproj" Targets="" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_main:Clean">
|
|
||||||
<MSBuild Projects="gtest_main.cbproj" Targets="Clean" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_main:Make">
|
|
||||||
<MSBuild Projects="gtest_main.cbproj" Targets="Make" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_unittest">
|
|
||||||
<MSBuild Projects="gtest_unittest.cbproj" Targets="" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_unittest:Clean">
|
|
||||||
<MSBuild Projects="gtest_unittest.cbproj" Targets="Clean" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="gtest_unittest:Make">
|
|
||||||
<MSBuild Projects="gtest_unittest.cbproj" Targets="Make" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="Build">
|
|
||||||
<CallTarget Targets="gtest;gtest_main;gtest_unittest" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="Clean">
|
|
||||||
<CallTarget Targets="gtest:Clean;gtest_main:Clean;gtest_unittest:Clean" />
|
|
||||||
</Target>
|
|
||||||
<Target Name="Make">
|
|
||||||
<CallTarget Targets="gtest:Make;gtest_main:Make;gtest_unittest:Make" />
|
|
||||||
</Target>
|
|
||||||
<Import Condition="Exists('$(MSBuildBinPath)\Borland.Group.Targets')" Project="$(MSBuildBinPath)\Borland.Group.Targets" />
|
|
||||||
</Project>
|
|
||||||
38
third_party/googletest/src/codegear/gtest_all.cc
vendored
38
third_party/googletest/src/codegear/gtest_all.cc
vendored
@@ -1,38 +0,0 @@
|
|||||||
// Copyright 2009, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Author: Josh Kelley (joshkel@gmail.com)
|
|
||||||
//
|
|
||||||
// Google C++ Testing Framework (Google Test)
|
|
||||||
//
|
|
||||||
// C++Builder's IDE cannot build a static library from files with hyphens
|
|
||||||
// in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 .
|
|
||||||
// This file serves as a workaround.
|
|
||||||
|
|
||||||
#include "src/gtest-all.cc"
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
// Copyright 2009, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Author: Josh Kelley (joshkel@gmail.com)
|
|
||||||
//
|
|
||||||
// Google C++ Testing Framework (Google Test)
|
|
||||||
//
|
|
||||||
// Links gtest.lib and gtest_main.lib into the current project in C++Builder.
|
|
||||||
// This means that these libraries can't be renamed, but it's the only way to
|
|
||||||
// ensure that Debug versus Release test builds are linked against the
|
|
||||||
// appropriate Debug or Release build of the libraries.
|
|
||||||
|
|
||||||
#pragma link "gtest.lib"
|
|
||||||
#pragma link "gtest_main.lib"
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{bca37a72-5b07-46cf-b44e-89f8e06451a2}</ProjectGuid>
|
|
||||||
<Config Condition="'$(Config)'==''">Release</Config>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_1>true</Cfg_1>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_2>true</Cfg_2>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Base)'!=''">
|
|
||||||
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
|
||||||
<OutputExt>lib</OutputExt>
|
|
||||||
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
|
|
||||||
<Defines>NO_STRICT</Defines>
|
|
||||||
<DynamicRTL>true</DynamicRTL>
|
|
||||||
<UsePackages>true</UsePackages>
|
|
||||||
<ProjectType>CppStaticLibrary</ProjectType>
|
|
||||||
<BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
|
|
||||||
<PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;dclZipForged11.bpi;vclZipForged11.bpi;GR32_BDS2006.bpi;GR32_DSGN_BDS2006.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi;CExceptionExpert11.bpi</PackageImports>
|
|
||||||
<BCC_wpar>false</BCC_wpar>
|
|
||||||
<IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</IncludePath>
|
|
||||||
<AllPackageLibs>rtl.lib;vcl.lib</AllPackageLibs>
|
|
||||||
<TLIB_PageSize>32</TLIB_PageSize>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</ILINK_LibraryPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
|
||||||
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
|
|
||||||
<DCC_Optimize>false</DCC_Optimize>
|
|
||||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
|
||||||
<Defines>_DEBUG;$(Defines)</Defines>
|
|
||||||
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
|
|
||||||
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
|
|
||||||
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
|
|
||||||
<BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
|
|
||||||
<DCC_Define>DEBUG</DCC_Define>
|
|
||||||
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
|
|
||||||
<IntermediateOutputDir>Debug</IntermediateOutputDir>
|
|
||||||
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
|
|
||||||
<BCC_StackFrames>true</BCC_StackFrames>
|
|
||||||
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>Full</TASM_Debugging>
|
|
||||||
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
|
||||||
<Defines>NDEBUG;$(Defines)</Defines>
|
|
||||||
<IntermediateOutputDir>Release</IntermediateOutputDir>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>None</TASM_Debugging>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ProjectExtensions>
|
|
||||||
<Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
|
|
||||||
<Borland.ProjectType>CppStaticLibrary</Borland.ProjectType>
|
|
||||||
<BorlandProject>
|
|
||||||
<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
|
|
||||||
</Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\include;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\src;..\src;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">1</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines><HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Count">1</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item0">32</HistoryLists_hlTLIB_PageSize><HistoryLists_hlTLIB_PageSize Name="Item1">16</HistoryLists_hlTLIB_PageSize></HistoryLists_hlTLIB_PageSize></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
|
|
||||||
<ItemGroup>
|
|
||||||
<CppCompile Include="..\src\gtest_main.cc">
|
|
||||||
<BuildOrder>0</BuildOrder>
|
|
||||||
</CppCompile>
|
|
||||||
<BuildConfiguration Include="Debug">
|
|
||||||
<Key>Cfg_1</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
<BuildConfiguration Include="Release">
|
|
||||||
<Key>Cfg_2</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ProjectGuid>{eea63393-5ac5-4b9c-8909-d75fef2daa41}</ProjectGuid>
|
|
||||||
<Config Condition="'$(Config)'==''">Release</Config>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_1>true</Cfg_1>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
|
||||||
<Base>true</Base>
|
|
||||||
<Cfg_2>true</Cfg_2>
|
|
||||||
<CfgParent>Base</CfgParent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Base)'!=''">
|
|
||||||
<OutputExt>exe</OutputExt>
|
|
||||||
<BCC_OptimizeForSpeed>true</BCC_OptimizeForSpeed>
|
|
||||||
<Defines>NO_STRICT</Defines>
|
|
||||||
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
|
|
||||||
<DynamicRTL>true</DynamicRTL>
|
|
||||||
<ILINK_ObjectSearchPath>..\test</ILINK_ObjectSearchPath>
|
|
||||||
<UsePackages>true</UsePackages>
|
|
||||||
<ProjectType>CppConsoleApplication</ProjectType>
|
|
||||||
<NoVCL>true</NoVCL>
|
|
||||||
<BCC_CPPCompileAlways>true</BCC_CPPCompileAlways>
|
|
||||||
<PackageImports>rtl.bpi;vcl.bpi;bcbie.bpi;vclx.bpi;vclactnband.bpi;xmlrtl.bpi;bcbsmp.bpi;dbrtl.bpi;vcldb.bpi;bdertl.bpi;vcldbx.bpi;dsnap.bpi;dsnapcon.bpi;vclib.bpi;ibxpress.bpi;adortl.bpi;dbxcds.bpi;dbexpress.bpi;DbxCommonDriver.bpi;websnap.bpi;vclie.bpi;webdsnap.bpi;inet.bpi;inetdbbde.bpi;inetdbxpress.bpi;soaprtl.bpi;Rave75VCL.bpi;teeUI.bpi;tee.bpi;teedb.bpi;IndyCore.bpi;IndySystem.bpi;IndyProtocols.bpi;IntrawebDB_90_100.bpi;Intraweb_90_100.bpi;Jcl.bpi;JclVcl.bpi;JvCoreD11R.bpi;JvSystemD11R.bpi;JvStdCtrlsD11R.bpi;JvAppFrmD11R.bpi;JvBandsD11R.bpi;JvDBD11R.bpi;JvDlgsD11R.bpi;JvBDED11R.bpi;JvCmpD11R.bpi;JvCryptD11R.bpi;JvCtrlsD11R.bpi;JvCustomD11R.bpi;JvDockingD11R.bpi;JvDotNetCtrlsD11R.bpi;JvEDID11R.bpi;JvGlobusD11R.bpi;JvHMID11R.bpi;JvInterpreterD11R.bpi;JvJansD11R.bpi;JvManagedThreadsD11R.bpi;JvMMD11R.bpi;JvNetD11R.bpi;JvPageCompsD11R.bpi;JvPluginD11R.bpi;JvPrintPreviewD11R.bpi;JvRuntimeDesignD11R.bpi;JvTimeFrameworkD11R.bpi;JvValidatorsD11R.bpi;JvWizardD11R.bpi;JvXPCtrlsD11R.bpi;VclSmp.bpi</PackageImports>
|
|
||||||
<BCC_wpar>false</BCC_wpar>
|
|
||||||
<IncludePath>$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..</IncludePath>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</ILINK_LibraryPath>
|
|
||||||
<Multithreaded>true</Multithreaded>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
|
||||||
<BCC_OptimizeForSpeed>false</BCC_OptimizeForSpeed>
|
|
||||||
<DCC_Optimize>false</DCC_Optimize>
|
|
||||||
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
|
|
||||||
<Defines>_DEBUG;$(Defines)</Defines>
|
|
||||||
<ILINK_FullDebugInfo>true</ILINK_FullDebugInfo>
|
|
||||||
<BCC_InlineFunctionExpansion>false</BCC_InlineFunctionExpansion>
|
|
||||||
<ILINK_DisableIncrementalLinking>true</ILINK_DisableIncrementalLinking>
|
|
||||||
<BCC_UseRegisterVariables>None</BCC_UseRegisterVariables>
|
|
||||||
<DCC_Define>DEBUG</DCC_Define>
|
|
||||||
<BCC_DebugLineNumbers>true</BCC_DebugLineNumbers>
|
|
||||||
<IntermediateOutputDir>Debug</IntermediateOutputDir>
|
|
||||||
<TASM_DisplaySourceLines>true</TASM_DisplaySourceLines>
|
|
||||||
<BCC_StackFrames>true</BCC_StackFrames>
|
|
||||||
<BCC_DisableOptimizations>true</BCC_DisableOptimizations>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\debug;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>Full</TASM_Debugging>
|
|
||||||
<BCC_SourceDebuggingOn>true</BCC_SourceDebuggingOn>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
|
||||||
<Defines>NDEBUG;$(Defines)</Defines>
|
|
||||||
<IntermediateOutputDir>Release</IntermediateOutputDir>
|
|
||||||
<ILINK_LibraryPath>$(BDS)\lib\release;$(ILINK_LibraryPath)</ILINK_LibraryPath>
|
|
||||||
<TASM_Debugging>None</TASM_Debugging>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ProjectExtensions>
|
|
||||||
<Borland.Personality>CPlusPlusBuilder.Personality</Borland.Personality>
|
|
||||||
<Borland.ProjectType>CppConsoleApplication</Borland.ProjectType>
|
|
||||||
<BorlandProject>
|
|
||||||
<BorlandProject><CPlusPlusBuilder.Personality><VersionInfo><VersionInfo Name="IncludeVerInfo">False</VersionInfo><VersionInfo Name="AutoIncBuild">False</VersionInfo><VersionInfo Name="MajorVer">1</VersionInfo><VersionInfo Name="MinorVer">0</VersionInfo><VersionInfo Name="Release">0</VersionInfo><VersionInfo Name="Build">0</VersionInfo><VersionInfo Name="Debug">False</VersionInfo><VersionInfo Name="PreRelease">False</VersionInfo><VersionInfo Name="Special">False</VersionInfo><VersionInfo Name="Private">False</VersionInfo><VersionInfo Name="DLL">False</VersionInfo><VersionInfo Name="Locale">1033</VersionInfo><VersionInfo Name="CodePage">1252</VersionInfo></VersionInfo><VersionInfoKeys><VersionInfoKeys Name="CompanyName"></VersionInfoKeys><VersionInfoKeys Name="FileDescription"></VersionInfoKeys><VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="InternalName"></VersionInfoKeys><VersionInfoKeys Name="LegalCopyright"></VersionInfoKeys><VersionInfoKeys Name="LegalTrademarks"></VersionInfoKeys><VersionInfoKeys Name="OriginalFilename"></VersionInfoKeys><VersionInfoKeys Name="ProductName"></VersionInfoKeys><VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys><VersionInfoKeys Name="Comments"></VersionInfoKeys></VersionInfoKeys><Debugging><Debugging Name="DebugSourceDirs"></Debugging></Debugging><Parameters><Parameters Name="RunParams"></Parameters><Parameters Name="Launcher"></Parameters><Parameters Name="UseLauncher">False</Parameters><Parameters Name="DebugCWD"></Parameters><Parameters Name="HostApplication"></Parameters><Parameters Name="RemoteHost"></Parameters><Parameters Name="RemotePath"></Parameters><Parameters Name="RemoteParams"></Parameters><Parameters Name="RemoteLauncher"></Parameters><Parameters Name="UseRemoteLauncher">False</Parameters><Parameters Name="RemoteCWD"></Parameters><Parameters Name="RemoteDebug">False</Parameters><Parameters Name="Debug Symbols Search Path"></Parameters><Parameters Name="LoadAllSymbols">True</Parameters><Parameters Name="LoadUnspecifiedSymbols">False</Parameters></Parameters><Excluded_Packages>
|
|
||||||
|
|
||||||
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcboffice2k100.bpl">CodeGear C++Builder Office 2000 Servers Package</Excluded_Packages>
|
|
||||||
<Excluded_Packages Name="$(BDS)\bin\bcbofficexp100.bpl">CodeGear C++Builder Office XP Servers Package</Excluded_Packages>
|
|
||||||
</Excluded_Packages><Linker><Linker Name="LibPrefix"></Linker><Linker Name="LibSuffix"></Linker><Linker Name="LibVersion"></Linker></Linker><ProjectProperties><ProjectProperties Name="AutoShowDeps">False</ProjectProperties><ProjectProperties Name="ManagePaths">True</ProjectProperties><ProjectProperties Name="VerifyPackages">True</ProjectProperties></ProjectProperties><HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Count">3</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item0">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test;..</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item1">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include;..\test</HistoryLists_hlIncludePath><HistoryLists_hlIncludePath Name="Item2">$(BDS)\include;$(BDS)\include\dinkumware;$(BDS)\include\vcl;..\include</HistoryLists_hlIncludePath></HistoryLists_hlIncludePath><HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Count">1</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item0">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item1">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;..\test</HistoryLists_hlILINK_LibraryPath><HistoryLists_hlILINK_LibraryPath Name="Item2">$(BDS)\lib;$(BDS)\lib\obj;$(BDS)\lib\psdk;$(OUTPUTDIR);..\test</HistoryLists_hlILINK_LibraryPath></HistoryLists_hlILINK_LibraryPath><HistoryLists_hlDefines><HistoryLists_hlDefines Name="Count">2</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item0">NO_STRICT</HistoryLists_hlDefines><HistoryLists_hlDefines Name="Item1">STRICT</HistoryLists_hlDefines></HistoryLists_hlDefines></CPlusPlusBuilder.Personality></BorlandProject></BorlandProject>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Borland.Cpp.Targets" />
|
|
||||||
<ItemGroup>
|
|
||||||
<CppCompile Include="..\test\gtest_unittest.cc">
|
|
||||||
<BuildOrder>0</BuildOrder>
|
|
||||||
</CppCompile>
|
|
||||||
<CppCompile Include="gtest_link.cc">
|
|
||||||
<BuildOrder>1</BuildOrder>
|
|
||||||
</CppCompile>
|
|
||||||
<BuildConfiguration Include="Debug">
|
|
||||||
<Key>Cfg_1</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
<BuildConfiguration Include="Release">
|
|
||||||
<Key>Cfg_2</Key>
|
|
||||||
</BuildConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
68
third_party/googletest/src/configure.ac
vendored
68
third_party/googletest/src/configure.ac
vendored
@@ -1,68 +0,0 @@
|
|||||||
m4_include(m4/acx_pthread.m4)
|
|
||||||
|
|
||||||
# At this point, the Xcode project assumes the version string will be three
|
|
||||||
# integers separated by periods and surrounded by square brackets (e.g.
|
|
||||||
# "[1.0.1]"). It also asumes that there won't be any closing parenthesis
|
|
||||||
# between "AC_INIT(" and the closing ")" including comments and strings.
|
|
||||||
AC_INIT([Google C++ Testing Framework],
|
|
||||||
[1.6.0],
|
|
||||||
[googletestframework@googlegroups.com],
|
|
||||||
[gtest])
|
|
||||||
|
|
||||||
# Provide various options to initialize the Autoconf and configure processes.
|
|
||||||
AC_PREREQ([2.59])
|
|
||||||
AC_CONFIG_SRCDIR([./COPYING])
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
|
||||||
AC_CONFIG_HEADERS([build-aux/config.h])
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
|
||||||
AC_CONFIG_FILES([scripts/gtest-config], [chmod +x scripts/gtest-config])
|
|
||||||
|
|
||||||
# Initialize Automake with various options. We require at least v1.9, prevent
|
|
||||||
# pedantic complaints about package files, and enable various distribution
|
|
||||||
# targets.
|
|
||||||
AM_INIT_AUTOMAKE([1.9 dist-bzip2 dist-zip foreign subdir-objects])
|
|
||||||
|
|
||||||
# Check for programs used in building Google Test.
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_LANG([C++])
|
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
|
|
||||||
# TODO(chandlerc@google.com): Currently we aren't running the Python tests
|
|
||||||
# against the interpreter detected by AM_PATH_PYTHON, and so we condition
|
|
||||||
# HAVE_PYTHON by requiring "python" to be in the PATH, and that interpreter's
|
|
||||||
# version to be >= 2.3. This will allow the scripts to use a "/usr/bin/env"
|
|
||||||
# hashbang.
|
|
||||||
PYTHON= # We *do not* allow the user to specify a python interpreter
|
|
||||||
AC_PATH_PROG([PYTHON],[python],[:])
|
|
||||||
AS_IF([test "$PYTHON" != ":"],
|
|
||||||
[AM_PYTHON_CHECK_VERSION([$PYTHON],[2.3],[:],[PYTHON=":"])])
|
|
||||||
AM_CONDITIONAL([HAVE_PYTHON],[test "$PYTHON" != ":"])
|
|
||||||
|
|
||||||
# Configure pthreads.
|
|
||||||
AC_ARG_WITH([pthreads],
|
|
||||||
[AS_HELP_STRING([--with-pthreads],
|
|
||||||
[use pthreads (default is yes)])],
|
|
||||||
[with_pthreads=$withval],
|
|
||||||
[with_pthreads=check])
|
|
||||||
|
|
||||||
have_pthreads=no
|
|
||||||
AS_IF([test "x$with_pthreads" != "xno"],
|
|
||||||
[ACX_PTHREAD(
|
|
||||||
[],
|
|
||||||
[AS_IF([test "x$with_pthreads" != "xcheck"],
|
|
||||||
[AC_MSG_FAILURE(
|
|
||||||
[--with-pthreads was specified, but unable to be used])])])
|
|
||||||
have_pthreads="$acx_pthread_ok"])
|
|
||||||
AM_CONDITIONAL([HAVE_PTHREADS],[test "x$have_pthreads" == "xyes"])
|
|
||||||
AC_SUBST(PTHREAD_CFLAGS)
|
|
||||||
AC_SUBST(PTHREAD_LIBS)
|
|
||||||
|
|
||||||
# TODO(chandlerc@google.com) Check for the necessary system headers.
|
|
||||||
|
|
||||||
# TODO(chandlerc@google.com) Check the types, structures, and other compiler
|
|
||||||
# and architecture characteristics.
|
|
||||||
|
|
||||||
# Output the generated files. No further autoconf macros may be used.
|
|
||||||
AC_OUTPUT
|
|
||||||
@@ -1,283 +0,0 @@
|
|||||||
// Copyright 2005, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
//
|
|
||||||
// The Google C++ Testing Framework (Google Test)
|
|
||||||
//
|
|
||||||
// This header file defines the public API for death tests. It is
|
|
||||||
// #included by gtest.h so a user doesn't need to include this
|
|
||||||
// directly.
|
|
||||||
|
|
||||||
#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
|
|
||||||
#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
|
|
||||||
|
|
||||||
#include "gtest/internal/gtest-death-test-internal.h"
|
|
||||||
|
|
||||||
namespace testing {
|
|
||||||
|
|
||||||
// This flag controls the style of death tests. Valid values are "threadsafe",
|
|
||||||
// meaning that the death test child process will re-execute the test binary
|
|
||||||
// from the start, running only a single death test, or "fast",
|
|
||||||
// meaning that the child process will execute the test logic immediately
|
|
||||||
// after forking.
|
|
||||||
GTEST_DECLARE_string_(death_test_style);
|
|
||||||
|
|
||||||
#if GTEST_HAS_DEATH_TEST
|
|
||||||
|
|
||||||
// The following macros are useful for writing death tests.
|
|
||||||
|
|
||||||
// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
|
|
||||||
// executed:
|
|
||||||
//
|
|
||||||
// 1. It generates a warning if there is more than one active
|
|
||||||
// thread. This is because it's safe to fork() or clone() only
|
|
||||||
// when there is a single thread.
|
|
||||||
//
|
|
||||||
// 2. The parent process clone()s a sub-process and runs the death
|
|
||||||
// test in it; the sub-process exits with code 0 at the end of the
|
|
||||||
// death test, if it hasn't exited already.
|
|
||||||
//
|
|
||||||
// 3. The parent process waits for the sub-process to terminate.
|
|
||||||
//
|
|
||||||
// 4. The parent process checks the exit code and error message of
|
|
||||||
// the sub-process.
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
//
|
|
||||||
// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
|
|
||||||
// for (int i = 0; i < 5; i++) {
|
|
||||||
// EXPECT_DEATH(server.ProcessRequest(i),
|
|
||||||
// "Invalid request .* in ProcessRequest()")
|
|
||||||
// << "Failed to die on request " << i);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
|
|
||||||
//
|
|
||||||
// bool KilledBySIGHUP(int exit_code) {
|
|
||||||
// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
|
|
||||||
//
|
|
||||||
// On the regular expressions used in death tests:
|
|
||||||
//
|
|
||||||
// On POSIX-compliant systems (*nix), we use the <regex.h> library,
|
|
||||||
// which uses the POSIX extended regex syntax.
|
|
||||||
//
|
|
||||||
// On other platforms (e.g. Windows), we only support a simple regex
|
|
||||||
// syntax implemented as part of Google Test. This limited
|
|
||||||
// implementation should be enough most of the time when writing
|
|
||||||
// death tests; though it lacks many features you can find in PCRE
|
|
||||||
// or POSIX extended regex syntax. For example, we don't support
|
|
||||||
// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
|
|
||||||
// repetition count ("x{5,7}"), among others.
|
|
||||||
//
|
|
||||||
// Below is the syntax that we do support. We chose it to be a
|
|
||||||
// subset of both PCRE and POSIX extended regex, so it's easy to
|
|
||||||
// learn wherever you come from. In the following: 'A' denotes a
|
|
||||||
// literal character, period (.), or a single \\ escape sequence;
|
|
||||||
// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
|
|
||||||
// natural numbers.
|
|
||||||
//
|
|
||||||
// c matches any literal character c
|
|
||||||
// \\d matches any decimal digit
|
|
||||||
// \\D matches any character that's not a decimal digit
|
|
||||||
// \\f matches \f
|
|
||||||
// \\n matches \n
|
|
||||||
// \\r matches \r
|
|
||||||
// \\s matches any ASCII whitespace, including \n
|
|
||||||
// \\S matches any character that's not a whitespace
|
|
||||||
// \\t matches \t
|
|
||||||
// \\v matches \v
|
|
||||||
// \\w matches any letter, _, or decimal digit
|
|
||||||
// \\W matches any character that \\w doesn't match
|
|
||||||
// \\c matches any literal character c, which must be a punctuation
|
|
||||||
// . matches any single character except \n
|
|
||||||
// A? matches 0 or 1 occurrences of A
|
|
||||||
// A* matches 0 or many occurrences of A
|
|
||||||
// A+ matches 1 or many occurrences of A
|
|
||||||
// ^ matches the beginning of a string (not that of each line)
|
|
||||||
// $ matches the end of a string (not that of each line)
|
|
||||||
// xy matches x followed by y
|
|
||||||
//
|
|
||||||
// If you accidentally use PCRE or POSIX extended regex features
|
|
||||||
// not implemented by us, you will get a run-time failure. In that
|
|
||||||
// case, please try to rewrite your regular expression within the
|
|
||||||
// above syntax.
|
|
||||||
//
|
|
||||||
// This implementation is *not* meant to be as highly tuned or robust
|
|
||||||
// as a compiled regex library, but should perform well enough for a
|
|
||||||
// death test, which already incurs significant overhead by launching
|
|
||||||
// a child process.
|
|
||||||
//
|
|
||||||
// Known caveats:
|
|
||||||
//
|
|
||||||
// A "threadsafe" style death test obtains the path to the test
|
|
||||||
// program from argv[0] and re-executes it in the sub-process. For
|
|
||||||
// simplicity, the current implementation doesn't search the PATH
|
|
||||||
// when launching the sub-process. This means that the user must
|
|
||||||
// invoke the test program via a path that contains at least one
|
|
||||||
// path separator (e.g. path/to/foo_test and
|
|
||||||
// /absolute/path/to/bar_test are fine, but foo_test is not). This
|
|
||||||
// is rarely a problem as people usually don't put the test binary
|
|
||||||
// directory in PATH.
|
|
||||||
//
|
|
||||||
// TODO(wan@google.com): make thread-safe death tests search the PATH.
|
|
||||||
|
|
||||||
// Asserts that a given statement causes the program to exit, with an
|
|
||||||
// integer exit status that satisfies predicate, and emitting error output
|
|
||||||
// that matches regex.
|
|
||||||
# define ASSERT_EXIT(statement, predicate, regex) \
|
|
||||||
GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
|
|
||||||
|
|
||||||
// Like ASSERT_EXIT, but continues on to successive tests in the
|
|
||||||
// test case, if any:
|
|
||||||
# define EXPECT_EXIT(statement, predicate, regex) \
|
|
||||||
GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
|
|
||||||
|
|
||||||
// Asserts that a given statement causes the program to exit, either by
|
|
||||||
// explicitly exiting with a nonzero exit code or being killed by a
|
|
||||||
// signal, and emitting error output that matches regex.
|
|
||||||
# define ASSERT_DEATH(statement, regex) \
|
|
||||||
ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
|
|
||||||
|
|
||||||
// Like ASSERT_DEATH, but continues on to successive tests in the
|
|
||||||
// test case, if any:
|
|
||||||
# define EXPECT_DEATH(statement, regex) \
|
|
||||||
EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
|
|
||||||
|
|
||||||
// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
|
|
||||||
|
|
||||||
// Tests that an exit code describes a normal exit with a given exit code.
|
|
||||||
class GTEST_API_ ExitedWithCode {
|
|
||||||
public:
|
|
||||||
explicit ExitedWithCode(int exit_code);
|
|
||||||
bool operator()(int exit_status) const;
|
|
||||||
private:
|
|
||||||
// No implementation - assignment is unsupported.
|
|
||||||
void operator=(const ExitedWithCode& other);
|
|
||||||
|
|
||||||
const int exit_code_;
|
|
||||||
};
|
|
||||||
|
|
||||||
# if !GTEST_OS_WINDOWS
|
|
||||||
// Tests that an exit code describes an exit due to termination by a
|
|
||||||
// given signal.
|
|
||||||
class GTEST_API_ KilledBySignal {
|
|
||||||
public:
|
|
||||||
explicit KilledBySignal(int signum);
|
|
||||||
bool operator()(int exit_status) const;
|
|
||||||
private:
|
|
||||||
const int signum_;
|
|
||||||
};
|
|
||||||
# endif // !GTEST_OS_WINDOWS
|
|
||||||
|
|
||||||
// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
|
|
||||||
// The death testing framework causes this to have interesting semantics,
|
|
||||||
// since the sideeffects of the call are only visible in opt mode, and not
|
|
||||||
// in debug mode.
|
|
||||||
//
|
|
||||||
// In practice, this can be used to test functions that utilize the
|
|
||||||
// LOG(DFATAL) macro using the following style:
|
|
||||||
//
|
|
||||||
// int DieInDebugOr12(int* sideeffect) {
|
|
||||||
// if (sideeffect) {
|
|
||||||
// *sideeffect = 12;
|
|
||||||
// }
|
|
||||||
// LOG(DFATAL) << "death";
|
|
||||||
// return 12;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
|
|
||||||
// int sideeffect = 0;
|
|
||||||
// // Only asserts in dbg.
|
|
||||||
// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
|
|
||||||
//
|
|
||||||
// #ifdef NDEBUG
|
|
||||||
// // opt-mode has sideeffect visible.
|
|
||||||
// EXPECT_EQ(12, sideeffect);
|
|
||||||
// #else
|
|
||||||
// // dbg-mode no visible sideeffect.
|
|
||||||
// EXPECT_EQ(0, sideeffect);
|
|
||||||
// #endif
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// This will assert that DieInDebugReturn12InOpt() crashes in debug
|
|
||||||
// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
|
|
||||||
// appropriate fallback value (12 in this case) in opt mode. If you
|
|
||||||
// need to test that a function has appropriate side-effects in opt
|
|
||||||
// mode, include assertions against the side-effects. A general
|
|
||||||
// pattern for this is:
|
|
||||||
//
|
|
||||||
// EXPECT_DEBUG_DEATH({
|
|
||||||
// // Side-effects here will have an effect after this statement in
|
|
||||||
// // opt mode, but none in debug mode.
|
|
||||||
// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
|
|
||||||
// }, "death");
|
|
||||||
//
|
|
||||||
# ifdef NDEBUG
|
|
||||||
|
|
||||||
# define EXPECT_DEBUG_DEATH(statement, regex) \
|
|
||||||
do { statement; } while (::testing::internal::AlwaysFalse())
|
|
||||||
|
|
||||||
# define ASSERT_DEBUG_DEATH(statement, regex) \
|
|
||||||
do { statement; } while (::testing::internal::AlwaysFalse())
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define EXPECT_DEBUG_DEATH(statement, regex) \
|
|
||||||
EXPECT_DEATH(statement, regex)
|
|
||||||
|
|
||||||
# define ASSERT_DEBUG_DEATH(statement, regex) \
|
|
||||||
ASSERT_DEATH(statement, regex)
|
|
||||||
|
|
||||||
# endif // NDEBUG for EXPECT_DEBUG_DEATH
|
|
||||||
#endif // GTEST_HAS_DEATH_TEST
|
|
||||||
|
|
||||||
// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
|
|
||||||
// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
|
|
||||||
// death tests are supported; otherwise they just issue a warning. This is
|
|
||||||
// useful when you are combining death test assertions with normal test
|
|
||||||
// assertions in one test.
|
|
||||||
#if GTEST_HAS_DEATH_TEST
|
|
||||||
# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
|
|
||||||
EXPECT_DEATH(statement, regex)
|
|
||||||
# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
|
|
||||||
ASSERT_DEATH(statement, regex)
|
|
||||||
#else
|
|
||||||
# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
|
|
||||||
GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
|
|
||||||
# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
|
|
||||||
GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} // namespace testing
|
|
||||||
|
|
||||||
#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
// Copyright 2005, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
//
|
|
||||||
// The Google C++ Testing Framework (Google Test)
|
|
||||||
//
|
|
||||||
// This header file defines the Message class.
|
|
||||||
//
|
|
||||||
// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
|
|
||||||
// leave some internal implementation details in this header file.
|
|
||||||
// They are clearly marked by comments like this:
|
|
||||||
//
|
|
||||||
// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
|
|
||||||
//
|
|
||||||
// Such code is NOT meant to be used by a user directly, and is subject
|
|
||||||
// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
|
|
||||||
// program!
|
|
||||||
|
|
||||||
#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
|
|
||||||
#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
#include "gtest/internal/gtest-string.h"
|
|
||||||
#include "gtest/internal/gtest-internal.h"
|
|
||||||
|
|
||||||
namespace testing {
|
|
||||||
|
|
||||||
// The Message class works like an ostream repeater.
|
|
||||||
//
|
|
||||||
// Typical usage:
|
|
||||||
//
|
|
||||||
// 1. You stream a bunch of values to a Message object.
|
|
||||||
// It will remember the text in a stringstream.
|
|
||||||
// 2. Then you stream the Message object to an ostream.
|
|
||||||
// This causes the text in the Message to be streamed
|
|
||||||
// to the ostream.
|
|
||||||
//
|
|
||||||
// For example;
|
|
||||||
//
|
|
||||||
// testing::Message foo;
|
|
||||||
// foo << 1 << " != " << 2;
|
|
||||||
// std::cout << foo;
|
|
||||||
//
|
|
||||||
// will print "1 != 2".
|
|
||||||
//
|
|
||||||
// Message is not intended to be inherited from. In particular, its
|
|
||||||
// destructor is not virtual.
|
|
||||||
//
|
|
||||||
// Note that stringstream behaves differently in gcc and in MSVC. You
|
|
||||||
// can stream a NULL char pointer to it in the former, but not in the
|
|
||||||
// latter (it causes an access violation if you do). The Message
|
|
||||||
// class hides this difference by treating a NULL char pointer as
|
|
||||||
// "(null)".
|
|
||||||
class GTEST_API_ Message {
|
|
||||||
private:
|
|
||||||
// The type of basic IO manipulators (endl, ends, and flush) for
|
|
||||||
// narrow streams.
|
|
||||||
typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Constructs an empty Message.
|
|
||||||
// We allocate the stringstream separately because otherwise each use of
|
|
||||||
// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
|
|
||||||
// stack frame leading to huge stack frames in some cases; gcc does not reuse
|
|
||||||
// the stack space.
|
|
||||||
Message() : ss_(new ::std::stringstream) {
|
|
||||||
// By default, we want there to be enough precision when printing
|
|
||||||
// a double to a Message.
|
|
||||||
*ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy constructor.
|
|
||||||
Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
|
|
||||||
*ss_ << msg.GetString();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Constructs a Message from a C-string.
|
|
||||||
explicit Message(const char* str) : ss_(new ::std::stringstream) {
|
|
||||||
*ss_ << str;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if GTEST_OS_SYMBIAN
|
|
||||||
// Streams a value (either a pointer or not) to this object.
|
|
||||||
template <typename T>
|
|
||||||
inline Message& operator <<(const T& value) {
|
|
||||||
StreamHelper(typename internal::is_pointer<T>::type(), value);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Streams a non-pointer value to this object.
|
|
||||||
template <typename T>
|
|
||||||
inline Message& operator <<(const T& val) {
|
|
||||||
::GTestStreamToHelper(ss_.get(), val);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Streams a pointer value to this object.
|
|
||||||
//
|
|
||||||
// This function is an overload of the previous one. When you
|
|
||||||
// stream a pointer to a Message, this definition will be used as it
|
|
||||||
// is more specialized. (The C++ Standard, section
|
|
||||||
// [temp.func.order].) If you stream a non-pointer, then the
|
|
||||||
// previous definition will be used.
|
|
||||||
//
|
|
||||||
// The reason for this overload is that streaming a NULL pointer to
|
|
||||||
// ostream is undefined behavior. Depending on the compiler, you
|
|
||||||
// may get "0", "(nil)", "(null)", or an access violation. To
|
|
||||||
// ensure consistent result across compilers, we always treat NULL
|
|
||||||
// as "(null)".
|
|
||||||
template <typename T>
|
|
||||||
inline Message& operator <<(T* const& pointer) { // NOLINT
|
|
||||||
if (pointer == NULL) {
|
|
||||||
*ss_ << "(null)";
|
|
||||||
} else {
|
|
||||||
::GTestStreamToHelper(ss_.get(), pointer);
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
#endif // GTEST_OS_SYMBIAN
|
|
||||||
|
|
||||||
// Since the basic IO manipulators are overloaded for both narrow
|
|
||||||
// and wide streams, we have to provide this specialized definition
|
|
||||||
// of operator <<, even though its body is the same as the
|
|
||||||
// templatized version above. Without this definition, streaming
|
|
||||||
// endl or other basic IO manipulators to Message will confuse the
|
|
||||||
// compiler.
|
|
||||||
Message& operator <<(BasicNarrowIoManip val) {
|
|
||||||
*ss_ << val;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instead of 1/0, we want to see true/false for bool values.
|
|
||||||
Message& operator <<(bool b) {
|
|
||||||
return *this << (b ? "true" : "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
// These two overloads allow streaming a wide C string to a Message
|
|
||||||
// using the UTF-8 encoding.
|
|
||||||
Message& operator <<(const wchar_t* wide_c_str) {
|
|
||||||
return *this << internal::String::ShowWideCString(wide_c_str);
|
|
||||||
}
|
|
||||||
Message& operator <<(wchar_t* wide_c_str) {
|
|
||||||
return *this << internal::String::ShowWideCString(wide_c_str);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if GTEST_HAS_STD_WSTRING
|
|
||||||
// Converts the given wide string to a narrow string using the UTF-8
|
|
||||||
// encoding, and streams the result to this Message object.
|
|
||||||
Message& operator <<(const ::std::wstring& wstr);
|
|
||||||
#endif // GTEST_HAS_STD_WSTRING
|
|
||||||
|
|
||||||
#if GTEST_HAS_GLOBAL_WSTRING
|
|
||||||
// Converts the given wide string to a narrow string using the UTF-8
|
|
||||||
// encoding, and streams the result to this Message object.
|
|
||||||
Message& operator <<(const ::wstring& wstr);
|
|
||||||
#endif // GTEST_HAS_GLOBAL_WSTRING
|
|
||||||
|
|
||||||
// Gets the text streamed to this object so far as a String.
|
|
||||||
// Each '\0' character in the buffer is replaced with "\\0".
|
|
||||||
//
|
|
||||||
// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
|
|
||||||
internal::String GetString() const {
|
|
||||||
return internal::StringStreamToString(ss_.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
#if GTEST_OS_SYMBIAN
|
|
||||||
// These are needed as the Nokia Symbian Compiler cannot decide between
|
|
||||||
// const T& and const T* in a function template. The Nokia compiler _can_
|
|
||||||
// decide between class template specializations for T and T*, so a
|
|
||||||
// tr1::type_traits-like is_pointer works, and we can overload on that.
|
|
||||||
template <typename T>
|
|
||||||
inline void StreamHelper(internal::true_type /*dummy*/, T* pointer) {
|
|
||||||
if (pointer == NULL) {
|
|
||||||
*ss_ << "(null)";
|
|
||||||
} else {
|
|
||||||
::GTestStreamToHelper(ss_.get(), pointer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
template <typename T>
|
|
||||||
inline void StreamHelper(internal::false_type /*dummy*/, const T& value) {
|
|
||||||
::GTestStreamToHelper(ss_.get(), value);
|
|
||||||
}
|
|
||||||
#endif // GTEST_OS_SYMBIAN
|
|
||||||
|
|
||||||
// We'll hold the text streamed to this object here.
|
|
||||||
const internal::scoped_ptr< ::std::stringstream> ss_;
|
|
||||||
|
|
||||||
// We declare (but don't implement) this to prevent the compiler
|
|
||||||
// from implementing the assignment operator.
|
|
||||||
void operator=(const Message&);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Streams a Message to an ostream.
|
|
||||||
inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
|
|
||||||
return os << sb.GetString();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace testing
|
|
||||||
|
|
||||||
#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,487 +0,0 @@
|
|||||||
$$ -*- mode: c++; -*-
|
|
||||||
$var n = 50 $$ Maximum length of Values arguments we want to support.
|
|
||||||
$var maxtuple = 10 $$ Maximum number of Combine arguments we want to support.
|
|
||||||
// Copyright 2008, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Authors: vladl@google.com (Vlad Losev)
|
|
||||||
//
|
|
||||||
// Macros and functions for implementing parameterized tests
|
|
||||||
// in Google C++ Testing Framework (Google Test)
|
|
||||||
//
|
|
||||||
// This file is generated by a SCRIPT. DO NOT EDIT BY HAND!
|
|
||||||
//
|
|
||||||
#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
|
|
||||||
#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
|
|
||||||
|
|
||||||
|
|
||||||
// Value-parameterized tests allow you to test your code with different
|
|
||||||
// parameters without writing multiple copies of the same test.
|
|
||||||
//
|
|
||||||
// Here is how you use value-parameterized tests:
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
// To write value-parameterized tests, first you should define a fixture
|
|
||||||
// class. It is usually derived from testing::TestWithParam<T> (see below for
|
|
||||||
// another inheritance scheme that's sometimes useful in more complicated
|
|
||||||
// class hierarchies), where the type of your parameter values.
|
|
||||||
// TestWithParam<T> is itself derived from testing::Test. T can be any
|
|
||||||
// copyable type. If it's a raw pointer, you are responsible for managing the
|
|
||||||
// lifespan of the pointed values.
|
|
||||||
|
|
||||||
class FooTest : public ::testing::TestWithParam<const char*> {
|
|
||||||
// You can implement all the usual class fixture members here.
|
|
||||||
};
|
|
||||||
|
|
||||||
// Then, use the TEST_P macro to define as many parameterized tests
|
|
||||||
// for this fixture as you want. The _P suffix is for "parameterized"
|
|
||||||
// or "pattern", whichever you prefer to think.
|
|
||||||
|
|
||||||
TEST_P(FooTest, DoesBlah) {
|
|
||||||
// Inside a test, access the test parameter with the GetParam() method
|
|
||||||
// of the TestWithParam<T> class:
|
|
||||||
EXPECT_TRUE(foo.Blah(GetParam()));
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(FooTest, HasBlahBlah) {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test
|
|
||||||
// case with any set of parameters you want. Google Test defines a number
|
|
||||||
// of functions for generating test parameters. They return what we call
|
|
||||||
// (surprise!) parameter generators. Here is a summary of them, which
|
|
||||||
// are all in the testing namespace:
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Range(begin, end [, step]) - Yields values {begin, begin+step,
|
|
||||||
// begin+step+step, ...}. The values do not
|
|
||||||
// include end. step defaults to 1.
|
|
||||||
// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
|
|
||||||
// ValuesIn(container) - Yields values from a C-style array, an STL
|
|
||||||
// ValuesIn(begin,end) container, or an iterator range [begin, end).
|
|
||||||
// Bool() - Yields sequence {false, true}.
|
|
||||||
// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
|
|
||||||
// for the math savvy) of the values generated
|
|
||||||
// by the N generators.
|
|
||||||
//
|
|
||||||
// For more details, see comments at the definitions of these functions below
|
|
||||||
// in this file.
|
|
||||||
//
|
|
||||||
// The following statement will instantiate tests from the FooTest test case
|
|
||||||
// each with parameter values "meeny", "miny", and "moe".
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(InstantiationName,
|
|
||||||
FooTest,
|
|
||||||
Values("meeny", "miny", "moe"));
|
|
||||||
|
|
||||||
// To distinguish different instances of the pattern, (yes, you
|
|
||||||
// can instantiate it more then once) the first argument to the
|
|
||||||
// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the
|
|
||||||
// actual test case name. Remember to pick unique prefixes for different
|
|
||||||
// instantiations. The tests from the instantiation above will have
|
|
||||||
// these names:
|
|
||||||
//
|
|
||||||
// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
|
|
||||||
// * InstantiationName/FooTest.DoesBlah/1 for "miny"
|
|
||||||
// * InstantiationName/FooTest.DoesBlah/2 for "moe"
|
|
||||||
// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
|
|
||||||
// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
|
|
||||||
// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
|
|
||||||
//
|
|
||||||
// You can use these names in --gtest_filter.
|
|
||||||
//
|
|
||||||
// This statement will instantiate all tests from FooTest again, each
|
|
||||||
// with parameter values "cat" and "dog":
|
|
||||||
|
|
||||||
const char* pets[] = {"cat", "dog"};
|
|
||||||
INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
|
|
||||||
|
|
||||||
// The tests from the instantiation above will have these names:
|
|
||||||
//
|
|
||||||
// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
|
|
||||||
// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
|
|
||||||
// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
|
|
||||||
// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
|
|
||||||
//
|
|
||||||
// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests
|
|
||||||
// in the given test case, whether their definitions come before or
|
|
||||||
// AFTER the INSTANTIATE_TEST_CASE_P statement.
|
|
||||||
//
|
|
||||||
// Please also note that generator expressions (including parameters to the
|
|
||||||
// generators) are evaluated in InitGoogleTest(), after main() has started.
|
|
||||||
// This allows the user on one hand, to adjust generator parameters in order
|
|
||||||
// to dynamically determine a set of tests to run and on the other hand,
|
|
||||||
// give the user a chance to inspect the generated tests with Google Test
|
|
||||||
// reflection API before RUN_ALL_TESTS() is executed.
|
|
||||||
//
|
|
||||||
// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
|
|
||||||
// for more examples.
|
|
||||||
//
|
|
||||||
// In the future, we plan to publish the API for defining new parameter
|
|
||||||
// generators. But for now this interface remains part of the internal
|
|
||||||
// implementation and is subject to change.
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// A parameterized test fixture must be derived from testing::Test and from
|
|
||||||
// testing::WithParamInterface<T>, where T is the type of the parameter
|
|
||||||
// values. Inheriting from TestWithParam<T> satisfies that requirement because
|
|
||||||
// TestWithParam<T> inherits from both Test and WithParamInterface. In more
|
|
||||||
// complicated hierarchies, however, it is occasionally useful to inherit
|
|
||||||
// separately from Test and WithParamInterface. For example:
|
|
||||||
|
|
||||||
class BaseTest : public ::testing::Test {
|
|
||||||
// You can inherit all the usual members for a non-parameterized test
|
|
||||||
// fixture here.
|
|
||||||
};
|
|
||||||
|
|
||||||
class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
|
|
||||||
// The usual test fixture members go here too.
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_F(BaseTest, HasFoo) {
|
|
||||||
// This is an ordinary non-parameterized test.
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_P(DerivedTest, DoesBlah) {
|
|
||||||
// GetParam works just the same here as if you inherit from TestWithParam.
|
|
||||||
EXPECT_TRUE(foo.Blah(GetParam()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif // 0
|
|
||||||
|
|
||||||
#include "gtest/internal/gtest-port.h"
|
|
||||||
|
|
||||||
#if !GTEST_OS_SYMBIAN
|
|
||||||
# include <utility>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// scripts/fuse_gtest.py depends on gtest's own header being #included
|
|
||||||
// *unconditionally*. Therefore these #includes cannot be moved
|
|
||||||
// inside #if GTEST_HAS_PARAM_TEST.
|
|
||||||
#include "gtest/internal/gtest-internal.h"
|
|
||||||
#include "gtest/internal/gtest-param-util.h"
|
|
||||||
#include "gtest/internal/gtest-param-util-generated.h"
|
|
||||||
|
|
||||||
#if GTEST_HAS_PARAM_TEST
|
|
||||||
|
|
||||||
namespace testing {
|
|
||||||
|
|
||||||
// Functions producing parameter generators.
|
|
||||||
//
|
|
||||||
// Google Test uses these generators to produce parameters for value-
|
|
||||||
// parameterized tests. When a parameterized test case is instantiated
|
|
||||||
// with a particular generator, Google Test creates and runs tests
|
|
||||||
// for each element in the sequence produced by the generator.
|
|
||||||
//
|
|
||||||
// In the following sample, tests from test case FooTest are instantiated
|
|
||||||
// each three times with parameter values 3, 5, and 8:
|
|
||||||
//
|
|
||||||
// class FooTest : public TestWithParam<int> { ... };
|
|
||||||
//
|
|
||||||
// TEST_P(FooTest, TestThis) {
|
|
||||||
// }
|
|
||||||
// TEST_P(FooTest, TestThat) {
|
|
||||||
// }
|
|
||||||
// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));
|
|
||||||
//
|
|
||||||
|
|
||||||
// Range() returns generators providing sequences of values in a range.
|
|
||||||
//
|
|
||||||
// Synopsis:
|
|
||||||
// Range(start, end)
|
|
||||||
// - returns a generator producing a sequence of values {start, start+1,
|
|
||||||
// start+2, ..., }.
|
|
||||||
// Range(start, end, step)
|
|
||||||
// - returns a generator producing a sequence of values {start, start+step,
|
|
||||||
// start+step+step, ..., }.
|
|
||||||
// Notes:
|
|
||||||
// * The generated sequences never include end. For example, Range(1, 5)
|
|
||||||
// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
|
|
||||||
// returns a generator producing {1, 3, 5, 7}.
|
|
||||||
// * start and end must have the same type. That type may be any integral or
|
|
||||||
// floating-point type or a user defined type satisfying these conditions:
|
|
||||||
// * It must be assignable (have operator=() defined).
|
|
||||||
// * It must have operator+() (operator+(int-compatible type) for
|
|
||||||
// two-operand version).
|
|
||||||
// * It must have operator<() defined.
|
|
||||||
// Elements in the resulting sequences will also have that type.
|
|
||||||
// * Condition start < end must be satisfied in order for resulting sequences
|
|
||||||
// to contain any elements.
|
|
||||||
//
|
|
||||||
template <typename T, typename IncrementT>
|
|
||||||
internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
|
|
||||||
return internal::ParamGenerator<T>(
|
|
||||||
new internal::RangeGenerator<T, IncrementT>(start, end, step));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
internal::ParamGenerator<T> Range(T start, T end) {
|
|
||||||
return Range(start, end, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValuesIn() function allows generation of tests with parameters coming from
|
|
||||||
// a container.
|
|
||||||
//
|
|
||||||
// Synopsis:
|
|
||||||
// ValuesIn(const T (&array)[N])
|
|
||||||
// - returns a generator producing sequences with elements from
|
|
||||||
// a C-style array.
|
|
||||||
// ValuesIn(const Container& container)
|
|
||||||
// - returns a generator producing sequences with elements from
|
|
||||||
// an STL-style container.
|
|
||||||
// ValuesIn(Iterator begin, Iterator end)
|
|
||||||
// - returns a generator producing sequences with elements from
|
|
||||||
// a range [begin, end) defined by a pair of STL-style iterators. These
|
|
||||||
// iterators can also be plain C pointers.
|
|
||||||
//
|
|
||||||
// Please note that ValuesIn copies the values from the containers
|
|
||||||
// passed in and keeps them to generate tests in RUN_ALL_TESTS().
|
|
||||||
//
|
|
||||||
// Examples:
|
|
||||||
//
|
|
||||||
// This instantiates tests from test case StringTest
|
|
||||||
// each with C-string values of "foo", "bar", and "baz":
|
|
||||||
//
|
|
||||||
// const char* strings[] = {"foo", "bar", "baz"};
|
|
||||||
// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings));
|
|
||||||
//
|
|
||||||
// This instantiates tests from test case StlStringTest
|
|
||||||
// each with STL strings with values "a" and "b":
|
|
||||||
//
|
|
||||||
// ::std::vector< ::std::string> GetParameterStrings() {
|
|
||||||
// ::std::vector< ::std::string> v;
|
|
||||||
// v.push_back("a");
|
|
||||||
// v.push_back("b");
|
|
||||||
// return v;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// INSTANTIATE_TEST_CASE_P(CharSequence,
|
|
||||||
// StlStringTest,
|
|
||||||
// ValuesIn(GetParameterStrings()));
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// This will also instantiate tests from CharTest
|
|
||||||
// each with parameter values 'a' and 'b':
|
|
||||||
//
|
|
||||||
// ::std::list<char> GetParameterChars() {
|
|
||||||
// ::std::list<char> list;
|
|
||||||
// list.push_back('a');
|
|
||||||
// list.push_back('b');
|
|
||||||
// return list;
|
|
||||||
// }
|
|
||||||
// ::std::list<char> l = GetParameterChars();
|
|
||||||
// INSTANTIATE_TEST_CASE_P(CharSequence2,
|
|
||||||
// CharTest,
|
|
||||||
// ValuesIn(l.begin(), l.end()));
|
|
||||||
//
|
|
||||||
template <typename ForwardIterator>
|
|
||||||
internal::ParamGenerator<
|
|
||||||
typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>
|
|
||||||
ValuesIn(ForwardIterator begin, ForwardIterator end) {
|
|
||||||
typedef typename ::testing::internal::IteratorTraits<ForwardIterator>
|
|
||||||
::value_type ParamType;
|
|
||||||
return internal::ParamGenerator<ParamType>(
|
|
||||||
new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T, size_t N>
|
|
||||||
internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
|
|
||||||
return ValuesIn(array, array + N);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Container>
|
|
||||||
internal::ParamGenerator<typename Container::value_type> ValuesIn(
|
|
||||||
const Container& container) {
|
|
||||||
return ValuesIn(container.begin(), container.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Values() allows generating tests from explicitly specified list of
|
|
||||||
// parameters.
|
|
||||||
//
|
|
||||||
// Synopsis:
|
|
||||||
// Values(T v1, T v2, ..., T vN)
|
|
||||||
// - returns a generator producing sequences with elements v1, v2, ..., vN.
|
|
||||||
//
|
|
||||||
// For example, this instantiates tests from test case BarTest each
|
|
||||||
// with values "one", "two", and "three":
|
|
||||||
//
|
|
||||||
// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three"));
|
|
||||||
//
|
|
||||||
// This instantiates tests from test case BazTest each with values 1, 2, 3.5.
|
|
||||||
// The exact type of values will depend on the type of parameter in BazTest.
|
|
||||||
//
|
|
||||||
// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
|
|
||||||
//
|
|
||||||
// Currently, Values() supports from 1 to $n parameters.
|
|
||||||
//
|
|
||||||
$range i 1..n
|
|
||||||
$for i [[
|
|
||||||
$range j 1..i
|
|
||||||
|
|
||||||
template <$for j, [[typename T$j]]>
|
|
||||||
internal::ValueArray$i<$for j, [[T$j]]> Values($for j, [[T$j v$j]]) {
|
|
||||||
return internal::ValueArray$i<$for j, [[T$j]]>($for j, [[v$j]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
]]
|
|
||||||
|
|
||||||
// Bool() allows generating tests with parameters in a set of (false, true).
|
|
||||||
//
|
|
||||||
// Synopsis:
|
|
||||||
// Bool()
|
|
||||||
// - returns a generator producing sequences with elements {false, true}.
|
|
||||||
//
|
|
||||||
// It is useful when testing code that depends on Boolean flags. Combinations
|
|
||||||
// of multiple flags can be tested when several Bool()'s are combined using
|
|
||||||
// Combine() function.
|
|
||||||
//
|
|
||||||
// In the following example all tests in the test case FlagDependentTest
|
|
||||||
// will be instantiated twice with parameters false and true.
|
|
||||||
//
|
|
||||||
// class FlagDependentTest : public testing::TestWithParam<bool> {
|
|
||||||
// virtual void SetUp() {
|
|
||||||
// external_flag = GetParam();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());
|
|
||||||
//
|
|
||||||
inline internal::ParamGenerator<bool> Bool() {
|
|
||||||
return Values(false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
# if GTEST_HAS_COMBINE
|
|
||||||
// Combine() allows the user to combine two or more sequences to produce
|
|
||||||
// values of a Cartesian product of those sequences' elements.
|
|
||||||
//
|
|
||||||
// Synopsis:
|
|
||||||
// Combine(gen1, gen2, ..., genN)
|
|
||||||
// - returns a generator producing sequences with elements coming from
|
|
||||||
// the Cartesian product of elements from the sequences generated by
|
|
||||||
// gen1, gen2, ..., genN. The sequence elements will have a type of
|
|
||||||
// tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
|
|
||||||
// of elements from sequences produces by gen1, gen2, ..., genN.
|
|
||||||
//
|
|
||||||
// Combine can have up to $maxtuple arguments. This number is currently limited
|
|
||||||
// by the maximum number of elements in the tuple implementation used by Google
|
|
||||||
// Test.
|
|
||||||
//
|
|
||||||
// Example:
|
|
||||||
//
|
|
||||||
// This will instantiate tests in test case AnimalTest each one with
|
|
||||||
// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
|
|
||||||
// tuple("dog", BLACK), and tuple("dog", WHITE):
|
|
||||||
//
|
|
||||||
// enum Color { BLACK, GRAY, WHITE };
|
|
||||||
// class AnimalTest
|
|
||||||
// : public testing::TestWithParam<tuple<const char*, Color> > {...};
|
|
||||||
//
|
|
||||||
// TEST_P(AnimalTest, AnimalLooksNice) {...}
|
|
||||||
//
|
|
||||||
// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,
|
|
||||||
// Combine(Values("cat", "dog"),
|
|
||||||
// Values(BLACK, WHITE)));
|
|
||||||
//
|
|
||||||
// This will instantiate tests in FlagDependentTest with all variations of two
|
|
||||||
// Boolean flags:
|
|
||||||
//
|
|
||||||
// class FlagDependentTest
|
|
||||||
// : public testing::TestWithParam<tuple(bool, bool)> > {
|
|
||||||
// virtual void SetUp() {
|
|
||||||
// // Assigns external_flag_1 and external_flag_2 values from the tuple.
|
|
||||||
// tie(external_flag_1, external_flag_2) = GetParam();
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// TEST_P(FlagDependentTest, TestFeature1) {
|
|
||||||
// // Test your code using external_flag_1 and external_flag_2 here.
|
|
||||||
// }
|
|
||||||
// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,
|
|
||||||
// Combine(Bool(), Bool()));
|
|
||||||
//
|
|
||||||
$range i 2..maxtuple
|
|
||||||
$for i [[
|
|
||||||
$range j 1..i
|
|
||||||
|
|
||||||
template <$for j, [[typename Generator$j]]>
|
|
||||||
internal::CartesianProductHolder$i<$for j, [[Generator$j]]> Combine(
|
|
||||||
$for j, [[const Generator$j& g$j]]) {
|
|
||||||
return internal::CartesianProductHolder$i<$for j, [[Generator$j]]>(
|
|
||||||
$for j, [[g$j]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
]]
|
|
||||||
# endif // GTEST_HAS_COMBINE
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# define TEST_P(test_case_name, test_name) \
|
|
||||||
class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \
|
|
||||||
: public test_case_name { \
|
|
||||||
public: \
|
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \
|
|
||||||
virtual void TestBody(); \
|
|
||||||
private: \
|
|
||||||
static int AddToRegistry() { \
|
|
||||||
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
|
|
||||||
GetTestCasePatternHolder<test_case_name>(\
|
|
||||||
#test_case_name, __FILE__, __LINE__)->AddTestPattern(\
|
|
||||||
#test_case_name, \
|
|
||||||
#test_name, \
|
|
||||||
new ::testing::internal::TestMetaFactory< \
|
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
|
|
||||||
return 0; \
|
|
||||||
} \
|
|
||||||
static int gtest_registering_dummy_; \
|
|
||||||
GTEST_DISALLOW_COPY_AND_ASSIGN_(\
|
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
|
|
||||||
}; \
|
|
||||||
int GTEST_TEST_CLASS_NAME_(test_case_name, \
|
|
||||||
test_name)::gtest_registering_dummy_ = \
|
|
||||||
GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
|
|
||||||
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
|
|
||||||
|
|
||||||
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
|
|
||||||
::testing::internal::ParamGenerator<test_case_name::ParamType> \
|
|
||||||
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
|
|
||||||
int gtest_##prefix##test_case_name##_dummy_ = \
|
|
||||||
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
|
|
||||||
GetTestCasePatternHolder<test_case_name>(\
|
|
||||||
#test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
|
|
||||||
#prefix, \
|
|
||||||
>est_##prefix##test_case_name##_EvalGenerator_, \
|
|
||||||
__FILE__, __LINE__)
|
|
||||||
|
|
||||||
} // namespace testing
|
|
||||||
|
|
||||||
#endif // GTEST_HAS_PARAM_TEST
|
|
||||||
|
|
||||||
#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
|
|
||||||
@@ -1,796 +0,0 @@
|
|||||||
// Copyright 2007, Google Inc.
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without
|
|
||||||
// modification, are permitted provided that the following conditions are
|
|
||||||
// met:
|
|
||||||
//
|
|
||||||
// * Redistributions of source code must retain the above copyright
|
|
||||||
// notice, this list of conditions and the following disclaimer.
|
|
||||||
// * Redistributions in binary form must reproduce the above
|
|
||||||
// copyright notice, this list of conditions and the following disclaimer
|
|
||||||
// in the documentation and/or other materials provided with the
|
|
||||||
// distribution.
|
|
||||||
// * Neither the name of Google Inc. nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from
|
|
||||||
// this software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
//
|
|
||||||
// Author: wan@google.com (Zhanyong Wan)
|
|
||||||
|
|
||||||
// Google Test - The Google C++ Testing Framework
|
|
||||||
//
|
|
||||||
// This file implements a universal value printer that can print a
|
|
||||||
// value of any type T:
|
|
||||||
//
|
|
||||||
// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
|
|
||||||
//
|
|
||||||
// A user can teach this function how to print a class type T by
|
|
||||||
// defining either operator<<() or PrintTo() in the namespace that
|
|
||||||
// defines T. More specifically, the FIRST defined function in the
|
|
||||||
// following list will be used (assuming T is defined in namespace
|
|
||||||
// foo):
|
|
||||||
//
|
|
||||||
// 1. foo::PrintTo(const T&, ostream*)
|
|
||||||
// 2. operator<<(ostream&, const T&) defined in either foo or the
|
|
||||||
// global namespace.
|
|
||||||
//
|
|
||||||
// If none of the above is defined, it will print the debug string of
|
|
||||||
// the value if it is a protocol buffer, or print the raw bytes in the
|
|
||||||
// value otherwise.
|
|
||||||
//
|
|
||||||
// To aid debugging: when T is a reference type, the address of the
|
|
||||||
// value is also printed; when T is a (const) char pointer, both the
|
|
||||||
// pointer value and the NUL-terminated string it points to are
|
|
||||||
// printed.
|
|
||||||
//
|
|
||||||
// We also provide some convenient wrappers:
|
|
||||||
//
|
|
||||||
// // Prints a value to a string. For a (const or not) char
|
|
||||||
// // pointer, the NUL-terminated string (but not the pointer) is
|
|
||||||
// // printed.
|
|
||||||
// std::string ::testing::PrintToString(const T& value);
|
|
||||||
//
|
|
||||||
// // Prints a value tersely: for a reference type, the referenced
|
|
||||||
// // value (but not the address) is printed; for a (const or not) char
|
|
||||||
// // pointer, the NUL-terminated string (but not the pointer) is
|
|
||||||
// // printed.
|
|
||||||
// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
|
|
||||||
//
|
|
||||||
// // Prints value using the type inferred by the compiler. The difference
|
|
||||||
// // from UniversalTersePrint() is that this function prints both the
|
|
||||||
// // pointer and the NUL-terminated string for a (const or not) char pointer.
|
|
||||||
// void ::testing::internal::UniversalPrint(const T& value, ostream*);
|
|
||||||
//
|
|
||||||
// // Prints the fields of a tuple tersely to a string vector, one
|
|
||||||
// // element for each field. Tuple support must be enabled in
|
|
||||||
// // gtest-port.h.
|
|
||||||
// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
|
|
||||||
// const Tuple& value);
|
|
||||||
//
|
|
||||||
// Known limitation:
|
|
||||||
//
|
|
||||||
// The print primitives print the elements of an STL-style container
|
|
||||||
// using the compiler-inferred type of *iter where iter is a
|
|
||||||
// const_iterator of the container. When const_iterator is an input
|
|
||||||
// iterator but not a forward iterator, this inferred type may not
|
|
||||||
// match value_type, and the print output may be incorrect. In
|
|
||||||
// practice, this is rarely a problem as for most containers
|
|
||||||
// const_iterator is a forward iterator. We'll fix this if there's an
|
|
||||||
// actual need for it. Note that this fix cannot rely on value_type
|
|
||||||
// being defined as many user-defined container types don't have
|
|
||||||
// value_type.
|
|
||||||
|
|
||||||
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
|
||||||
#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
|
||||||
|
|
||||||
#include <ostream> // NOLINT
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
#include "gtest/internal/gtest-port.h"
|
|
||||||
#include "gtest/internal/gtest-internal.h"
|
|
||||||
|
|
||||||
namespace testing {
|
|
||||||
|
|
||||||
// Definitions in the 'internal' and 'internal2' name spaces are
|
|
||||||
// subject to change without notice. DO NOT USE THEM IN USER CODE!
|
|
||||||
namespace internal2 {
|
|
||||||
|
|
||||||
// Prints the given number of bytes in the given object to the given
|
|
||||||
// ostream.
|
|
||||||
GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
|
|
||||||
size_t count,
|
|
||||||
::std::ostream* os);
|
|
||||||
|
|
||||||
// For selecting which printer to use when a given type has neither <<
|
|
||||||
// nor PrintTo().
|
|
||||||
enum TypeKind {
|
|
||||||
kProtobuf, // a protobuf type
|
|
||||||
kConvertibleToInteger, // a type implicitly convertible to BiggestInt
|
|
||||||
// (e.g. a named or unnamed enum type)
|
|
||||||
kOtherType // anything else
|
|
||||||
};
|
|
||||||
|
|
||||||
// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called
|
|
||||||
// by the universal printer to print a value of type T when neither
|
|
||||||
// operator<< nor PrintTo() is defined for T, where kTypeKind is the
|
|
||||||
// "kind" of T as defined by enum TypeKind.
|
|
||||||
template <typename T, TypeKind kTypeKind>
|
|
||||||
class TypeWithoutFormatter {
|
|
||||||
public:
|
|
||||||
// This default version is called when kTypeKind is kOtherType.
|
|
||||||
static void PrintValue(const T& value, ::std::ostream* os) {
|
|
||||||
PrintBytesInObjectTo(reinterpret_cast<const unsigned char*>(&value),
|
|
||||||
sizeof(value), os);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// We print a protobuf using its ShortDebugString() when the string
|
|
||||||
// doesn't exceed this many characters; otherwise we print it using
|
|
||||||
// DebugString() for better readability.
|
|
||||||
const size_t kProtobufOneLinerMaxLength = 50;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class TypeWithoutFormatter<T, kProtobuf> {
|
|
||||||
public:
|
|
||||||
static void PrintValue(const T& value, ::std::ostream* os) {
|
|
||||||
const ::testing::internal::string short_str = value.ShortDebugString();
|
|
||||||
const ::testing::internal::string pretty_str =
|
|
||||||
short_str.length() <= kProtobufOneLinerMaxLength ?
|
|
||||||
short_str : ("\n" + value.DebugString());
|
|
||||||
*os << ("<" + pretty_str + ">");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class TypeWithoutFormatter<T, kConvertibleToInteger> {
|
|
||||||
public:
|
|
||||||
// Since T has no << operator or PrintTo() but can be implicitly
|
|
||||||
// converted to BiggestInt, we print it as a BiggestInt.
|
|
||||||
//
|
|
||||||
// Most likely T is an enum type (either named or unnamed), in which
|
|
||||||
// case printing it as an integer is the desired behavior. In case
|
|
||||||
// T is not an enum, printing it as an integer is the best we can do
|
|
||||||
// given that it has no user-defined printer.
|
|
||||||
static void PrintValue(const T& value, ::std::ostream* os) {
|
|
||||||
const internal::BiggestInt kBigInt = value;
|
|
||||||
*os << kBigInt;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Prints the given value to the given ostream. If the value is a
|
|
||||||
// protocol message, its debug string is printed; if it's an enum or
|
|
||||||
// of a type implicitly convertible to BiggestInt, it's printed as an
|
|
||||||
// integer; otherwise the bytes in the value are printed. This is
|
|
||||||
// what UniversalPrinter<T>::Print() does when it knows nothing about
|
|
||||||
// type T and T has neither << operator nor PrintTo().
|
|
||||||
//
|
|
||||||
// A user can override this behavior for a class type Foo by defining
|
|
||||||
// a << operator in the namespace where Foo is defined.
|
|
||||||
//
|
|
||||||
// We put this operator in namespace 'internal2' instead of 'internal'
|
|
||||||
// to simplify the implementation, as much code in 'internal' needs to
|
|
||||||
// use << in STL, which would conflict with our own << were it defined
|
|
||||||
// in 'internal'.
|
|
||||||
//
|
|
||||||
// Note that this operator<< takes a generic std::basic_ostream<Char,
|
|
||||||
// CharTraits> type instead of the more restricted std::ostream. If
|
|
||||||
// we define it to take an std::ostream instead, we'll get an
|
|
||||||
// "ambiguous overloads" compiler error when trying to print a type
|
|
||||||
// Foo that supports streaming to std::basic_ostream<Char,
|
|
||||||
// CharTraits>, as the compiler cannot tell whether
|
|
||||||
// operator<<(std::ostream&, const T&) or
|
|
||||||
// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more
|
|
||||||
// specific.
|
|
||||||
template <typename Char, typename CharTraits, typename T>
|
|
||||||
::std::basic_ostream<Char, CharTraits>& operator<<(
|
|
||||||
::std::basic_ostream<Char, CharTraits>& os, const T& x) {
|
|
||||||
TypeWithoutFormatter<T,
|
|
||||||
(internal::IsAProtocolMessage<T>::value ? kProtobuf :
|
|
||||||
internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
|
|
||||||
kConvertibleToInteger : kOtherType)>::PrintValue(x, &os);
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace internal2
|
|
||||||
} // namespace testing
|
|
||||||
|
|
||||||
// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up
|
|
||||||
// magic needed for implementing UniversalPrinter won't work.
|
|
||||||
namespace testing_internal {
|
|
||||||
|
|
||||||
// Used to print a value that is not an STL-style container when the
|
|
||||||
// user doesn't define PrintTo() for it.
|
|
||||||
template <typename T>
|
|
||||||
void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
|
|
||||||
// With the following statement, during unqualified name lookup,
|
|
||||||
// testing::internal2::operator<< appears as if it was declared in
|
|
||||||
// the nearest enclosing namespace that contains both
|
|
||||||
// ::testing_internal and ::testing::internal2, i.e. the global
|
|
||||||
// namespace. For more details, refer to the C++ Standard section
|
|
||||||
// 7.3.4-1 [namespace.udir]. This allows us to fall back onto
|
|
||||||
// testing::internal2::operator<< in case T doesn't come with a <<
|
|
||||||
// operator.
|
|
||||||
//
|
|
||||||
// We cannot write 'using ::testing::internal2::operator<<;', which
|
|
||||||
// gcc 3.3 fails to compile due to a compiler bug.
|
|
||||||
using namespace ::testing::internal2; // NOLINT
|
|
||||||
|
|
||||||
// Assuming T is defined in namespace foo, in the next statement,
|
|
||||||
// the compiler will consider all of:
|
|
||||||
//
|
|
||||||
// 1. foo::operator<< (thanks to Koenig look-up),
|
|
||||||
// 2. ::operator<< (as the current namespace is enclosed in ::),
|
|
||||||
// 3. testing::internal2::operator<< (thanks to the using statement above).
|
|
||||||
//
|
|
||||||
// The operator<< whose type matches T best will be picked.
|
|
||||||
//
|
|
||||||
// We deliberately allow #2 to be a candidate, as sometimes it's
|
|
||||||
// impossible to define #1 (e.g. when foo is ::std, defining
|
|
||||||
// anything in it is undefined behavior unless you are a compiler
|
|
||||||
// vendor.).
|
|
||||||
*os << value;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace testing_internal
|
|
||||||
|
|
||||||
namespace testing {
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
|
|
||||||
// value to the given ostream. The caller must ensure that
|
|
||||||
// 'ostream_ptr' is not NULL, or the behavior is undefined.
|
|
||||||
//
|
|
||||||
// We define UniversalPrinter as a class template (as opposed to a
|
|
||||||
// function template), as we need to partially specialize it for
|
|
||||||
// reference types, which cannot be done with function templates.
|
|
||||||
template <typename T>
|
|
||||||
class UniversalPrinter;
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void UniversalPrint(const T& value, ::std::ostream* os);
|
|
||||||
|
|
||||||
// Used to print an STL-style container when the user doesn't define
|
|
||||||
// a PrintTo() for it.
|
|
||||||
template <typename C>
|
|
||||||
void DefaultPrintTo(IsContainer /* dummy */,
|
|
||||||
false_type /* is not a pointer */,
|
|
||||||
const C& container, ::std::ostream* os) {
|
|
||||||
const size_t kMaxCount = 32; // The maximum number of elements to print.
|
|
||||||
*os << '{';
|
|
||||||
size_t count = 0;
|
|
||||||
for (typename C::const_iterator it = container.begin();
|
|
||||||
it != container.end(); ++it, ++count) {
|
|
||||||
if (count > 0) {
|
|
||||||
*os << ',';
|
|
||||||
if (count == kMaxCount) { // Enough has been printed.
|
|
||||||
*os << " ...";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*os << ' ';
|
|
||||||
// We cannot call PrintTo(*it, os) here as PrintTo() doesn't
|
|
||||||
// handle *it being a native array.
|
|
||||||
internal::UniversalPrint(*it, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count > 0) {
|
|
||||||
*os << ' ';
|
|
||||||
}
|
|
||||||
*os << '}';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used to print a pointer that is neither a char pointer nor a member
|
|
||||||
// pointer, when the user doesn't define PrintTo() for it. (A member
|
|
||||||
// variable pointer or member function pointer doesn't really point to
|
|
||||||
// a location in the address space. Their representation is
|
|
||||||
// implementation-defined. Therefore they will be printed as raw
|
|
||||||
// bytes.)
|
|
||||||
template <typename T>
|
|
||||||
void DefaultPrintTo(IsNotContainer /* dummy */,
|
|
||||||
true_type /* is a pointer */,
|
|
||||||
T* p, ::std::ostream* os) {
|
|
||||||
if (p == NULL) {
|
|
||||||
*os << "NULL";
|
|
||||||
} else {
|
|
||||||
// C++ doesn't allow casting from a function pointer to any object
|
|
||||||
// pointer.
|
|
||||||
//
|
|
||||||
// IsTrue() silences warnings: "Condition is always true",
|
|
||||||
// "unreachable code".
|
|
||||||
if (IsTrue(ImplicitlyConvertible<T*, const void*>::value)) {
|
|
||||||
// T is not a function type. We just call << to print p,
|
|
||||||
// relying on ADL to pick up user-defined << for their pointer
|
|
||||||
// types, if any.
|
|
||||||
*os << p;
|
|
||||||
} else {
|
|
||||||
// T is a function type, so '*os << p' doesn't do what we want
|
|
||||||
// (it just prints p as bool). We want to print p as a const
|
|
||||||
// void*. However, we cannot cast it to const void* directly,
|
|
||||||
// even using reinterpret_cast, as earlier versions of gcc
|
|
||||||
// (e.g. 3.4.5) cannot compile the cast when p is a function
|
|
||||||
// pointer. Casting to UInt64 first solves the problem.
|
|
||||||
*os << reinterpret_cast<const void*>(
|
|
||||||
reinterpret_cast<internal::UInt64>(p));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used to print a non-container, non-pointer value when the user
|
|
||||||
// doesn't define PrintTo() for it.
|
|
||||||
template <typename T>
|
|
||||||
void DefaultPrintTo(IsNotContainer /* dummy */,
|
|
||||||
false_type /* is not a pointer */,
|
|
||||||
const T& value, ::std::ostream* os) {
|
|
||||||
::testing_internal::DefaultPrintNonContainerTo(value, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prints the given value using the << operator if it has one;
|
|
||||||
// otherwise prints the bytes in it. This is what
|
|
||||||
// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
|
|
||||||
// or overloaded for type T.
|
|
||||||
//
|
|
||||||
// A user can override this behavior for a class type Foo by defining
|
|
||||||
// an overload of PrintTo() in the namespace where Foo is defined. We
|
|
||||||
// give the user this option as sometimes defining a << operator for
|
|
||||||
// Foo is not desirable (e.g. the coding style may prevent doing it,
|
|
||||||
// or there is already a << operator but it doesn't do what the user
|
|
||||||
// wants).
|
|
||||||
template <typename T>
|
|
||||||
void PrintTo(const T& value, ::std::ostream* os) {
|
|
||||||
// DefaultPrintTo() is overloaded. The type of its first two
|
|
||||||
// arguments determine which version will be picked. If T is an
|
|
||||||
// STL-style container, the version for container will be called; if
|
|
||||||
// T is a pointer, the pointer version will be called; otherwise the
|
|
||||||
// generic version will be called.
|
|
||||||
//
|
|
||||||
// Note that we check for container types here, prior to we check
|
|
||||||
// for protocol message types in our operator<<. The rationale is:
|
|
||||||
//
|
|
||||||
// For protocol messages, we want to give people a chance to
|
|
||||||
// override Google Mock's format by defining a PrintTo() or
|
|
||||||
// operator<<. For STL containers, other formats can be
|
|
||||||
// incompatible with Google Mock's format for the container
|
|
||||||
// elements; therefore we check for container types here to ensure
|
|
||||||
// that our format is used.
|
|
||||||
//
|
|
||||||
// The second argument of DefaultPrintTo() is needed to bypass a bug
|
|
||||||
// in Symbian's C++ compiler that prevents it from picking the right
|
|
||||||
// overload between:
|
|
||||||
//
|
|
||||||
// PrintTo(const T& x, ...);
|
|
||||||
// PrintTo(T* x, ...);
|
|
||||||
DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The following list of PrintTo() overloads tells
|
|
||||||
// UniversalPrinter<T>::Print() how to print standard types (built-in
|
|
||||||
// types, strings, plain arrays, and pointers).
|
|
||||||
|
|
||||||
// Overloads for various char types.
|
|
||||||
GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
|
|
||||||
GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
|
|
||||||
inline void PrintTo(char c, ::std::ostream* os) {
|
|
||||||
// When printing a plain char, we always treat it as unsigned. This
|
|
||||||
// way, the output won't be affected by whether the compiler thinks
|
|
||||||
// char is signed or not.
|
|
||||||
PrintTo(static_cast<unsigned char>(c), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overloads for other simple built-in types.
|
|
||||||
inline void PrintTo(bool x, ::std::ostream* os) {
|
|
||||||
*os << (x ? "true" : "false");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overload for wchar_t type.
|
|
||||||
// Prints a wchar_t as a symbol if it is printable or as its internal
|
|
||||||
// code otherwise and also as its decimal code (except for L'\0').
|
|
||||||
// The L'\0' char is printed as "L'\\0'". The decimal code is printed
|
|
||||||
// as signed integer when wchar_t is implemented by the compiler
|
|
||||||
// as a signed type and is printed as an unsigned integer when wchar_t
|
|
||||||
// is implemented as an unsigned type.
|
|
||||||
GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
|
|
||||||
|
|
||||||
// Overloads for C strings.
|
|
||||||
GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(char* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const char*>(s), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// signed/unsigned char is often used for representing binary data, so
|
|
||||||
// we print pointers to it as void* to be safe.
|
|
||||||
inline void PrintTo(const signed char* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const void*>(s), os);
|
|
||||||
}
|
|
||||||
inline void PrintTo(signed char* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const void*>(s), os);
|
|
||||||
}
|
|
||||||
inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const void*>(s), os);
|
|
||||||
}
|
|
||||||
inline void PrintTo(unsigned char* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const void*>(s), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// MSVC can be configured to define wchar_t as a typedef of unsigned
|
|
||||||
// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
|
|
||||||
// type. When wchar_t is a typedef, defining an overload for const
|
|
||||||
// wchar_t* would cause unsigned short* be printed as a wide string,
|
|
||||||
// possibly causing invalid memory accesses.
|
|
||||||
#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
|
|
||||||
// Overloads for wide C strings
|
|
||||||
GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(wchar_t* s, ::std::ostream* os) {
|
|
||||||
PrintTo(ImplicitCast_<const wchar_t*>(s), os);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Overload for C arrays. Multi-dimensional arrays are printed
|
|
||||||
// properly.
|
|
||||||
|
|
||||||
// Prints the given number of elements in an array, without printing
|
|
||||||
// the curly braces.
|
|
||||||
template <typename T>
|
|
||||||
void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
|
|
||||||
UniversalPrint(a[0], os);
|
|
||||||
for (size_t i = 1; i != count; i++) {
|
|
||||||
*os << ", ";
|
|
||||||
UniversalPrint(a[i], os);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overloads for ::string and ::std::string.
|
|
||||||
#if GTEST_HAS_GLOBAL_STRING
|
|
||||||
GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(const ::string& s, ::std::ostream* os) {
|
|
||||||
PrintStringTo(s, os);
|
|
||||||
}
|
|
||||||
#endif // GTEST_HAS_GLOBAL_STRING
|
|
||||||
|
|
||||||
GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
|
|
||||||
PrintStringTo(s, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overloads for ::wstring and ::std::wstring.
|
|
||||||
#if GTEST_HAS_GLOBAL_WSTRING
|
|
||||||
GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(const ::wstring& s, ::std::ostream* os) {
|
|
||||||
PrintWideStringTo(s, os);
|
|
||||||
}
|
|
||||||
#endif // GTEST_HAS_GLOBAL_WSTRING
|
|
||||||
|
|
||||||
#if GTEST_HAS_STD_WSTRING
|
|
||||||
GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
|
|
||||||
inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
|
|
||||||
PrintWideStringTo(s, os);
|
|
||||||
}
|
|
||||||
#endif // GTEST_HAS_STD_WSTRING
|
|
||||||
|
|
||||||
#if GTEST_HAS_TR1_TUPLE
|
|
||||||
// Overload for ::std::tr1::tuple. Needed for printing function arguments,
|
|
||||||
// which are packed as tuples.
|
|
||||||
|
|
||||||
// Helper function for printing a tuple. T must be instantiated with
|
|
||||||
// a tuple type.
|
|
||||||
template <typename T>
|
|
||||||
void PrintTupleTo(const T& t, ::std::ostream* os);
|
|
||||||
|
|
||||||
// Overloaded PrintTo() for tuples of various arities. We support
|
|
||||||
// tuples of up-to 10 fields. The following implementation works
|
|
||||||
// regardless of whether tr1::tuple is implemented using the
|
|
||||||
// non-standard variadic template feature or not.
|
|
||||||
|
|
||||||
inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
|
||||||
typename T6>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
|
||||||
typename T6, typename T7>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
|
||||||
typename T6, typename T7, typename T8>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
|
||||||
typename T6, typename T7, typename T8, typename T9>
|
|
||||||
void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
|
||||||
typename T6, typename T7, typename T8, typename T9, typename T10>
|
|
||||||
void PrintTo(
|
|
||||||
const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
|
|
||||||
::std::ostream* os) {
|
|
||||||
PrintTupleTo(t, os);
|
|
||||||
}
|
|
||||||
#endif // GTEST_HAS_TR1_TUPLE
|
|
||||||
|
|
||||||
// Overload for std::pair.
|
|
||||||
template <typename T1, typename T2>
|
|
||||||
void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
|
|
||||||
*os << '(';
|
|
||||||
// We cannot use UniversalPrint(value.first, os) here, as T1 may be
|
|
||||||
// a reference type. The same for printing value.second.
|
|
||||||
UniversalPrinter<T1>::Print(value.first, os);
|
|
||||||
*os << ", ";
|
|
||||||
UniversalPrinter<T2>::Print(value.second, os);
|
|
||||||
*os << ')';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Implements printing a non-reference type T by letting the compiler
|
|
||||||
// pick the right overload of PrintTo() for T.
|
|
||||||
template <typename T>
|
|
||||||
class UniversalPrinter {
|
|
||||||
public:
|
|
||||||
// MSVC warns about adding const to a function type, so we want to
|
|
||||||
// disable the warning.
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# pragma warning(push) // Saves the current warning state.
|
|
||||||
# pragma warning(disable:4180) // Temporarily disables warning 4180.
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
// Note: we deliberately don't call this PrintTo(), as that name
|
|
||||||
// conflicts with ::testing::internal::PrintTo in the body of the
|
|
||||||
// function.
|
|
||||||
static void Print(const T& value, ::std::ostream* os) {
|
|
||||||
// By default, ::testing::internal::PrintTo() is used for printing
|
|
||||||
// the value.
|
|
||||||
//
|
|
||||||
// Thanks to Koenig look-up, if T is a class and has its own
|
|
||||||
// PrintTo() function defined in its namespace, that function will
|
|
||||||
// be visible here. Since it is more specific than the generic ones
|
|
||||||
// in ::testing::internal, it will be picked by the compiler in the
|
|
||||||
// following statement - exactly what we want.
|
|
||||||
PrintTo(value, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# pragma warning(pop) // Restores the warning state.
|
|
||||||
#endif // _MSC_VER
|
|
||||||
};
|
|
||||||
|
|
||||||
// UniversalPrintArray(begin, len, os) prints an array of 'len'
|
|
||||||
// elements, starting at address 'begin'.
|
|
||||||
template <typename T>
|
|
||||||
void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
|
|
||||||
if (len == 0) {
|
|
||||||
*os << "{}";
|
|
||||||
} else {
|
|
||||||
*os << "{ ";
|
|
||||||
const size_t kThreshold = 18;
|
|
||||||
const size_t kChunkSize = 8;
|
|
||||||
// If the array has more than kThreshold elements, we'll have to
|
|
||||||
// omit some details by printing only the first and the last
|
|
||||||
// kChunkSize elements.
|
|
||||||
// TODO(wan@google.com): let the user control the threshold using a flag.
|
|
||||||
if (len <= kThreshold) {
|
|
||||||
PrintRawArrayTo(begin, len, os);
|
|
||||||
} else {
|
|
||||||
PrintRawArrayTo(begin, kChunkSize, os);
|
|
||||||
*os << ", ..., ";
|
|
||||||
PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
|
|
||||||
}
|
|
||||||
*os << " }";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// This overload prints a (const) char array compactly.
|
|
||||||
GTEST_API_ void UniversalPrintArray(const char* begin,
|
|
||||||
size_t len,
|
|
||||||
::std::ostream* os);
|
|
||||||
|
|
||||||
// Implements printing an array type T[N].
|
|
||||||
template <typename T, size_t N>
|
|
||||||
class UniversalPrinter<T[N]> {
|
|
||||||
public:
|
|
||||||
// Prints the given array, omitting some elements when there are too
|
|
||||||
// many.
|
|
||||||
static void Print(const T (&a)[N], ::std::ostream* os) {
|
|
||||||
UniversalPrintArray(a, N, os);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Implements printing a reference type T&.
|
|
||||||
template <typename T>
|
|
||||||
class UniversalPrinter<T&> {
|
|
||||||
public:
|
|
||||||
// MSVC warns about adding const to a function type, so we want to
|
|
||||||
// disable the warning.
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# pragma warning(push) // Saves the current warning state.
|
|
||||||
# pragma warning(disable:4180) // Temporarily disables warning 4180.
|
|
||||||
#endif // _MSC_VER
|
|
||||||
|
|
||||||
static void Print(const T& value, ::std::ostream* os) {
|
|
||||||
// Prints the address of the value. We use reinterpret_cast here
|
|
||||||
// as static_cast doesn't compile when T is a function type.
|
|
||||||
*os << "@" << reinterpret_cast<const void*>(&value) << " ";
|
|
||||||
|
|
||||||
// Then prints the value itself.
|
|
||||||
UniversalPrint(value, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# pragma warning(pop) // Restores the warning state.
|
|
||||||
#endif // _MSC_VER
|
|
||||||
};
|
|
||||||
|
|
||||||
// Prints a value tersely: for a reference type, the referenced value
|
|
||||||
// (but not the address) is printed; for a (const) char pointer, the
|
|
||||||
// NUL-terminated string (but not the pointer) is printed.
|
|
||||||
template <typename T>
|
|
||||||
void UniversalTersePrint(const T& value, ::std::ostream* os) {
|
|
||||||
UniversalPrint(value, os);
|
|
||||||
}
|
|
||||||
inline void UniversalTersePrint(const char* str, ::std::ostream* os) {
|
|
||||||
if (str == NULL) {
|
|
||||||
*os << "NULL";
|
|
||||||
} else {
|
|
||||||
UniversalPrint(string(str), os);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
inline void UniversalTersePrint(char* str, ::std::ostream* os) {
|
|
||||||
UniversalTersePrint(static_cast<const char*>(str), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prints a value using the type inferred by the compiler. The
|
|
||||||
// difference between this and UniversalTersePrint() is that for a
|
|
||||||
// (const) char pointer, this prints both the pointer and the
|
|
||||||
// NUL-terminated string.
|
|
||||||
template <typename T>
|
|
||||||
void UniversalPrint(const T& value, ::std::ostream* os) {
|
|
||||||
UniversalPrinter<T>::Print(value, os);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if GTEST_HAS_TR1_TUPLE
|
|
||||||
typedef ::std::vector<string> Strings;
|
|
||||||
|
|
||||||
// This helper template allows PrintTo() for tuples and
|
|
||||||
// UniversalTersePrintTupleFieldsToStrings() to be defined by
|
|
||||||
// induction on the number of tuple fields. The idea is that
|
|
||||||
// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
|
|
||||||
// fields in tuple t, and can be defined in terms of
|
|
||||||
// TuplePrefixPrinter<N - 1>.
|
|
||||||
|
|
||||||
// The inductive case.
|
|
||||||
template <size_t N>
|
|
||||||
struct TuplePrefixPrinter {
|
|
||||||
// Prints the first N fields of a tuple.
|
|
||||||
template <typename Tuple>
|
|
||||||
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
|
|
||||||
TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
|
|
||||||
*os << ", ";
|
|
||||||
UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
|
|
||||||
::Print(::std::tr1::get<N - 1>(t), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tersely prints the first N fields of a tuple to a string vector,
|
|
||||||
// one element for each field.
|
|
||||||
template <typename Tuple>
|
|
||||||
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
|
|
||||||
TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
|
|
||||||
::std::stringstream ss;
|
|
||||||
UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
|
|
||||||
strings->push_back(ss.str());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Base cases.
|
|
||||||
template <>
|
|
||||||
struct TuplePrefixPrinter<0> {
|
|
||||||
template <typename Tuple>
|
|
||||||
static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
|
|
||||||
|
|
||||||
template <typename Tuple>
|
|
||||||
static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
|
|
||||||
};
|
|
||||||
// We have to specialize the entire TuplePrefixPrinter<> class
|
|
||||||
// template here, even though the definition of
|
|
||||||
// TersePrintPrefixToStrings() is the same as the generic version, as
|
|
||||||
// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
|
|
||||||
// support specializing a method template of a class template.
|
|
||||||
template <>
|
|
||||||
struct TuplePrefixPrinter<1> {
|
|
||||||
template <typename Tuple>
|
|
||||||
static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
|
|
||||||
UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
|
|
||||||
Print(::std::tr1::get<0>(t), os);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Tuple>
|
|
||||||
static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
|
|
||||||
::std::stringstream ss;
|
|
||||||
UniversalTersePrint(::std::tr1::get<0>(t), &ss);
|
|
||||||
strings->push_back(ss.str());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Helper function for printing a tuple. T must be instantiated with
|
|
||||||
// a tuple type.
|
|
||||||
template <typename T>
|
|
||||||
void PrintTupleTo(const T& t, ::std::ostream* os) {
|
|
||||||
*os << "(";
|
|
||||||
TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
|
|
||||||
PrintPrefixTo(t, os);
|
|
||||||
*os << ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prints the fields of a tuple tersely to a string vector, one
|
|
||||||
// element for each field. See the comment before
|
|
||||||
// UniversalTersePrint() for how we define "tersely".
|
|
||||||
template <typename Tuple>
|
|
||||||
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
|
|
||||||
Strings result;
|
|
||||||
TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
|
|
||||||
TersePrintPrefixToStrings(value, &result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif // GTEST_HAS_TR1_TUPLE
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
::std::string PrintToString(const T& value) {
|
|
||||||
::std::stringstream ss;
|
|
||||||
internal::UniversalTersePrint(value, &ss);
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace testing
|
|
||||||
|
|
||||||
#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user