Compare commits
	
		
			498 Commits
		
	
	
		
			sandbox/jk
			...
			v1.2.0
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					b9ce430292 | ||
| 
						 | 
					feba090e5f | ||
| 
						 | 
					a1d929ea97 | ||
| 
						 | 
					7a09f6b892 | ||
| 
						 | 
					fd671152bc | ||
| 
						 | 
					57e12be283 | ||
| 
						 | 
					a0ad16e203 | ||
| 
						 | 
					2cd48bdc92 | ||
| 
						 | 
					cc91d655e4 | ||
| 
						 | 
					74efda4bd6 | ||
| 
						 | 
					3a19eebe4d | ||
| 
						 | 
					000c8414b5 | ||
| 
						 | 
					bc10eab41b | ||
| 
						 | 
					ef2248a2a3 | ||
| 
						 | 
					9a3de881c0 | ||
| 
						 | 
					f2b36a4de7 | ||
| 
						 | 
					bfca084fcd | ||
| 
						 | 
					9961ad479a | ||
| 
						 | 
					7891fb5eda | ||
| 
						 | 
					836f8e9883 | ||
| 
						 | 
					9bc8d5aab9 | ||
| 
						 | 
					eebb648380 | ||
| 
						 | 
					d034bfa947 | ||
| 
						 | 
					464b1df6d4 | ||
| 
						 | 
					6b1d95d6d8 | ||
| 
						 | 
					efb2f92702 | ||
| 
						 | 
					9cc6f078dc | ||
| 
						 | 
					17718fbbcd | ||
| 
						 | 
					0d80584327 | ||
| 
						 | 
					b52288aaff | ||
| 
						 | 
					8bb82fded5 | ||
| 
						 | 
					6475224e4f | ||
| 
						 | 
					999f31f71c | ||
| 
						 | 
					7c7801e34d | ||
| 
						 | 
					a5ffcdd8d4 | ||
| 
						 | 
					cd7f6841aa | ||
| 
						 | 
					83e8f2f976 | ||
| 
						 | 
					7ebcaeb0fa | ||
| 
						 | 
					4d9791e2b1 | ||
| 
						 | 
					69d074841d | ||
| 
						 | 
					80fe4723d2 | ||
| 
						 | 
					fe91e47bc7 | ||
| 
						 | 
					0a3eec86e5 | ||
| 
						 | 
					78bf8284cf | ||
| 
						 | 
					ee28bb87b4 | ||
| 
						 | 
					01824d1848 | ||
| 
						 | 
					95390b2b20 | ||
| 
						 | 
					03c0af8747 | ||
| 
						 | 
					7ee44eef13 | ||
| 
						 | 
					ca003fbb22 | ||
| 
						 | 
					9016fa22e0 | ||
| 
						 | 
					3c8007f19e | ||
| 
						 | 
					3b783d2217 | ||
| 
						 | 
					9e06601db6 | ||
| 
						 | 
					b0e1c5f899 | ||
| 
						 | 
					8a6a7ae292 | ||
| 
						 | 
					533470c998 | ||
| 
						 | 
					65d73881f7 | ||
| 
						 | 
					1fc3cc8e97 | ||
| 
						 | 
					96e5939faf | ||
| 
						 | 
					6106b72eb6 | ||
| 
						 | 
					fd3078fd8f | ||
| 
						 | 
					5ed84c2fdf | ||
| 
						 | 
					861a6bbbfd | ||
| 
						 | 
					adaf77c075 | ||
| 
						 | 
					15dffcfefa | ||
| 
						 | 
					4cf4c94ad1 | ||
| 
						 | 
					9da8a34437 | ||
| 
						 | 
					52bddd44c0 | ||
| 
						 | 
					f6886c4b93 | ||
| 
						 | 
					ec658125b0 | ||
| 
						 | 
					d21070a538 | ||
| 
						 | 
					81fd7ac589 | ||
| 
						 | 
					4de7aed6fb | ||
| 
						 | 
					8b698e8cb1 | ||
| 
						 | 
					107f14bcf9 | ||
| 
						 | 
					4c53bacce4 | ||
| 
						 | 
					30d8ba541e | ||
| 
						 | 
					55cff377dd | ||
| 
						 | 
					1a89bc04e8 | ||
| 
						 | 
					eb8e9f80c4 | ||
| 
						 | 
					85b27a1271 | ||
| 
						 | 
					cc017ca8df | ||
| 
						 | 
					0e213fb999 | ||
| 
						 | 
					e6109dbd41 | ||
| 
						 | 
					4206c6dd01 | ||
| 
						 | 
					f199bab7ab | ||
| 
						 | 
					7ca59827e3 | ||
| 
						 | 
					30f58b526d | ||
| 
						 | 
					9bbab8e457 | ||
| 
						 | 
					ea90cee2a9 | ||
| 
						 | 
					6f35b1958e | ||
| 
						 | 
					9704cdec9f | ||
| 
						 | 
					d539c1db5a | ||
| 
						 | 
					96f706655e | ||
| 
						 | 
					3730963073 | ||
| 
						 | 
					d377580d07 | ||
| 
						 | 
					d9ed9f9dae | ||
| 
						 | 
					ab98103fac | ||
| 
						 | 
					a75a9cf2fd | ||
| 
						 | 
					eb492100cd | ||
| 
						 | 
					4e72915ebc | ||
| 
						 | 
					f4316f39a1 | ||
| 
						 | 
					0211cd899a | ||
| 
						 | 
					22141d9d79 | ||
| 
						 | 
					b501251e2e | ||
| 
						 | 
					5979b89b92 | ||
| 
						 | 
					c03cc3a85e | ||
| 
						 | 
					e278673c8e | ||
| 
						 | 
					154f1c2234 | ||
| 
						 | 
					eec08d5cfc | ||
| 
						 | 
					57c7e45066 | ||
| 
						 | 
					1338a98d07 | ||
| 
						 | 
					1076101b2b | ||
| 
						 | 
					33d91719d0 | ||
| 
						 | 
					0925442e66 | ||
| 
						 | 
					a082467891 | ||
| 
						 | 
					260f5071ed | ||
| 
						 | 
					648cfcb437 | ||
| 
						 | 
					08cf9faed0 | ||
| 
						 | 
					7b7ca65bfc | ||
| 
						 | 
					8d02833a61 | ||
| 
						 | 
					818b10396d | ||
| 
						 | 
					2ff6d35064 | ||
| 
						 | 
					488ba1ab9c | ||
| 
						 | 
					c6fd0a5dd6 | ||
| 
						 | 
					7e9a519fbb | ||
| 
						 | 
					64075c9b01 | ||
| 
						 | 
					c953aeacd4 | ||
| 
						 | 
					90625c3bc1 | ||
| 
						 | 
					10f8b36146 | ||
| 
						 | 
					7177c3220c | ||
| 
						 | 
					446d85e4d7 | ||
| 
						 | 
					c533f2a43e | ||
| 
						 | 
					5746a76145 | ||
| 
						 | 
					c522217d78 | ||
| 
						 | 
					e75e249b75 | ||
| 
						 | 
					2a96d6b0d5 | ||
| 
						 | 
					24c346dffc | ||
| 
						 | 
					8bec177dc4 | ||
| 
						 | 
					f0b500bc4f | ||
| 
						 | 
					e8d58d3fd0 | ||
| 
						 | 
					cdb2a126a6 | ||
| 
						 | 
					fa0f418523 | ||
| 
						 | 
					bd6ffaa325 | ||
| 
						 | 
					272974af36 | ||
| 
						 | 
					12ddb75a9a | ||
| 
						 | 
					e57394aa1d | ||
| 
						 | 
					6cb50ce527 | ||
| 
						 | 
					8ee88da060 | ||
| 
						 | 
					b0cfcb2ca8 | ||
| 
						 | 
					1829d03906 | ||
| 
						 | 
					9f0b42247d | ||
| 
						 | 
					985f09fdca | ||
| 
						 | 
					d71ba03822 | ||
| 
						 | 
					97fd7c5eb6 | ||
| 
						 | 
					2b59e14a00 | ||
| 
						 | 
					d1b6fa4161 | ||
| 
						 | 
					b4ab43f12c | ||
| 
						 | 
					ff61cbc510 | ||
| 
						 | 
					4180dfd93c | ||
| 
						 | 
					ec52713999 | ||
| 
						 | 
					429743c56b | ||
| 
						 | 
					51ebb9a396 | ||
| 
						 | 
					3c37e7d2fa | ||
| 
						 | 
					336ca9a43a | ||
| 
						 | 
					aa165c8c5d | ||
| 
						 | 
					a9a1eac6c7 | ||
| 
						 | 
					69babd39f1 | ||
| 
						 | 
					b78d90703c | ||
| 
						 | 
					4b0b43632b | ||
| 
						 | 
					0e17ee56e8 | ||
| 
						 | 
					6ce58e84d3 | ||
| 
						 | 
					1746b2adc6 | ||
| 
						 | 
					a497cb59cd | ||
| 
						 | 
					41aede61e9 | ||
| 
						 | 
					a82c58c40f | ||
| 
						 | 
					3c208a5a5e | ||
| 
						 | 
					03b3fcecac | ||
| 
						 | 
					cbc249ba00 | ||
| 
						 | 
					1347b2ce0f | ||
| 
						 | 
					d4d7589428 | ||
| 
						 | 
					f47544745e | ||
| 
						 | 
					ef4a9670a8 | ||
| 
						 | 
					1161055129 | ||
| 
						 | 
					aa4f9dd153 | ||
| 
						 | 
					6b8665ebc4 | ||
| 
						 | 
					e66e9ddfb4 | ||
| 
						 | 
					0cdc046ff2 | ||
| 
						 | 
					dd0100ddb1 | ||
| 
						 | 
					e593014ebd | ||
| 
						 | 
					4066c8b205 | ||
| 
						 | 
					fbea897d85 | ||
| 
						 | 
					8967fcaf84 | ||
| 
						 | 
					980ca6324f | ||
| 
						 | 
					fce8f063e3 | ||
| 
						 | 
					5215c8f066 | ||
| 
						 | 
					310666b1cd | ||
| 
						 | 
					9f89c4c291 | ||
| 
						 | 
					903efe8a2f | ||
| 
						 | 
					fe8b1e51f4 | ||
| 
						 | 
					9ec2552792 | ||
| 
						 | 
					e3e63fbcba | ||
| 
						 | 
					c0e80959ce | ||
| 
						 | 
					a9cb6f6918 | ||
| 
						 | 
					210fa2810a | ||
| 
						 | 
					de6ddefa9f | ||
| 
						 | 
					f31c40086e | ||
| 
						 | 
					7f009975e9 | ||
| 
						 | 
					4d3c3be6ba | ||
| 
						 | 
					a6f4fc5a93 | ||
| 
						 | 
					827e22c732 | ||
| 
						 | 
					3eb4143fc3 | ||
| 
						 | 
					a591209afd | ||
| 
						 | 
					606ac45b2f | ||
| 
						 | 
					b25ebf7dde | ||
| 
						 | 
					94285b79ab | ||
| 
						 | 
					07ff7fa811 | ||
| 
						 | 
					e61573c5f4 | ||
| 
						 | 
					bb3d510a18 | ||
| 
						 | 
					15296c24a6 | ||
| 
						 | 
					eab09e34e3 | ||
| 
						 | 
					cdc35037a5 | ||
| 
						 | 
					147e864629 | ||
| 
						 | 
					b293698561 | ||
| 
						 | 
					acd147c50c | ||
| 
						 | 
					e7bbedce5f | ||
| 
						 | 
					e2c5e78ad9 | ||
| 
						 | 
					31fd98d724 | ||
| 
						 | 
					e859faa29e | ||
| 
						 | 
					532faf0f1c | ||
| 
						 | 
					6c86ef2ea4 | ||
| 
						 | 
					d67acd870a | ||
| 
						 | 
					4e06b0c602 | ||
| 
						 | 
					a441b60aa0 | ||
| 
						 | 
					96b6b6bbf0 | ||
| 
						 | 
					a87fb0da5b | ||
| 
						 | 
					3cecdd683e | ||
| 
						 | 
					1a376c407a | ||
| 
						 | 
					17b34a1bba | ||
| 
						 | 
					3897b48aba | ||
| 
						 | 
					c8c71f1fbf | ||
| 
						 | 
					007486329f | ||
| 
						 | 
					c7acd6db5e | ||
| 
						 | 
					6fc1d9efc4 | ||
| 
						 | 
					6291dd4c2f | ||
| 
						 | 
					d6e80deb32 | ||
| 
						 | 
					7c32cb52b5 | ||
| 
						 | 
					5daaa838a6 | ||
| 
						 | 
					b178fe7bfb | ||
| 
						 | 
					5eaa9bcfe3 | ||
| 
						 | 
					0277c70a17 | ||
| 
						 | 
					576629baaf | ||
| 
						 | 
					8df79e9d42 | ||
| 
						 | 
					7b0b6a2c41 | ||
| 
						 | 
					0ca0c4f6a0 | ||
| 
						 | 
					0164a1cc5b | ||
| 
						 | 
					30fb976e3e | ||
| 
						 | 
					52ec78be7d | ||
| 
						 | 
					598759be1d | ||
| 
						 | 
					71618e542c | ||
| 
						 | 
					118b9931d7 | ||
| 
						 | 
					538c6ea3d3 | ||
| 
						 | 
					53d92e61cc | ||
| 
						 | 
					9904c28f5b | ||
| 
						 | 
					baedcedcbe | ||
| 
						 | 
					5d0174bc02 | ||
| 
						 | 
					363a67c601 | ||
| 
						 | 
					5205d299bb | ||
| 
						 | 
					2926571be6 | ||
| 
						 | 
					e343988f9d | ||
| 
						 | 
					965d8686bb | ||
| 
						 | 
					2b10528adc | ||
| 
						 | 
					c8a88a7642 | ||
| 
						 | 
					0d3f31e83a | ||
| 
						 | 
					7f63bfa6d2 | ||
| 
						 | 
					cab6ac16e0 | ||
| 
						 | 
					b073e3cdd4 | ||
| 
						 | 
					cd0bf0e407 | ||
| 
						 | 
					0927a41139 | ||
| 
						 | 
					7fccab39b5 | ||
| 
						 | 
					dd6134b472 | ||
| 
						 | 
					fc2fc899ae | ||
| 
						 | 
					f78e5a04e6 | ||
| 
						 | 
					5715c39cf8 | ||
| 
						 | 
					d7f26e13fe | ||
| 
						 | 
					d850034443 | ||
| 
						 | 
					ffe79d61d4 | ||
| 
						 | 
					9ec20f85c4 | ||
| 
						 | 
					caf0f14f84 | ||
| 
						 | 
					d708e7fbbe | ||
| 
						 | 
					d790bc1779 | ||
| 
						 | 
					2fb29ff7f9 | ||
| 
						 | 
					57faddb7c5 | ||
| 
						 | 
					49f7f05f52 | ||
| 
						 | 
					5e39a8c16f | ||
| 
						 | 
					0f7e4665ae | ||
| 
						 | 
					4890853010 | ||
| 
						 | 
					410ae576e7 | ||
| 
						 | 
					a419f0f232 | ||
| 
						 | 
					cf0970157d | ||
| 
						 | 
					ad479a9b3d | ||
| 
						 | 
					ea392d4714 | ||
| 
						 | 
					b9180fc049 | ||
| 
						 | 
					2d225689d3 | ||
| 
						 | 
					2bf62c1dbb | ||
| 
						 | 
					e82d261d10 | ||
| 
						 | 
					8631c1b8a2 | ||
| 
						 | 
					eb5b965b44 | ||
| 
						 | 
					600875cd6a | ||
| 
						 | 
					0fe79aab19 | ||
| 
						 | 
					38ddb426d0 | ||
| 
						 | 
					c1b417c6ba | ||
| 
						 | 
					282b58006b | ||
| 
						 | 
					1e1799c9cb | ||
| 
						 | 
					4853e5fb1b | ||
| 
						 | 
					65dd157c3c | ||
| 
						 | 
					51fe9168d5 | ||
| 
						 | 
					eec30c891d | ||
| 
						 | 
					871bd23e4c | ||
| 
						 | 
					92963df086 | ||
| 
						 | 
					44d35f7b25 | ||
| 
						 | 
					c7ca380832 | ||
| 
						 | 
					297dc90255 | ||
| 
						 | 
					499510f2be | ||
| 
						 | 
					2d6cb342c2 | ||
| 
						 | 
					c8f4c187b3 | ||
| 
						 | 
					9851486b2f | ||
| 
						 | 
					6f3d7ecc66 | ||
| 
						 | 
					14d827f44e | ||
| 
						 | 
					22f56b93e5 | ||
| 
						 | 
					3e32105d63 | ||
| 
						 | 
					2bf8fb5889 | ||
| 
						 | 
					f039a85fd8 | ||
| 
						 | 
					f86993f195 | ||
| 
						 | 
					357800e7cd | ||
| 
						 | 
					9f9cc8fe71 | ||
| 
						 | 
					ef8ba4f668 | ||
| 
						 | 
					9260aa8e15 | ||
| 
						 | 
					25a36d6b3c | ||
| 
						 | 
					d8216b19b6 | ||
| 
						 | 
					d46ddd0839 | ||
| 
						 | 
					0cc044f071 | ||
| 
						 | 
					8b1a14d12f | ||
| 
						 | 
					e50c842755 | ||
| 
						 | 
					22ae1403e9 | ||
| 
						 | 
					28f5451572 | ||
| 
						 | 
					14c9fce8e4 | ||
| 
						 | 
					f2a6799cc9 | ||
| 
						 | 
					e918ed98d4 | ||
| 
						 | 
					e5cef5d5a6 | ||
| 
						 | 
					faed00d844 | ||
| 
						 | 
					101c2bd1fa | ||
| 
						 | 
					414b5eaede | ||
| 
						 | 
					3f252e30e4 | ||
| 
						 | 
					f0605f4b7e | ||
| 
						 | 
					60b36abf85 | ||
| 
						 | 
					24e7b1b90d | ||
| 
						 | 
					061a16d96e | ||
| 
						 | 
					1b27e93cd1 | ||
| 
						 | 
					3939e85b26 | ||
| 
						 | 
					0c483d6b68 | ||
| 
						 | 
					dba053898a | ||
| 
						 | 
					504601bb14 | ||
| 
						 | 
					b41c17d625 | ||
| 
						 | 
					11876faa11 | ||
| 
						 | 
					88e4a8af0f | ||
| 
						 | 
					175495fe73 | ||
| 
						 | 
					f4126995b7 | ||
| 
						 | 
					a7eea3e267 | ||
| 
						 | 
					d72c536ede | ||
| 
						 | 
					8e858f90f3 | ||
| 
						 | 
					abf1784c31 | ||
| 
						 | 
					317d4244cb | ||
| 
						 | 
					c311b3b3a9 | ||
| 
						 | 
					5948a02106 | ||
| 
						 | 
					441cac8ea6 | ||
| 
						 | 
					97495c5c5c | ||
| 
						 | 
					b35a0db0e7 | ||
| 
						 | 
					a91b42f022 | ||
| 
						 | 
					21173e1999 | ||
| 
						 | 
					b5b61c179d | ||
| 
						 | 
					0c261715b0 | ||
| 
						 | 
					3c5ed6f52e | ||
| 
						 | 
					6dc21bce63 | ||
| 
						 | 
					87b12ac875 | ||
| 
						 | 
					72b7db36f3 | ||
| 
						 | 
					e0a80519c7 | ||
| 
						 | 
					46da1cae05 | ||
| 
						 | 
					e4dc2b9248 | ||
| 
						 | 
					6b33ca395f | ||
| 
						 | 
					9aa58f3fcb | ||
| 
						 | 
					d9ca52452b | ||
| 
						 | 
					8106df8f5a | ||
| 
						 | 
					c459d37c26 | ||
| 
						 | 
					811d0ff209 | ||
| 
						 | 
					21ac3c8f26 | ||
| 
						 | 
					4ed05a8bb1 | ||
| 
						 | 
					00794a93ec | ||
| 
						 | 
					8b15cf6929 | ||
| 
						 | 
					3df4436e1a | ||
| 
						 | 
					a46ec16569 | ||
| 
						 | 
					3f8349467a | ||
| 
						 | 
					31322c5faa | ||
| 
						 | 
					a337725625 | ||
| 
						 | 
					b3151c80fc | ||
| 
						 | 
					0799cccce3 | ||
| 
						 | 
					c88fc5b2f9 | ||
| 
						 | 
					cb265a497d | ||
| 
						 | 
					ccea000c4b | ||
| 
						 | 
					403966ae00 | ||
| 
						 | 
					bf2c903000 | ||
| 
						 | 
					85ef83a173 | ||
| 
						 | 
					1991123054 | ||
| 
						 | 
					9e9f5f3d70 | ||
| 
						 | 
					06dc2f6166 | ||
| 
						 | 
					66ba79f5fb | ||
| 
						 | 
					fd9df44a05 | ||
| 
						 | 
					3c021e1d79 | ||
| 
						 | 
					451ab0c01e | ||
| 
						 | 
					bcee56bed5 | ||
| 
						 | 
					921ffdd2c9 | ||
| 
						 | 
					9ed1b2f09e | ||
| 
						 | 
					6a819ce4fe | ||
| 
						 | 
					56e8485c84 | ||
| 
						 | 
					a05bf133ae | ||
| 
						 | 
					e68953b7c8 | ||
| 
						 | 
					9aa2bd8a03 | ||
| 
						 | 
					6b7cf3077d | ||
| 
						 | 
					eb0c5a6ffc | ||
| 
						 | 
					422f97d7ab | ||
| 
						 | 
					7af4eb014b | ||
| 
						 | 
					20cd3e6b8f | ||
| 
						 | 
					6b66c01c88 | ||
| 
						 | 
					9c41143d66 | ||
| 
						 | 
					e9cacfd66d | ||
| 
						 | 
					301409107f | ||
| 
						 | 
					ddf94f6184 | ||
| 
						 | 
					c21f53a501 | ||
| 
						 | 
					7a1590713e | ||
| 
						 | 
					9ed874713f | ||
| 
						 | 
					676610d2a8 | ||
| 
						 | 
					fd903902ef | ||
| 
						 | 
					154b4b4196 | ||
| 
						 | 
					953c6a011e | ||
| 
						 | 
					e50f96a4a3 | ||
| 
						 | 
					5d88a82aa0 | ||
| 
						 | 
					cbcfbe1b29 | ||
| 
						 | 
					888699091d | ||
| 
						 | 
					87c40b35eb | ||
| 
						 | 
					a60461a340 | ||
| 
						 | 
					f0f609c2e2 | ||
| 
						 | 
					91b5c98b3d | ||
| 
						 | 
					8d07a97acc | ||
| 
						 | 
					6d84322762 | ||
| 
						 | 
					c34d91a84e | ||
| 
						 | 
					aabae97e57 | ||
| 
						 | 
					52cf4dcaea | ||
| 
						 | 
					b8fa2839a2 | ||
| 
						 | 
					2578b767c3 | ||
| 
						 | 
					ce328b855f | ||
| 
						 | 
					aab70f4d7a | ||
| 
						 | 
					bcba86e2e9 | ||
| 
						 | 
					9a4052a4ec | ||
| 
						 | 
					b1bfd0ba87 | ||
| 
						 | 
					019384f2d3 | ||
| 
						 | 
					e2c6b05f9a | ||
| 
						 | 
					61c5e31ca1 | ||
| 
						 | 
					ad1216151d | ||
| 
						 | 
					02a31e6b3c | ||
| 
						 | 
					84be08b07f | ||
| 
						 | 
					313bfbb6a2 | ||
| 
						 | 
					2089f26b08 | ||
| 
						 | 
					507ee87e3e | ||
| 
						 | 
					f2bd11faa4 | ||
| 
						 | 
					0c1cec2205 | ||
| 
						 | 
					dadc9189ed | ||
| 
						 | 
					f05feab7b9 | ||
| 
						 | 
					02360dd2c2 | ||
| 
						 | 
					b0a12a2880 | ||
| 
						 | 
					b5ce9456db | ||
| 
						 | 
					e6047a17a9 | ||
| 
						 | 
					f93b1e7be1 | ||
| 
						 | 
					04b9e0d787 | ||
| 
						 | 
					ce42e79abc | ||
| 
						 | 
					565d0e6feb | ||
| 
						 | 
					6b151d436d | ||
| 
						 | 
					5f0b303c28 | ||
| 
						 | 
					3653fb473a | ||
| 
						 | 
					e8223bd250 | ||
| 
						 | 
					7989bb7fe7 | ||
| 
						 | 
					6776bd62b5 | ||
| 
						 | 
					a5879f7c81 | ||
| 
						 | 
					12ee845ee7 | ||
| 
						 | 
					d02e74a073 | ||
| 
						 | 
					78071b3b97 | ||
| 
						 | 
					8144132866 | ||
| 
						 | 
					768ae275dc | 
							
								
								
									
										10
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -32,6 +32,8 @@
 | 
				
			|||||||
/ivfdec.dox
 | 
					/ivfdec.dox
 | 
				
			||||||
/ivfenc
 | 
					/ivfenc
 | 
				
			||||||
/ivfenc.dox
 | 
					/ivfenc.dox
 | 
				
			||||||
 | 
					/libvpx.so*
 | 
				
			||||||
 | 
					/libvpx.ver
 | 
				
			||||||
/obj_int_extract
 | 
					/obj_int_extract
 | 
				
			||||||
/postproc
 | 
					/postproc
 | 
				
			||||||
/postproc.c
 | 
					/postproc.c
 | 
				
			||||||
@@ -43,6 +45,7 @@
 | 
				
			|||||||
/simple_encoder
 | 
					/simple_encoder
 | 
				
			||||||
/simple_encoder.c
 | 
					/simple_encoder.c
 | 
				
			||||||
/simple_encoder.dox
 | 
					/simple_encoder.dox
 | 
				
			||||||
 | 
					/test_libvpx
 | 
				
			||||||
/twopass_encoder
 | 
					/twopass_encoder
 | 
				
			||||||
/twopass_encoder.c
 | 
					/twopass_encoder.c
 | 
				
			||||||
/twopass_encoder.dox
 | 
					/twopass_encoder.dox
 | 
				
			||||||
@@ -55,7 +58,14 @@
 | 
				
			|||||||
/vp8cx_set_ref
 | 
					/vp8cx_set_ref
 | 
				
			||||||
/vp8cx_set_ref.c
 | 
					/vp8cx_set_ref.c
 | 
				
			||||||
/vp8cx_set_ref.dox
 | 
					/vp8cx_set_ref.dox
 | 
				
			||||||
 | 
					/vpx.pc
 | 
				
			||||||
/vpx_config.c
 | 
					/vpx_config.c
 | 
				
			||||||
/vpx_config.h
 | 
					/vpx_config.h
 | 
				
			||||||
 | 
					/vpx_rtcd.h
 | 
				
			||||||
/vpx_version.h
 | 
					/vpx_version.h
 | 
				
			||||||
 | 
					/vpxdec
 | 
				
			||||||
 | 
					/vpxenc
 | 
				
			||||||
TAGS
 | 
					TAGS
 | 
				
			||||||
 | 
					.cproject
 | 
				
			||||||
 | 
					.project
 | 
				
			||||||
 | 
					.settings
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								.mailmap
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								.mailmap
									
									
									
									
									
								
							@@ -5,3 +5,4 @@ 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>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								AUTHORS
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								AUTHORS
									
									
									
									
									
								
							@@ -31,9 +31,11 @@ John Koleszar <jkoleszar@google.com>
 | 
				
			|||||||
Joshua Bleecher Snyder <josh@treelinelabs.com>
 | 
					Joshua Bleecher Snyder <josh@treelinelabs.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>
 | 
				
			||||||
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>
 | 
				
			||||||
 | 
					Marco Paniconi <marpan@google.com>
 | 
				
			||||||
Martin Ettl <ettl.martin78@googlemail.com>
 | 
					Martin Ettl <ettl.martin78@googlemail.com>
 | 
				
			||||||
Michael Kohler <michaelkohler@live.com>
 | 
					Michael Kohler <michaelkohler@live.com>
 | 
				
			||||||
Mike Hommey <mhommey@mozilla.com>
 | 
					Mike Hommey <mhommey@mozilla.com>
 | 
				
			||||||
@@ -43,6 +45,7 @@ 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>
 | 
				
			||||||
Philip Jägenstedt <philipj@opera.com>
 | 
					Philip Jägenstedt <philipj@opera.com>
 | 
				
			||||||
 | 
					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>
 | 
				
			||||||
@@ -50,6 +53,7 @@ Ronald S. Bultje <rbultje@google.com>
 | 
				
			|||||||
Scott LaVarnway <slavarnway@google.com>
 | 
					Scott LaVarnway <slavarnway@google.com>
 | 
				
			||||||
Stefan Holmer <holmer@google.com>
 | 
					Stefan Holmer <holmer@google.com>
 | 
				
			||||||
Taekhyun Kim <takim@nvidia.com>
 | 
					Taekhyun Kim <takim@nvidia.com>
 | 
				
			||||||
 | 
					Takanori MATSUURA <t.matsuu@gmail.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>
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										121
									
								
								CHANGELOG
									
									
									
									
									
								
							
							
						
						
									
										121
									
								
								CHANGELOG
									
									
									
									
									
								
							@@ -1,3 +1,124 @@
 | 
				
			|||||||
 | 
					2012-12-21 v1.2.0
 | 
				
			||||||
 | 
					  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
 | 
				
			||||||
 | 
					  encouraged to upgrade.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - 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:
 | 
				
			||||||
 | 
					      VP8 optimizations for MIPS dspr2
 | 
				
			||||||
 | 
					      vpxenc: add -quiet option
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Speed:
 | 
				
			||||||
 | 
					      Encoder and decoder speed is consistent with the Eider release.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Quality:
 | 
				
			||||||
 | 
					      In general, quality is consistent with the Eider release.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Minor tweaks to ARNR filtering
 | 
				
			||||||
 | 
					      Minor improvements to real time encoding with multiple temporal layers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Bug Fixes:
 | 
				
			||||||
 | 
					      Fixes multithreaded encoder race condition in loopfilter
 | 
				
			||||||
 | 
					      Fixes multi-resolution threaded encoding
 | 
				
			||||||
 | 
					      Fix potential encoder dead-lock after picture resize
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					2012-05-09 v1.1.0 "Eider"
 | 
				
			||||||
 | 
					  This introduces a number of enhancements, mostly focused on real-time
 | 
				
			||||||
 | 
					  encoding. In addition, it fixes a decoder bug (first introduced in
 | 
				
			||||||
 | 
					  Duclair) so all users of that release are encouraged to upgrade.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - 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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This release introduces a new temporal denoiser, controlled by the
 | 
				
			||||||
 | 
					    VP8E_SET_NOISE_SENSITIVITY control. The temporal denoiser does not
 | 
				
			||||||
 | 
					    currently take a strength parameter, so the control is effectively
 | 
				
			||||||
 | 
					    a boolean - zero (off) or non-zero (on). For compatibility with
 | 
				
			||||||
 | 
					    existing applications, the values accepted are the same as those
 | 
				
			||||||
 | 
					    for the spatial denoiser (0-6). The temporal denoiser is enabled
 | 
				
			||||||
 | 
					    by default, and the older spatial denoiser may be restored by
 | 
				
			||||||
 | 
					    configuring with --disable-temporal-denoising. The temporal denoiser
 | 
				
			||||||
 | 
					    is more computationally intensive than the spatial one.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This release removes support for a legacy, decode only API that was
 | 
				
			||||||
 | 
					    supported, but deprecated, at the initial release of libvpx
 | 
				
			||||||
 | 
					    (v0.9.0). This is not expected to have any impact. If you are
 | 
				
			||||||
 | 
					    impacted, you can apply a reversion to commit 2bf8fb58 locally.
 | 
				
			||||||
 | 
					    Please update to the latest libvpx API if you are affected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Enhancements:
 | 
				
			||||||
 | 
					      Adds a motion compensated temporal denoiser to the encoder, which
 | 
				
			||||||
 | 
					      gives higher quality than the older spatial denoiser. (See above
 | 
				
			||||||
 | 
					      for notes on upgrading).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      In addition, support for new compilers and platforms were added,
 | 
				
			||||||
 | 
					      including:
 | 
				
			||||||
 | 
					        improved support for XCode
 | 
				
			||||||
 | 
					        Android x86 NDK build
 | 
				
			||||||
 | 
					        OS/2 support
 | 
				
			||||||
 | 
					        SunCC support
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Changing resolution with vpx_codec_enc_config_set() is now
 | 
				
			||||||
 | 
					      supported. Previously, reinitializing the codec was required to
 | 
				
			||||||
 | 
					      change the input resolution.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      The vpxenc application has initial support for producing multiple
 | 
				
			||||||
 | 
					      encodes from the same input in one call. Resizing is not yet
 | 
				
			||||||
 | 
					      supported, but varying other codec parameters is. Use -- to
 | 
				
			||||||
 | 
					      delineate output streams. Options persist from one stream to the
 | 
				
			||||||
 | 
					      next.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Also, the vpxenc application will now use a keyframe interval of
 | 
				
			||||||
 | 
					      5 seconds by default. Use the --kf-max-dist option to override.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Speed:
 | 
				
			||||||
 | 
					      Decoder performance improved 2.5% versus Duclair. Encoder speed is
 | 
				
			||||||
 | 
					      consistent with Duclair for most material. Two pass encoding of
 | 
				
			||||||
 | 
					      slideshow-like material will see significant improvements.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Large realtime encoding speed gains at a small quality expense are
 | 
				
			||||||
 | 
					      possible by configuring the on-the-fly bitpacking experiment with
 | 
				
			||||||
 | 
					      --enable-onthefly-bitpacking. Realtime encoder can be up to 13%
 | 
				
			||||||
 | 
					      faster (ARM) depending on the number of threads and bitrate
 | 
				
			||||||
 | 
					      settings. This technique sees constant gain over the 5-16 speed
 | 
				
			||||||
 | 
					      range. For VC style input the loss seen is up to 0.2dB. See commit
 | 
				
			||||||
 | 
					      52cf4dca for further details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Quality:
 | 
				
			||||||
 | 
					      On the whole, quality is consistent with the Duclair release. Some
 | 
				
			||||||
 | 
					      tweaks:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Reduced blockiness in easy sections by applying a penalty to
 | 
				
			||||||
 | 
					        intra modes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Improved quality of static sections (like slideshows) with
 | 
				
			||||||
 | 
					        two pass encoding.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Improved keyframe sizing with multiple temporal layers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - Bug Fixes:
 | 
				
			||||||
 | 
					      Corrected alt-ref contribution to frame rate for visible updates
 | 
				
			||||||
 | 
					      to the alt-ref buffer. This affected applications making manual
 | 
				
			||||||
 | 
					      usage of the frame reference flags, or temporal layers.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Additional constraints were added to disable multi-frame quality
 | 
				
			||||||
 | 
					      enhancement (MFQE) in sections of the frame where there is motion.
 | 
				
			||||||
 | 
					      (#392)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Fixed corruption issues when vpx_codec_enc_config_set() was called
 | 
				
			||||||
 | 
					      with spatial resampling enabled.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      Fixed a decoder error introduced in Duclair where the segmentation
 | 
				
			||||||
 | 
					      map was not being reinitialized on keyframes (#378)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
2012-01-27 v1.0.0 "Duclair"
 | 
					2012-01-27 v1.0.0 "Duclair"
 | 
				
			||||||
  Our fourth named release, focused on performance and features related to
 | 
					  Our fourth named release, focused on performance and features related to
 | 
				
			||||||
  real-time encoding. It also fixes a decoder crash bug introduced in
 | 
					  real-time encoding. It also fixes a decoder crash bug introduced in
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
				
			|||||||
vpx Multi-Format Codec SDK
 | 
					vpx Multi-Format Codec SDK
 | 
				
			||||||
README - 19 May 2010
 | 
					README - 21 June 2012
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Welcome to the WebM VP8 Codec SDK!
 | 
					Welcome to the WebM VP8 Codec SDK!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -15,11 +15,19 @@ COMPILING THE APPLICATIONS/LIBRARIES:
 | 
				
			|||||||
    * Building the documentation requires PHP[3] and Doxygen[4]. If you do not
 | 
					    * Building the documentation requires PHP[3] and Doxygen[4]. If you do not
 | 
				
			||||||
      have these packages, you must pass --disable-install-docs to the
 | 
					      have these packages, you must pass --disable-install-docs to the
 | 
				
			||||||
      configure script.
 | 
					      configure script.
 | 
				
			||||||
 | 
					    * Downloading the data for the unit tests requires curl[5] and sha1sum.
 | 
				
			||||||
 | 
					      sha1sum is provided via the GNU coreutils, installed by default on
 | 
				
			||||||
 | 
					      many *nix platforms, as well as MinGW and Cygwin. If coreutils is not
 | 
				
			||||||
 | 
					      available, a compatible version of sha1sum can be built from
 | 
				
			||||||
 | 
					      source[6]. These requirements are optional if not running the unit
 | 
				
			||||||
 | 
					      tests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [1]: http://www.tortall.net/projects/yasm
 | 
					    [1]: http://www.tortall.net/projects/yasm
 | 
				
			||||||
    [2]: http://www.cygwin.com
 | 
					    [2]: http://www.cygwin.com
 | 
				
			||||||
    [3]: http://php.net
 | 
					    [3]: http://php.net
 | 
				
			||||||
    [4]: http://www.doxygen.org
 | 
					    [4]: http://www.doxygen.org
 | 
				
			||||||
 | 
					    [5]: http://curl.haxx.se
 | 
				
			||||||
 | 
					    [6]: http://www.microbrew.org/tools/md5sha1sum/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  2. Out-of-tree builds
 | 
					  2. Out-of-tree builds
 | 
				
			||||||
  Out of tree builds are a supported method of building the application. For
 | 
					  Out of tree builds are a supported method of building the application. For
 | 
				
			||||||
@@ -94,5 +102,5 @@ COMPILING THE APPLICATIONS/LIBRARIES:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SUPPORT
 | 
					SUPPORT
 | 
				
			||||||
  This library is an open source project supported by its community. Please
 | 
					  This library is an open source project supported by its community. Please
 | 
				
			||||||
  please email webm-users@webmproject.org for help.
 | 
					  please email webm-discuss@webmproject.org for help.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,15 +27,22 @@
 | 
				
			|||||||
# Android.mk file in the libvpx directory:
 | 
					# Android.mk file in the libvpx directory:
 | 
				
			||||||
# LOCAL_PATH := $(call my-dir)
 | 
					# LOCAL_PATH := $(call my-dir)
 | 
				
			||||||
# include $(CLEAR_VARS)
 | 
					# include $(CLEAR_VARS)
 | 
				
			||||||
# include libvpx/build/make/Android.mk
 | 
					# include jni/libvpx/build/make/Android.mk
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# There are currently two TARGET_ARCH_ABI targets for ARM.
 | 
					# There are currently two TARGET_ARCH_ABI targets for ARM.
 | 
				
			||||||
# armeabi and armeabi-v7a.  armeabi-v7a is selected by creating an
 | 
					# armeabi and armeabi-v7a.  armeabi-v7a is selected by creating an
 | 
				
			||||||
# Application.mk in the jni directory that contains:
 | 
					# Application.mk in the jni directory that contains:
 | 
				
			||||||
# APP_ABI := armeabi-v7a
 | 
					# APP_ABI := armeabi-v7a
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					# By default libvpx will detect at runtime the existance of NEON extension.
 | 
				
			||||||
 | 
					# For this we import the 'cpufeatures' module from the NDK sources.
 | 
				
			||||||
 | 
					# libvpx can also be configured without this runtime detection method.
 | 
				
			||||||
 | 
					# Configuring with --disable-runtime-cpu-detect will assume presence of NEON.
 | 
				
			||||||
 | 
					# Configuring with --disable-runtime-cpu-detect --disable-neon will remove any
 | 
				
			||||||
 | 
					# NEON dependency.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# To change to building armeabi, run ./libvpx/configure again, but with
 | 
					# To change to building armeabi, run ./libvpx/configure again, but with
 | 
				
			||||||
# --target=arm5te-android-gcc and and modify the Application.mk file to
 | 
					# --target=arm5te-android-gcc and modify the Application.mk file to
 | 
				
			||||||
# set APP_ABI := armeabi
 | 
					# set APP_ABI := armeabi
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Running ndk-build will build libvpx and include it in your project.
 | 
					# Running ndk-build will build libvpx and include it in your project.
 | 
				
			||||||
@@ -99,7 +106,7 @@ $$(eval $$(call ev-build-file))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
$(1) : $$(_OBJ) $(2)
 | 
					$(1) : $$(_OBJ) $(2)
 | 
				
			||||||
	@mkdir -p $$(dir $$@)
 | 
						@mkdir -p $$(dir $$@)
 | 
				
			||||||
	@grep -w EQU $$< | tr -d '\#' | $(CONFIG_DIR)/$(ASM_CONVERSION) > $$@
 | 
						@grep $(OFFSET_PATTERN) $$< | tr -d '\#' | $(CONFIG_DIR)/$(ASM_CONVERSION) > $$@
 | 
				
			||||||
endef
 | 
					endef
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Use ads2gas script to convert from RVCT format to GAS format.  This passes
 | 
					# Use ads2gas script to convert from RVCT format to GAS format.  This passes
 | 
				
			||||||
@@ -118,6 +125,9 @@ $(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm $(ASM_CNV_OFFSETS_DEPEND)
 | 
				
			|||||||
	@mkdir -p $(dir $@)
 | 
						@mkdir -p $(dir $@)
 | 
				
			||||||
	@$(CONFIG_DIR)/$(ASM_CONVERSION) <$< > $@
 | 
						@$(CONFIG_DIR)/$(ASM_CONVERSION) <$< > $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# For building vpx_rtcd.h, which has a rule in libs.mk
 | 
				
			||||||
 | 
					TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
 | 
				
			||||||
 | 
					target := libs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOCAL_SRC_FILES += vpx_config.c
 | 
					LOCAL_SRC_FILES += vpx_config.c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -163,7 +173,11 @@ LOCAL_MODULE := libvpx
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
LOCAL_LDLIBS := -llog
 | 
					LOCAL_LDLIBS := -llog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOCAL_STATIC_LIBRARIES := cpufeatures
 | 
					ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
 | 
				
			||||||
 | 
					  LOCAL_STATIC_LIBRARIES := cpufeatures
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_rtcd.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: clean
 | 
					.PHONY: clean
 | 
				
			||||||
clean:
 | 
					clean:
 | 
				
			||||||
@@ -171,6 +185,7 @@ clean:
 | 
				
			|||||||
	@$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
 | 
						@$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
 | 
				
			||||||
	@$(RM) $(patsubst %.asm, %.*, $(ASM_CNV_OFFSETS_DEPEND))
 | 
						@$(RM) $(patsubst %.asm, %.*, $(ASM_CNV_OFFSETS_DEPEND))
 | 
				
			||||||
	@$(RM) -r $(ASM_CNV_PATH)
 | 
						@$(RM) -r $(ASM_CNV_PATH)
 | 
				
			||||||
 | 
						@$(RM) $(CLEAN-OBJS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(BUILD_SHARED_LIBRARY)
 | 
					include $(BUILD_SHARED_LIBRARY)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -190,4 +205,7 @@ ifeq ($(CONFIG_VP8_ENCODER), yes)
 | 
				
			|||||||
    $(LIBVPX_PATH)/vp8/encoder/asm_enc_offsets.c))
 | 
					    $(LIBVPX_PATH)/vp8/encoder/asm_enc_offsets.c))
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
 | 
				
			||||||
$(call import-module,cpufeatures)
 | 
					$(call import-module,cpufeatures)
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,6 +21,7 @@ all: .DEFAULT
 | 
				
			|||||||
clean:: .DEFAULT
 | 
					clean:: .DEFAULT
 | 
				
			||||||
install:: .DEFAULT
 | 
					install:: .DEFAULT
 | 
				
			||||||
test:: .DEFAULT
 | 
					test:: .DEFAULT
 | 
				
			||||||
 | 
					testdata:: .DEFAULT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
 | 
					# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
 | 
				
			||||||
@@ -66,6 +67,7 @@ endif
 | 
				
			|||||||
BUILD_ROOT?=.
 | 
					BUILD_ROOT?=.
 | 
				
			||||||
VPATH=$(SRC_PATH_BARE)
 | 
					VPATH=$(SRC_PATH_BARE)
 | 
				
			||||||
CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
 | 
					CFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
 | 
				
			||||||
 | 
					CXXFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT) -I$(SRC_PATH)
 | 
				
			||||||
ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
 | 
					ASFLAGS+=-I$(BUILD_PFX)$(BUILD_ROOT)/ -I$(SRC_PATH)/
 | 
				
			||||||
DIST_DIR?=dist
 | 
					DIST_DIR?=dist
 | 
				
			||||||
HOSTCC?=gcc
 | 
					HOSTCC?=gcc
 | 
				
			||||||
@@ -98,6 +100,8 @@ dist:
 | 
				
			|||||||
install::
 | 
					install::
 | 
				
			||||||
.PHONY: test
 | 
					.PHONY: test
 | 
				
			||||||
test::
 | 
					test::
 | 
				
			||||||
 | 
					.PHONY: testdata
 | 
				
			||||||
 | 
					testdata::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(BUILD_PFX)%.c.d: %.c
 | 
					$(BUILD_PFX)%.c.d: %.c
 | 
				
			||||||
	$(if $(quiet),@echo "    [DEP] $@")
 | 
						$(if $(quiet),@echo "    [DEP] $@")
 | 
				
			||||||
@@ -111,11 +115,11 @@ $(BUILD_PFX)%.c.o: %.c
 | 
				
			|||||||
$(BUILD_PFX)%.cc.d: %.cc
 | 
					$(BUILD_PFX)%.cc.d: %.cc
 | 
				
			||||||
	$(if $(quiet),@echo "    [DEP] $@")
 | 
						$(if $(quiet),@echo "    [DEP] $@")
 | 
				
			||||||
	$(qexec)mkdir -p $(dir $@)
 | 
						$(qexec)mkdir -p $(dir $@)
 | 
				
			||||||
	$(qexec)g++ $(INTERNAL_CFLAGS) $(CFLAGS) -M $< | $(fmt_deps) > $@
 | 
						$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -M $< | $(fmt_deps) > $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(BUILD_PFX)%.cc.o: %.cc
 | 
					$(BUILD_PFX)%.cc.o: %.cc
 | 
				
			||||||
	$(if $(quiet),@echo "    [CXX] $@")
 | 
						$(if $(quiet),@echo "    [CXX] $@")
 | 
				
			||||||
	$(qexec)g++ $(INTERNAL_CFLAGS) $(CFLAGS) -c -o $@ $<
 | 
						$(qexec)$(CXX) $(INTERNAL_CFLAGS) $(CXXFLAGS) -c -o $@ $<
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(BUILD_PFX)%.asm.d: %.asm
 | 
					$(BUILD_PFX)%.asm.d: %.asm
 | 
				
			||||||
	$(if $(quiet),@echo "    [DEP] $@")
 | 
						$(if $(quiet),@echo "    [DEP] $@")
 | 
				
			||||||
@@ -213,7 +217,7 @@ define linkerxx_template
 | 
				
			|||||||
$(1): $(filter-out -%,$(2))
 | 
					$(1): $(filter-out -%,$(2))
 | 
				
			||||||
$(1):
 | 
					$(1):
 | 
				
			||||||
	$(if $(quiet),@echo    "    [LD] $$@")
 | 
						$(if $(quiet),@echo    "    [LD] $$@")
 | 
				
			||||||
	$(qexec)g++ $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
 | 
						$(qexec)$$(CXX) $$(strip $$(INTERNAL_LDFLAGS) $$(LDFLAGS) -o $$@ $(2) $(3) $$(extralibs))
 | 
				
			||||||
endef
 | 
					endef
 | 
				
			||||||
# make-3.80 has a bug with expanding large input strings to the eval function,
 | 
					# make-3.80 has a bug with expanding large input strings to the eval function,
 | 
				
			||||||
# which was triggered in some cases by the following component of
 | 
					# which was triggered in some cases by the following component of
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,12 +26,22 @@ print "\t.equ DO1STROUNDING, 0\n";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
while (<STDIN>)
 | 
					while (<STDIN>)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    undef $comment;
 | 
				
			||||||
 | 
					    undef $line;
 | 
				
			||||||
 | 
					    $comment_char = ";";
 | 
				
			||||||
 | 
					    $comment_sub = "@";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Handle comments.
 | 
				
			||||||
 | 
					    if (/$comment_char/)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      $comment = "";
 | 
				
			||||||
 | 
					      ($line, $comment) = /(.*?)$comment_char(.*)/;
 | 
				
			||||||
 | 
					      $_ = $line;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Load and store alignment
 | 
					    # Load and store alignment
 | 
				
			||||||
    s/@/,:/g;
 | 
					    s/@/,:/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Comment character
 | 
					 | 
				
			||||||
    s/;/@/g;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Hexadecimal constants prefaced by 0x
 | 
					    # Hexadecimal constants prefaced by 0x
 | 
				
			||||||
    s/#&/#0x/g;
 | 
					    s/#&/#0x/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -51,16 +61,27 @@ while (<STDIN>)
 | 
				
			|||||||
    s/:SHR:/ >> /g;
 | 
					    s/:SHR:/ >> /g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert ELSE to .else
 | 
					    # Convert ELSE to .else
 | 
				
			||||||
    s/ELSE/.else/g;
 | 
					    s/\bELSE\b/.else/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert ENDIF to .endif
 | 
					    # Convert ENDIF to .endif
 | 
				
			||||||
    s/ENDIF/.endif/g;
 | 
					    s/\bENDIF\b/.endif/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert ELSEIF to .elseif
 | 
					    # Convert ELSEIF to .elseif
 | 
				
			||||||
    s/ELSEIF/.elseif/g;
 | 
					    s/\bELSEIF\b/.elseif/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert LTORG to .ltorg
 | 
					    # Convert LTORG to .ltorg
 | 
				
			||||||
    s/LTORG/.ltorg/g;
 | 
					    s/\bLTORG\b/.ltorg/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Convert endfunc to nothing.
 | 
				
			||||||
 | 
					    s/\bendfunc\b//ig;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Convert FUNCTION to nothing.
 | 
				
			||||||
 | 
					    s/\bFUNCTION\b//g;
 | 
				
			||||||
 | 
					    s/\bfunction\b//g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    s/\bENTRY\b//g;
 | 
				
			||||||
 | 
					    s/\bMSARMASM\b/0/g;
 | 
				
			||||||
 | 
					    s/^\s+end\s+$//g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Convert IF :DEF:to .if
 | 
					    # Convert IF :DEF:to .if
 | 
				
			||||||
    # gcc doesn't have the ability to do a conditional
 | 
					    # gcc doesn't have the ability to do a conditional
 | 
				
			||||||
@@ -106,6 +127,7 @@ while (<STDIN>)
 | 
				
			|||||||
    if (s/RN\s+([Rr]\d+|lr)/.req $1/)
 | 
					    if (s/RN\s+([Rr]\d+|lr)/.req $1/)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        print;
 | 
					        print;
 | 
				
			||||||
 | 
					        print "$comment_sub$comment\n" if defined $comment;
 | 
				
			||||||
        next;
 | 
					        next;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -114,6 +136,9 @@ while (<STDIN>)
 | 
				
			|||||||
    s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
 | 
					    s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
 | 
				
			||||||
    s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
 | 
					    s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    s/EXPORT\s+([\$\w]*)/.global $1/;
 | 
				
			||||||
 | 
					    s/export\s+([\$\w]*)/.global $1/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # No vertical bars required; make additional symbol with prepended
 | 
					    # No vertical bars required; make additional symbol with prepended
 | 
				
			||||||
    # underscore
 | 
					    # underscore
 | 
				
			||||||
    s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
 | 
					    s/^\|(\$?\w+)\|/_$1\n\t$1:/g;
 | 
				
			||||||
@@ -124,11 +149,19 @@ while (<STDIN>)
 | 
				
			|||||||
    s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
 | 
					    s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # ALIGN directive
 | 
					    # ALIGN directive
 | 
				
			||||||
    s/ALIGN/.balign/g;
 | 
					    s/\bALIGN\b/.balign/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # ARM code
 | 
					    # ARM code
 | 
				
			||||||
    s/\sARM/.arm/g;
 | 
					    s/\sARM/.arm/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # push/pop
 | 
				
			||||||
 | 
					    s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g;
 | 
				
			||||||
 | 
					    s/(pop\s+)(r\d+)/ldmia sp\!, \{$2\}/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # NEON code
 | 
				
			||||||
 | 
					    s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g;
 | 
				
			||||||
 | 
					    s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # eabi_attributes numerical equivalents can be found in the
 | 
					    # eabi_attributes numerical equivalents can be found in the
 | 
				
			||||||
    # "ARM IHI 0045C" document.
 | 
					    # "ARM IHI 0045C" document.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -157,10 +190,10 @@ while (<STDIN>)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # EQU directive
 | 
					    # EQU directive
 | 
				
			||||||
    s/(.*)EQU(.*)/.equ $1, $2/;
 | 
					    s/(\S+\s+)EQU(\s+\S+)/.equ $1, $2/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Begin macro definition
 | 
					    # Begin macro definition
 | 
				
			||||||
    if (/MACRO/) {
 | 
					    if (/\bMACRO\b/) {
 | 
				
			||||||
        $_ = <STDIN>;
 | 
					        $_ = <STDIN>;
 | 
				
			||||||
        s/^/.macro/;
 | 
					        s/^/.macro/;
 | 
				
			||||||
        s/\$//g;                # remove formal param reference
 | 
					        s/\$//g;                # remove formal param reference
 | 
				
			||||||
@@ -169,9 +202,10 @@ while (<STDIN>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # For macros, use \ to reference formal params
 | 
					    # For macros, use \ to reference formal params
 | 
				
			||||||
    s/\$/\\/g;                  # End macro definition
 | 
					    s/\$/\\/g;                  # End macro definition
 | 
				
			||||||
    s/MEND/.endm/;              # No need to tell it where to stop assembling
 | 
					    s/\bMEND\b/.endm/;              # No need to tell it where to stop assembling
 | 
				
			||||||
    next if /^\s*END\s*$/;
 | 
					    next if /^\s*END\s*$/;
 | 
				
			||||||
    print;
 | 
					    print;
 | 
				
			||||||
 | 
					    print "$comment_sub$comment\n" if defined $comment;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Mark that this object doesn't need an executable stack.
 | 
					# Mark that this object doesn't need an executable stack.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -166,6 +166,17 @@ is_in(){
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
add_cflags() {
 | 
					add_cflags() {
 | 
				
			||||||
    CFLAGS="${CFLAGS} $@"
 | 
					    CFLAGS="${CFLAGS} $@"
 | 
				
			||||||
 | 
					    CXXFLAGS="${CXXFLAGS} $@"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_cflags_only() {
 | 
				
			||||||
 | 
					    CFLAGS="${CFLAGS} $@"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_cxxflags_only() {
 | 
				
			||||||
 | 
					    CXXFLAGS="${CXXFLAGS} $@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -277,6 +288,13 @@ check_cc() {
 | 
				
			|||||||
    check_cmd ${CC} ${CFLAGS} "$@" -c -o ${TMP_O} ${TMP_C}
 | 
					    check_cmd ${CC} ${CFLAGS} "$@" -c -o ${TMP_O} ${TMP_C}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					check_cxx() {
 | 
				
			||||||
 | 
					    log check_cxx "$@"
 | 
				
			||||||
 | 
					    cat >${TMP_C}
 | 
				
			||||||
 | 
					    log_file ${TMP_C}
 | 
				
			||||||
 | 
					    check_cmd ${CXX} ${CXXFLAGS} "$@" -c -o ${TMP_O} ${TMP_C}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_cpp() {
 | 
					check_cpp() {
 | 
				
			||||||
    log check_cpp "$@"
 | 
					    log check_cpp "$@"
 | 
				
			||||||
    cat > ${TMP_C}
 | 
					    cat > ${TMP_C}
 | 
				
			||||||
@@ -310,8 +328,25 @@ int x;
 | 
				
			|||||||
EOF
 | 
					EOF
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					check_cxxflags() {
 | 
				
			||||||
 | 
					    log check_cxxflags "$@"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Catch CFLAGS that trigger CXX warnings
 | 
				
			||||||
 | 
					    case "$CXX" in
 | 
				
			||||||
 | 
					      *g++*) check_cxx -Werror "$@" <<EOF
 | 
				
			||||||
 | 
					int x;
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					      ;;
 | 
				
			||||||
 | 
					      *) check_cxx "$@" <<EOF
 | 
				
			||||||
 | 
					int x;
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					      ;;
 | 
				
			||||||
 | 
					    esac
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_add_cflags() {
 | 
					check_add_cflags() {
 | 
				
			||||||
    check_cflags "$@" && add_cflags "$@"
 | 
					    check_cxxflags "$@" && add_cxxflags_only "$@"
 | 
				
			||||||
 | 
					    check_cflags "$@" && add_cflags_only "$@"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_add_asflags() {
 | 
					check_add_asflags() {
 | 
				
			||||||
@@ -367,7 +402,9 @@ true
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
write_common_target_config_mk() {
 | 
					write_common_target_config_mk() {
 | 
				
			||||||
    local CC=${CC}
 | 
					    local CC=${CC}
 | 
				
			||||||
 | 
					    local CXX=${CXX}
 | 
				
			||||||
    enabled ccache && CC="ccache ${CC}"
 | 
					    enabled ccache && CC="ccache ${CC}"
 | 
				
			||||||
 | 
					    enabled ccache && CXX="ccache ${CXX}"
 | 
				
			||||||
    print_webm_license $1 "##" ""
 | 
					    print_webm_license $1 "##" ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    cat >> $1 << EOF
 | 
					    cat >> $1 << EOF
 | 
				
			||||||
@@ -379,6 +416,7 @@ TOOLCHAIN=${toolchain}
 | 
				
			|||||||
ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl}
 | 
					ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CC=${CC}
 | 
					CC=${CC}
 | 
				
			||||||
 | 
					CXX=${CXX}
 | 
				
			||||||
AR=${AR}
 | 
					AR=${AR}
 | 
				
			||||||
LD=${LD}
 | 
					LD=${LD}
 | 
				
			||||||
AS=${AS}
 | 
					AS=${AS}
 | 
				
			||||||
@@ -386,6 +424,7 @@ STRIP=${STRIP}
 | 
				
			|||||||
NM=${NM}
 | 
					NM=${NM}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CFLAGS  = ${CFLAGS}
 | 
					CFLAGS  = ${CFLAGS}
 | 
				
			||||||
 | 
					CXXFLAGS  = ${CXXFLAGS}
 | 
				
			||||||
ARFLAGS = -rus\$(if \$(quiet),c,v)
 | 
					ARFLAGS = -rus\$(if \$(quiet),c,v)
 | 
				
			||||||
LDFLAGS = ${LDFLAGS}
 | 
					LDFLAGS = ${LDFLAGS}
 | 
				
			||||||
ASFLAGS = ${ASFLAGS}
 | 
					ASFLAGS = ${ASFLAGS}
 | 
				
			||||||
@@ -458,9 +497,12 @@ process_common_cmdline() {
 | 
				
			|||||||
        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
 | 
					        eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
 | 
				
			||||||
        if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
 | 
					        if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
 | 
				
			||||||
            [ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
 | 
					            [ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
 | 
				
			||||||
        else
 | 
					        elif [ $action = "disable" ] && ! disabled $option ; then
 | 
				
			||||||
            echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
 | 
					          echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
 | 
				
			||||||
                die_unknown $opt
 | 
					            die_unknown $opt
 | 
				
			||||||
 | 
					        elif [ $action = "enable" ] && ! enabled $option ; then
 | 
				
			||||||
 | 
					          echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
 | 
				
			||||||
 | 
					            die_unknown $opt
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        $action $option
 | 
					        $action $option
 | 
				
			||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
@@ -535,6 +577,7 @@ post_process_cmdline() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
setup_gnu_toolchain() {
 | 
					setup_gnu_toolchain() {
 | 
				
			||||||
        CC=${CC:-${CROSS}gcc}
 | 
					        CC=${CC:-${CROSS}gcc}
 | 
				
			||||||
 | 
					        CXX=${CXX:-${CROSS}g++}
 | 
				
			||||||
        AR=${AR:-${CROSS}ar}
 | 
					        AR=${AR:-${CROSS}ar}
 | 
				
			||||||
        LD=${LD:-${CROSS}${link_with_cc:-ld}}
 | 
					        LD=${LD:-${CROSS}${link_with_cc:-ld}}
 | 
				
			||||||
        AS=${AS:-${CROSS}as}
 | 
					        AS=${AS:-${CROSS}as}
 | 
				
			||||||
@@ -546,10 +589,19 @@ setup_gnu_toolchain() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
process_common_toolchain() {
 | 
					process_common_toolchain() {
 | 
				
			||||||
    if [ -z "$toolchain" ]; then
 | 
					    if [ -z "$toolchain" ]; then
 | 
				
			||||||
        gcctarget="$(gcc -dumpmachine 2> /dev/null)"
 | 
					        gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # detect tgt_isa
 | 
					        # detect tgt_isa
 | 
				
			||||||
        case "$gcctarget" in
 | 
					        case "$gcctarget" in
 | 
				
			||||||
 | 
					            armv6*)
 | 
				
			||||||
 | 
					                tgt_isa=armv6
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					            armv7*)
 | 
				
			||||||
 | 
					                tgt_isa=armv7
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
 | 
					            armv5te*)
 | 
				
			||||||
 | 
					                tgt_isa=armv5te
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
            *x86_64*|*amd64*)
 | 
					            *x86_64*|*amd64*)
 | 
				
			||||||
                tgt_isa=x86_64
 | 
					                tgt_isa=x86_64
 | 
				
			||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
@@ -585,6 +637,10 @@ process_common_toolchain() {
 | 
				
			|||||||
                tgt_isa=x86_64
 | 
					                tgt_isa=x86_64
 | 
				
			||||||
                tgt_os=darwin11
 | 
					                tgt_os=darwin11
 | 
				
			||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
 | 
					            *darwin12*)
 | 
				
			||||||
 | 
					                tgt_isa=x86_64
 | 
				
			||||||
 | 
					                tgt_os=darwin12
 | 
				
			||||||
 | 
					                ;;
 | 
				
			||||||
            *mingw32*|*cygwin*)
 | 
					            *mingw32*|*cygwin*)
 | 
				
			||||||
                [ -z "$tgt_isa" ] && tgt_isa=x86
 | 
					                [ -z "$tgt_isa" ] && tgt_isa=x86
 | 
				
			||||||
                tgt_os=win32
 | 
					                tgt_os=win32
 | 
				
			||||||
@@ -635,44 +691,51 @@ process_common_toolchain() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Handle darwin variants. Newer SDKs allow targeting older
 | 
					    # Handle darwin variants. Newer SDKs allow targeting older
 | 
				
			||||||
    # platforms, so find the newest SDK available.
 | 
					    # platforms, so find the newest SDK available.
 | 
				
			||||||
    if [ -d "/Developer/SDKs/MacOSX10.4u.sdk" ]; then
 | 
					    case ${toolchain} in
 | 
				
			||||||
        osx_sdk_dir="/Developer/SDKs/MacOSX10.4u.sdk"
 | 
					        *-darwin*)
 | 
				
			||||||
    fi
 | 
					            if [ -z "${DEVELOPER_DIR}" ]; then
 | 
				
			||||||
    if [ -d "/Developer/SDKs/MacOSX10.5.sdk" ]; then
 | 
					                DEVELOPER_DIR=`xcode-select -print-path 2> /dev/null`
 | 
				
			||||||
        osx_sdk_dir="/Developer/SDKs/MacOSX10.5.sdk"
 | 
					                [ $? -ne 0 ] && OSX_SKIP_DIR_CHECK=1
 | 
				
			||||||
    fi
 | 
					            fi
 | 
				
			||||||
    if [ -d "/Developer/SDKs/MacOSX10.6.sdk" ]; then
 | 
					            if [ -z "${OSX_SKIP_DIR_CHECK}" ]; then
 | 
				
			||||||
        osx_sdk_dir="/Developer/SDKs/MacOSX10.6.sdk"
 | 
					                OSX_SDK_ROOTS="${DEVELOPER_DIR}/SDKs"
 | 
				
			||||||
    fi
 | 
					                OSX_SDK_VERSIONS="MacOSX10.4u.sdk MacOSX10.5.sdk MacOSX10.6.sdk"
 | 
				
			||||||
    if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then
 | 
					                OSX_SDK_VERSIONS="${OSX_SDK_VERSIONS} MacOSX10.7.sdk"
 | 
				
			||||||
        osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk"
 | 
					                for v in ${OSX_SDK_VERSIONS}; do
 | 
				
			||||||
 | 
					                    if [ -d "${OSX_SDK_ROOTS}/${v}" ]; then
 | 
				
			||||||
 | 
					                        osx_sdk_dir="${OSX_SDK_ROOTS}/${v}"
 | 
				
			||||||
 | 
					                    fi
 | 
				
			||||||
 | 
					                done
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
 | 
					    esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ -d "${osx_sdk_dir}" ]; then
 | 
				
			||||||
 | 
					        add_cflags  "-isysroot ${osx_sdk_dir}"
 | 
				
			||||||
 | 
					        add_ldflags "-isysroot ${osx_sdk_dir}"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    case ${toolchain} in
 | 
					    case ${toolchain} in
 | 
				
			||||||
        *-darwin8-*)
 | 
					        *-darwin8-*)
 | 
				
			||||||
            add_cflags  "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_cflags  "-mmacosx-version-min=10.4"
 | 
					            add_cflags  "-mmacosx-version-min=10.4"
 | 
				
			||||||
            add_ldflags "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_ldflags "-mmacosx-version-min=10.4"
 | 
					            add_ldflags "-mmacosx-version-min=10.4"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        *-darwin9-*)
 | 
					        *-darwin9-*)
 | 
				
			||||||
            add_cflags  "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_cflags  "-mmacosx-version-min=10.5"
 | 
					            add_cflags  "-mmacosx-version-min=10.5"
 | 
				
			||||||
            add_ldflags "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_ldflags "-mmacosx-version-min=10.5"
 | 
					            add_ldflags "-mmacosx-version-min=10.5"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        *-darwin10-*)
 | 
					        *-darwin10-*)
 | 
				
			||||||
            add_cflags  "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_cflags  "-mmacosx-version-min=10.6"
 | 
					            add_cflags  "-mmacosx-version-min=10.6"
 | 
				
			||||||
            add_ldflags "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_ldflags "-mmacosx-version-min=10.6"
 | 
					            add_ldflags "-mmacosx-version-min=10.6"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        *-darwin11-*)
 | 
					        *-darwin11-*)
 | 
				
			||||||
            add_cflags  "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_cflags  "-mmacosx-version-min=10.7"
 | 
					            add_cflags  "-mmacosx-version-min=10.7"
 | 
				
			||||||
            add_ldflags "-isysroot ${osx_sdk_dir}"
 | 
					 | 
				
			||||||
            add_ldflags "-mmacosx-version-min=10.7"
 | 
					            add_ldflags "-mmacosx-version-min=10.7"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					        *-darwin12-*)
 | 
				
			||||||
 | 
					            add_cflags  "-mmacosx-version-min=10.8"
 | 
				
			||||||
 | 
					            add_ldflags "-mmacosx-version-min=10.8"
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
    esac
 | 
					    esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Handle Solaris variants. Solaris 10 needs -lposix4
 | 
					    # Handle Solaris variants. Solaris 10 needs -lposix4
 | 
				
			||||||
@@ -704,6 +767,7 @@ process_common_toolchain() {
 | 
				
			|||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        armv5te)
 | 
					        armv5te)
 | 
				
			||||||
            soft_enable edsp
 | 
					            soft_enable edsp
 | 
				
			||||||
 | 
					            disable fast_unaligned
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -719,17 +783,23 @@ process_common_toolchain() {
 | 
				
			|||||||
            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
 | 
				
			||||||
 | 
					                check_add_cflags  -march=armv7-a -mfloat-abi=softfp
 | 
				
			||||||
 | 
					                check_add_asflags -march=armv7-a -mfloat-abi=softfp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if enabled neon
 | 
					                if enabled neon
 | 
				
			||||||
                then
 | 
					                then
 | 
				
			||||||
                    check_add_cflags -mfpu=neon #-ftree-vectorize
 | 
					                    check_add_cflags -mfpu=neon #-ftree-vectorize
 | 
				
			||||||
                    check_add_asflags -mfpu=neon
 | 
					                    check_add_asflags -mfpu=neon
 | 
				
			||||||
                fi
 | 
					                fi
 | 
				
			||||||
                check_add_cflags -march=armv7-a -mcpu=cortex-a8 -mfloat-abi=softfp
 | 
					
 | 
				
			||||||
                check_add_asflags -mcpu=cortex-a8 -mfloat-abi=softfp  #-march=armv7-a
 | 
					                if [ -z "${tune_cpu}" ]; then
 | 
				
			||||||
 | 
					                    tune_cpu=cortex-a8
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                check_add_cflags -march=${tgt_isa}
 | 
					                check_add_cflags -march=${tgt_isa}
 | 
				
			||||||
                check_add_asflags -march=${tgt_isa}
 | 
					                check_add_asflags -march=${tgt_isa}
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            enabled debug && add_asflags -g
 | 
					            enabled debug && add_asflags -g
 | 
				
			||||||
            asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
 | 
					            asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
@@ -778,6 +848,7 @@ process_common_toolchain() {
 | 
				
			|||||||
                               -name "arm-linux-androideabi-gcc*" -print -quit`
 | 
					                               -name "arm-linux-androideabi-gcc*" -print -quit`
 | 
				
			||||||
            TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
 | 
					            TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
 | 
				
			||||||
            CC=${TOOLCHAIN_PATH}gcc
 | 
					            CC=${TOOLCHAIN_PATH}gcc
 | 
				
			||||||
 | 
					            CXX=${TOOLCHAIN_PATH}g++
 | 
				
			||||||
            AR=${TOOLCHAIN_PATH}ar
 | 
					            AR=${TOOLCHAIN_PATH}ar
 | 
				
			||||||
            LD=${TOOLCHAIN_PATH}gcc
 | 
					            LD=${TOOLCHAIN_PATH}gcc
 | 
				
			||||||
            AS=${TOOLCHAIN_PATH}as
 | 
					            AS=${TOOLCHAIN_PATH}as
 | 
				
			||||||
@@ -796,20 +867,29 @@ process_common_toolchain() {
 | 
				
			|||||||
            add_cflags "--sysroot=${alt_libc}"
 | 
					            add_cflags "--sysroot=${alt_libc}"
 | 
				
			||||||
            add_ldflags "--sysroot=${alt_libc}"
 | 
					            add_ldflags "--sysroot=${alt_libc}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # linker flag that routes around a CPU bug in some
 | 
				
			||||||
 | 
					            # Cortex-A8 implementations (NDK Dev Guide)
 | 
				
			||||||
 | 
					            add_ldflags "-Wl,--fix-cortex-a8"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            enable pic
 | 
					            enable pic
 | 
				
			||||||
            soft_enable realtime_only
 | 
					            soft_enable realtime_only
 | 
				
			||||||
            if [ ${tgt_isa} == "armv7" ]; then
 | 
					            if [ ${tgt_isa} == "armv7" ]; then
 | 
				
			||||||
                enable runtime_cpu_detect
 | 
					                soft_enable runtime_cpu_detect
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					            if enabled runtime_cpu_detect; then
 | 
				
			||||||
 | 
					                add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
          ;;
 | 
					          ;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        darwin*)
 | 
					        darwin*)
 | 
				
			||||||
            if [ -z "${sdk_path}" ]; then
 | 
					            if [ -z "${sdk_path}" ]; then
 | 
				
			||||||
                SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer
 | 
					                SDK_PATH=`xcode-select -print-path 2> /dev/null`
 | 
				
			||||||
 | 
					                SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                SDK_PATH=${sdk_path}
 | 
					                SDK_PATH=${sdk_path}
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
            TOOLCHAIN_PATH=${SDK_PATH}/usr/bin
 | 
					            TOOLCHAIN_PATH=${SDK_PATH}/usr/bin
 | 
				
			||||||
 | 
					            CXX=${TOOLCHAIN_PATH}/g++
 | 
				
			||||||
            CC=${TOOLCHAIN_PATH}/gcc
 | 
					            CC=${TOOLCHAIN_PATH}/gcc
 | 
				
			||||||
            AR=${TOOLCHAIN_PATH}/ar
 | 
					            AR=${TOOLCHAIN_PATH}/ar
 | 
				
			||||||
            LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
 | 
					            LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
 | 
				
			||||||
@@ -827,7 +907,7 @@ process_common_toolchain() {
 | 
				
			|||||||
            add_ldflags -arch_only ${tgt_isa}
 | 
					            add_ldflags -arch_only ${tgt_isa}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if [ -z "${alt_libc}" ]; then
 | 
					            if [ -z "${alt_libc}" ]; then
 | 
				
			||||||
                alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.0.sdk
 | 
					                alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.1.sdk
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            add_cflags  "-isysroot ${alt_libc}"
 | 
					            add_cflags  "-isysroot ${alt_libc}"
 | 
				
			||||||
@@ -873,13 +953,16 @@ process_common_toolchain() {
 | 
				
			|||||||
        esac
 | 
					        esac
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
    mips*)
 | 
					    mips*)
 | 
				
			||||||
        CROSS=${CROSS:-mipsel-linux-uclibc-}
 | 
					 | 
				
			||||||
        link_with_cc=gcc
 | 
					        link_with_cc=gcc
 | 
				
			||||||
        setup_gnu_toolchain
 | 
					        setup_gnu_toolchain
 | 
				
			||||||
        tune_cflags="-mtune="
 | 
					        tune_cflags="-mtune="
 | 
				
			||||||
 | 
					        if enabled dspr2; then
 | 
				
			||||||
 | 
					            check_add_cflags -mips32r2 -mdspr2
 | 
				
			||||||
 | 
					            disable fast_unaligned
 | 
				
			||||||
 | 
					        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 ppc
 | 
				
			||||||
@@ -907,6 +990,11 @@ process_common_toolchain() {
 | 
				
			|||||||
    x86*)
 | 
					    x86*)
 | 
				
			||||||
        bits=32
 | 
					        bits=32
 | 
				
			||||||
        enabled x86_64 && bits=64
 | 
					        enabled x86_64 && bits=64
 | 
				
			||||||
 | 
					        check_cpp <<EOF && bits=x32
 | 
				
			||||||
 | 
					#ifndef __ILP32__
 | 
				
			||||||
 | 
					#error "not x32"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
        soft_enable runtime_cpu_detect
 | 
					        soft_enable runtime_cpu_detect
 | 
				
			||||||
        soft_enable mmx
 | 
					        soft_enable mmx
 | 
				
			||||||
        soft_enable sse
 | 
					        soft_enable sse
 | 
				
			||||||
@@ -921,6 +1009,7 @@ process_common_toolchain() {
 | 
				
			|||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
            solaris*)
 | 
					            solaris*)
 | 
				
			||||||
                CC=${CC:-${CROSS}gcc}
 | 
					                CC=${CC:-${CROSS}gcc}
 | 
				
			||||||
 | 
					                CXX=${CXX:-${CROSS}g++}
 | 
				
			||||||
                LD=${LD:-${CROSS}gcc}
 | 
					                LD=${LD:-${CROSS}gcc}
 | 
				
			||||||
                CROSS=${CROSS:-g}
 | 
					                CROSS=${CROSS:-g}
 | 
				
			||||||
                ;;
 | 
					                ;;
 | 
				
			||||||
@@ -948,16 +1037,22 @@ process_common_toolchain() {
 | 
				
			|||||||
                        tune_cflags="-march="
 | 
					                        tune_cflags="-march="
 | 
				
			||||||
                    ;;
 | 
					                    ;;
 | 
				
			||||||
                esac
 | 
					                esac
 | 
				
			||||||
                ;;
 | 
					            ;;
 | 
				
			||||||
            gcc*)
 | 
					            gcc*)
 | 
				
			||||||
                add_cflags  -m${bits}
 | 
					                add_cflags -m${bits}
 | 
				
			||||||
                add_ldflags -m${bits}
 | 
					                add_ldflags -m${bits}
 | 
				
			||||||
                link_with_cc=gcc
 | 
					                link_with_cc=gcc
 | 
				
			||||||
                tune_cflags="-march="
 | 
					                tune_cflags="-march="
 | 
				
			||||||
            setup_gnu_toolchain
 | 
					            setup_gnu_toolchain
 | 
				
			||||||
                #for 32 bit x86 builds, -O3 did not turn on this flag
 | 
					                #for 32 bit x86 builds, -O3 did not turn on this flag
 | 
				
			||||||
                enabled optimizations && check_add_cflags -fomit-frame-pointer
 | 
					                enabled optimizations && check_add_cflags -fomit-frame-pointer
 | 
				
			||||||
                ;;
 | 
					            ;;
 | 
				
			||||||
 | 
					            vs*)
 | 
				
			||||||
 | 
					                # When building with Microsoft Visual Studio the assembler is
 | 
				
			||||||
 | 
					                # invoked directly. Checking at configure time is unnecessary.
 | 
				
			||||||
 | 
					                # Skip the check by setting AS arbitrarily
 | 
				
			||||||
 | 
					                AS=msvs
 | 
				
			||||||
 | 
					            ;;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case "${AS}" in
 | 
					        case "${AS}" in
 | 
				
			||||||
@@ -966,7 +1061,7 @@ process_common_toolchain() {
 | 
				
			|||||||
                which yasm >/dev/null 2>&1 && AS=yasm
 | 
					                which yasm >/dev/null 2>&1 && AS=yasm
 | 
				
			||||||
                [ "${AS}" = auto -o -z "${AS}" ] \
 | 
					                [ "${AS}" = auto -o -z "${AS}" ] \
 | 
				
			||||||
                    && die "Neither yasm nor nasm have been found"
 | 
					                    && die "Neither yasm nor nasm have been found"
 | 
				
			||||||
                ;;
 | 
					            ;;
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
        log_echo "  using $AS"
 | 
					        log_echo "  using $AS"
 | 
				
			||||||
        [ "${AS##*/}" = nasm ] && add_asflags -Ox
 | 
					        [ "${AS##*/}" = nasm ] && add_asflags -Ox
 | 
				
			||||||
@@ -1048,7 +1143,7 @@ process_common_toolchain() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Work around longjmp interception on glibc >= 2.11, to improve binary
 | 
					    # Work around longjmp interception on glibc >= 2.11, to improve binary
 | 
				
			||||||
    # compatibility. See http://code.google.com/p/webm/issues/detail?id=166
 | 
					    # compatibility. See http://code.google.com/p/webm/issues/detail?id=166
 | 
				
			||||||
    enabled linux && check_add_cflags -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 gnu_strip
 | 
				
			||||||
@@ -1063,12 +1158,24 @@ EOF
 | 
				
			|||||||
    # Almost every platform uses pthreads.
 | 
					    # Almost every platform uses pthreads.
 | 
				
			||||||
    if enabled multithread; then
 | 
					    if enabled multithread; then
 | 
				
			||||||
        case ${toolchain} in
 | 
					        case ${toolchain} in
 | 
				
			||||||
            *-win*);;
 | 
					            *-win*-vs*);;
 | 
				
			||||||
            *-android-gcc);;
 | 
					            *-android-gcc);;
 | 
				
			||||||
            *) check_header pthread.h && add_extralibs -lpthread
 | 
					            *) check_header pthread.h && add_extralibs -lpthread
 | 
				
			||||||
        esac
 | 
					        esac
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # only for MIPS platforms
 | 
				
			||||||
 | 
					    case ${toolchain} in
 | 
				
			||||||
 | 
					        mips*)
 | 
				
			||||||
 | 
					            if enabled dspr2; then
 | 
				
			||||||
 | 
					                if enabled big_endian; then
 | 
				
			||||||
 | 
					                    echo "dspr2 optimizations are available only for little endian platforms"
 | 
				
			||||||
 | 
					                    disable dspr2
 | 
				
			||||||
 | 
					                fi
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					    esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # for sysconf(3) and friends.
 | 
					    # for sysconf(3) and friends.
 | 
				
			||||||
    check_header unistd.h
 | 
					    check_header unistd.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,7 +42,7 @@ done
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
[ -n "$srcfile" ] || show_help
 | 
					[ -n "$srcfile" ] || show_help
 | 
				
			||||||
sfx=${sfx:-asm}
 | 
					sfx=${sfx:-asm}
 | 
				
			||||||
includes=$(egrep -i "include +\"?+[a-z0-9_/]+\.${sfx}" $srcfile |
 | 
					includes=$(LC_ALL=C egrep -i "include +\"?[a-z0-9_/]+\.${sfx}" $srcfile |
 | 
				
			||||||
           perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
 | 
					           perl -p -e "s;.*?([a-z0-9_/]+.${sfx}).*;\1;")
 | 
				
			||||||
#" restore editor state
 | 
					#" restore editor state
 | 
				
			||||||
for inc in ${includes}; do
 | 
					for inc in ${includes}; do
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -680,7 +680,7 @@ int parse_coff(uint8_t *buf, size_t sz)
 | 
				
			|||||||
    uint32_t symoffset;
 | 
					    uint32_t symoffset;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    char **sectionlist;  //this array holds all section names in their correct order.
 | 
					    char **sectionlist;  //this array holds all section names in their correct order.
 | 
				
			||||||
    //it is used to check if the symbol is in .bss or .data section.
 | 
					    //it is used to check if the symbol is in .bss or .rdata section.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    nsections = get_le16(buf + 2);
 | 
					    nsections = get_le16(buf + 2);
 | 
				
			||||||
    symtab_ptr = get_le32(buf + 8);
 | 
					    symtab_ptr = get_le32(buf + 8);
 | 
				
			||||||
@@ -725,15 +725,15 @@ int parse_coff(uint8_t *buf, size_t sz)
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        strcpy(sectionlist[i], sectionname);
 | 
					        strcpy(sectionlist[i], sectionname);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!strcmp(sectionname, ".data")) sectionrawdata_ptr = get_le32(ptr + 20);
 | 
					        if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ptr += 40;
 | 
					        ptr += 40;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
 | 
					    //log_msg("COFF: Symbol table at offset %u\n", symtab_ptr);
 | 
				
			||||||
    //log_msg("COFF: raw data pointer ofset for section .data is %u\n", sectionrawdata_ptr);
 | 
					    //log_msg("COFF: raw data pointer ofset for section .rdata is %u\n", sectionrawdata_ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /*  The compiler puts the data with non-zero offset in .data section, but puts the data with
 | 
					    /*  The compiler puts the data with non-zero offset in .rdata section, but puts the data with
 | 
				
			||||||
        zero offset in .bss section. So, if the data in in .bss section, set offset=0.
 | 
					        zero offset in .bss section. So, if the data in in .bss section, set offset=0.
 | 
				
			||||||
        Note from Wiki: In an object module compiled from C, the bss section contains
 | 
					        Note from Wiki: In an object module compiled from C, the bss section contains
 | 
				
			||||||
        the local variables (but not functions) that were declared with the static keyword,
 | 
					        the local variables (but not functions) that were declared with the static keyword,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -196,8 +196,8 @@ filter() {
 | 
				
			|||||||
# Helper functions for generating the arch specific RTCD files
 | 
					# Helper functions for generating the arch specific RTCD files
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
common_top() {
 | 
					common_top() {
 | 
				
			||||||
  local outfile_basename=$(basename ${outfile:-rtcd.h})
 | 
					  local outfile_basename=$(basename ${symbol:-rtcd.h})
 | 
				
			||||||
  local include_guard=$(echo -n $outfile_basename | tr '[a-z]' '[A-Z]' | tr -c '[A-Z]' _)
 | 
					  local include_guard=$(echo $outfile_basename | tr '[a-z]' '[A-Z]' | tr -c '[A-Z]' _)
 | 
				
			||||||
  cat <<EOF
 | 
					  cat <<EOF
 | 
				
			||||||
#ifndef ${include_guard}
 | 
					#ifndef ${include_guard}
 | 
				
			||||||
#define ${include_guard}
 | 
					#define ${include_guard}
 | 
				
			||||||
@@ -211,6 +211,8 @@ common_top() {
 | 
				
			|||||||
$(process_forward_decls)
 | 
					$(process_forward_decls)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(declare_function_pointers c $ALL_ARCHS)
 | 
					$(declare_function_pointers c $ALL_ARCHS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ${symbol:-rtcd}(void);
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -225,17 +227,16 @@ x86() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  # Assign the helper variable for each enabled extension
 | 
					  # Assign the helper variable for each enabled extension
 | 
				
			||||||
  for opt in $ALL_ARCHS; do
 | 
					  for opt in $ALL_ARCHS; do
 | 
				
			||||||
    local uc=$(echo -n $opt | tr '[a-z]' '[A-Z]')
 | 
					    local uc=$(echo $opt | tr '[a-z]' '[A-Z]')
 | 
				
			||||||
    eval "have_${opt}=\"flags & HAS_${uc}\""
 | 
					    eval "have_${opt}=\"flags & HAS_${uc}\""
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cat <<EOF
 | 
					  cat <<EOF
 | 
				
			||||||
$(common_top)
 | 
					$(common_top)
 | 
				
			||||||
void ${symbol:-rtcd}(void);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef RTCD_C
 | 
					#ifdef RTCD_C
 | 
				
			||||||
#include "vpx_ports/x86.h"
 | 
					#include "vpx_ports/x86.h"
 | 
				
			||||||
void ${symbol:-rtcd}(void)
 | 
					static void setup_rtcd_internal(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int flags = x86_simd_caps();
 | 
					    int flags = x86_simd_caps();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -253,7 +254,7 @@ arm() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  # Assign the helper variable for each enabled extension
 | 
					  # Assign the helper variable for each enabled extension
 | 
				
			||||||
  for opt in $ALL_ARCHS; do
 | 
					  for opt in $ALL_ARCHS; do
 | 
				
			||||||
    local uc=$(echo -n $opt | tr '[a-z]' '[A-Z]')
 | 
					    local uc=$(echo $opt | tr '[a-z]' '[A-Z]')
 | 
				
			||||||
    eval "have_${opt}=\"flags & HAS_${uc}\""
 | 
					    eval "have_${opt}=\"flags & HAS_${uc}\""
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -261,11 +262,9 @@ arm() {
 | 
				
			|||||||
$(common_top)
 | 
					$(common_top)
 | 
				
			||||||
#include "vpx_config.h"
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ${symbol:-rtcd}(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef RTCD_C
 | 
					#ifdef RTCD_C
 | 
				
			||||||
#include "vpx_ports/arm.h"
 | 
					#include "vpx_ports/arm.h"
 | 
				
			||||||
void ${symbol:-rtcd}(void)
 | 
					static void setup_rtcd_internal(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int flags = arm_cpu_caps();
 | 
					    int flags = arm_cpu_caps();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -279,16 +278,34 @@ EOF
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					mips() {
 | 
				
			||||||
 | 
					  determine_indirection c $ALL_ARCHS
 | 
				
			||||||
 | 
					  cat <<EOF
 | 
				
			||||||
 | 
					$(common_top)
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef RTCD_C
 | 
				
			||||||
 | 
					static void setup_rtcd_internal(void)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					$(set_function_pointers c $ALL_ARCHS)
 | 
				
			||||||
 | 
					#if HAVE_DSPR2
 | 
				
			||||||
 | 
					void dsputil_static_init();
 | 
				
			||||||
 | 
					dsputil_static_init();
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					$(common_bottom)
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unoptimized() {
 | 
					unoptimized() {
 | 
				
			||||||
  determine_indirection c
 | 
					  determine_indirection c
 | 
				
			||||||
  cat <<EOF
 | 
					  cat <<EOF
 | 
				
			||||||
$(common_top)
 | 
					$(common_top)
 | 
				
			||||||
#include "vpx_config.h"
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ${symbol:-rtcd}(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#ifdef RTCD_C
 | 
					#ifdef RTCD_C
 | 
				
			||||||
void ${symbol:-rtcd}(void)
 | 
					static void setup_rtcd_internal(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
$(set_function_pointers c)
 | 
					$(set_function_pointers c)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -312,6 +329,15 @@ case $arch in
 | 
				
			|||||||
    require $(filter $REQUIRES)
 | 
					    require $(filter $REQUIRES)
 | 
				
			||||||
    x86
 | 
					    x86
 | 
				
			||||||
    ;;
 | 
					    ;;
 | 
				
			||||||
 | 
					  mips32)
 | 
				
			||||||
 | 
					    ALL_ARCHS=$(filter mips32)
 | 
				
			||||||
 | 
					    dspr2=$([ -f "$config_file" ] && eval echo $(grep HAVE_DSPR2 "$config_file"))
 | 
				
			||||||
 | 
					    HAVE_DSPR2="${dspr2#*=}"
 | 
				
			||||||
 | 
					    if [ "$HAVE_DSPR2" = "yes" ]; then
 | 
				
			||||||
 | 
					        ALL_ARCHS=$(filter mips32 dspr2)
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    mips
 | 
				
			||||||
 | 
					    ;;
 | 
				
			||||||
  armv5te)
 | 
					  armv5te)
 | 
				
			||||||
    ALL_ARCHS=$(filter edsp)
 | 
					    ALL_ARCHS=$(filter edsp)
 | 
				
			||||||
    arm
 | 
					    arm
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										72
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										72
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -20,9 +20,10 @@ show_help(){
 | 
				
			|||||||
    show_help_pre
 | 
					    show_help_pre
 | 
				
			||||||
    cat << EOF
 | 
					    cat << EOF
 | 
				
			||||||
Advanced options:
 | 
					Advanced options:
 | 
				
			||||||
  ${toggle_libs}                  don't build libraries
 | 
					  ${toggle_libs}                  libraries
 | 
				
			||||||
  ${toggle_examples}              don't build examples
 | 
					  ${toggle_examples}              examples
 | 
				
			||||||
  ${toggle_unit_tests}            build unit tests
 | 
					  ${toggle_docs}                  documentation
 | 
				
			||||||
 | 
					  ${toggle_unit_tests}            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 (iOS, android builds only)
 | 
				
			||||||
@@ -39,6 +40,7 @@ Advanced options:
 | 
				
			|||||||
  ${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
 | 
				
			||||||
 | 
					  ${toggle_onthefly_bitpacking}   enable on-the-fly bitpacking in real-time encoding
 | 
				
			||||||
  ${toggle_error_concealment}     enable this option to get a decoder which is able to conceal losses
 | 
					  ${toggle_error_concealment}     enable this option to get a decoder which is able to conceal losses
 | 
				
			||||||
  ${toggle_runtime_cpu_detect}    runtime cpu detection
 | 
					  ${toggle_runtime_cpu_detect}    runtime cpu detection
 | 
				
			||||||
  ${toggle_shared}                shared library support
 | 
					  ${toggle_shared}                shared library support
 | 
				
			||||||
@@ -46,6 +48,7 @@ Advanced options:
 | 
				
			|||||||
  ${toggle_small}                 favor smaller size over speed
 | 
					  ${toggle_small}                 favor smaller size over speed
 | 
				
			||||||
  ${toggle_postproc_visualizer}   macro block / block level visualizers
 | 
					  ${toggle_postproc_visualizer}   macro block / block level visualizers
 | 
				
			||||||
  ${toggle_multi_res_encoding}    enable multiple-resolution encoding
 | 
					  ${toggle_multi_res_encoding}    enable multiple-resolution encoding
 | 
				
			||||||
 | 
					  ${toggle_temporal_denoising}    enable temporal denoising and disable the spatial denoiser
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Codecs:
 | 
					Codecs:
 | 
				
			||||||
  Codecs can be selectively enabled or disabled individually, or by family:
 | 
					  Codecs can be selectively enabled or disabled individually, or by family:
 | 
				
			||||||
@@ -107,6 +110,8 @@ all_platforms="${all_platforms} x86-darwin8-icc"
 | 
				
			|||||||
all_platforms="${all_platforms} x86-darwin9-gcc"
 | 
					all_platforms="${all_platforms} x86-darwin9-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} x86-darwin9-icc"
 | 
					all_platforms="${all_platforms} x86-darwin9-icc"
 | 
				
			||||||
all_platforms="${all_platforms} x86-darwin10-gcc"
 | 
					all_platforms="${all_platforms} x86-darwin10-gcc"
 | 
				
			||||||
 | 
					all_platforms="${all_platforms} x86-darwin11-gcc"
 | 
				
			||||||
 | 
					all_platforms="${all_platforms} x86-darwin12-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} x86-linux-gcc"
 | 
					all_platforms="${all_platforms} x86-linux-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} x86-linux-icc"
 | 
					all_platforms="${all_platforms} x86-linux-icc"
 | 
				
			||||||
all_platforms="${all_platforms} x86-os2-gcc"
 | 
					all_platforms="${all_platforms} x86-os2-gcc"
 | 
				
			||||||
@@ -118,6 +123,7 @@ all_platforms="${all_platforms} x86-win32-vs9"
 | 
				
			|||||||
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"
 | 
				
			||||||
 | 
					all_platforms="${all_platforms} x86_64-darwin12-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} x86_64-linux-gcc"
 | 
					all_platforms="${all_platforms} x86_64-linux-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} x86_64-linux-icc"
 | 
					all_platforms="${all_platforms} x86_64-linux-icc"
 | 
				
			||||||
all_platforms="${all_platforms} x86_64-solaris-gcc"
 | 
					all_platforms="${all_platforms} x86_64-solaris-gcc"
 | 
				
			||||||
@@ -126,6 +132,9 @@ 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} 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-darwin11-gcc"
 | 
				
			||||||
 | 
					all_platforms="${all_platforms} universal-darwin12-gcc"
 | 
				
			||||||
all_platforms="${all_platforms} generic-gnu"
 | 
					all_platforms="${all_platforms} generic-gnu"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# all_targets is a list of all targets that can be configured
 | 
					# all_targets is a list of all targets that can be configured
 | 
				
			||||||
@@ -164,6 +173,7 @@ enable md5
 | 
				
			|||||||
enable spatial_resampling
 | 
					enable spatial_resampling
 | 
				
			||||||
enable multithread
 | 
					enable multithread
 | 
				
			||||||
enable os_support
 | 
					enable os_support
 | 
				
			||||||
 | 
					enable temporal_denoising
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ -d ${source_path}/../include ] && enable alt_tree_layout
 | 
					[ -d ${source_path}/../include ] && enable alt_tree_layout
 | 
				
			||||||
for d in vp8; do
 | 
					for d in vp8; do
 | 
				
			||||||
@@ -177,6 +187,8 @@ else
 | 
				
			|||||||
# customer environment
 | 
					# customer environment
 | 
				
			||||||
[ -f ${source_path}/../include/vpx/vp8cx.h ] && CODECS="${CODECS} vp8_encoder"
 | 
					[ -f ${source_path}/../include/vpx/vp8cx.h ] && CODECS="${CODECS} vp8_encoder"
 | 
				
			||||||
[ -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/vp8cx.h ] || disable vp8_encoder
 | 
				
			||||||
 | 
					[ -f ${source_path}/../include/vpx/vp8dx.h ] || disable vp8_decoder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt
 | 
					[ -f ${source_path}/../lib/*/*mt.lib ] && soft_enable static_msvcrt
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
@@ -198,6 +210,7 @@ ARCH_EXT_LIST="
 | 
				
			|||||||
    neon
 | 
					    neon
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mips32
 | 
					    mips32
 | 
				
			||||||
 | 
					    dspr2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    mmx
 | 
					    mmx
 | 
				
			||||||
    sse
 | 
					    sse
 | 
				
			||||||
@@ -253,6 +266,7 @@ CONFIG_LIST="
 | 
				
			|||||||
    static_msvcrt
 | 
					    static_msvcrt
 | 
				
			||||||
    spatial_resampling
 | 
					    spatial_resampling
 | 
				
			||||||
    realtime_only
 | 
					    realtime_only
 | 
				
			||||||
 | 
					    onthefly_bitpacking
 | 
				
			||||||
    error_concealment
 | 
					    error_concealment
 | 
				
			||||||
    shared
 | 
					    shared
 | 
				
			||||||
    static
 | 
					    static
 | 
				
			||||||
@@ -261,6 +275,7 @@ CONFIG_LIST="
 | 
				
			|||||||
    os_support
 | 
					    os_support
 | 
				
			||||||
    unit_tests
 | 
					    unit_tests
 | 
				
			||||||
    multi_res_encoding
 | 
					    multi_res_encoding
 | 
				
			||||||
 | 
					    temporal_denoising
 | 
				
			||||||
"
 | 
					"
 | 
				
			||||||
CMDLINE_SELECT="
 | 
					CMDLINE_SELECT="
 | 
				
			||||||
    extra_warnings
 | 
					    extra_warnings
 | 
				
			||||||
@@ -279,6 +294,7 @@ CMDLINE_SELECT="
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    libs
 | 
					    libs
 | 
				
			||||||
    examples
 | 
					    examples
 | 
				
			||||||
 | 
					    docs
 | 
				
			||||||
    libc
 | 
					    libc
 | 
				
			||||||
    as
 | 
					    as
 | 
				
			||||||
    fast_unaligned
 | 
					    fast_unaligned
 | 
				
			||||||
@@ -297,6 +313,7 @@ CMDLINE_SELECT="
 | 
				
			|||||||
    mem_tracker
 | 
					    mem_tracker
 | 
				
			||||||
    spatial_resampling
 | 
					    spatial_resampling
 | 
				
			||||||
    realtime_only
 | 
					    realtime_only
 | 
				
			||||||
 | 
					    onthefly_bitpacking
 | 
				
			||||||
    error_concealment
 | 
					    error_concealment
 | 
				
			||||||
    shared
 | 
					    shared
 | 
				
			||||||
    static
 | 
					    static
 | 
				
			||||||
@@ -304,6 +321,7 @@ CMDLINE_SELECT="
 | 
				
			|||||||
    postproc_visualizer
 | 
					    postproc_visualizer
 | 
				
			||||||
    unit_tests
 | 
					    unit_tests
 | 
				
			||||||
    multi_res_encoding
 | 
					    multi_res_encoding
 | 
				
			||||||
 | 
					    temporal_denoising
 | 
				
			||||||
"
 | 
					"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
process_cmdline() {
 | 
					process_cmdline() {
 | 
				
			||||||
@@ -438,7 +456,13 @@ process_detect() {
 | 
				
			|||||||
        # Can only build shared libs on a subset of platforms. Doing this check
 | 
					        # Can only build shared libs on a subset of platforms. Doing this check
 | 
				
			||||||
        # here rather than at option parse time because the target auto-detect
 | 
					        # here rather than at option parse time because the target auto-detect
 | 
				
			||||||
        # magic happens after the command line has been parsed.
 | 
					        # magic happens after the command line has been parsed.
 | 
				
			||||||
        enabled linux || die "--enable-shared only supported on ELF for now"
 | 
					        if ! enabled linux; then
 | 
				
			||||||
 | 
					            if enabled gnu; then
 | 
				
			||||||
 | 
					                echo "--enable-shared is only supported on ELF; assuming this is OK"
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					                die "--enable-shared only supported on ELF for now"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
    if [ -z "$CC" ]; then
 | 
					    if [ -z "$CC" ]; then
 | 
				
			||||||
        echo "Bypassing toolchain for environment detection."
 | 
					        echo "Bypassing toolchain for environment detection."
 | 
				
			||||||
@@ -484,11 +508,20 @@ process_toolchain() {
 | 
				
			|||||||
    case $toolchain in
 | 
					    case $toolchain in
 | 
				
			||||||
        universal-darwin*)
 | 
					        universal-darwin*)
 | 
				
			||||||
            local darwin_ver=${tgt_os##darwin}
 | 
					            local darwin_ver=${tgt_os##darwin}
 | 
				
			||||||
            fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # Intel
 | 
					            # Snow Leopard (10.6/darwin10) dropped support for PPC
 | 
				
			||||||
            fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
 | 
					            # Include PPC support for all prior versions
 | 
				
			||||||
            if [ $darwin_ver -gt 8 ]; then
 | 
					            if [ $darwin_ver -lt 10 ]; then
 | 
				
			||||||
 | 
					                fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # Tiger (10.4/darwin8) brought support for x86
 | 
				
			||||||
 | 
					            if [ $darwin_ver -ge 8 ]; then
 | 
				
			||||||
 | 
					                fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
 | 
				
			||||||
 | 
					            fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # Leopard (10.5/darwin9) brought 64 bit support
 | 
				
			||||||
 | 
					            if [ $darwin_ver -ge 9 ]; then
 | 
				
			||||||
                fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
 | 
					                fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
 | 
				
			||||||
            fi
 | 
					            fi
 | 
				
			||||||
            ;;
 | 
					            ;;
 | 
				
			||||||
@@ -504,6 +537,10 @@ process_toolchain() {
 | 
				
			|||||||
        check_add_cflags -Wpointer-arith
 | 
					        check_add_cflags -Wpointer-arith
 | 
				
			||||||
        check_add_cflags -Wtype-limits
 | 
					        check_add_cflags -Wtype-limits
 | 
				
			||||||
        check_add_cflags -Wcast-qual
 | 
					        check_add_cflags -Wcast-qual
 | 
				
			||||||
 | 
					        check_add_cflags -Wimplicit-function-declaration
 | 
				
			||||||
 | 
					        check_add_cflags -Wuninitialized
 | 
				
			||||||
 | 
					        check_add_cflags -Wunused-variable
 | 
				
			||||||
 | 
					        check_add_cflags -Wunused-but-set-variable
 | 
				
			||||||
        enabled extra_warnings || check_add_cflags -Wno-unused-function
 | 
					        enabled extra_warnings || check_add_cflags -Wno-unused-function
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -558,6 +595,25 @@ process_toolchain() {
 | 
				
			|||||||
    if enabled postproc_visualizer; then
 | 
					    if enabled postproc_visualizer; then
 | 
				
			||||||
        enabled postproc || die "postproc_visualizer requires postproc to be enabled"
 | 
					        enabled postproc || die "postproc_visualizer requires postproc to be enabled"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Enable unit tests if we have a working C++ compiler
 | 
				
			||||||
 | 
					    case "$toolchain" in
 | 
				
			||||||
 | 
					        *-vs*)
 | 
				
			||||||
 | 
					            soft_enable unit_tests
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					        *-android-*)
 | 
				
			||||||
 | 
					            # GTestLog must be modified to use Android logging utilities.
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					        *-darwin-*)
 | 
				
			||||||
 | 
					            # iOS/ARM builds do not work with gtest. This does not match
 | 
				
			||||||
 | 
					            # x86 targets.
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					        *)
 | 
				
			||||||
 | 
					            check_cxx "$@" <<EOF && soft_enable unit_tests
 | 
				
			||||||
 | 
					int z;
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					        ;;
 | 
				
			||||||
 | 
					    esac
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										3
									
								
								docs.mk
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								docs.mk
									
									
									
									
									
								
							@@ -21,9 +21,6 @@ CODEC_DOX :=    mainpage.dox \
 | 
				
			|||||||
		usage_dx.dox \
 | 
							usage_dx.dox \
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Other doxy files sourced in Markdown
 | 
					# Other doxy files sourced in Markdown
 | 
				
			||||||
TXT_DOX-$(CONFIG_VP8)          += vp8_api1_migration.dox
 | 
					 | 
				
			||||||
vp8_api1_migration.dox.DESC     = VP8 API 1.x Migration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
TXT_DOX = $(call enabled,TXT_DOX)
 | 
					TXT_DOX = $(call enabled,TXT_DOX)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%.dox: %.txt
 | 
					%.dox: %.txt
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										35
									
								
								examples.mk
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								examples.mk
									
									
									
									
									
								
							@@ -8,20 +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.
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIBYUV_SRCS +=  third_party/libyuv/include/libyuv/basic_types.h  \
 | 
					 | 
				
			||||||
                third_party/libyuv/include/libyuv/cpu_id.h  \
 | 
					 | 
				
			||||||
                third_party/libyuv/include/libyuv/scale.h  \
 | 
					 | 
				
			||||||
                third_party/libyuv/source/row.h \
 | 
					 | 
				
			||||||
                third_party/libyuv/source/scale.c  \
 | 
					 | 
				
			||||||
                third_party/libyuv/source/cpu_id.c
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
NESTEGG_SRCS += nestegg/halloc/halloc.h \
 | 
					 | 
				
			||||||
                nestegg/halloc/src/align.h \
 | 
					 | 
				
			||||||
                nestegg/halloc/src/halloc.c \
 | 
					 | 
				
			||||||
                nestegg/halloc/src/hlist.h \
 | 
					 | 
				
			||||||
                nestegg/halloc/src/macros.h \
 | 
					 | 
				
			||||||
                nestegg/include/nestegg/nestegg.h \
 | 
					 | 
				
			||||||
                nestegg/src/nestegg.c
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# List of examples to build. UTILS are files that are taken from the source
 | 
					# List of examples to build. UTILS are files that are taken from the source
 | 
				
			||||||
# tree directly, and GEN_EXAMPLES are files that are created from the
 | 
					# tree directly, and GEN_EXAMPLES are files that are created from the
 | 
				
			||||||
@@ -32,7 +18,13 @@ 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                 += tools_common.c tools_common.h
 | 
					vpxdec.SRCS                 += tools_common.c tools_common.h
 | 
				
			||||||
vpxdec.SRCS                 += $(NESTEGG_SRCS)
 | 
					vpxdec.SRCS                 += nestegg/halloc/halloc.h
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/halloc/src/align.h
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/halloc/src/halloc.c
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/halloc/src/hlist.h
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/halloc/src/macros.h
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/include/nestegg/nestegg.h
 | 
				
			||||||
 | 
					vpxdec.SRCS                 += nestegg/src/nestegg.c
 | 
				
			||||||
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
 | 
				
			||||||
@@ -40,11 +32,10 @@ vpxenc.SRCS                 += args.c args.h y4minput.c y4minput.h
 | 
				
			|||||||
vpxenc.SRCS                 += tools_common.c tools_common.h
 | 
					vpxenc.SRCS                 += tools_common.c tools_common.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                 += libmkv/EbmlIDs.h
 | 
					vpxenc.SRCS                 += libmkv/EbmlIDs.h
 | 
				
			||||||
vpxenc.SRCS                 += libmkv/EbmlWriter.c
 | 
					vpxenc.SRCS                 += libmkv/EbmlWriter.c
 | 
				
			||||||
vpxenc.SRCS                 += libmkv/EbmlWriter.h
 | 
					vpxenc.SRCS                 += libmkv/EbmlWriter.h
 | 
				
			||||||
vpxenc.SRCS                 += $(LIBYUV_SRCS)
 | 
					 | 
				
			||||||
vpxenc.SRCS                 += $(NESTEGG_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_ENCODERS)    += vp8_scalable_patterns.c
 | 
					UTILS-$(CONFIG_ENCODERS)    += vp8_scalable_patterns.c
 | 
				
			||||||
@@ -107,8 +98,14 @@ vp8cx_set_ref.GUID                  = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
 | 
				
			|||||||
vp8cx_set_ref.DESCRIPTION           = VP8 set encoder reference frame
 | 
					vp8cx_set_ref.DESCRIPTION           = VP8 set encoder reference frame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# C file is provided, not generated automatically.
 | 
					# C file is provided, not generated automatically.
 | 
				
			||||||
GEN_EXAMPLES-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c
 | 
					UTILS-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c
 | 
				
			||||||
vp8_multi_resolution_encoder.SRCS         += $(LIBYUV_SRCS)
 | 
					vp8_multi_resolution_encoder.SRCS  \
 | 
				
			||||||
 | 
					                         += third_party/libyuv/include/libyuv/basic_types.h  \
 | 
				
			||||||
 | 
					                            third_party/libyuv/include/libyuv/cpu_id.h  \
 | 
				
			||||||
 | 
					                            third_party/libyuv/include/libyuv/scale.h  \
 | 
				
			||||||
 | 
					                            third_party/libyuv/source/row.h \
 | 
				
			||||||
 | 
					                            third_party/libyuv/source/scale.c  \
 | 
				
			||||||
 | 
					                            third_party/libyuv/source/cpu_id.c
 | 
				
			||||||
vp8_multi_resolution_encoder.GUID         = 04f8738e-63c8-423b-90fa-7c2703a374de
 | 
					vp8_multi_resolution_encoder.GUID         = 04f8738e-63c8-423b-90fa-7c2703a374de
 | 
				
			||||||
vp8_multi_resolution_encoder.DESCRIPTION  = VP8 Multiple-resolution Encoding
 | 
					vp8_multi_resolution_encoder.DESCRIPTION  = VP8 Multiple-resolution Encoding
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,8 +48,8 @@ for(plane=0; plane < 3; plane++) {
 | 
				
			|||||||
    unsigned char *buf =img->planes[plane];
 | 
					    unsigned char *buf =img->planes[plane];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
 | 
					    for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
 | 
				
			||||||
        if(fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
 | 
					        (void) fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
 | 
				
			||||||
           outfile));
 | 
					                      outfile);
 | 
				
			||||||
        buf += img->stride[plane];
 | 
					        buf += img->stride[plane];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,7 @@ static void write_ivf_file_header(FILE *outfile,
 | 
				
			|||||||
    mem_put_le32(header+24, frame_cnt);           /* length */
 | 
					    mem_put_le32(header+24, frame_cnt);           /* length */
 | 
				
			||||||
    mem_put_le32(header+28, 0);                   /* unused */
 | 
					    mem_put_le32(header+28, 0);                   /* unused */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(fwrite(header, 1, 32, outfile));
 | 
					    (void) fwrite(header, 1, 32, outfile);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -103,7 +103,7 @@ static void write_ivf_frame_header(FILE *outfile,
 | 
				
			|||||||
    mem_put_le32(header+4, pts&0xFFFFFFFF);
 | 
					    mem_put_le32(header+4, pts&0xFFFFFFFF);
 | 
				
			||||||
    mem_put_le32(header+8, pts >> 32);
 | 
					    mem_put_le32(header+8, pts >> 32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if(fwrite(header, 1, 12, outfile));
 | 
					    (void) fwrite(header, 1, 12, outfile);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main(int argc, char **argv) {
 | 
					int main(int argc, char **argv) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,13 +61,14 @@ if(vpx_codec_encode(&codec, frame_avail? &raw : NULL, frame_cnt,
 | 
				
			|||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 | 
				
			||||||
case VPX_CODEC_CX_FRAME_PKT:
 | 
					case VPX_CODEC_CX_FRAME_PKT:
 | 
				
			||||||
    write_ivf_frame_header(outfile, pkt);
 | 
					    write_ivf_frame_header(outfile, pkt);
 | 
				
			||||||
    if(fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
 | 
					    (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
 | 
				
			||||||
              outfile));
 | 
					                  outfile);
 | 
				
			||||||
    break;
 | 
					    break;
 | 
				
			||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
				
			||||||
 | 
					vpx_img_free(&raw);
 | 
				
			||||||
if(vpx_codec_destroy(&codec))
 | 
					if(vpx_codec_destroy(&codec))
 | 
				
			||||||
    die_codec(&codec, "Failed to destroy codec");
 | 
					    die_codec(&codec, "Failed to destroy codec");
 | 
				
			||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -71,5 +71,17 @@ Pass Progress Reporting
 | 
				
			|||||||
It's sometimes helpful to see when each pass completes.
 | 
					It's sometimes helpful to see when each pass completes.
 | 
				
			||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
 | 
				
			||||||
    printf("Pass %d complete.\n", pass+1);
 | 
					    printf("Pass %d complete.\n", pass+1);
 | 
				
			||||||
 | 
					    if(vpx_codec_destroy(&codec))
 | 
				
			||||||
 | 
					        die_codec(&codec, "Failed to destroy codec");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Clean-up
 | 
				
			||||||
 | 
					-----------------------------
 | 
				
			||||||
 | 
					Destruction of the encoder instance must be done on each pass. The
 | 
				
			||||||
 | 
					raw image should be destroyed at the end as usual.
 | 
				
			||||||
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
				
			||||||
 | 
					vpx_img_free(&raw);
 | 
				
			||||||
 | 
					free(stats.buf);
 | 
				
			||||||
 | 
					~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										292
									
								
								libmkv/EbmlIDs.h
									
									
									
									
									
								
							
							
						
						
									
										292
									
								
								libmkv/EbmlIDs.h
									
									
									
									
									
								
							@@ -1,16 +1,16 @@
 | 
				
			|||||||
// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 | 
					/*
 | 
				
			||||||
//
 | 
					 *  Copyright (c) 2010 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
 | 
					 *  Use of this source code is governed by a BSD-style license
 | 
				
			||||||
// tree. An additional intellectual property rights grant can be found
 | 
					 *  that can be found in the LICENSE file in the root of the source
 | 
				
			||||||
// in the file PATENTS.  All contributing project authors may
 | 
					 *  tree. An additional intellectual property rights grant can be found
 | 
				
			||||||
// be found in the AUTHORS file in the root of the source tree.
 | 
					 *  in the file PATENTS.  All contributing project authors may
 | 
				
			||||||
 | 
					 *  be found in the AUTHORS file in the root of the source tree.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
#ifndef MKV_DEFS_HPP
 | 
					#ifndef MKV_DEFS_HPP
 | 
				
			||||||
#define MKV_DEFS_HPP 1
 | 
					#define MKV_DEFS_HPP 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//Commenting out values not available in webm, but available in matroska
 | 
					/* Commenting out values not available in webm, but available in matroska */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum mkv
 | 
					enum mkv
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -22,7 +22,7 @@ enum mkv
 | 
				
			|||||||
    DocType = 0x4282,
 | 
					    DocType = 0x4282,
 | 
				
			||||||
    DocTypeVersion = 0x4287,
 | 
					    DocTypeVersion = 0x4287,
 | 
				
			||||||
    DocTypeReadVersion = 0x4285,
 | 
					    DocTypeReadVersion = 0x4285,
 | 
				
			||||||
//  CRC_32 = 0xBF,
 | 
					/* CRC_32 = 0xBF, */
 | 
				
			||||||
    Void = 0xEC,
 | 
					    Void = 0xEC,
 | 
				
			||||||
    SignatureSlot = 0x1B538667,
 | 
					    SignatureSlot = 0x1B538667,
 | 
				
			||||||
    SignatureAlgo = 0x7E8A,
 | 
					    SignatureAlgo = 0x7E8A,
 | 
				
			||||||
@@ -32,61 +32,61 @@ enum mkv
 | 
				
			|||||||
    SignatureElements = 0x7E5B,
 | 
					    SignatureElements = 0x7E5B,
 | 
				
			||||||
    SignatureElementList = 0x7E7B,
 | 
					    SignatureElementList = 0x7E7B,
 | 
				
			||||||
    SignedElement = 0x6532,
 | 
					    SignedElement = 0x6532,
 | 
				
			||||||
    //segment
 | 
					    /* segment */
 | 
				
			||||||
    Segment = 0x18538067,
 | 
					    Segment = 0x18538067,
 | 
				
			||||||
    //Meta Seek Information
 | 
					    /* Meta Seek Information */
 | 
				
			||||||
    SeekHead = 0x114D9B74,
 | 
					    SeekHead = 0x114D9B74,
 | 
				
			||||||
    Seek = 0x4DBB,
 | 
					    Seek = 0x4DBB,
 | 
				
			||||||
    SeekID = 0x53AB,
 | 
					    SeekID = 0x53AB,
 | 
				
			||||||
    SeekPosition = 0x53AC,
 | 
					    SeekPosition = 0x53AC,
 | 
				
			||||||
    //Segment Information
 | 
					    /* Segment Information */
 | 
				
			||||||
    Info = 0x1549A966,
 | 
					    Info = 0x1549A966,
 | 
				
			||||||
//  SegmentUID = 0x73A4,
 | 
					/* SegmentUID = 0x73A4, */
 | 
				
			||||||
//  SegmentFilename = 0x7384,
 | 
					/* SegmentFilename = 0x7384, */
 | 
				
			||||||
//  PrevUID = 0x3CB923,
 | 
					/* PrevUID = 0x3CB923, */
 | 
				
			||||||
//  PrevFilename = 0x3C83AB,
 | 
					/* PrevFilename = 0x3C83AB, */
 | 
				
			||||||
//  NextUID = 0x3EB923,
 | 
					/* NextUID = 0x3EB923, */
 | 
				
			||||||
//  NextFilename = 0x3E83BB,
 | 
					/* NextFilename = 0x3E83BB, */
 | 
				
			||||||
//  SegmentFamily = 0x4444,
 | 
					/* SegmentFamily = 0x4444, */
 | 
				
			||||||
//  ChapterTranslate = 0x6924,
 | 
					/* ChapterTranslate = 0x6924, */
 | 
				
			||||||
//  ChapterTranslateEditionUID = 0x69FC,
 | 
					/* ChapterTranslateEditionUID = 0x69FC, */
 | 
				
			||||||
//  ChapterTranslateCodec = 0x69BF,
 | 
					/* ChapterTranslateCodec = 0x69BF, */
 | 
				
			||||||
//  ChapterTranslateID = 0x69A5,
 | 
					/* ChapterTranslateID = 0x69A5, */
 | 
				
			||||||
    TimecodeScale = 0x2AD7B1,
 | 
					    TimecodeScale = 0x2AD7B1,
 | 
				
			||||||
    Segment_Duration = 0x4489,
 | 
					    Segment_Duration = 0x4489,
 | 
				
			||||||
    DateUTC = 0x4461,
 | 
					    DateUTC = 0x4461,
 | 
				
			||||||
//  Title = 0x7BA9,
 | 
					/* Title = 0x7BA9, */
 | 
				
			||||||
    MuxingApp = 0x4D80,
 | 
					    MuxingApp = 0x4D80,
 | 
				
			||||||
    WritingApp = 0x5741,
 | 
					    WritingApp = 0x5741,
 | 
				
			||||||
    //Cluster
 | 
					    /* Cluster */
 | 
				
			||||||
    Cluster = 0x1F43B675,
 | 
					    Cluster = 0x1F43B675,
 | 
				
			||||||
    Timecode = 0xE7,
 | 
					    Timecode = 0xE7,
 | 
				
			||||||
//  SilentTracks = 0x5854,
 | 
					/* SilentTracks = 0x5854, */
 | 
				
			||||||
//  SilentTrackNumber = 0x58D7,
 | 
					/* SilentTrackNumber = 0x58D7, */
 | 
				
			||||||
//  Position = 0xA7,
 | 
					/* Position = 0xA7, */
 | 
				
			||||||
    PrevSize = 0xAB,
 | 
					    PrevSize = 0xAB,
 | 
				
			||||||
    BlockGroup = 0xA0,
 | 
					    BlockGroup = 0xA0,
 | 
				
			||||||
    Block = 0xA1,
 | 
					    Block = 0xA1,
 | 
				
			||||||
//  BlockVirtual = 0xA2,
 | 
					/* BlockVirtual = 0xA2, */
 | 
				
			||||||
//  BlockAdditions = 0x75A1,
 | 
					/* BlockAdditions = 0x75A1, */
 | 
				
			||||||
//  BlockMore = 0xA6,
 | 
					/* BlockMore = 0xA6, */
 | 
				
			||||||
//  BlockAddID = 0xEE,
 | 
					/* BlockAddID = 0xEE, */
 | 
				
			||||||
//  BlockAdditional = 0xA5,
 | 
					/* BlockAdditional = 0xA5, */
 | 
				
			||||||
    BlockDuration = 0x9B,
 | 
					    BlockDuration = 0x9B,
 | 
				
			||||||
//  ReferencePriority = 0xFA,
 | 
					/* ReferencePriority = 0xFA, */
 | 
				
			||||||
    ReferenceBlock = 0xFB,
 | 
					    ReferenceBlock = 0xFB,
 | 
				
			||||||
//  ReferenceVirtual = 0xFD,
 | 
					/* ReferenceVirtual = 0xFD, */
 | 
				
			||||||
//  CodecState = 0xA4,
 | 
					/* CodecState = 0xA4, */
 | 
				
			||||||
//  Slices = 0x8E,
 | 
					/* Slices = 0x8E, */
 | 
				
			||||||
//  TimeSlice = 0xE8,
 | 
					/* TimeSlice = 0xE8, */
 | 
				
			||||||
    LaceNumber = 0xCC,
 | 
					    LaceNumber = 0xCC,
 | 
				
			||||||
//  FrameNumber = 0xCD,
 | 
					/* FrameNumber = 0xCD, */
 | 
				
			||||||
//  BlockAdditionID = 0xCB,
 | 
					/* BlockAdditionID = 0xCB, */
 | 
				
			||||||
//  MkvDelay = 0xCE,
 | 
					/* MkvDelay = 0xCE, */
 | 
				
			||||||
//  Cluster_Duration = 0xCF,
 | 
					/* Cluster_Duration = 0xCF, */
 | 
				
			||||||
    SimpleBlock = 0xA3,
 | 
					    SimpleBlock = 0xA3,
 | 
				
			||||||
//  EncryptedBlock = 0xAF,
 | 
					/* EncryptedBlock = 0xAF, */
 | 
				
			||||||
    //Track
 | 
					    /* Track */
 | 
				
			||||||
    Tracks = 0x1654AE6B,
 | 
					    Tracks = 0x1654AE6B,
 | 
				
			||||||
    TrackEntry = 0xAE,
 | 
					    TrackEntry = 0xAE,
 | 
				
			||||||
    TrackNumber = 0xD7,
 | 
					    TrackNumber = 0xD7,
 | 
				
			||||||
@@ -96,28 +96,28 @@ enum mkv
 | 
				
			|||||||
    FlagDefault = 0x88,
 | 
					    FlagDefault = 0x88,
 | 
				
			||||||
    FlagForced = 0x55AA,
 | 
					    FlagForced = 0x55AA,
 | 
				
			||||||
    FlagLacing = 0x9C,
 | 
					    FlagLacing = 0x9C,
 | 
				
			||||||
//  MinCache = 0x6DE7,
 | 
					/* MinCache = 0x6DE7, */
 | 
				
			||||||
//  MaxCache = 0x6DF8,
 | 
					/* MaxCache = 0x6DF8, */
 | 
				
			||||||
    DefaultDuration = 0x23E383,
 | 
					    DefaultDuration = 0x23E383,
 | 
				
			||||||
//  TrackTimecodeScale = 0x23314F,
 | 
					/* TrackTimecodeScale = 0x23314F, */
 | 
				
			||||||
//  TrackOffset = 0x537F,
 | 
					/* TrackOffset = 0x537F, */
 | 
				
			||||||
//  MaxBlockAdditionID = 0x55EE,
 | 
					/* MaxBlockAdditionID = 0x55EE, */
 | 
				
			||||||
    Name = 0x536E,
 | 
					    Name = 0x536E,
 | 
				
			||||||
    Language = 0x22B59C,
 | 
					    Language = 0x22B59C,
 | 
				
			||||||
    CodecID = 0x86,
 | 
					    CodecID = 0x86,
 | 
				
			||||||
    CodecPrivate = 0x63A2,
 | 
					    CodecPrivate = 0x63A2,
 | 
				
			||||||
    CodecName = 0x258688,
 | 
					    CodecName = 0x258688,
 | 
				
			||||||
//  AttachmentLink = 0x7446,
 | 
					/* AttachmentLink = 0x7446, */
 | 
				
			||||||
//  CodecSettings = 0x3A9697,
 | 
					/* CodecSettings = 0x3A9697, */
 | 
				
			||||||
//  CodecInfoURL = 0x3B4040,
 | 
					/* CodecInfoURL = 0x3B4040, */
 | 
				
			||||||
//  CodecDownloadURL = 0x26B240,
 | 
					/* CodecDownloadURL = 0x26B240, */
 | 
				
			||||||
//  CodecDecodeAll = 0xAA,
 | 
					/* CodecDecodeAll = 0xAA, */
 | 
				
			||||||
//  TrackOverlay = 0x6FAB,
 | 
					/* TrackOverlay = 0x6FAB, */
 | 
				
			||||||
//  TrackTranslate = 0x6624,
 | 
					/* TrackTranslate = 0x6624, */
 | 
				
			||||||
//  TrackTranslateEditionUID = 0x66FC,
 | 
					/* TrackTranslateEditionUID = 0x66FC, */
 | 
				
			||||||
//  TrackTranslateCodec = 0x66BF,
 | 
					/* TrackTranslateCodec = 0x66BF, */
 | 
				
			||||||
//  TrackTranslateTrackID = 0x66A5,
 | 
					/* TrackTranslateTrackID = 0x66A5, */
 | 
				
			||||||
    //video
 | 
					    /* video */
 | 
				
			||||||
    Video = 0xE0,
 | 
					    Video = 0xE0,
 | 
				
			||||||
    FlagInterlaced = 0x9A,
 | 
					    FlagInterlaced = 0x9A,
 | 
				
			||||||
    StereoMode = 0x53B8,
 | 
					    StereoMode = 0x53B8,
 | 
				
			||||||
@@ -131,101 +131,101 @@ enum mkv
 | 
				
			|||||||
    DisplayHeight = 0x54BA,
 | 
					    DisplayHeight = 0x54BA,
 | 
				
			||||||
    DisplayUnit = 0x54B2,
 | 
					    DisplayUnit = 0x54B2,
 | 
				
			||||||
    AspectRatioType = 0x54B3,
 | 
					    AspectRatioType = 0x54B3,
 | 
				
			||||||
//  ColourSpace = 0x2EB524,
 | 
					/* ColourSpace = 0x2EB524, */
 | 
				
			||||||
//  GammaValue = 0x2FB523,
 | 
					/* GammaValue = 0x2FB523, */
 | 
				
			||||||
    FrameRate = 0x2383E3,
 | 
					    FrameRate = 0x2383E3,
 | 
				
			||||||
    //end video
 | 
					    /* end video */
 | 
				
			||||||
    //audio
 | 
					    /* audio */
 | 
				
			||||||
    Audio = 0xE1,
 | 
					    Audio = 0xE1,
 | 
				
			||||||
    SamplingFrequency = 0xB5,
 | 
					    SamplingFrequency = 0xB5,
 | 
				
			||||||
    OutputSamplingFrequency = 0x78B5,
 | 
					    OutputSamplingFrequency = 0x78B5,
 | 
				
			||||||
    Channels = 0x9F,
 | 
					    Channels = 0x9F,
 | 
				
			||||||
//  ChannelPositions = 0x7D7B,
 | 
					/* ChannelPositions = 0x7D7B, */
 | 
				
			||||||
    BitDepth = 0x6264,
 | 
					    BitDepth = 0x6264,
 | 
				
			||||||
    //end audio
 | 
					    /* end audio */
 | 
				
			||||||
    //content encoding
 | 
					    /* content encoding */
 | 
				
			||||||
//  ContentEncodings = 0x6d80,
 | 
					/* ContentEncodings = 0x6d80, */
 | 
				
			||||||
//  ContentEncoding = 0x6240,
 | 
					/* ContentEncoding = 0x6240, */
 | 
				
			||||||
//  ContentEncodingOrder = 0x5031,
 | 
					/* ContentEncodingOrder = 0x5031, */
 | 
				
			||||||
//  ContentEncodingScope = 0x5032,
 | 
					/* ContentEncodingScope = 0x5032, */
 | 
				
			||||||
//  ContentEncodingType = 0x5033,
 | 
					/* ContentEncodingType = 0x5033, */
 | 
				
			||||||
//  ContentCompression = 0x5034,
 | 
					/* ContentCompression = 0x5034, */
 | 
				
			||||||
//  ContentCompAlgo = 0x4254,
 | 
					/* ContentCompAlgo = 0x4254, */
 | 
				
			||||||
//  ContentCompSettings = 0x4255,
 | 
					/* ContentCompSettings = 0x4255, */
 | 
				
			||||||
//  ContentEncryption = 0x5035,
 | 
					/* ContentEncryption = 0x5035, */
 | 
				
			||||||
//  ContentEncAlgo = 0x47e1,
 | 
					/* ContentEncAlgo = 0x47e1, */
 | 
				
			||||||
//  ContentEncKeyID = 0x47e2,
 | 
					/* ContentEncKeyID = 0x47e2, */
 | 
				
			||||||
//  ContentSignature = 0x47e3,
 | 
					/* ContentSignature = 0x47e3, */
 | 
				
			||||||
//  ContentSigKeyID = 0x47e4,
 | 
					/* ContentSigKeyID = 0x47e4, */
 | 
				
			||||||
//  ContentSigAlgo = 0x47e5,
 | 
					/* ContentSigAlgo = 0x47e5, */
 | 
				
			||||||
//  ContentSigHashAlgo = 0x47e6,
 | 
					/* ContentSigHashAlgo = 0x47e6, */
 | 
				
			||||||
    //end content encoding
 | 
					    /* end content encoding */
 | 
				
			||||||
    //Cueing Data
 | 
					    /* Cueing Data */
 | 
				
			||||||
    Cues = 0x1C53BB6B,
 | 
					    Cues = 0x1C53BB6B,
 | 
				
			||||||
    CuePoint = 0xBB,
 | 
					    CuePoint = 0xBB,
 | 
				
			||||||
    CueTime = 0xB3,
 | 
					    CueTime = 0xB3,
 | 
				
			||||||
    CueTrackPositions = 0xB7,
 | 
					    CueTrackPositions = 0xB7,
 | 
				
			||||||
    CueTrack = 0xF7,
 | 
					    CueTrack = 0xF7,
 | 
				
			||||||
    CueClusterPosition = 0xF1,
 | 
					    CueClusterPosition = 0xF1,
 | 
				
			||||||
    CueBlockNumber = 0x5378,
 | 
					    CueBlockNumber = 0x5378
 | 
				
			||||||
//  CueCodecState = 0xEA,
 | 
					/* CueCodecState = 0xEA, */
 | 
				
			||||||
//  CueReference = 0xDB,
 | 
					/* CueReference = 0xDB, */
 | 
				
			||||||
//  CueRefTime = 0x96,
 | 
					/* CueRefTime = 0x96, */
 | 
				
			||||||
//  CueRefCluster = 0x97,
 | 
					/* CueRefCluster = 0x97, */
 | 
				
			||||||
//  CueRefNumber = 0x535F,
 | 
					/* CueRefNumber = 0x535F, */
 | 
				
			||||||
//  CueRefCodecState = 0xEB,
 | 
					/* CueRefCodecState = 0xEB, */
 | 
				
			||||||
    //Attachment
 | 
					    /* Attachment */
 | 
				
			||||||
//  Attachments = 0x1941A469,
 | 
					/* Attachments = 0x1941A469, */
 | 
				
			||||||
//  AttachedFile = 0x61A7,
 | 
					/* AttachedFile = 0x61A7, */
 | 
				
			||||||
//  FileDescription = 0x467E,
 | 
					/* FileDescription = 0x467E, */
 | 
				
			||||||
//  FileName = 0x466E,
 | 
					/* FileName = 0x466E, */
 | 
				
			||||||
//  FileMimeType = 0x4660,
 | 
					/* FileMimeType = 0x4660, */
 | 
				
			||||||
//  FileData = 0x465C,
 | 
					/* FileData = 0x465C, */
 | 
				
			||||||
//  FileUID = 0x46AE,
 | 
					/* FileUID = 0x46AE, */
 | 
				
			||||||
//  FileReferral = 0x4675,
 | 
					/* FileReferral = 0x4675, */
 | 
				
			||||||
    //Chapters
 | 
					    /* Chapters */
 | 
				
			||||||
//  Chapters = 0x1043A770,
 | 
					/* Chapters = 0x1043A770, */
 | 
				
			||||||
//  EditionEntry = 0x45B9,
 | 
					/* EditionEntry = 0x45B9, */
 | 
				
			||||||
//  EditionUID = 0x45BC,
 | 
					/* EditionUID = 0x45BC, */
 | 
				
			||||||
//  EditionFlagHidden = 0x45BD,
 | 
					/* EditionFlagHidden = 0x45BD, */
 | 
				
			||||||
//  EditionFlagDefault = 0x45DB,
 | 
					/* EditionFlagDefault = 0x45DB, */
 | 
				
			||||||
//  EditionFlagOrdered = 0x45DD,
 | 
					/* EditionFlagOrdered = 0x45DD, */
 | 
				
			||||||
//  ChapterAtom = 0xB6,
 | 
					/* ChapterAtom = 0xB6, */
 | 
				
			||||||
//  ChapterUID = 0x73C4,
 | 
					/* ChapterUID = 0x73C4, */
 | 
				
			||||||
//  ChapterTimeStart = 0x91,
 | 
					/* ChapterTimeStart = 0x91, */
 | 
				
			||||||
//  ChapterTimeEnd = 0x92,
 | 
					/* ChapterTimeEnd = 0x92, */
 | 
				
			||||||
//  ChapterFlagHidden = 0x98,
 | 
					/* ChapterFlagHidden = 0x98, */
 | 
				
			||||||
//  ChapterFlagEnabled = 0x4598,
 | 
					/* ChapterFlagEnabled = 0x4598, */
 | 
				
			||||||
//  ChapterSegmentUID = 0x6E67,
 | 
					/* ChapterSegmentUID = 0x6E67, */
 | 
				
			||||||
//  ChapterSegmentEditionUID = 0x6EBC,
 | 
					/* ChapterSegmentEditionUID = 0x6EBC, */
 | 
				
			||||||
//  ChapterPhysicalEquiv = 0x63C3,
 | 
					/* ChapterPhysicalEquiv = 0x63C3, */
 | 
				
			||||||
//  ChapterTrack = 0x8F,
 | 
					/* ChapterTrack = 0x8F, */
 | 
				
			||||||
//  ChapterTrackNumber = 0x89,
 | 
					/* ChapterTrackNumber = 0x89, */
 | 
				
			||||||
//  ChapterDisplay = 0x80,
 | 
					/* ChapterDisplay = 0x80, */
 | 
				
			||||||
//  ChapString = 0x85,
 | 
					/* ChapString = 0x85, */
 | 
				
			||||||
//  ChapLanguage = 0x437C,
 | 
					/* ChapLanguage = 0x437C, */
 | 
				
			||||||
//  ChapCountry = 0x437E,
 | 
					/* ChapCountry = 0x437E, */
 | 
				
			||||||
//  ChapProcess = 0x6944,
 | 
					/* ChapProcess = 0x6944, */
 | 
				
			||||||
//  ChapProcessCodecID = 0x6955,
 | 
					/* ChapProcessCodecID = 0x6955, */
 | 
				
			||||||
//  ChapProcessPrivate = 0x450D,
 | 
					/* ChapProcessPrivate = 0x450D, */
 | 
				
			||||||
//  ChapProcessCommand = 0x6911,
 | 
					/* ChapProcessCommand = 0x6911, */
 | 
				
			||||||
//  ChapProcessTime = 0x6922,
 | 
					/* ChapProcessTime = 0x6922, */
 | 
				
			||||||
//  ChapProcessData = 0x6933,
 | 
					/* ChapProcessData = 0x6933, */
 | 
				
			||||||
    //Tagging
 | 
					    /* Tagging */
 | 
				
			||||||
//  Tags = 0x1254C367,
 | 
					/* Tags = 0x1254C367, */
 | 
				
			||||||
//  Tag = 0x7373,
 | 
					/* Tag = 0x7373, */
 | 
				
			||||||
//  Targets = 0x63C0,
 | 
					/* Targets = 0x63C0, */
 | 
				
			||||||
//  TargetTypeValue = 0x68CA,
 | 
					/* TargetTypeValue = 0x68CA, */
 | 
				
			||||||
//  TargetType = 0x63CA,
 | 
					/* TargetType = 0x63CA, */
 | 
				
			||||||
//  Tagging_TrackUID = 0x63C5,
 | 
					/* Tagging_TrackUID = 0x63C5, */
 | 
				
			||||||
//  Tagging_EditionUID = 0x63C9,
 | 
					/* Tagging_EditionUID = 0x63C9, */
 | 
				
			||||||
//  Tagging_ChapterUID = 0x63C4,
 | 
					/* Tagging_ChapterUID = 0x63C4, */
 | 
				
			||||||
//  AttachmentUID = 0x63C6,
 | 
					/* AttachmentUID = 0x63C6, */
 | 
				
			||||||
//  SimpleTag = 0x67C8,
 | 
					/* SimpleTag = 0x67C8, */
 | 
				
			||||||
//  TagName = 0x45A3,
 | 
					/* TagName = 0x45A3, */
 | 
				
			||||||
//  TagLanguage = 0x447A,
 | 
					/* TagLanguage = 0x447A, */
 | 
				
			||||||
//  TagDefault = 0x4484,
 | 
					/* TagDefault = 0x4484, */
 | 
				
			||||||
//  TagString = 0x4487,
 | 
					/* TagString = 0x4487, */
 | 
				
			||||||
//  TagBinary = 0x4485,
 | 
					/* TagBinary = 0x4485, */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,12 @@
 | 
				
			|||||||
// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
 | 
					/*
 | 
				
			||||||
//
 | 
					 *  Copyright (c) 2010 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
 | 
					 *  Use of this source code is governed by a BSD-style license
 | 
				
			||||||
// tree. An additional intellectual property rights grant can be found
 | 
					 *  that can be found in the LICENSE file in the root of the source
 | 
				
			||||||
// in the file PATENTS.  All contributing project authors may
 | 
					 *  tree. An additional intellectual property rights grant can be found
 | 
				
			||||||
// be found in the AUTHORS file in the root of the source tree.
 | 
					 *  in the file PATENTS.  All contributing project authors may
 | 
				
			||||||
 | 
					 *  be found in the AUTHORS file in the root of the source tree.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
#include "EbmlWriter.h"
 | 
					#include "EbmlWriter.h"
 | 
				
			||||||
#include <stdlib.h>
 | 
					#include <stdlib.h>
 | 
				
			||||||
#include <wchar.h>
 | 
					#include <wchar.h>
 | 
				
			||||||
@@ -18,11 +18,13 @@
 | 
				
			|||||||
#define LITERALU64(n) n##LLU
 | 
					#define LITERALU64(n) n##LLU
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Ebml_WriteLen(EbmlGlobal *glob, long long val)
 | 
					void Ebml_WriteLen(EbmlGlobal *glob, int64_t val)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    //TODO check and make sure we are not > than 0x0100000000000000LLU
 | 
					    /* TODO check and make sure we are not > than 0x0100000000000000LLU */
 | 
				
			||||||
    unsigned char size = 8; //size in bytes to output
 | 
					    unsigned char size = 8; /* size in bytes to output */
 | 
				
			||||||
    unsigned long long minVal = LITERALU64(0x00000000000000ff); //mask to compare for byte size
 | 
					
 | 
				
			||||||
 | 
					    /* mask to compare for byte size */
 | 
				
			||||||
 | 
					    int64_t minVal = 0xff;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (size = 1; size < 8; size ++)
 | 
					    for (size = 1; size < 8; size ++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -32,7 +34,7 @@ void Ebml_WriteLen(EbmlGlobal *glob, long long val)
 | 
				
			|||||||
        minVal = (minVal << 7);
 | 
					        minVal = (minVal << 7);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    val |= (LITERALU64(0x000000000000080) << ((size - 1) * 7));
 | 
					    val |= (((uint64_t)0x80) << ((size - 1) * 7));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Ebml_Serialize(glob, (void *) &val, sizeof(val), size);
 | 
					    Ebml_Serialize(glob, (void *) &val, sizeof(val), size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -40,23 +42,25 @@ void Ebml_WriteLen(EbmlGlobal *glob, long long val)
 | 
				
			|||||||
void Ebml_WriteString(EbmlGlobal *glob, const char *str)
 | 
					void Ebml_WriteString(EbmlGlobal *glob, const char *str)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const size_t size_ = strlen(str);
 | 
					    const size_t size_ = strlen(str);
 | 
				
			||||||
    const unsigned long long  size = size_;
 | 
					    const uint64_t  size = size_;
 | 
				
			||||||
    Ebml_WriteLen(glob, size);
 | 
					    Ebml_WriteLen(glob, size);
 | 
				
			||||||
    //TODO: it's not clear from the spec whether the nul terminator
 | 
					    /* TODO: it's not clear from the spec whether the nul terminator
 | 
				
			||||||
    //should be serialized too.  For now we omit the null terminator.
 | 
					     * should be serialized too.  For now we omit the null terminator.
 | 
				
			||||||
    Ebml_Write(glob, str, size);
 | 
					     */
 | 
				
			||||||
 | 
					    Ebml_Write(glob, str, (unsigned long)size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr)
 | 
					void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    const size_t strlen = wcslen(wstr);
 | 
					    const size_t strlen = wcslen(wstr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    //TODO: it's not clear from the spec whether the nul terminator
 | 
					    /* TODO: it's not clear from the spec whether the nul terminator
 | 
				
			||||||
    //should be serialized too.  For now we include it.
 | 
					     * should be serialized too.  For now we include it.
 | 
				
			||||||
    const unsigned long long  size = strlen;
 | 
					     */
 | 
				
			||||||
 | 
					    const uint64_t  size = strlen;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Ebml_WriteLen(glob, size);
 | 
					    Ebml_WriteLen(glob, size);
 | 
				
			||||||
    Ebml_Write(glob, wstr, size);
 | 
					    Ebml_Write(glob, wstr, (unsigned long)size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id)
 | 
					void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id)
 | 
				
			||||||
@@ -85,12 +89,12 @@ void Ebml_SerializeUnsigned64(EbmlGlobal *glob, unsigned long class_id, uint64_t
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned long ui)
 | 
					void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned long ui)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    unsigned char size = 8; //size in bytes to output
 | 
					    unsigned char size = 8; /* size in bytes to output */
 | 
				
			||||||
    unsigned char sizeSerialized = 0;
 | 
					    unsigned char sizeSerialized = 0;
 | 
				
			||||||
    unsigned long minVal;
 | 
					    unsigned long minVal;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Ebml_WriteID(glob, class_id);
 | 
					    Ebml_WriteID(glob, class_id);
 | 
				
			||||||
    minVal = 0x7fLU; //mask to compare for byte size
 | 
					    minVal = 0x7fLU; /* mask to compare for byte size */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (size = 1; size < 4; size ++)
 | 
					    for (size = 1; size < 4; size ++)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@@ -106,7 +110,7 @@ void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned l
 | 
				
			|||||||
    Ebml_Serialize(glob, &sizeSerialized, sizeof(sizeSerialized), 1);
 | 
					    Ebml_Serialize(glob, &sizeSerialized, sizeof(sizeSerialized), 1);
 | 
				
			||||||
    Ebml_Serialize(glob, &ui, sizeof(ui), size);
 | 
					    Ebml_Serialize(glob, &ui, sizeof(ui), size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
//TODO: perhaps this is a poor name for this id serializer helper function
 | 
					/* TODO: perhaps this is a poor name for this id serializer helper function */
 | 
				
			||||||
void Ebml_SerializeBinary(EbmlGlobal *glob, unsigned long class_id, unsigned long bin)
 | 
					void Ebml_SerializeBinary(EbmlGlobal *glob, unsigned long class_id, unsigned long bin)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int size;
 | 
					    int size;
 | 
				
			||||||
@@ -168,4 +172,4 @@ void Ebml_WriteVoid(EbmlGlobal *glob, unsigned long vSize)
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//TODO Serialize Date
 | 
					/* TODO Serialize Date */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,26 +1,30 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2010 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 EBMLWRITER_HPP
 | 
					#ifndef EBMLWRITER_HPP
 | 
				
			||||||
#define EBMLWRITER_HPP
 | 
					#define EBMLWRITER_HPP
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Copyright (c) 2010 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.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//note: you must define write and serialize functions as well as your own EBML_GLOBAL
 | 
					 | 
				
			||||||
//These functions MUST be implemented
 | 
					 | 
				
			||||||
#include <stddef.h>
 | 
					#include <stddef.h>
 | 
				
			||||||
#include "vpx/vpx_integer.h"
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* note: you must define write and serialize functions as well as your own
 | 
				
			||||||
 | 
					 * EBML_GLOBAL
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * These functions MUST be implemented
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct EbmlGlobal EbmlGlobal;
 | 
					typedef struct EbmlGlobal EbmlGlobal;
 | 
				
			||||||
void  Ebml_Serialize(EbmlGlobal *glob, const void *, int, unsigned long);
 | 
					void  Ebml_Serialize(EbmlGlobal *glob, const void *, int, unsigned long);
 | 
				
			||||||
void  Ebml_Write(EbmlGlobal *glob, const void *, unsigned long);
 | 
					void  Ebml_Write(EbmlGlobal *glob, const void *, unsigned long);
 | 
				
			||||||
/////
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*****/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Ebml_WriteLen(EbmlGlobal *glob, long long val);
 | 
					void Ebml_WriteLen(EbmlGlobal *glob, int64_t val);
 | 
				
			||||||
void Ebml_WriteString(EbmlGlobal *glob, const char *str);
 | 
					void Ebml_WriteString(EbmlGlobal *glob, const char *str);
 | 
				
			||||||
void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr);
 | 
					void Ebml_WriteUTF8(EbmlGlobal *glob, const wchar_t *wstr);
 | 
				
			||||||
void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id);
 | 
					void Ebml_WriteID(EbmlGlobal *glob, unsigned long class_id);
 | 
				
			||||||
@@ -28,11 +32,11 @@ void Ebml_SerializeUnsigned64(EbmlGlobal *glob, unsigned long class_id, uint64_t
 | 
				
			|||||||
void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned long ui);
 | 
					void Ebml_SerializeUnsigned(EbmlGlobal *glob, unsigned long class_id, unsigned long ui);
 | 
				
			||||||
void Ebml_SerializeBinary(EbmlGlobal *glob, unsigned long class_id, unsigned long ui);
 | 
					void Ebml_SerializeBinary(EbmlGlobal *glob, unsigned long class_id, unsigned long ui);
 | 
				
			||||||
void Ebml_SerializeFloat(EbmlGlobal *glob, unsigned long class_id, double d);
 | 
					void Ebml_SerializeFloat(EbmlGlobal *glob, unsigned long class_id, double d);
 | 
				
			||||||
//TODO make this more generic to signed
 | 
					/* TODO make this more generic to signed */
 | 
				
			||||||
void Ebml_WriteSigned16(EbmlGlobal *glob, short val);
 | 
					void Ebml_WriteSigned16(EbmlGlobal *glob, short val);
 | 
				
			||||||
void Ebml_SerializeString(EbmlGlobal *glob, unsigned long class_id, const char *s);
 | 
					void Ebml_SerializeString(EbmlGlobal *glob, unsigned long class_id, const char *s);
 | 
				
			||||||
void Ebml_SerializeUTF8(EbmlGlobal *glob, unsigned long class_id, wchar_t *s);
 | 
					void Ebml_SerializeUTF8(EbmlGlobal *glob, unsigned long class_id, wchar_t *s);
 | 
				
			||||||
void Ebml_SerializeData(EbmlGlobal *glob, unsigned long class_id, unsigned char *data, unsigned long data_length);
 | 
					void Ebml_SerializeData(EbmlGlobal *glob, unsigned long class_id, unsigned char *data, unsigned long data_length);
 | 
				
			||||||
void Ebml_WriteVoid(EbmlGlobal *glob, unsigned long vSize);
 | 
					void Ebml_WriteVoid(EbmlGlobal *glob, unsigned long vSize);
 | 
				
			||||||
//TODO need date function
 | 
					/* TODO need date function */
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										171
									
								
								libs.mk
									
									
									
									
									
								
							
							
						
						
									
										171
									
								
								libs.mk
									
									
									
									
									
								
							@@ -17,10 +17,19 @@ else
 | 
				
			|||||||
  ASM:=.asm
 | 
					  ASM:=.asm
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CODEC_SRCS-yes += CHANGELOG
 | 
				
			||||||
CODEC_SRCS-yes += libs.mk
 | 
					CODEC_SRCS-yes += libs.mk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# If this is a universal (fat) binary, then all the subarchitectures have
 | 
				
			||||||
 | 
					# already been built and our job is to stitch them together. The
 | 
				
			||||||
 | 
					# BUILD_LIBVPX variable indicates whether we should be building
 | 
				
			||||||
 | 
					# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
 | 
				
			||||||
 | 
					# that we're stitching.
 | 
				
			||||||
 | 
					$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
 | 
					include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
 | 
				
			||||||
CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
 | 
					CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
 | 
				
			||||||
 | 
					CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
 | 
					include $(SRC_PATH_BARE)/vpx_mem/vpx_mem.mk
 | 
				
			||||||
CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
 | 
					CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
 | 
				
			||||||
@@ -28,17 +37,17 @@ CODEC_SRCS-yes += $(addprefix vpx_mem/,$(call enabled,MEM_SRCS))
 | 
				
			|||||||
include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
 | 
					include $(SRC_PATH_BARE)/vpx_scale/vpx_scale.mk
 | 
				
			||||||
CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
 | 
					CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
 | 
				
			||||||
 | 
					CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(CONFIG_VP8_ENCODER),yes)
 | 
					ifeq ($(CONFIG_VP8_ENCODER),yes)
 | 
				
			||||||
  VP8_PREFIX=vp8/
 | 
					  VP8_PREFIX=vp8/
 | 
				
			||||||
  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
 | 
					  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8cx.mk
 | 
				
			||||||
  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
 | 
					  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_CX_SRCS))
 | 
				
			||||||
  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
 | 
					  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_CX_EXPORTS))
 | 
				
			||||||
  CODEC_SRCS-yes += $(VP8_PREFIX)vp8cx.mk vpx/vp8.h vpx/vp8cx.h vpx/vp8e.h
 | 
					  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
 | 
				
			||||||
  CODEC_SRCS-$(ARCH_ARM) += $(VP8_PREFIX)vp8cx_arm.mk
 | 
					 | 
				
			||||||
  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8e.h include/vpx/vp8cx.h
 | 
					 | 
				
			||||||
  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
 | 
					  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
 | 
				
			||||||
  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
 | 
					 | 
				
			||||||
  CODEC_DOC_SECTIONS += vp8 vp8_encoder
 | 
					  CODEC_DOC_SECTIONS += vp8 vp8_encoder
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -47,10 +56,8 @@ ifeq ($(CONFIG_VP8_DECODER),yes)
 | 
				
			|||||||
  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk
 | 
					  include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8dx.mk
 | 
				
			||||||
  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS))
 | 
					  CODEC_SRCS-yes += $(addprefix $(VP8_PREFIX),$(call enabled,VP8_DX_SRCS))
 | 
				
			||||||
  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS))
 | 
					  CODEC_EXPORTS-yes += $(addprefix $(VP8_PREFIX),$(VP8_DX_EXPORTS))
 | 
				
			||||||
  CODEC_SRCS-yes += $(VP8_PREFIX)vp8dx.mk vpx/vp8.h vpx/vp8dx.h
 | 
					 | 
				
			||||||
  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
 | 
					  INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8dx.h
 | 
				
			||||||
  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
 | 
					  INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP8_PREFIX)/%
 | 
				
			||||||
  CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8dx.h
 | 
					 | 
				
			||||||
  CODEC_DOC_SECTIONS += vp8 vp8_decoder
 | 
					  CODEC_DOC_SECTIONS += vp8 vp8_decoder
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -65,6 +72,7 @@ endif
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
ifeq ($(CONFIG_MSVS),yes)
 | 
					ifeq ($(CONFIG_MSVS),yes)
 | 
				
			||||||
CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
 | 
					CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
 | 
				
			||||||
 | 
					GTEST_LIB=$(if $(CONFIG_STATIC_MSVCRT),gtestmt,gtestmd)
 | 
				
			||||||
# This variable uses deferred expansion intentionally, since the results of
 | 
					# This variable uses deferred expansion intentionally, since the results of
 | 
				
			||||||
# $(wildcard) may change during the course of the Make.
 | 
					# $(wildcard) may change during the course of the Make.
 | 
				
			||||||
VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
 | 
					VS_PLATFORMS = $(foreach d,$(wildcard */Release/$(CODEC_LIB).lib),$(word 1,$(subst /, ,$(d))))
 | 
				
			||||||
@@ -81,29 +89,10 @@ INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Release/%)
 | 
				
			|||||||
INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Debug/%)
 | 
					INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/%  $(p)/Debug/%)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# If this is a universal (fat) binary, then all the subarchitectures have
 | 
					 | 
				
			||||||
# already been built and our job is to stitch them together. The
 | 
					 | 
				
			||||||
# BUILD_LIBVPX variable indicates whether we should be building
 | 
					 | 
				
			||||||
# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
 | 
					 | 
				
			||||||
# that we're stitching.
 | 
					 | 
				
			||||||
$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
 | 
					CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
 | 
					CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx/vpx_integer.h
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/asm_offsets.h
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_timer.h
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem.h
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
 | 
					CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
 | 
				
			||||||
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
 | 
					INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
 | 
				
			||||||
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emms.asm
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86.h
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_abi_support.asm
 | 
					 | 
				
			||||||
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/x86_cpuid.c
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm_cpudetect.c
 | 
					 | 
				
			||||||
CODEC_SRCS-$(ARCH_ARM) += vpx_ports/arm.h
 | 
					 | 
				
			||||||
CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
 | 
					CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
 | 
				
			||||||
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
 | 
					CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
 | 
				
			||||||
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
 | 
					CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
 | 
				
			||||||
@@ -114,7 +103,6 @@ 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_top.h
 | 
				
			||||||
INSTALL-LIBS-yes += include/vpx/vpx_codec_impl_bottom.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_DECODERS) += include/vpx/vpx_decoder_compat.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)
 | 
				
			||||||
ifeq ($(CONFIG_MSVS),yes)
 | 
					ifeq ($(CONFIG_MSVS),yes)
 | 
				
			||||||
@@ -146,7 +134,7 @@ ifeq ($(CONFIG_MSVS),yes)
 | 
				
			|||||||
obj_int_extract.vcproj: $(SRC_PATH_BARE)/build/make/obj_int_extract.c
 | 
					obj_int_extract.vcproj: $(SRC_PATH_BARE)/build/make/obj_int_extract.c
 | 
				
			||||||
	@cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat .
 | 
						@cp $(SRC_PATH_BARE)/build/x86-msvs/obj_int_extract.bat .
 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
				
			||||||
    --exe \
 | 
					    --exe \
 | 
				
			||||||
    --target=$(TOOLCHAIN) \
 | 
					    --target=$(TOOLCHAIN) \
 | 
				
			||||||
    --name=obj_int_extract \
 | 
					    --name=obj_int_extract \
 | 
				
			||||||
@@ -162,14 +150,14 @@ PROJECTS-$(BUILD_LIBVPX) += obj_int_extract.bat
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
vpx.def: $(call enabled,CODEC_EXPORTS)
 | 
					vpx.def: $(call enabled,CODEC_EXPORTS)
 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_def.sh\
 | 
				
			||||||
            --name=vpx\
 | 
					            --name=vpx\
 | 
				
			||||||
            --out=$@ $^
 | 
					            --out=$@ $^
 | 
				
			||||||
CLEAN-OBJS += vpx.def
 | 
					CLEAN-OBJS += vpx.def
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vpx.vcproj: $(CODEC_SRCS) vpx.def
 | 
					vpx.vcproj: $(CODEC_SRCS) vpx.def
 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
				
			||||||
			--lib \
 | 
								--lib \
 | 
				
			||||||
			--target=$(TOOLCHAIN) \
 | 
								--target=$(TOOLCHAIN) \
 | 
				
			||||||
            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
					            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
				
			||||||
@@ -233,7 +221,7 @@ vpx.pc: config.mk libs.mk
 | 
				
			|||||||
	$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
 | 
						$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
 | 
				
			||||||
	$(qexec)echo 'prefix=$(PREFIX)' >> $@
 | 
						$(qexec)echo 'prefix=$(PREFIX)' >> $@
 | 
				
			||||||
	$(qexec)echo 'exec_prefix=$${prefix}' >> $@
 | 
						$(qexec)echo 'exec_prefix=$${prefix}' >> $@
 | 
				
			||||||
	$(qexec)echo 'libdir=$${prefix}/lib' >> $@
 | 
						$(qexec)echo 'libdir=$${prefix}/$(LIBSUBDIR)' >> $@
 | 
				
			||||||
	$(qexec)echo 'includedir=$${prefix}/include' >> $@
 | 
						$(qexec)echo 'includedir=$${prefix}/include' >> $@
 | 
				
			||||||
	$(qexec)echo '' >> $@
 | 
						$(qexec)echo '' >> $@
 | 
				
			||||||
	$(qexec)echo 'Name: vpx' >> $@
 | 
						$(qexec)echo 'Name: vpx' >> $@
 | 
				
			||||||
@@ -242,6 +230,7 @@ vpx.pc: config.mk libs.mk
 | 
				
			|||||||
	$(qexec)echo 'Requires:' >> $@
 | 
						$(qexec)echo 'Requires:' >> $@
 | 
				
			||||||
	$(qexec)echo 'Conflicts:' >> $@
 | 
						$(qexec)echo 'Conflicts:' >> $@
 | 
				
			||||||
	$(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
 | 
						$(qexec)echo 'Libs: -L$${libdir} -lvpx' >> $@
 | 
				
			||||||
 | 
						$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
 | 
				
			||||||
	$(qexec)echo 'Cflags: -I$${includedir}' >> $@
 | 
						$(qexec)echo 'Cflags: -I$${includedir}' >> $@
 | 
				
			||||||
INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
 | 
					INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
 | 
				
			||||||
INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
 | 
					INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
 | 
				
			||||||
@@ -280,40 +269,48 @@ $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
 | 
				
			|||||||
# Calculate platform- and compiler-specific offsets for hand coded assembly
 | 
					# Calculate platform- and compiler-specific offsets for hand coded assembly
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					OFFSET_PATTERN:='^[a-zA-Z0-9_]* EQU'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC))
 | 
					ifeq ($(filter icc gcc,$(TGT_CC)), $(TGT_CC))
 | 
				
			||||||
    $(BUILD_PFX)asm_com_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
 | 
					    $(BUILD_PFX)asm_com_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
 | 
				
			||||||
	grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
				
			||||||
    $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S: $(VP8_PREFIX)common/asm_com_offsets.c
 | 
					    $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S: $(VP8_PREFIX)common/asm_com_offsets.c
 | 
				
			||||||
    CLEAN-OBJS += $(BUILD_PFX)asm_com_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
 | 
					    CLEAN-OBJS += $(BUILD_PFX)asm_com_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)common/asm_com_offsets.c.S
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(BUILD_PFX)asm_enc_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
 | 
					    $(BUILD_PFX)asm_enc_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
 | 
				
			||||||
	grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
				
			||||||
    $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S: $(VP8_PREFIX)encoder/asm_enc_offsets.c
 | 
					    $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S: $(VP8_PREFIX)encoder/asm_enc_offsets.c
 | 
				
			||||||
    CLEAN-OBJS += $(BUILD_PFX)asm_enc_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
 | 
					    CLEAN-OBJS += $(BUILD_PFX)asm_enc_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)encoder/asm_enc_offsets.c.S
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $(BUILD_PFX)asm_dec_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
 | 
					    $(BUILD_PFX)asm_dec_offsets.asm: $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
 | 
				
			||||||
	grep -w EQU $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)LC_ALL=C grep $(OFFSET_PATTERN) $< | tr -d '$$\#' $(ADS2GAS) > $@
 | 
				
			||||||
    $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S: $(VP8_PREFIX)decoder/asm_dec_offsets.c
 | 
					    $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S: $(VP8_PREFIX)decoder/asm_dec_offsets.c
 | 
				
			||||||
    CLEAN-OBJS += $(BUILD_PFX)asm_dec_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
 | 
					    CLEAN-OBJS += $(BUILD_PFX)asm_dec_offsets.asm $(BUILD_PFX)$(VP8_PREFIX)decoder/asm_dec_offsets.c.S
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
  ifeq ($(filter rvct,$(TGT_CC)), $(TGT_CC))
 | 
					  ifeq ($(filter rvct,$(TGT_CC)), $(TGT_CC))
 | 
				
			||||||
    asm_com_offsets.asm: obj_int_extract
 | 
					    asm_com_offsets.asm: obj_int_extract
 | 
				
			||||||
    asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
 | 
					    asm_com_offsets.asm: $(VP8_PREFIX)common/asm_com_offsets.c.o
 | 
				
			||||||
	./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
				
			||||||
    OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
 | 
					    OBJS-yes += $(VP8_PREFIX)common/asm_com_offsets.c.o
 | 
				
			||||||
    CLEAN-OBJS += asm_com_offsets.asm
 | 
					    CLEAN-OBJS += asm_com_offsets.asm
 | 
				
			||||||
    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
 | 
					    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_com_offsets.asm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    asm_enc_offsets.asm: obj_int_extract
 | 
					    asm_enc_offsets.asm: obj_int_extract
 | 
				
			||||||
    asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
 | 
					    asm_enc_offsets.asm: $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
 | 
				
			||||||
	./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
				
			||||||
    OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
 | 
					    OBJS-yes += $(VP8_PREFIX)encoder/asm_enc_offsets.c.o
 | 
				
			||||||
    CLEAN-OBJS += asm_enc_offsets.asm
 | 
					    CLEAN-OBJS += asm_enc_offsets.asm
 | 
				
			||||||
    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
 | 
					    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_enc_offsets.asm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    asm_dec_offsets.asm: obj_int_extract
 | 
					    asm_dec_offsets.asm: obj_int_extract
 | 
				
			||||||
    asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
 | 
					    asm_dec_offsets.asm: $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
 | 
				
			||||||
	./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
 | 
						$(qexec)./obj_int_extract rvds $< $(ADS2GAS) > $@
 | 
				
			||||||
    OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
 | 
					    OBJS-yes += $(VP8_PREFIX)decoder/asm_dec_offsets.c.o
 | 
				
			||||||
    CLEAN-OBJS += asm_dec_offsets.asm
 | 
					    CLEAN-OBJS += asm_dec_offsets.asm
 | 
				
			||||||
    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
 | 
					    $(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)asm_dec_offsets.asm
 | 
				
			||||||
@@ -326,8 +323,7 @@ CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# Rule to generate runtime cpu detection files
 | 
					# Rule to generate runtime cpu detection files
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
$(OBJS-yes:.o=.d): vpx_rtcd.h
 | 
					$(BUILD_PFX)vpx_rtcd.h: $(SRC_PATH_BARE)/$(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
 | 
				
			||||||
vpx_rtcd.h: $(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
 | 
					 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$(TGT_ISA) \
 | 
				
			||||||
          --sym=vpx_rtcd \
 | 
					          --sym=vpx_rtcd \
 | 
				
			||||||
@@ -335,25 +331,43 @@ vpx_rtcd.h: $(sort $(filter %rtcd_defs.sh,$(CODEC_SRCS)))
 | 
				
			|||||||
          $(RTCD_OPTIONS) $^ > $@
 | 
					          $(RTCD_OPTIONS) $^ > $@
 | 
				
			||||||
CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
 | 
					CLEAN-OBJS += $(BUILD_PFX)vpx_rtcd.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CODEC_DOC_SRCS += vpx/vpx_codec.h \
 | 
					 | 
				
			||||||
                  vpx/vpx_decoder.h \
 | 
					 | 
				
			||||||
                  vpx/vpx_encoder.h \
 | 
					 | 
				
			||||||
                  vpx/vpx_image.h
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
## libvpx test directives
 | 
					## libvpx test directives
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
 | 
					 | 
				
			||||||
ifeq ($(CONFIG_UNIT_TESTS),yes)
 | 
					ifeq ($(CONFIG_UNIT_TESTS),yes)
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA_PATH ?= .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					include $(SRC_PATH_BARE)/test/test.mk
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
 | 
				
			||||||
 | 
					LIBVPX_TEST_BINS=./test_libvpx
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
 | 
				
			||||||
 | 
					                     $(call enabled,LIBVPX_TEST_DATA))
 | 
				
			||||||
 | 
					libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$(LIBVPX_TEST_DATA):
 | 
				
			||||||
 | 
						@echo "    [DOWNLOAD] $@"
 | 
				
			||||||
 | 
						$(qexec)trap 'rm -f $@' INT TERM &&\
 | 
				
			||||||
 | 
					            curl -L -o $@ $(call libvpx_test_data_url,$(@F))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					testdata:: $(LIBVPX_TEST_DATA)
 | 
				
			||||||
 | 
						$(qexec)if [ -x "$$(which sha1sum)" ]; then\
 | 
				
			||||||
 | 
					            echo "Checking test data:";\
 | 
				
			||||||
 | 
					            if [ -n "$(LIBVPX_TEST_DATA)" ]; then\
 | 
				
			||||||
 | 
					                for f in $(call enabled,LIBVPX_TEST_DATA); do\
 | 
				
			||||||
 | 
					                    grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
 | 
				
			||||||
 | 
					                        (cd $(LIBVPX_TEST_DATA_PATH); sha1sum -c);\
 | 
				
			||||||
 | 
					                done; \
 | 
				
			||||||
 | 
					            fi; \
 | 
				
			||||||
 | 
					        else\
 | 
				
			||||||
 | 
					            echo "Skipping test data integrity check, sha1sum not found.";\
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
 | 
					ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
 | 
				
			||||||
ifeq ($(CONFIG_MSVS),yes)
 | 
					ifeq ($(CONFIG_MSVS),yes)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIBVPX_TEST_SRCS=$(filter %_test.cc,$(call enabled,CODEC_SRCS))
 | 
					 | 
				
			||||||
LIBVPX_TEST_BINS=$(sort $(LIBVPX_TEST_SRCS:.cc.o=))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
 | 
					gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
				
			||||||
            --lib \
 | 
					            --lib \
 | 
				
			||||||
            --target=$(TOOLCHAIN) \
 | 
					            --target=$(TOOLCHAIN) \
 | 
				
			||||||
            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
					            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
				
			||||||
@@ -366,27 +380,22 @@ gtest.vcproj: $(SRC_PATH_BARE)/third_party/googletest/src/src/gtest-all.cc
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
PROJECTS-$(CONFIG_MSVS) += gtest.vcproj
 | 
					PROJECTS-$(CONFIG_MSVS) += gtest.vcproj
 | 
				
			||||||
 | 
					
 | 
				
			||||||
define unit_test_vcproj_template
 | 
					test_libvpx.vcproj: $(LIBVPX_TEST_SRCS)
 | 
				
			||||||
$(notdir $(1:.cc=.vcproj)): $(SRC_PATH_BARE)/$(1)
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	@echo "    [vcproj] $$@"
 | 
						$(qexec)$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh \
 | 
				
			||||||
	$$(SRC_PATH_BARE)/build/make/gen_msvs_proj.sh\
 | 
					            --exe \
 | 
				
			||||||
            --exe\
 | 
					            --target=$(TOOLCHAIN) \
 | 
				
			||||||
            --target=$$(TOOLCHAIN)\
 | 
					            --name=test_libvpx \
 | 
				
			||||||
            --name=$(notdir $(1:.cc=))\
 | 
					            --proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
 | 
				
			||||||
            --ver=$$(CONFIG_VS_VERSION)\
 | 
					            --ver=$(CONFIG_VS_VERSION) \
 | 
				
			||||||
            $$(if $$(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
					            $(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
 | 
				
			||||||
            --out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
 | 
					            --out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
 | 
				
			||||||
            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
 | 
					            -I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
 | 
				
			||||||
            -L. -lvpxmt -lwinmm -lgtestmt $$^
 | 
					            -L. -l$(CODEC_LIB) -lwinmm -l$(GTEST_LIB) $^
 | 
				
			||||||
endef
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(foreach proj,$(LIBVPX_TEST_BINS),\
 | 
					PROJECTS-$(CONFIG_MSVS) += test_libvpx.vcproj
 | 
				
			||||||
    $(eval $(call unit_test_vcproj_template,$(proj))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
PROJECTS-$(CONFIG_MSVS) += $(foreach proj,$(LIBVPX_TEST_BINS),\
 | 
					test:: testdata
 | 
				
			||||||
     $(notdir $(proj:.cc=.vcproj)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
test::
 | 
					 | 
				
			||||||
	@set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
 | 
						@set -e; for t in $(addprefix Win32/Release/,$(notdir $(LIBVPX_TEST_BINS:.cc=.exe))); do $$t; done
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
@@ -394,28 +403,35 @@ else
 | 
				
			|||||||
include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
 | 
					include $(SRC_PATH_BARE)/third_party/googletest/gtest.mk
 | 
				
			||||||
GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS))
 | 
					GTEST_SRCS := $(addprefix third_party/googletest/src/,$(call enabled,GTEST_SRCS))
 | 
				
			||||||
GTEST_OBJS=$(call objs,$(GTEST_SRCS))
 | 
					GTEST_OBJS=$(call objs,$(GTEST_SRCS))
 | 
				
			||||||
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
 | 
					$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
 | 
				
			||||||
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
 | 
					$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
 | 
				
			||||||
OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
 | 
					OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
 | 
				
			||||||
LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
 | 
					LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
 | 
				
			||||||
$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
 | 
					$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIBVPX_TEST_SRCS=$(filter %_test.cc,$(call enabled,CODEC_SRCS))
 | 
					LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
 | 
				
			||||||
LIBVPX_TEST_OBJS=$(call objs,$(LIBVPX_TEST_SRCS))
 | 
					$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
 | 
				
			||||||
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
 | 
					$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
 | 
				
			||||||
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
 | 
					 | 
				
			||||||
LIBVPX_TEST_BINS=$(sort $(LIBVPX_TEST_OBJS:.cc.o=))
 | 
					 | 
				
			||||||
OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
 | 
					OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
 | 
				
			||||||
 | 
					BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install test sources only if codec source is included
 | 
				
			||||||
 | 
					INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
 | 
				
			||||||
 | 
					    $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
 | 
				
			||||||
 | 
					INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
 | 
				
			||||||
 | 
					CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
 | 
				
			||||||
$(foreach bin,$(LIBVPX_TEST_BINS),\
 | 
					$(foreach bin,$(LIBVPX_TEST_BINS),\
 | 
				
			||||||
    $(if $(BUILD_LIBVPX),$(eval $(bin): libvpx.a libgtest.a ))\
 | 
					    $(if $(BUILD_LIBVPX),$(eval $(bin): \
 | 
				
			||||||
 | 
					        lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\
 | 
				
			||||||
    $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
 | 
					    $(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
 | 
				
			||||||
        $(bin).cc.o \
 | 
					        $(LIBVPX_TEST_OBJS) \
 | 
				
			||||||
        -L. -lvpx -lgtest -lpthread -lm)\
 | 
					        -L. -lvpx -lgtest -lpthread -lm)\
 | 
				
			||||||
        )))\
 | 
					        )))\
 | 
				
			||||||
    $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
 | 
					    $(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test:: $(LIBVPX_TEST_BINS)
 | 
					test:: $(LIBVPX_TEST_BINS) testdata
 | 
				
			||||||
	@set -e; for t in $(LIBVPX_TEST_BINS); do $$t; done
 | 
						@set -e; for t in $(LIBVPX_TEST_BINS); do $$t; done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
@@ -433,3 +449,6 @@ libs.doxy: $(CODEC_DOC_SRCS)
 | 
				
			|||||||
	@echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
 | 
						@echo "PREDEFINED = VPX_CODEC_DISABLE_COMPAT" >> $@
 | 
				
			||||||
	@echo "INCLUDE_PATH += ." >> $@;
 | 
						@echo "INCLUDE_PATH += ." >> $@;
 | 
				
			||||||
	@echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@
 | 
						@echo "ENABLED_SECTIONS += $(sort $(CODEC_DOC_SECTIONS))" >> $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Generate vpx_rtcd.h for all objects
 | 
				
			||||||
 | 
					$(OBJS-yes:.o=.d): $(BUILD_PFX)vpx_rtcd.h
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								mainpage.dox
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								mainpage.dox
									
									
									
									
									
								
							@@ -12,8 +12,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  This distribution of the WebM VP8 Codec SDK includes the following support:
 | 
					  This distribution of the WebM VP8 Codec SDK includes the following support:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \if vp8_encoder    - \ref vp8_encoder   \endif
 | 
					  \if vp8_encoder
 | 
				
			||||||
  \if vp8_decoder    - \ref vp8_decoder   \endif
 | 
					  - \ref vp8_encoder
 | 
				
			||||||
 | 
					  \endif
 | 
				
			||||||
 | 
					  \if vp8_decoder
 | 
				
			||||||
 | 
					  - \ref vp8_decoder
 | 
				
			||||||
 | 
					  \endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \section main_startpoints Starting Points
 | 
					  \section main_startpoints Starting Points
 | 
				
			||||||
@@ -24,8 +28,12 @@
 | 
				
			|||||||
  - Read the \ref samples "sample code" for examples of how to interact with the
 | 
					  - Read the \ref samples "sample code" for examples of how to interact with the
 | 
				
			||||||
    codec.
 | 
					    codec.
 | 
				
			||||||
  - \ref codec reference
 | 
					  - \ref codec reference
 | 
				
			||||||
    \if encoder - \ref encoder reference \endif
 | 
					    \if encoder
 | 
				
			||||||
    \if decoder - \ref decoder reference \endif
 | 
					    - \ref encoder reference
 | 
				
			||||||
 | 
					    \endif
 | 
				
			||||||
 | 
					    \if decoder
 | 
				
			||||||
 | 
					    - \ref decoder reference
 | 
				
			||||||
 | 
					    \endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  \section main_support Support Options & FAQ
 | 
					  \section main_support Support Options & FAQ
 | 
				
			||||||
  The WebM project is an open source project supported by its community. For
 | 
					  The WebM project is an open source project supported by its community. For
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1272,7 +1272,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
 | 
				
			|||||||
  if (total > block_size)
 | 
					  if (total > block_size)
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  entry = ne_find_track_entry(ctx, track - 1);
 | 
					  entry = ne_find_track_entry(ctx, (unsigned int)(track - 1));
 | 
				
			||||||
  if (!entry)
 | 
					  if (!entry)
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1291,7 +1291,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  pkt = ne_alloc(sizeof(*pkt));
 | 
					  pkt = ne_alloc(sizeof(*pkt));
 | 
				
			||||||
  pkt->track = track - 1;
 | 
					  pkt->track = track - 1;
 | 
				
			||||||
  pkt->timecode = abs_timecode * tc_scale * track_scale;
 | 
					  pkt->timecode = (uint64_t)(abs_timecode * tc_scale * track_scale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ctx->log(ctx, NESTEGG_LOG_DEBUG, "%sblock t %lld pts %f f %llx frames: %llu",
 | 
					  ctx->log(ctx, NESTEGG_LOG_DEBUG, "%sblock t %lld pts %f f %llx frames: %llu",
 | 
				
			||||||
           block_id == ID_BLOCK ? "" : "simple", pkt->track, pkt->timecode / 1e9, flags, frames);
 | 
					           block_id == ID_BLOCK ? "" : "simple", pkt->track, pkt->timecode / 1e9, flags, frames);
 | 
				
			||||||
@@ -1774,35 +1774,35 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (ne_get_uint(entry->video.pixel_width, &value) != 0)
 | 
					  if (ne_get_uint(entry->video.pixel_width, &value) != 0)
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
  params->width = value;
 | 
					  params->width = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (ne_get_uint(entry->video.pixel_height, &value) != 0)
 | 
					  if (ne_get_uint(entry->video.pixel_height, &value) != 0)
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
  params->height = value;
 | 
					  params->height = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = 0;
 | 
					  value = 0;
 | 
				
			||||||
  ne_get_uint(entry->video.pixel_crop_bottom, &value);
 | 
					  ne_get_uint(entry->video.pixel_crop_bottom, &value);
 | 
				
			||||||
  params->crop_bottom = value;
 | 
					  params->crop_bottom = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = 0;
 | 
					  value = 0;
 | 
				
			||||||
  ne_get_uint(entry->video.pixel_crop_top, &value);
 | 
					  ne_get_uint(entry->video.pixel_crop_top, &value);
 | 
				
			||||||
  params->crop_top = value;
 | 
					  params->crop_top = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = 0;
 | 
					  value = 0;
 | 
				
			||||||
  ne_get_uint(entry->video.pixel_crop_left, &value);
 | 
					  ne_get_uint(entry->video.pixel_crop_left, &value);
 | 
				
			||||||
  params->crop_left = value;
 | 
					  params->crop_left = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = 0;
 | 
					  value = 0;
 | 
				
			||||||
  ne_get_uint(entry->video.pixel_crop_right, &value);
 | 
					  ne_get_uint(entry->video.pixel_crop_right, &value);
 | 
				
			||||||
  params->crop_right = value;
 | 
					  params->crop_right = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = params->width;
 | 
					  value = params->width;
 | 
				
			||||||
  ne_get_uint(entry->video.display_width, &value);
 | 
					  ne_get_uint(entry->video.display_width, &value);
 | 
				
			||||||
  params->display_width = value;
 | 
					  params->display_width = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = params->height;
 | 
					  value = params->height;
 | 
				
			||||||
  ne_get_uint(entry->video.display_height, &value);
 | 
					  ne_get_uint(entry->video.display_height, &value);
 | 
				
			||||||
  params->display_height = value;
 | 
					  params->display_height = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1828,11 +1828,11 @@ nestegg_track_audio_params(nestegg * ctx, unsigned int track,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  value = 1;
 | 
					  value = 1;
 | 
				
			||||||
  ne_get_uint(entry->audio.channels, &value);
 | 
					  ne_get_uint(entry->audio.channels, &value);
 | 
				
			||||||
  params->channels = value;
 | 
					  params->channels = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  value = 16;
 | 
					  value = 16;
 | 
				
			||||||
  ne_get_uint(entry->audio.bit_depth, &value);
 | 
					  ne_get_uint(entry->audio.bit_depth, &value);
 | 
				
			||||||
  params->depth = value;
 | 
					  params->depth = (unsigned int)value;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1888,7 +1888,7 @@ nestegg_free_packet(nestegg_packet * pkt)
 | 
				
			|||||||
int
 | 
					int
 | 
				
			||||||
nestegg_packet_track(nestegg_packet * pkt, unsigned int * track)
 | 
					nestegg_packet_track(nestegg_packet * pkt, unsigned int * track)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  *track = pkt->track;
 | 
					  *track = (unsigned int)pkt->track;
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								solution.mk
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								solution.mk
									
									
									
									
									
								
							@@ -8,18 +8,19 @@
 | 
				
			|||||||
##  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.
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# libvpx reverse dependencies (targets that depend on libvpx)
 | 
				
			||||||
 | 
					VPX_NONDEPS=$(addsuffix .vcproj,vpx gtest obj_int_extract)
 | 
				
			||||||
 | 
					VPX_RDEPS=$(foreach vcp,\
 | 
				
			||||||
 | 
					              $(filter-out $(VPX_NONDEPS),$^), --dep=$(vcp:.vcproj=):vpx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vpx.sln: $(wildcard *.vcproj)
 | 
					vpx.sln: $(wildcard *.vcproj)
 | 
				
			||||||
	@echo "    [CREATE] $@"
 | 
						@echo "    [CREATE] $@"
 | 
				
			||||||
	$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
 | 
						$(SRC_PATH_BARE)/build/make/gen_msvs_sln.sh \
 | 
				
			||||||
            $(if $(filter %vpx.vcproj,$^),\
 | 
					            $(if $(filter vpx.vcproj,$^),$(VPX_RDEPS)) \
 | 
				
			||||||
                $(foreach vcp,$(filter-out %vpx.vcproj %gtest.vcproj %obj_int_extract.vcproj,$^),\
 | 
					            --dep=vpx:obj_int_extract \
 | 
				
			||||||
                  --dep=$(vcp:.vcproj=):vpx) \
 | 
					            --dep=test_libvpx:gtest \
 | 
				
			||||||
                $(foreach vcp,$(filter %_test.vcproj,$^),\
 | 
					            --ver=$(CONFIG_VS_VERSION)\
 | 
				
			||||||
                  --dep=$(vcp:.vcproj=):gtest)) \
 | 
					            --out=$@ $^
 | 
				
			||||||
                  --dep=vpx:obj_int_extract \
 | 
					 | 
				
			||||||
                  --ver=$(CONFIG_VS_VERSION)\
 | 
					 | 
				
			||||||
                  --out=$@ $^
 | 
					 | 
				
			||||||
vpx.sln.mk: vpx.sln
 | 
					vpx.sln.mk: vpx.sln
 | 
				
			||||||
	@true
 | 
						@true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										53
									
								
								test/acm_random.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								test/acm_random.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 LIBVPX_TEST_ACM_RANDOM_H_
 | 
				
			||||||
 | 
					#define LIBVPX_TEST_ACM_RANDOM_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ACMRandom {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  ACMRandom() {
 | 
				
			||||||
 | 
					    Reset(DeterministicSeed());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  explicit ACMRandom(int seed) {
 | 
				
			||||||
 | 
					    Reset(seed);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void Reset(int seed) {
 | 
				
			||||||
 | 
					    srand(seed);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  uint8_t Rand8(void) {
 | 
				
			||||||
 | 
					    return (rand() >> 8) & 0xff;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int PseudoUniform(int range) {
 | 
				
			||||||
 | 
					    return (rand() >> 8) % range;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int operator()(int n) {
 | 
				
			||||||
 | 
					    return PseudoUniform(n);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static int DeterministicSeed(void) {
 | 
				
			||||||
 | 
					    return 0xbaba;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // LIBVPX_TEST_ACM_RANDOM_H_
 | 
				
			||||||
							
								
								
									
										71
									
								
								test/altref_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								test/altref_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/i420_video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// lookahead range: [kLookAheadMin, kLookAheadMax).
 | 
				
			||||||
 | 
					const int kLookAheadMin = 5;
 | 
				
			||||||
 | 
					const int kLookAheadMax = 26;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class AltRefTest : public libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<int> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  AltRefTest() : altref_count_(0) {}
 | 
				
			||||||
 | 
					  virtual ~AltRefTest() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(libvpx_test::kTwoPassGood);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void BeginPassHook(unsigned int pass) {
 | 
				
			||||||
 | 
					    altref_count_ = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
 | 
				
			||||||
 | 
					                                  libvpx_test::Encoder *encoder) {
 | 
				
			||||||
 | 
					    if (video->frame() == 1) {
 | 
				
			||||||
 | 
					      encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
 | 
				
			||||||
 | 
					      encoder->Control(VP8E_SET_CPUUSED, 3);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    if (pkt->data.frame.flags & VPX_FRAME_IS_INVISIBLE) ++altref_count_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int altref_count() const { return altref_count_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  int altref_count_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(AltRefTest, MonotonicTimestamps) {
 | 
				
			||||||
 | 
					  const vpx_rational timebase = { 33333333, 1000000000 };
 | 
				
			||||||
 | 
					  cfg_.g_timebase = timebase;
 | 
				
			||||||
 | 
					  cfg_.rc_target_bitrate = 1000;
 | 
				
			||||||
 | 
					  cfg_.g_lag_in_frames = GetParam();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                     timebase.den, timebase.num, 0, 30);
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					  EXPECT_GE(altref_count(), 1);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(NonZeroLag, AltRefTest,
 | 
				
			||||||
 | 
					                        ::testing::Range(kLookAheadMin, kLookAheadMax));
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										90
									
								
								test/boolcoder_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								test/boolcoder_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,90 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vp8/encoder/boolhuff.h"
 | 
				
			||||||
 | 
					#include "vp8/decoder/dboolhuff.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <math.h>
 | 
				
			||||||
 | 
					#include <stddef.h>
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					const int num_tests = 10;
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST(VP8, TestBitIO) {
 | 
				
			||||||
 | 
					  ACMRandom rnd(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					  for (int n = 0; n < num_tests; ++n) {
 | 
				
			||||||
 | 
					    for (int method = 0; method <= 7; ++method) {   // we generate various proba
 | 
				
			||||||
 | 
					      const int bits_to_test = 1000;
 | 
				
			||||||
 | 
					      uint8_t probas[bits_to_test];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      for (int i = 0; i < bits_to_test; ++i) {
 | 
				
			||||||
 | 
					        const int parity = i & 1;
 | 
				
			||||||
 | 
					        probas[i] =
 | 
				
			||||||
 | 
					            (method == 0) ? 0 : (method == 1) ? 255 :
 | 
				
			||||||
 | 
					            (method == 2) ? 128 :
 | 
				
			||||||
 | 
					            (method == 3) ? rnd.Rand8() :
 | 
				
			||||||
 | 
					            (method == 4) ? (parity ? 0 : 255) :
 | 
				
			||||||
 | 
					            // alternate between low and high proba:
 | 
				
			||||||
 | 
					            (method == 5) ? (parity ? rnd(128) : 255 - rnd(128)) :
 | 
				
			||||||
 | 
					            (method == 6) ?
 | 
				
			||||||
 | 
					                (parity ? rnd(64) : 255 - rnd(64)) :
 | 
				
			||||||
 | 
					                (parity ? rnd(32) : 255 - rnd(32));
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      for (int bit_method = 0; bit_method <= 3; ++bit_method) {
 | 
				
			||||||
 | 
					        const int random_seed = 6432;
 | 
				
			||||||
 | 
					        const int buffer_size = 10000;
 | 
				
			||||||
 | 
					        ACMRandom bit_rnd(random_seed);
 | 
				
			||||||
 | 
					        BOOL_CODER bw;
 | 
				
			||||||
 | 
					        uint8_t bw_buffer[buffer_size];
 | 
				
			||||||
 | 
					        vp8_start_encode(&bw, bw_buffer, bw_buffer + buffer_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
 | 
				
			||||||
 | 
					        for (int i = 0; i < bits_to_test; ++i) {
 | 
				
			||||||
 | 
					          if (bit_method == 2) {
 | 
				
			||||||
 | 
					            bit = (i & 1);
 | 
				
			||||||
 | 
					          } else if (bit_method == 3) {
 | 
				
			||||||
 | 
					            bit = bit_rnd(2);
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          vp8_encode_bool(&bw, bit, static_cast<int>(probas[i]));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        vp8_stop_encode(&bw);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        BOOL_DECODER br;
 | 
				
			||||||
 | 
					        vp8dx_start_decode(&br, bw_buffer, buffer_size);
 | 
				
			||||||
 | 
					        bit_rnd.Reset(random_seed);
 | 
				
			||||||
 | 
					        for (int i = 0; i < bits_to_test; ++i) {
 | 
				
			||||||
 | 
					          if (bit_method == 2) {
 | 
				
			||||||
 | 
					            bit = (i & 1);
 | 
				
			||||||
 | 
					          } else if (bit_method == 3) {
 | 
				
			||||||
 | 
					            bit = bit_rnd(2);
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
 | 
				
			||||||
 | 
					              << "pos: "<< i << " / " << bits_to_test
 | 
				
			||||||
 | 
					              << " bit_method: " << bit_method
 | 
				
			||||||
 | 
					              << " method: " << method;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										61
									
								
								test/config_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								test/config_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ConfigTest : public ::libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<enum libvpx_test::TestMode> {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  ConfigTest() : frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(GetParam());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void BeginPassHook(unsigned int /*pass*/) {
 | 
				
			||||||
 | 
					    frame_count_in_ = 0;
 | 
				
			||||||
 | 
					    frame_count_out_ = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) {
 | 
				
			||||||
 | 
					    ++frame_count_in_;
 | 
				
			||||||
 | 
					    abort_ |= (frame_count_in_ >= frame_count_max_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {
 | 
				
			||||||
 | 
					    ++frame_count_out_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  unsigned int frame_count_in_;
 | 
				
			||||||
 | 
					  unsigned int frame_count_out_;
 | 
				
			||||||
 | 
					  unsigned int frame_count_max_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(ConfigTest, LagIsDisabled) {
 | 
				
			||||||
 | 
					  frame_count_max_ = 2;
 | 
				
			||||||
 | 
					  cfg_.g_lag_in_frames = 15;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  libvpx_test::DummyVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_EQ(frame_count_in_, frame_count_out_);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(OnePassModes, ConfigTest, ONE_PASS_TEST_MODES);
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										106
									
								
								test/cq_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										106
									
								
								test/cq_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,106 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 <cmath>
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/i420_video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// CQ level range: [kCQLevelMin, kCQLevelMax).
 | 
				
			||||||
 | 
					const int kCQLevelMin = 4;
 | 
				
			||||||
 | 
					const int kCQLevelMax = 63;
 | 
				
			||||||
 | 
					const int kCQLevelStep = 8;
 | 
				
			||||||
 | 
					const int kCQTargetBitrate = 2000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class CQTest : public libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<int> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  CQTest() : cq_level_(GetParam()) { init_flags_ = VPX_CODEC_USE_PSNR; }
 | 
				
			||||||
 | 
					  virtual ~CQTest() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(libvpx_test::kTwoPassGood);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void BeginPassHook(unsigned int /*pass*/) {
 | 
				
			||||||
 | 
					    file_size_ = 0;
 | 
				
			||||||
 | 
					    psnr_ = 0.0;
 | 
				
			||||||
 | 
					    n_frames_ = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
 | 
				
			||||||
 | 
					                                  libvpx_test::Encoder *encoder) {
 | 
				
			||||||
 | 
					    if (video->frame() == 1) {
 | 
				
			||||||
 | 
					      if (cfg_.rc_end_usage == VPX_CQ) {
 | 
				
			||||||
 | 
					        encoder->Control(VP8E_SET_CQ_LEVEL, cq_level_);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      encoder->Control(VP8E_SET_CPUUSED, 3);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    psnr_ += pow(10.0, pkt->data.psnr.psnr[0] / 10.0);
 | 
				
			||||||
 | 
					    n_frames_++;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    file_size_ += pkt->data.frame.sz;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  double GetLinearPSNROverBitrate() const {
 | 
				
			||||||
 | 
					    double avg_psnr = log10(psnr_ / n_frames_) * 10.0;
 | 
				
			||||||
 | 
					    return pow(10.0, avg_psnr / 10.0) / file_size_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int file_size() const { return file_size_; }
 | 
				
			||||||
 | 
					  int n_frames() const { return n_frames_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  int cq_level_;
 | 
				
			||||||
 | 
					  int file_size_;
 | 
				
			||||||
 | 
					  double psnr_;
 | 
				
			||||||
 | 
					  int n_frames_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int prev_actual_bitrate = kCQTargetBitrate;
 | 
				
			||||||
 | 
					TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
 | 
				
			||||||
 | 
					  const vpx_rational timebase = { 33333333, 1000000000 };
 | 
				
			||||||
 | 
					  cfg_.g_timebase = timebase;
 | 
				
			||||||
 | 
					  cfg_.rc_target_bitrate = kCQTargetBitrate;
 | 
				
			||||||
 | 
					  cfg_.g_lag_in_frames = 25;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  cfg_.rc_end_usage = VPX_CQ;
 | 
				
			||||||
 | 
					  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                     timebase.den, timebase.num, 0, 30);
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					  const double cq_psnr_lin = GetLinearPSNROverBitrate();
 | 
				
			||||||
 | 
					  const int cq_actual_bitrate = file_size() * 8 * 30 / (n_frames() * 1000);
 | 
				
			||||||
 | 
					  EXPECT_LE(cq_actual_bitrate, kCQTargetBitrate);
 | 
				
			||||||
 | 
					  EXPECT_LE(cq_actual_bitrate, prev_actual_bitrate);
 | 
				
			||||||
 | 
					  prev_actual_bitrate = cq_actual_bitrate;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // try targeting the approximate same bitrate with VBR mode
 | 
				
			||||||
 | 
					  cfg_.rc_end_usage = VPX_VBR;
 | 
				
			||||||
 | 
					  cfg_.rc_target_bitrate = cq_actual_bitrate;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					  const double vbr_psnr_lin = GetLinearPSNROverBitrate();
 | 
				
			||||||
 | 
					  EXPECT_GE(cq_psnr_lin, vbr_psnr_lin);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(CQLevelRange, CQTest,
 | 
				
			||||||
 | 
					                        ::testing::Range(kCQLevelMin, kCQLevelMax,
 | 
				
			||||||
 | 
					                                         kCQLevelStep));
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										178
									
								
								test/datarate_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										178
									
								
								test/datarate_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,178 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/i420_video_source.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class DatarateTest : public ::libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<enum libvpx_test::TestMode> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(GetParam());
 | 
				
			||||||
 | 
					    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;
 | 
				
			||||||
 | 
					    bits_total_ = 0;
 | 
				
			||||||
 | 
					    duration_ = 0.0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
 | 
				
			||||||
 | 
					                                  ::libvpx_test::Encoder *encoder) {
 | 
				
			||||||
 | 
					    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_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // TODO(jimbankoski): Remove these lines when the issue:
 | 
				
			||||||
 | 
					    // http://code.google.com/p/webm/issues/detail?id=496 is fixed.
 | 
				
			||||||
 | 
					    // For now the codec assumes buffer starts at starting buffer rate
 | 
				
			||||||
 | 
					    // plus one frame's time.
 | 
				
			||||||
 | 
					    if (last_pts_ == 0)
 | 
				
			||||||
 | 
					      duration = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // 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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Test the buffer model here before subtracting the frame. Do so because
 | 
				
			||||||
 | 
					     * the way the leaky bucket model works in libvpx is to allow the buffer to
 | 
				
			||||||
 | 
					     * empty - and then stop showing frames until we've got enough bits to
 | 
				
			||||||
 | 
					     * show one. As noted in comment below (issue 495), this does not currently
 | 
				
			||||||
 | 
					     * apply to key frames. For now exclude key frames in condition below. */
 | 
				
			||||||
 | 
					    bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) ? true: false;
 | 
				
			||||||
 | 
					    if (!key_frame) {
 | 
				
			||||||
 | 
					      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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Subtract from the buffer the bits associated with a played back frame.
 | 
				
			||||||
 | 
					    bits_in_buffer_model_ -= frame_size_in_bits;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Update the running total of bits for end of test datarate checks.
 | 
				
			||||||
 | 
					    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 most recent pts.
 | 
				
			||||||
 | 
					    last_pts_ = pkt->data.frame.pts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // We update this so that we can calculate the datarate minus the last
 | 
				
			||||||
 | 
					    // frame encoded in the file.
 | 
				
			||||||
 | 
					    bits_in_last_frame_ = frame_size_in_bits;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ++frame_number_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void EndPassHook(void) {
 | 
				
			||||||
 | 
					    if (bits_total_) {
 | 
				
			||||||
 | 
					      const double file_size_in_kb = bits_total_ / 1000;  /* bits per kilobit */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      duration_ = (last_pts_ + 1) * timebase_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Effective file datarate includes the time spent prebuffering.
 | 
				
			||||||
 | 
					      effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0
 | 
				
			||||||
 | 
					          / (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      file_datarate_ = file_size_in_kb / duration_;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_codec_pts_t last_pts_;
 | 
				
			||||||
 | 
					  int bits_in_buffer_model_;
 | 
				
			||||||
 | 
					  double timebase_;
 | 
				
			||||||
 | 
					  int frame_number_;
 | 
				
			||||||
 | 
					  vpx_codec_pts_t first_drop_;
 | 
				
			||||||
 | 
					  int64_t bits_total_;
 | 
				
			||||||
 | 
					  double duration_;
 | 
				
			||||||
 | 
					  double file_datarate_;
 | 
				
			||||||
 | 
					  double effective_datarate_;
 | 
				
			||||||
 | 
					  int bits_in_last_frame_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(DatarateTest, BasicBufferModel) {
 | 
				
			||||||
 | 
					  cfg_.rc_buf_initial_sz = 500;
 | 
				
			||||||
 | 
					  cfg_.rc_dropframe_thresh = 1;
 | 
				
			||||||
 | 
					  cfg_.rc_max_quantizer = 56;
 | 
				
			||||||
 | 
					  cfg_.rc_end_usage = VPX_CBR;
 | 
				
			||||||
 | 
					  // 2 pass cbr datarate control has a bug hidden by the small # of
 | 
				
			||||||
 | 
					  // frames selected in this encode. The problem is that even if the buffer is
 | 
				
			||||||
 | 
					  // negative we produce a keyframe on a cutscene. Ignoring datarate
 | 
				
			||||||
 | 
					  // constraints
 | 
				
			||||||
 | 
					  // TODO(jimbankoski): ( Fix when issue
 | 
				
			||||||
 | 
					  // http://code.google.com/p/webm/issues/detail?id=495 is addressed. )
 | 
				
			||||||
 | 
					  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                       30, 1, 0, 140);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // There is an issue for low bitrates in real-time mode, where the
 | 
				
			||||||
 | 
					  // effective_datarate slightly overshoots the target bitrate.
 | 
				
			||||||
 | 
					  // This is same the issue as noted about (#495).
 | 
				
			||||||
 | 
					  // TODO(jimbankoski/marpan): Update test to run for lower bitrates (< 100),
 | 
				
			||||||
 | 
					  // when the issue is resolved.
 | 
				
			||||||
 | 
					  for (int i = 100; i < 800; i += 200) {
 | 
				
			||||||
 | 
					    cfg_.rc_target_bitrate = i;
 | 
				
			||||||
 | 
					    ResetModel();
 | 
				
			||||||
 | 
					    ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					    ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_)
 | 
				
			||||||
 | 
					        << " The datarate for the file exceeds the target!";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.3)
 | 
				
			||||||
 | 
					        << " The datarate for the file missed the target!";
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(DatarateTest, ChangingDropFrameThresh) {
 | 
				
			||||||
 | 
					  cfg_.rc_buf_initial_sz = 500;
 | 
				
			||||||
 | 
					  cfg_.rc_max_quantizer = 36;
 | 
				
			||||||
 | 
					  cfg_.rc_end_usage = VPX_CBR;
 | 
				
			||||||
 | 
					  cfg_.rc_target_bitrate = 200;
 | 
				
			||||||
 | 
					  cfg_.kf_mode = VPX_KF_DISABLED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const int frame_count = 40;
 | 
				
			||||||
 | 
					  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                       30, 1, 0, frame_count);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Here we check that the first dropped frame gets earlier and earlier
 | 
				
			||||||
 | 
					  // as the drop frame threshold is increased.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const int kDropFrameThreshTestStep = 30;
 | 
				
			||||||
 | 
					  vpx_codec_pts_t last_drop = frame_count;
 | 
				
			||||||
 | 
					  for (int i = 1; i < 91; i += kDropFrameThreshTestStep) {
 | 
				
			||||||
 | 
					    cfg_.rc_dropframe_thresh = i;
 | 
				
			||||||
 | 
					    ResetModel();
 | 
				
			||||||
 | 
					    ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					    ASSERT_LE(first_drop_, last_drop)
 | 
				
			||||||
 | 
					        << " The first dropped frame for drop_thresh " << i
 | 
				
			||||||
 | 
					        << " > first dropped frame for drop_thresh "
 | 
				
			||||||
 | 
					        << i - kDropFrameThreshTestStep;
 | 
				
			||||||
 | 
					    last_drop = first_drop_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(AllModes, DatarateTest, ALL_TEST_MODES);
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										48
									
								
								test/decode_test_driver.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								test/decode_test_driver.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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/decode_test_driver.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					void Decoder::DecodeFrame(const uint8_t *cxdata, int size) {
 | 
				
			||||||
 | 
					  if (!decoder_.priv) {
 | 
				
			||||||
 | 
					    const vpx_codec_err_t res_init = vpx_codec_dec_init(&decoder_,
 | 
				
			||||||
 | 
					                                                        &vpx_codec_vp8_dx_algo,
 | 
				
			||||||
 | 
					                                                        &cfg_, 0);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res_init) << DecodeError();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_codec_err_t res_dec;
 | 
				
			||||||
 | 
					  REGISTER_STATE_CHECK(res_dec = vpx_codec_decode(&decoder_,
 | 
				
			||||||
 | 
					                                                  cxdata, size, NULL, 0));
 | 
				
			||||||
 | 
					  ASSERT_EQ(VPX_CODEC_OK, res_dec) << DecodeError();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void DecoderTest::RunLoop(CompressedVideoSource *video) {
 | 
				
			||||||
 | 
					  vpx_codec_dec_cfg_t dec_cfg = {0};
 | 
				
			||||||
 | 
					  Decoder decoder(dec_cfg, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Decode frames.
 | 
				
			||||||
 | 
					  for (video->Begin(); video->cxdata(); video->Next()) {
 | 
				
			||||||
 | 
					    decoder.DecodeFrame(video->cxdata(), video->frame_size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    DxDataIterator dec_iter = decoder.GetDxData();
 | 
				
			||||||
 | 
					    const vpx_image_t *img = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Get decompressed data
 | 
				
			||||||
 | 
					    while ((img = dec_iter.Next()))
 | 
				
			||||||
 | 
					      DecompressedFrameHook(*img, video->frame_number());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
							
								
								
									
										97
									
								
								test/decode_test_driver.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										97
									
								
								test/decode_test_driver.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,97 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_DECODE_TEST_DRIVER_H_
 | 
				
			||||||
 | 
					#define TEST_DECODE_TEST_DRIVER_H_
 | 
				
			||||||
 | 
					#include <cstring>
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_decoder.h"
 | 
				
			||||||
 | 
					#include "vpx/vp8dx.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class CompressedVideoSource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Provides an object to handle decoding output
 | 
				
			||||||
 | 
					class DxDataIterator {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  explicit DxDataIterator(vpx_codec_ctx_t *decoder)
 | 
				
			||||||
 | 
					      : decoder_(decoder), iter_(NULL) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const vpx_image_t *Next() {
 | 
				
			||||||
 | 
					    return vpx_codec_get_frame(decoder_, &iter_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  vpx_codec_ctx_t  *decoder_;
 | 
				
			||||||
 | 
					  vpx_codec_iter_t  iter_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Provides a simplified interface to manage one video decoding.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// TODO: similar to Encoder class, the exact services should be
 | 
				
			||||||
 | 
					// added as more tests are added.
 | 
				
			||||||
 | 
					class Decoder {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
 | 
				
			||||||
 | 
					      : cfg_(cfg), deadline_(deadline) {
 | 
				
			||||||
 | 
					    memset(&decoder_, 0, sizeof(decoder_));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ~Decoder() {
 | 
				
			||||||
 | 
					    vpx_codec_destroy(&decoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void DecodeFrame(const uint8_t *cxdata, int size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  DxDataIterator GetDxData() {
 | 
				
			||||||
 | 
					    return DxDataIterator(&decoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void set_deadline(unsigned long deadline) {
 | 
				
			||||||
 | 
					    deadline_ = deadline;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void Control(int ctrl_id, int arg) {
 | 
				
			||||||
 | 
					    const vpx_codec_err_t res = vpx_codec_control_(&decoder_, ctrl_id, arg);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  const char *DecodeError() {
 | 
				
			||||||
 | 
					    const char *detail = vpx_codec_error_detail(&decoder_);
 | 
				
			||||||
 | 
					    return detail ? detail : vpx_codec_error(&decoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_codec_ctx_t     decoder_;
 | 
				
			||||||
 | 
					  vpx_codec_dec_cfg_t cfg_;
 | 
				
			||||||
 | 
					  unsigned int        deadline_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Common test functionality for all Decoder tests.
 | 
				
			||||||
 | 
					class DecoderTest {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  // Main loop.
 | 
				
			||||||
 | 
					  virtual void RunLoop(CompressedVideoSource *video);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called on every decompressed frame.
 | 
				
			||||||
 | 
					  virtual void DecompressedFrameHook(const vpx_image_t& img,
 | 
				
			||||||
 | 
					                                     const unsigned int frame_number) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  DecoderTest() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~DecoderTest() {}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_DECODE_TEST_DRIVER_H_
 | 
				
			||||||
							
								
								
									
										206
									
								
								test/encode_test_driver.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										206
									
								
								test/encode_test_driver.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,206 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_config.h"
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					#include "test/decode_test_driver.h"
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) {
 | 
				
			||||||
 | 
					  if (video->img())
 | 
				
			||||||
 | 
					    EncodeFrameInternal(*video, frame_flags);
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    Flush();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Handle twopass stats
 | 
				
			||||||
 | 
					  CxDataIterator iter = GetCxData();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
 | 
				
			||||||
 | 
					    if (pkt->kind != VPX_CODEC_STATS_PKT)
 | 
				
			||||||
 | 
					      continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    stats_->Append(*pkt);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void Encoder::EncodeFrameInternal(const VideoSource &video,
 | 
				
			||||||
 | 
					                                  const unsigned long frame_flags) {
 | 
				
			||||||
 | 
					  vpx_codec_err_t res;
 | 
				
			||||||
 | 
					  const vpx_image_t *img = video.img();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Handle first frame initialization
 | 
				
			||||||
 | 
					  if (!encoder_.priv) {
 | 
				
			||||||
 | 
					    cfg_.g_w = img->d_w;
 | 
				
			||||||
 | 
					    cfg_.g_h = img->d_h;
 | 
				
			||||||
 | 
					    cfg_.g_timebase = video.timebase();
 | 
				
			||||||
 | 
					    cfg_.rc_twopass_stats_in = stats_->buf();
 | 
				
			||||||
 | 
					    res = vpx_codec_enc_init(&encoder_, &vpx_codec_vp8_cx_algo, &cfg_,
 | 
				
			||||||
 | 
					                             init_flags_);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Handle frame resizing
 | 
				
			||||||
 | 
					  if (cfg_.g_w != img->d_w || cfg_.g_h != img->d_h) {
 | 
				
			||||||
 | 
					    cfg_.g_w = img->d_w;
 | 
				
			||||||
 | 
					    cfg_.g_h = img->d_h;
 | 
				
			||||||
 | 
					    res = vpx_codec_enc_config_set(&encoder_, &cfg_);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Encode the frame
 | 
				
			||||||
 | 
					  REGISTER_STATE_CHECK(
 | 
				
			||||||
 | 
					      res = vpx_codec_encode(&encoder_,
 | 
				
			||||||
 | 
					                             video.img(), video.pts(), video.duration(),
 | 
				
			||||||
 | 
					                             frame_flags, deadline_));
 | 
				
			||||||
 | 
					  ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void Encoder::Flush() {
 | 
				
			||||||
 | 
					  const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0,
 | 
				
			||||||
 | 
					                                               deadline_);
 | 
				
			||||||
 | 
					  ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EncoderTest::SetMode(TestMode mode) {
 | 
				
			||||||
 | 
					  switch (mode) {
 | 
				
			||||||
 | 
					    case kRealTime:
 | 
				
			||||||
 | 
					      deadline_ = VPX_DL_REALTIME;
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case kOnePassGood:
 | 
				
			||||||
 | 
					    case kTwoPassGood:
 | 
				
			||||||
 | 
					      deadline_ = VPX_DL_GOOD_QUALITY;
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    case kOnePassBest:
 | 
				
			||||||
 | 
					    case kTwoPassBest:
 | 
				
			||||||
 | 
					      deadline_ = VPX_DL_BEST_QUALITY;
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    default:
 | 
				
			||||||
 | 
					      ASSERT_TRUE(false) << "Unexpected mode " << mode;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (mode == kTwoPassGood || mode == kTwoPassBest)
 | 
				
			||||||
 | 
					    passes_ = 2;
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    passes_ = 1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					// The function should return "true" most of the time, therefore no early
 | 
				
			||||||
 | 
					// break-out is implemented within the match checking process.
 | 
				
			||||||
 | 
					static bool compare_img(const vpx_image_t *img1,
 | 
				
			||||||
 | 
					                        const vpx_image_t *img2) {
 | 
				
			||||||
 | 
					  bool match = (img1->fmt == img2->fmt) &&
 | 
				
			||||||
 | 
					               (img1->d_w == img2->d_w) &&
 | 
				
			||||||
 | 
					               (img1->d_h == img2->d_h);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const unsigned int width_y  = img1->d_w;
 | 
				
			||||||
 | 
					  const unsigned int height_y = img1->d_h;
 | 
				
			||||||
 | 
					  unsigned int i;
 | 
				
			||||||
 | 
					  for (i = 0; i < height_y; ++i)
 | 
				
			||||||
 | 
					    match = ( memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
 | 
				
			||||||
 | 
					                     img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
 | 
				
			||||||
 | 
					                     width_y) == 0) && match;
 | 
				
			||||||
 | 
					  const unsigned int width_uv  = (img1->d_w + 1) >> 1;
 | 
				
			||||||
 | 
					  const unsigned int height_uv = (img1->d_h + 1) >> 1;
 | 
				
			||||||
 | 
					  for (i = 0; i <  height_uv; ++i)
 | 
				
			||||||
 | 
					    match = ( memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
 | 
				
			||||||
 | 
					                     img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
 | 
				
			||||||
 | 
					                     width_uv) == 0) && match;
 | 
				
			||||||
 | 
					  for (i = 0; i < height_uv; ++i)
 | 
				
			||||||
 | 
					    match = ( memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
 | 
				
			||||||
 | 
					                     img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
 | 
				
			||||||
 | 
					                     width_uv) == 0) && match;
 | 
				
			||||||
 | 
					  return match;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void EncoderTest::RunLoop(VideoSource *video) {
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					  vpx_codec_dec_cfg_t dec_cfg = {0};
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  stats_.Reset();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (unsigned int pass = 0; pass < passes_; pass++) {
 | 
				
			||||||
 | 
					    last_pts_ = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (passes_ == 1)
 | 
				
			||||||
 | 
					      cfg_.g_pass = VPX_RC_ONE_PASS;
 | 
				
			||||||
 | 
					    else if (pass == 0)
 | 
				
			||||||
 | 
					      cfg_.g_pass = VPX_RC_FIRST_PASS;
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      cfg_.g_pass = VPX_RC_LAST_PASS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    BeginPassHook(pass);
 | 
				
			||||||
 | 
					    Encoder encoder(cfg_, deadline_, init_flags_, &stats_);
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					    Decoder decoder(dec_cfg, 0);
 | 
				
			||||||
 | 
					    bool has_cxdata = false;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    bool again;
 | 
				
			||||||
 | 
					    for (again = true, video->Begin(); again; video->Next()) {
 | 
				
			||||||
 | 
					      again = video->img() != NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      PreEncodeFrameHook(video);
 | 
				
			||||||
 | 
					      PreEncodeFrameHook(video, &encoder);
 | 
				
			||||||
 | 
					      encoder.EncodeFrame(video, frame_flags_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      CxDataIterator iter = encoder.GetCxData();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
 | 
				
			||||||
 | 
					        again = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        switch (pkt->kind) {
 | 
				
			||||||
 | 
					          case VPX_CODEC_CX_FRAME_PKT:
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					            has_cxdata = true;
 | 
				
			||||||
 | 
					            decoder.DecodeFrame((const uint8_t*)pkt->data.frame.buf,
 | 
				
			||||||
 | 
					                                pkt->data.frame.sz);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					            ASSERT_GE(pkt->data.frame.pts, last_pts_);
 | 
				
			||||||
 | 
					            last_pts_ = pkt->data.frame.pts;
 | 
				
			||||||
 | 
					            FramePktHook(pkt);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          case VPX_CODEC_PSNR_PKT:
 | 
				
			||||||
 | 
					            PSNRPktHook(pkt);
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          default:
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if CONFIG_VP8_DECODER
 | 
				
			||||||
 | 
					      if (has_cxdata) {
 | 
				
			||||||
 | 
					        const vpx_image_t *img_enc = encoder.GetPreviewFrame();
 | 
				
			||||||
 | 
					        DxDataIterator dec_iter = decoder.GetDxData();
 | 
				
			||||||
 | 
					        const vpx_image_t *img_dec = dec_iter.Next();
 | 
				
			||||||
 | 
					        if(img_enc && img_dec) {
 | 
				
			||||||
 | 
					          const bool res = compare_img(img_enc, img_dec);
 | 
				
			||||||
 | 
					          ASSERT_TRUE(res)<< "Encoder/Decoder mismatch found.";
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					      if (!Continue())
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EndPassHook();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!Continue())
 | 
				
			||||||
 | 
					      break;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
							
								
								
									
										197
									
								
								test/encode_test_driver.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										197
									
								
								test/encode_test_driver.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,197 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_ENCODE_TEST_DRIVER_H_
 | 
				
			||||||
 | 
					#define TEST_ENCODE_TEST_DRIVER_H_
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include <vector>
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_encoder.h"
 | 
				
			||||||
 | 
					#include "vpx/vp8cx.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class VideoSource;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum TestMode {
 | 
				
			||||||
 | 
					  kRealTime,
 | 
				
			||||||
 | 
					  kOnePassGood,
 | 
				
			||||||
 | 
					  kOnePassBest,
 | 
				
			||||||
 | 
					  kTwoPassGood,
 | 
				
			||||||
 | 
					  kTwoPassBest
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					#define ALL_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
 | 
				
			||||||
 | 
					                                         ::libvpx_test::kOnePassGood, \
 | 
				
			||||||
 | 
					                                         ::libvpx_test::kOnePassBest, \
 | 
				
			||||||
 | 
					                                         ::libvpx_test::kTwoPassGood, \
 | 
				
			||||||
 | 
					                                         ::libvpx_test::kTwoPassBest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define ONE_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
 | 
				
			||||||
 | 
					                                              ::libvpx_test::kOnePassGood, \
 | 
				
			||||||
 | 
					                                              ::libvpx_test::kOnePassBest)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Provides an object to handle the libvpx get_cx_data() iteration pattern
 | 
				
			||||||
 | 
					class CxDataIterator {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  explicit CxDataIterator(vpx_codec_ctx_t *encoder)
 | 
				
			||||||
 | 
					    : encoder_(encoder), iter_(NULL) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const vpx_codec_cx_pkt_t *Next() {
 | 
				
			||||||
 | 
					    return vpx_codec_get_cx_data(encoder_, &iter_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  vpx_codec_ctx_t  *encoder_;
 | 
				
			||||||
 | 
					  vpx_codec_iter_t  iter_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Implements an in-memory store for libvpx twopass statistics
 | 
				
			||||||
 | 
					class TwopassStatsStore {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  void Append(const vpx_codec_cx_pkt_t &pkt) {
 | 
				
			||||||
 | 
					    buffer_.append(reinterpret_cast<char *>(pkt.data.twopass_stats.buf),
 | 
				
			||||||
 | 
					                   pkt.data.twopass_stats.sz);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_fixed_buf_t buf() {
 | 
				
			||||||
 | 
					    const vpx_fixed_buf_t buf = { &buffer_[0], buffer_.size() };
 | 
				
			||||||
 | 
					    return buf;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void Reset() {
 | 
				
			||||||
 | 
					    buffer_.clear();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  std::string  buffer_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Provides a simplified interface to manage one video encoding pass, given
 | 
				
			||||||
 | 
					// a configuration and video source.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// TODO(jkoleszar): The exact services it provides and the appropriate
 | 
				
			||||||
 | 
					// level of abstraction will be fleshed out as more tests are written.
 | 
				
			||||||
 | 
					class Encoder {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  Encoder(vpx_codec_enc_cfg_t cfg, unsigned long deadline,
 | 
				
			||||||
 | 
					          const unsigned long init_flags, TwopassStatsStore *stats)
 | 
				
			||||||
 | 
					    : cfg_(cfg), deadline_(deadline), init_flags_(init_flags), stats_(stats) {
 | 
				
			||||||
 | 
					    memset(&encoder_, 0, sizeof(encoder_));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ~Encoder() {
 | 
				
			||||||
 | 
					    vpx_codec_destroy(&encoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  CxDataIterator GetCxData() {
 | 
				
			||||||
 | 
					    return CxDataIterator(&encoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const vpx_image_t *GetPreviewFrame() {
 | 
				
			||||||
 | 
					    return vpx_codec_get_preview_frame(&encoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  // This is a thin wrapper around vpx_codec_encode(), so refer to
 | 
				
			||||||
 | 
					  // vpx_encoder.h for its semantics.
 | 
				
			||||||
 | 
					  void EncodeFrame(VideoSource *video, const unsigned long frame_flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Convenience wrapper for EncodeFrame()
 | 
				
			||||||
 | 
					  void EncodeFrame(VideoSource *video) {
 | 
				
			||||||
 | 
					    EncodeFrame(video, 0);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void Control(int ctrl_id, int arg) {
 | 
				
			||||||
 | 
					    const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void set_deadline(unsigned long deadline) {
 | 
				
			||||||
 | 
					    deadline_ = deadline;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  const char *EncoderError() {
 | 
				
			||||||
 | 
					    const char *detail = vpx_codec_error_detail(&encoder_);
 | 
				
			||||||
 | 
					    return detail ? detail : vpx_codec_error(&encoder_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Encode an image
 | 
				
			||||||
 | 
					  void EncodeFrameInternal(const VideoSource &video,
 | 
				
			||||||
 | 
					                           const unsigned long frame_flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Flush the encoder on EOS
 | 
				
			||||||
 | 
					  void Flush();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_codec_ctx_t      encoder_;
 | 
				
			||||||
 | 
					  vpx_codec_enc_cfg_t  cfg_;
 | 
				
			||||||
 | 
					  unsigned long        deadline_;
 | 
				
			||||||
 | 
					  unsigned long        init_flags_;
 | 
				
			||||||
 | 
					  TwopassStatsStore   *stats_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Common test functionality for all Encoder tests.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// This class is a mixin which provides the main loop common to all
 | 
				
			||||||
 | 
					// encoder tests. It provides hooks which can be overridden by subclasses
 | 
				
			||||||
 | 
					// to implement each test's specific behavior, while centralizing the bulk
 | 
				
			||||||
 | 
					// of the boilerplate. Note that it doesn't inherit the gtest testing
 | 
				
			||||||
 | 
					// classes directly, so that tests can be parameterized differently.
 | 
				
			||||||
 | 
					class EncoderTest {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  EncoderTest() : abort_(false), init_flags_(0), frame_flags_(0),
 | 
				
			||||||
 | 
					                  last_pts_(0) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~EncoderTest() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Initialize the cfg_ member with the default configuration.
 | 
				
			||||||
 | 
					  void InitializeConfig() {
 | 
				
			||||||
 | 
					    const vpx_codec_err_t res = vpx_codec_enc_config_default(
 | 
				
			||||||
 | 
					                                    &vpx_codec_vp8_cx_algo, &cfg_, 0);
 | 
				
			||||||
 | 
					    ASSERT_EQ(VPX_CODEC_OK, res);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Map the TestMode enum to the deadline_ and passes_ variables.
 | 
				
			||||||
 | 
					  void SetMode(TestMode mode);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Main loop.
 | 
				
			||||||
 | 
					  virtual void RunLoop(VideoSource *video);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called at the beginning of a pass.
 | 
				
			||||||
 | 
					  virtual void BeginPassHook(unsigned int pass) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called at the end of a pass.
 | 
				
			||||||
 | 
					  virtual void EndPassHook() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called before encoding a frame.
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(VideoSource *video) {}
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(VideoSource *video, Encoder *encoder) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called on every compressed data packet.
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to be called on every PSNR packet.
 | 
				
			||||||
 | 
					  virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Hook to determine whether the encode loop should continue.
 | 
				
			||||||
 | 
					  virtual bool Continue() const { return !abort_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bool                 abort_;
 | 
				
			||||||
 | 
					  vpx_codec_enc_cfg_t  cfg_;
 | 
				
			||||||
 | 
					  unsigned int         passes_;
 | 
				
			||||||
 | 
					  unsigned long        deadline_;
 | 
				
			||||||
 | 
					  TwopassStatsStore    stats_;
 | 
				
			||||||
 | 
					  unsigned long        init_flags_;
 | 
				
			||||||
 | 
					  unsigned long        frame_flags_;
 | 
				
			||||||
 | 
					  vpx_codec_pts_t      last_pts_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_ENCODE_TEST_DRIVER_H_
 | 
				
			||||||
							
								
								
									
										90
									
								
								test/error_resilience_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										90
									
								
								test/error_resilience_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,90 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					  Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/i420_video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ErrorResilienceTest : public libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<int> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  ErrorResilienceTest() {
 | 
				
			||||||
 | 
					    psnr_ = 0.0;
 | 
				
			||||||
 | 
					    nframes_ = 0;
 | 
				
			||||||
 | 
					    encoding_mode_ = static_cast<libvpx_test::TestMode>(GetParam());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  virtual ~ErrorResilienceTest() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(encoding_mode_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void BeginPassHook(unsigned int /*pass*/) {
 | 
				
			||||||
 | 
					    psnr_ = 0.0;
 | 
				
			||||||
 | 
					    nframes_ = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    psnr_ += pkt->data.psnr.psnr[0];
 | 
				
			||||||
 | 
					    nframes_++;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  double GetAveragePsnr() const {
 | 
				
			||||||
 | 
					    if (nframes_)
 | 
				
			||||||
 | 
					      return psnr_ / nframes_;
 | 
				
			||||||
 | 
					    return 0.0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  double psnr_;
 | 
				
			||||||
 | 
					  unsigned int nframes_;
 | 
				
			||||||
 | 
					  libvpx_test::TestMode encoding_mode_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(ErrorResilienceTest, OnVersusOff) {
 | 
				
			||||||
 | 
					  const vpx_rational timebase = { 33333333, 1000000000 };
 | 
				
			||||||
 | 
					  cfg_.g_timebase = timebase;
 | 
				
			||||||
 | 
					  cfg_.rc_target_bitrate = 2000;
 | 
				
			||||||
 | 
					  cfg_.g_lag_in_frames = 25;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  init_flags_ = VPX_CODEC_USE_PSNR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                     timebase.den, timebase.num, 0, 30);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Error resilient mode OFF.
 | 
				
			||||||
 | 
					  cfg_.g_error_resilient = 0;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					  const double psnr_resilience_off = GetAveragePsnr();
 | 
				
			||||||
 | 
					  EXPECT_GT(psnr_resilience_off, 25.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Error resilient mode ON.
 | 
				
			||||||
 | 
					  cfg_.g_error_resilient = 1;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					  const double psnr_resilience_on = GetAveragePsnr();
 | 
				
			||||||
 | 
					  EXPECT_GT(psnr_resilience_on, 25.0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Test that turning on error resilient mode hurts by 10% at most.
 | 
				
			||||||
 | 
					  if (psnr_resilience_off > 0.0) {
 | 
				
			||||||
 | 
					    const double psnr_ratio = psnr_resilience_on / psnr_resilience_off;
 | 
				
			||||||
 | 
					    EXPECT_GE(psnr_ratio, 0.9);
 | 
				
			||||||
 | 
					    EXPECT_LE(psnr_ratio, 1.1);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(OnOffTest, ErrorResilienceTest,
 | 
				
			||||||
 | 
					                        ONE_PASS_TEST_MODES);
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										169
									
								
								test/fdct4x4_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										169
									
								
								test/fdct4x4_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,169 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					*  Copyright (c) 2012 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 <stddef.h>
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const int cospi8sqrt2minus1 = 20091;
 | 
				
			||||||
 | 
					const int sinpi8sqrt2 = 35468;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void reference_idct4x4(const int16_t *input, int16_t *output) {
 | 
				
			||||||
 | 
					  const int16_t *ip = input;
 | 
				
			||||||
 | 
					  int16_t *op = output;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (int i = 0; i < 4; ++i) {
 | 
				
			||||||
 | 
					    const int a1 = ip[0] + ip[8];
 | 
				
			||||||
 | 
					    const int b1 = ip[0] - ip[8];
 | 
				
			||||||
 | 
					    const int temp1 = (ip[4] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    const int temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    const int c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					    const int temp3 = ip[4] + ((ip[4] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    const int temp4 = (ip[12] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    const int d1 = temp3 + temp4;
 | 
				
			||||||
 | 
					    op[0] = a1 + d1;
 | 
				
			||||||
 | 
					    op[12] = a1 - d1;
 | 
				
			||||||
 | 
					    op[4] = b1 + c1;
 | 
				
			||||||
 | 
					    op[8] = b1 - c1;
 | 
				
			||||||
 | 
					    ++ip;
 | 
				
			||||||
 | 
					    ++op;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  ip = output;
 | 
				
			||||||
 | 
					  op = output;
 | 
				
			||||||
 | 
					  for (int i = 0; i < 4; ++i) {
 | 
				
			||||||
 | 
					    const int a1 = ip[0] + ip[2];
 | 
				
			||||||
 | 
					    const int b1 = ip[0] - ip[2];
 | 
				
			||||||
 | 
					    const int temp1 = (ip[1] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    const int temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    const int c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					    const int temp3 = ip[1] + ((ip[1] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    const int temp4 = (ip[3] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    const int d1 = temp3 + temp4;
 | 
				
			||||||
 | 
					    op[0] = (a1 + d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[3] = (a1 - d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[1] = (b1 + c1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[2] = (b1 - c1 + 4) >> 3;
 | 
				
			||||||
 | 
					    ip += 4;
 | 
				
			||||||
 | 
					    op += 4;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST(Vp8FdctTest, SignBiasCheck) {
 | 
				
			||||||
 | 
					  ACMRandom rnd(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					  int16_t test_input_block[16];
 | 
				
			||||||
 | 
					  int16_t test_output_block[16];
 | 
				
			||||||
 | 
					  const int pitch = 8;
 | 
				
			||||||
 | 
					  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) {
 | 
				
			||||||
 | 
					    // Initialize a test block with input range [-255, 255].
 | 
				
			||||||
 | 
					    for (int j = 0; j < 16; ++j)
 | 
				
			||||||
 | 
					      test_input_block[j] = rnd.Rand8() - rnd.Rand8();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vp8_short_fdct4x4_c(test_input_block, test_output_block, pitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    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];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bool bias_acceptable = true;
 | 
				
			||||||
 | 
					  for (int j = 0; j < 16; ++j)
 | 
				
			||||||
 | 
					    bias_acceptable = bias_acceptable &&
 | 
				
			||||||
 | 
					    (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 10000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_EQ(true, bias_acceptable)
 | 
				
			||||||
 | 
					    << "Error: 4x4 FDCT has a sign bias > 1% for input range [-255, 255]";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vp8_short_fdct4x4_c(test_input_block, test_output_block, pitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    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];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bias_acceptable = true;
 | 
				
			||||||
 | 
					  for (int j = 0; j < 16; ++j)
 | 
				
			||||||
 | 
					    bias_acceptable = bias_acceptable &&
 | 
				
			||||||
 | 
					    (abs(count_sign_block[j][0] - count_sign_block[j][1]) < 100000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_EQ(true, bias_acceptable)
 | 
				
			||||||
 | 
					    << "Error: 4x4 FDCT has a sign bias > 10% for input range [-15, 15]";
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST(Vp8FdctTest, 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) {
 | 
				
			||||||
 | 
					    int16_t test_input_block[16];
 | 
				
			||||||
 | 
					    int16_t test_temp_block[16];
 | 
				
			||||||
 | 
					    int16_t test_output_block[16];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Initialize a test block with input range [-255, 255].
 | 
				
			||||||
 | 
					    for (int j = 0; j < 16; ++j)
 | 
				
			||||||
 | 
					      test_input_block[j] = rnd.Rand8() - rnd.Rand8();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const int pitch = 8;
 | 
				
			||||||
 | 
					    vp8_short_fdct4x4_c(test_input_block, test_temp_block, pitch);
 | 
				
			||||||
 | 
					    reference_idct4x4(test_temp_block, test_output_block);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (int j = 0; j < 16; ++j) {
 | 
				
			||||||
 | 
					      const int diff = test_input_block[j] - test_output_block[j];
 | 
				
			||||||
 | 
					      const int error = diff * diff;
 | 
				
			||||||
 | 
					      if (max_error < error)
 | 
				
			||||||
 | 
					        max_error = error;
 | 
				
			||||||
 | 
					      total_error += error;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_GE(1, max_error )
 | 
				
			||||||
 | 
					    << "Error: FDCT/IDCT has an individual roundtrip error > 1";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_GE(count_test_block, total_error)
 | 
				
			||||||
 | 
					    << "Error: FDCT/IDCT has average roundtrip error > 1 per block";
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										117
									
								
								test/i420_video_source.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								test/i420_video_source.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,117 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_I420_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					#define TEST_I420_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					#include <cstdio>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// This class extends VideoSource to allow parsing of raw yv12
 | 
				
			||||||
 | 
					// so that we can do actual file encodes.
 | 
				
			||||||
 | 
					class I420VideoSource : public VideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  I420VideoSource(const std::string &file_name,
 | 
				
			||||||
 | 
					                  unsigned int width, unsigned int height,
 | 
				
			||||||
 | 
					                  int rate_numerator, int rate_denominator,
 | 
				
			||||||
 | 
					                  unsigned int start, int limit)
 | 
				
			||||||
 | 
					      : file_name_(file_name),
 | 
				
			||||||
 | 
					        input_file_(NULL),
 | 
				
			||||||
 | 
					        img_(NULL),
 | 
				
			||||||
 | 
					        start_(start),
 | 
				
			||||||
 | 
					        limit_(limit),
 | 
				
			||||||
 | 
					        frame_(0),
 | 
				
			||||||
 | 
					        width_(0),
 | 
				
			||||||
 | 
					        height_(0),
 | 
				
			||||||
 | 
					        framerate_numerator_(rate_numerator),
 | 
				
			||||||
 | 
					        framerate_denominator_(rate_denominator) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // This initializes raw_sz_, width_, height_ and allocates an img.
 | 
				
			||||||
 | 
					    SetSize(width, height);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~I420VideoSource() {
 | 
				
			||||||
 | 
					    vpx_img_free(img_);
 | 
				
			||||||
 | 
					    if (input_file_)
 | 
				
			||||||
 | 
					      fclose(input_file_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Begin() {
 | 
				
			||||||
 | 
					    if (input_file_)
 | 
				
			||||||
 | 
					      fclose(input_file_);
 | 
				
			||||||
 | 
					    input_file_ = OpenTestDataFile(file_name_);
 | 
				
			||||||
 | 
					    ASSERT_TRUE(input_file_) << "Input file open failed. Filename: "
 | 
				
			||||||
 | 
					        << file_name_;
 | 
				
			||||||
 | 
					    if (start_) {
 | 
				
			||||||
 | 
					      fseek(input_file_, raw_sz_ * start_, SEEK_SET);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    frame_ = start_;
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Next() {
 | 
				
			||||||
 | 
					    ++frame_;
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL;  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Models a stream where Timebase = 1/FPS, so pts == frame.
 | 
				
			||||||
 | 
					  virtual vpx_codec_pts_t pts() const { return frame_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned long duration() const { return 1; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual vpx_rational_t timebase() const {
 | 
				
			||||||
 | 
					    const vpx_rational_t t = { framerate_denominator_, framerate_numerator_ };
 | 
				
			||||||
 | 
					    return t;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned int frame() const { return frame_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned int limit() const { return limit_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void SetSize(unsigned int width, unsigned int height) {
 | 
				
			||||||
 | 
					    if (width != width_ || height != height_) {
 | 
				
			||||||
 | 
					      vpx_img_free(img_);
 | 
				
			||||||
 | 
					      img_ = vpx_img_alloc(NULL, VPX_IMG_FMT_VPXI420, width, height, 1);
 | 
				
			||||||
 | 
					      ASSERT_TRUE(img_ != NULL);
 | 
				
			||||||
 | 
					      width_ = width;
 | 
				
			||||||
 | 
					      height_ = height;
 | 
				
			||||||
 | 
					      raw_sz_ = width * height * 3 / 2;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FillFrame() {
 | 
				
			||||||
 | 
					    // Read a frame from input_file.
 | 
				
			||||||
 | 
					    if (fread(img_->img_data, raw_sz_, 1, input_file_) == 0) {
 | 
				
			||||||
 | 
					      limit_ = frame_;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  std::string file_name_;
 | 
				
			||||||
 | 
					  FILE *input_file_;
 | 
				
			||||||
 | 
					  vpx_image_t *img_;
 | 
				
			||||||
 | 
					  size_t raw_sz_;
 | 
				
			||||||
 | 
					  unsigned int start_;
 | 
				
			||||||
 | 
					  unsigned int limit_;
 | 
				
			||||||
 | 
					  unsigned int frame_;
 | 
				
			||||||
 | 
					  unsigned int width_;
 | 
				
			||||||
 | 
					  unsigned int height_;
 | 
				
			||||||
 | 
					  unsigned int framerate_numerator_;
 | 
				
			||||||
 | 
					  unsigned int framerate_denominator_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_I420_VIDEO_SOURCE_H_
 | 
				
			||||||
							
								
								
									
										126
									
								
								test/idctllm_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										126
									
								
								test/idctllm_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,126 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2010 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.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*idct_fn_t)(short *input, unsigned char *pred_ptr,
 | 
				
			||||||
 | 
					                          int pred_stride, unsigned char *dst_ptr,
 | 
				
			||||||
 | 
					                          int dst_stride);
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					class IDCTTest : public ::testing::TestWithParam<idct_fn_t>
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  protected:
 | 
				
			||||||
 | 
					    virtual void SetUp()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        UUT = GetParam();
 | 
				
			||||||
 | 
					        memset(input, 0, sizeof(input));
 | 
				
			||||||
 | 
					        /* Set up guard blocks */
 | 
				
			||||||
 | 
					        for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					            output[i] = ((i&0xF)<4&&(i<64))?0:-1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    idct_fn_t UUT;
 | 
				
			||||||
 | 
					    short input[16];
 | 
				
			||||||
 | 
					    unsigned char output[256];
 | 
				
			||||||
 | 
					    unsigned char predict[256];
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IDCTTest, TestGuardBlocks)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        if((i&0xF) < 4 && i<64)
 | 
				
			||||||
 | 
					            EXPECT_EQ(0, output[i]) << i;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            EXPECT_EQ(255, output[i]);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IDCTTest, TestAllZeros)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        if((i&0xF) < 4 && i<64)
 | 
				
			||||||
 | 
					            EXPECT_EQ(0, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            EXPECT_EQ(255, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IDCTTest, TestAllOnes)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    input[0] = 4;
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        if((i&0xF) < 4 && i<64)
 | 
				
			||||||
 | 
					            EXPECT_EQ(1, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            EXPECT_EQ(255, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IDCTTest, TestAddOne)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        predict[i] = i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    input[0] = 4;
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(UUT(input, predict, 16, output, 16));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        if((i&0xF) < 4 && i<64)
 | 
				
			||||||
 | 
					            EXPECT_EQ(i+1, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            EXPECT_EQ(255, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IDCTTest, TestWithData)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<16; i++)
 | 
				
			||||||
 | 
					        input[i] = i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(i=0; i<256; i++)
 | 
				
			||||||
 | 
					        if((i&0xF) > 3 || i>63)
 | 
				
			||||||
 | 
					            EXPECT_EQ(255, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else if(i == 0)
 | 
				
			||||||
 | 
					            EXPECT_EQ(11, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else if(i == 34)
 | 
				
			||||||
 | 
					            EXPECT_EQ(1, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else if(i == 2 || i == 17 || i == 32)
 | 
				
			||||||
 | 
					            EXPECT_EQ(3, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					            EXPECT_EQ(0, output[i]) << "i==" << i;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, IDCTTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(vp8_short_idct4x4llm_c));
 | 
				
			||||||
 | 
					#if HAVE_MMX
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(MMX, IDCTTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(vp8_short_idct4x4llm_mmx));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										357
									
								
								test/intrapred_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										357
									
								
								test/intrapred_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,357 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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.h>
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vp8/common/blockd.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class IntraPredBase {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  void SetupMacroblock(uint8_t *data, int block_size, int stride,
 | 
				
			||||||
 | 
					                       int num_planes) {
 | 
				
			||||||
 | 
					    memset(&mb_, 0, sizeof(mb_));
 | 
				
			||||||
 | 
					    memset(&mi_, 0, sizeof(mi_));
 | 
				
			||||||
 | 
					    mb_.up_available = 1;
 | 
				
			||||||
 | 
					    mb_.left_available = 1;
 | 
				
			||||||
 | 
					    mb_.mode_info_context = &mi_;
 | 
				
			||||||
 | 
					    stride_ = stride;
 | 
				
			||||||
 | 
					    block_size_ = block_size;
 | 
				
			||||||
 | 
					    num_planes_ = num_planes;
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes; p++)
 | 
				
			||||||
 | 
					      data_ptr_[p] = data + stride * (block_size + 1) * p +
 | 
				
			||||||
 | 
					                     stride + block_size;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void FillRandom() {
 | 
				
			||||||
 | 
					    // Fill edges with random data
 | 
				
			||||||
 | 
					    ACMRandom rnd(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++) {
 | 
				
			||||||
 | 
					      for (int x = -1 ; x <= block_size_; x++)
 | 
				
			||||||
 | 
					        data_ptr_[p][x - stride_] = rnd.Rand8();
 | 
				
			||||||
 | 
					      for (int y = 0; y < block_size_; y++)
 | 
				
			||||||
 | 
					        data_ptr_[p][y * stride_ - 1] = rnd.Rand8();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Predict(MB_PREDICTION_MODE mode) = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void SetLeftUnavailable() {
 | 
				
			||||||
 | 
					    mb_.left_available = 0;
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++)
 | 
				
			||||||
 | 
					      for (int i = -1; i < block_size_; ++i)
 | 
				
			||||||
 | 
					        data_ptr_[p][stride_ * i - 1] = 129;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void SetTopUnavailable() {
 | 
				
			||||||
 | 
					    mb_.up_available = 0;
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++)
 | 
				
			||||||
 | 
					      memset(&data_ptr_[p][-1 - stride_], 127, block_size_ + 2);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void SetTopLeftUnavailable() {
 | 
				
			||||||
 | 
					    SetLeftUnavailable();
 | 
				
			||||||
 | 
					    SetTopUnavailable();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int BlockSizeLog2Min1() const {
 | 
				
			||||||
 | 
					    switch (block_size_) {
 | 
				
			||||||
 | 
					      case 16:
 | 
				
			||||||
 | 
					        return 3;
 | 
				
			||||||
 | 
					      case 8:
 | 
				
			||||||
 | 
					        return 2;
 | 
				
			||||||
 | 
					      default:
 | 
				
			||||||
 | 
					        return 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // check DC prediction output against a reference
 | 
				
			||||||
 | 
					  void CheckDCPrediction() const {
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++) {
 | 
				
			||||||
 | 
					      // calculate expected DC
 | 
				
			||||||
 | 
					      int expected;
 | 
				
			||||||
 | 
					      if (mb_.up_available || mb_.left_available) {
 | 
				
			||||||
 | 
					        int sum = 0, shift = BlockSizeLog2Min1() + mb_.up_available +
 | 
				
			||||||
 | 
					                             mb_.left_available;
 | 
				
			||||||
 | 
					        if (mb_.up_available)
 | 
				
			||||||
 | 
					          for (int x = 0; x < block_size_; x++)
 | 
				
			||||||
 | 
					            sum += data_ptr_[p][x - stride_];
 | 
				
			||||||
 | 
					        if (mb_.left_available)
 | 
				
			||||||
 | 
					          for (int y = 0; y < block_size_; y++)
 | 
				
			||||||
 | 
					            sum += data_ptr_[p][y * stride_ - 1];
 | 
				
			||||||
 | 
					        expected = (sum + (1 << (shift - 1))) >> shift;
 | 
				
			||||||
 | 
					      } else
 | 
				
			||||||
 | 
					        expected = 0x80;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // check that all subsequent lines are equal to the first
 | 
				
			||||||
 | 
					      for (int y = 1; y < block_size_; ++y)
 | 
				
			||||||
 | 
					        ASSERT_EQ(0, memcmp(data_ptr_[p], &data_ptr_[p][y * stride_],
 | 
				
			||||||
 | 
					                            block_size_));
 | 
				
			||||||
 | 
					      // within the first line, ensure that each pixel has the same value
 | 
				
			||||||
 | 
					      for (int x = 1; x < block_size_; ++x)
 | 
				
			||||||
 | 
					        ASSERT_EQ(data_ptr_[p][0], data_ptr_[p][x]);
 | 
				
			||||||
 | 
					      // now ensure that that pixel has the expected (DC) value
 | 
				
			||||||
 | 
					      ASSERT_EQ(expected, data_ptr_[p][0]);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // check V prediction output against a reference
 | 
				
			||||||
 | 
					  void CheckVPrediction() const {
 | 
				
			||||||
 | 
					    // check that all lines equal the top border
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++)
 | 
				
			||||||
 | 
					      for (int y = 0; y < block_size_; y++)
 | 
				
			||||||
 | 
					        ASSERT_EQ(0, memcmp(&data_ptr_[p][-stride_],
 | 
				
			||||||
 | 
					                            &data_ptr_[p][y * stride_], block_size_));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // check H prediction output against a reference
 | 
				
			||||||
 | 
					  void CheckHPrediction() const {
 | 
				
			||||||
 | 
					    // for each line, ensure that each pixel is equal to the left border
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++)
 | 
				
			||||||
 | 
					      for (int y = 0; y < block_size_; y++)
 | 
				
			||||||
 | 
					        for (int x = 0; x < block_size_; x++)
 | 
				
			||||||
 | 
					          ASSERT_EQ(data_ptr_[p][-1 + y * stride_],
 | 
				
			||||||
 | 
					                    data_ptr_[p][x + y * stride_]);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static int ClipByte(int value) {
 | 
				
			||||||
 | 
					    if (value > 255)
 | 
				
			||||||
 | 
					      return 255;
 | 
				
			||||||
 | 
					    else if (value < 0)
 | 
				
			||||||
 | 
					      return 0;
 | 
				
			||||||
 | 
					    return value;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // check TM prediction output against a reference
 | 
				
			||||||
 | 
					  void CheckTMPrediction() const {
 | 
				
			||||||
 | 
					    for (int p = 0; p < num_planes_; p++)
 | 
				
			||||||
 | 
					      for (int y = 0; y < block_size_; y++)
 | 
				
			||||||
 | 
					        for (int x = 0; x < block_size_; x++) {
 | 
				
			||||||
 | 
					          const int expected = ClipByte(data_ptr_[p][x - stride_]
 | 
				
			||||||
 | 
					                                      + data_ptr_[p][stride_ * y - 1]
 | 
				
			||||||
 | 
					                                      - data_ptr_[p][-1 - stride_]);
 | 
				
			||||||
 | 
					          ASSERT_EQ(expected, data_ptr_[p][y * stride_ + x]);
 | 
				
			||||||
 | 
					       }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Actual test
 | 
				
			||||||
 | 
					  void RunTest() {
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("DC_PRED");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      Predict(DC_PRED);
 | 
				
			||||||
 | 
					      CheckDCPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("DC_PRED LEFT");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      SetLeftUnavailable();
 | 
				
			||||||
 | 
					      Predict(DC_PRED);
 | 
				
			||||||
 | 
					      CheckDCPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("DC_PRED TOP");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      SetTopUnavailable();
 | 
				
			||||||
 | 
					      Predict(DC_PRED);
 | 
				
			||||||
 | 
					      CheckDCPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("DC_PRED TOP_LEFT");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      SetTopLeftUnavailable();
 | 
				
			||||||
 | 
					      Predict(DC_PRED);
 | 
				
			||||||
 | 
					      CheckDCPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("H_PRED");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      Predict(H_PRED);
 | 
				
			||||||
 | 
					      CheckHPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("V_PRED");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      Predict(V_PRED);
 | 
				
			||||||
 | 
					      CheckVPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      SCOPED_TRACE("TM_PRED");
 | 
				
			||||||
 | 
					      FillRandom();
 | 
				
			||||||
 | 
					      Predict(TM_PRED);
 | 
				
			||||||
 | 
					      CheckTMPrediction();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  MACROBLOCKD mb_;
 | 
				
			||||||
 | 
					  MODE_INFO mi_;
 | 
				
			||||||
 | 
					  uint8_t *data_ptr_[2];  // in the case of Y, only [0] is used
 | 
				
			||||||
 | 
					  int stride_;
 | 
				
			||||||
 | 
					  int block_size_;
 | 
				
			||||||
 | 
					  int num_planes_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*intra_pred_y_fn_t)(MACROBLOCKD *x,
 | 
				
			||||||
 | 
					                                  uint8_t *yabove_row,
 | 
				
			||||||
 | 
					                                  uint8_t *yleft,
 | 
				
			||||||
 | 
					                                  int left_stride,
 | 
				
			||||||
 | 
					                                  uint8_t *ypred_ptr,
 | 
				
			||||||
 | 
					                                  int y_stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>,
 | 
				
			||||||
 | 
					    protected IntraPredBase {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  static void SetUpTestCase() {
 | 
				
			||||||
 | 
					    data_array_ = reinterpret_cast<uint8_t*>(
 | 
				
			||||||
 | 
					        vpx_memalign(kDataAlignment, kDataBufferSize));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static void TearDownTestCase() {
 | 
				
			||||||
 | 
					    vpx_free(data_array_);
 | 
				
			||||||
 | 
					    data_array_ = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  static const int kBlockSize = 16;
 | 
				
			||||||
 | 
					  static const int kDataAlignment = 16;
 | 
				
			||||||
 | 
					  static const int kStride = kBlockSize * 3;
 | 
				
			||||||
 | 
					  // We use 48 so that the data pointer of the first pixel in each row of
 | 
				
			||||||
 | 
					  // each macroblock is 16-byte aligned, and this gives us access to the
 | 
				
			||||||
 | 
					  // top-left and top-right corner pixels belonging to the top-left/right
 | 
				
			||||||
 | 
					  // macroblocks.
 | 
				
			||||||
 | 
					  // We use 17 lines so we have one line above us for top-prediction.
 | 
				
			||||||
 | 
					  static const int kDataBufferSize = kStride * (kBlockSize + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    pred_fn_ = GetParam();
 | 
				
			||||||
 | 
					    SetupMacroblock(data_array_, kBlockSize, kStride, 1);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Predict(MB_PREDICTION_MODE mode) {
 | 
				
			||||||
 | 
					    mb_.mode_info_context->mbmi.mode = mode;
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(pred_fn_(&mb_,
 | 
				
			||||||
 | 
					                                  data_ptr_[0] - kStride,
 | 
				
			||||||
 | 
					                                  data_ptr_[0] - 1, kStride,
 | 
				
			||||||
 | 
					                                  data_ptr_[0], kStride));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  intra_pred_y_fn_t pred_fn_;
 | 
				
			||||||
 | 
					  static uint8_t* data_array_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					uint8_t* IntraPredYTest::data_array_ = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IntraPredYTest, IntraPredTests) {
 | 
				
			||||||
 | 
					  RunTest();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, IntraPredYTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mby_s_c));
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE2, IntraPredYTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mby_s_sse2));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSSE3
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredYTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mby_s_ssse3));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*intra_pred_uv_fn_t)(MACROBLOCKD *x,
 | 
				
			||||||
 | 
					                                   uint8_t *uabove_row,
 | 
				
			||||||
 | 
					                                   uint8_t *vabove_row,
 | 
				
			||||||
 | 
					                                   uint8_t *uleft,
 | 
				
			||||||
 | 
					                                   uint8_t *vleft,
 | 
				
			||||||
 | 
					                                   int left_stride,
 | 
				
			||||||
 | 
					                                   uint8_t *upred_ptr,
 | 
				
			||||||
 | 
					                                   uint8_t *vpred_ptr,
 | 
				
			||||||
 | 
					                                   int pred_stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>,
 | 
				
			||||||
 | 
					    protected IntraPredBase {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  static void SetUpTestCase() {
 | 
				
			||||||
 | 
					    data_array_ = reinterpret_cast<uint8_t*>(
 | 
				
			||||||
 | 
					        vpx_memalign(kDataAlignment, kDataBufferSize));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static void TearDownTestCase() {
 | 
				
			||||||
 | 
					    vpx_free(data_array_);
 | 
				
			||||||
 | 
					    data_array_ = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  static const int kBlockSize = 8;
 | 
				
			||||||
 | 
					  static const int kDataAlignment = 8;
 | 
				
			||||||
 | 
					  static const int kStride = kBlockSize * 3;
 | 
				
			||||||
 | 
					  // We use 24 so that the data pointer of the first pixel in each row of
 | 
				
			||||||
 | 
					  // each macroblock is 8-byte aligned, and this gives us access to the
 | 
				
			||||||
 | 
					  // top-left and top-right corner pixels belonging to the top-left/right
 | 
				
			||||||
 | 
					  // macroblocks.
 | 
				
			||||||
 | 
					  // We use 9 lines so we have one line above us for top-prediction.
 | 
				
			||||||
 | 
					  // [0] = U, [1] = V
 | 
				
			||||||
 | 
					  static const int kDataBufferSize = 2 * kStride * (kBlockSize + 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    pred_fn_ = GetParam();
 | 
				
			||||||
 | 
					    SetupMacroblock(data_array_, kBlockSize, kStride, 2);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Predict(MB_PREDICTION_MODE mode) {
 | 
				
			||||||
 | 
					    mb_.mode_info_context->mbmi.uv_mode = mode;
 | 
				
			||||||
 | 
					    pred_fn_(&mb_, data_ptr_[0] - kStride, data_ptr_[1] - kStride,
 | 
				
			||||||
 | 
					             data_ptr_[0] - 1, data_ptr_[1] - 1, kStride,
 | 
				
			||||||
 | 
					             data_ptr_[0], data_ptr_[1], kStride);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  intra_pred_uv_fn_t pred_fn_;
 | 
				
			||||||
 | 
					  // We use 24 so that the data pointer of the first pixel in each row of
 | 
				
			||||||
 | 
					  // each macroblock is 8-byte aligned, and this gives us access to the
 | 
				
			||||||
 | 
					  // top-left and top-right corner pixels belonging to the top-left/right
 | 
				
			||||||
 | 
					  // macroblocks.
 | 
				
			||||||
 | 
					  // We use 9 lines so we have one line above us for top-prediction.
 | 
				
			||||||
 | 
					  // [0] = U, [1] = V
 | 
				
			||||||
 | 
					  static uint8_t* data_array_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					uint8_t* IntraPredUVTest::data_array_ = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(IntraPredUVTest, IntraPredTests) {
 | 
				
			||||||
 | 
					  RunTest();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, IntraPredUVTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mbuv_s_c));
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE2, IntraPredUVTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mbuv_s_sse2));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSSE3
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(
 | 
				
			||||||
 | 
					                            vp8_build_intra_predictors_mbuv_s_ssse3));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										109
									
								
								test/ivf_video_source.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										109
									
								
								test/ivf_video_source.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,109 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_IVF_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					#define TEST_IVF_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					#include <cstdio>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					#include <new>
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					const unsigned int kCodeBufferSize = 256 * 1024;
 | 
				
			||||||
 | 
					const unsigned int kIvfFileHdrSize = 32;
 | 
				
			||||||
 | 
					const unsigned int kIvfFrameHdrSize = 12;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static unsigned int MemGetLe32(const uint8_t *mem) {
 | 
				
			||||||
 | 
					  return (mem[3] << 24) | (mem[2] << 16) | (mem[1] << 8) | (mem[0]);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// This class extends VideoSource to allow parsing of ivf files,
 | 
				
			||||||
 | 
					// so that we can do actual file decodes.
 | 
				
			||||||
 | 
					class IVFVideoSource : public CompressedVideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  IVFVideoSource(const std::string &file_name)
 | 
				
			||||||
 | 
					      : file_name_(file_name),
 | 
				
			||||||
 | 
					        input_file_(NULL),
 | 
				
			||||||
 | 
					        compressed_frame_buf_(NULL),
 | 
				
			||||||
 | 
					        frame_sz_(0),
 | 
				
			||||||
 | 
					        frame_(0),
 | 
				
			||||||
 | 
					        end_of_file_(false) {
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~IVFVideoSource() {
 | 
				
			||||||
 | 
					    delete[] compressed_frame_buf_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (input_file_)
 | 
				
			||||||
 | 
					      fclose(input_file_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Init() {
 | 
				
			||||||
 | 
					    // Allocate a buffer for read in the compressed video frame.
 | 
				
			||||||
 | 
					    compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize];
 | 
				
			||||||
 | 
					    ASSERT_TRUE(compressed_frame_buf_) << "Allocate frame buffer failed";
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Begin() {
 | 
				
			||||||
 | 
					    input_file_ = OpenTestDataFile(file_name_);
 | 
				
			||||||
 | 
					    ASSERT_TRUE(input_file_) << "Input file open failed. Filename: "
 | 
				
			||||||
 | 
					        << file_name_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Read file header
 | 
				
			||||||
 | 
					    uint8_t file_hdr[kIvfFileHdrSize];
 | 
				
			||||||
 | 
					    ASSERT_EQ(kIvfFileHdrSize, fread(file_hdr, 1, kIvfFileHdrSize, input_file_))
 | 
				
			||||||
 | 
					        << "File header read failed.";
 | 
				
			||||||
 | 
					    // Check file header
 | 
				
			||||||
 | 
					    ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' && file_hdr[2] == 'I'
 | 
				
			||||||
 | 
					                && file_hdr[3] == 'F') << "Input is not an IVF file.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Next() {
 | 
				
			||||||
 | 
					    ++frame_;
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void FillFrame() {
 | 
				
			||||||
 | 
					    uint8_t frame_hdr[kIvfFrameHdrSize];
 | 
				
			||||||
 | 
					    // Check frame header and read a frame from input_file.
 | 
				
			||||||
 | 
					    if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_)
 | 
				
			||||||
 | 
					        != kIvfFrameHdrSize) {
 | 
				
			||||||
 | 
					      end_of_file_ = true;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      end_of_file_ = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      frame_sz_ = MemGetLe32(frame_hdr);
 | 
				
			||||||
 | 
					      ASSERT_LE(frame_sz_, kCodeBufferSize)
 | 
				
			||||||
 | 
					          << "Frame is too big for allocated code buffer";
 | 
				
			||||||
 | 
					      ASSERT_EQ(frame_sz_,
 | 
				
			||||||
 | 
					                fread(compressed_frame_buf_, 1, frame_sz_, input_file_))
 | 
				
			||||||
 | 
					          << "Failed to read complete frame";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual const uint8_t *cxdata() const {
 | 
				
			||||||
 | 
					    return end_of_file_ ? NULL : compressed_frame_buf_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  virtual const unsigned int frame_size() const { return frame_sz_; }
 | 
				
			||||||
 | 
					  virtual const unsigned int frame_number() const { return frame_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  std::string file_name_;
 | 
				
			||||||
 | 
					  FILE *input_file_;
 | 
				
			||||||
 | 
					  uint8_t *compressed_frame_buf_;
 | 
				
			||||||
 | 
					  unsigned int frame_sz_;
 | 
				
			||||||
 | 
					  unsigned int frame_;
 | 
				
			||||||
 | 
					  bool end_of_file_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_IVF_VIDEO_SOURCE_H_
 | 
				
			||||||
							
								
								
									
										145
									
								
								test/keyframe_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								test/keyframe_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,145 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 <climits>
 | 
				
			||||||
 | 
					#include <vector>
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/i420_video_source.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class KeyframeTest : public ::libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<enum libvpx_test::TestMode> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(GetParam());
 | 
				
			||||||
 | 
					    kf_count_ = 0;
 | 
				
			||||||
 | 
					    kf_count_max_ = INT_MAX;
 | 
				
			||||||
 | 
					    kf_do_force_kf_ = false;
 | 
				
			||||||
 | 
					    set_cpu_used_ = 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
 | 
				
			||||||
 | 
					                                  ::libvpx_test::Encoder *encoder) {
 | 
				
			||||||
 | 
					    if (kf_do_force_kf_)
 | 
				
			||||||
 | 
					      frame_flags_ = (video->frame() % 3) ? 0 : VPX_EFLAG_FORCE_KF;
 | 
				
			||||||
 | 
					    if (set_cpu_used_ && video->frame() == 1)
 | 
				
			||||||
 | 
					      encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) {
 | 
				
			||||||
 | 
					      kf_pts_list_.push_back(pkt->data.frame.pts);
 | 
				
			||||||
 | 
					      kf_count_++;
 | 
				
			||||||
 | 
					      abort_ |= kf_count_ > kf_count_max_;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bool kf_do_force_kf_;
 | 
				
			||||||
 | 
					  int kf_count_;
 | 
				
			||||||
 | 
					  int kf_count_max_;
 | 
				
			||||||
 | 
					  std::vector<vpx_codec_pts_t> kf_pts_list_;
 | 
				
			||||||
 | 
					  int set_cpu_used_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(KeyframeTest, TestRandomVideoSource) {
 | 
				
			||||||
 | 
					  // Validate that encoding the RandomVideoSource produces multiple keyframes.
 | 
				
			||||||
 | 
					  // This validates the results of the TestDisableKeyframes test.
 | 
				
			||||||
 | 
					  kf_count_max_ = 2;  // early exit successful tests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ::libvpx_test::RandomVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // In realtime mode - auto placed keyframes are exceedingly rare,  don't
 | 
				
			||||||
 | 
					  // bother with this check   if(GetParam() > 0)
 | 
				
			||||||
 | 
					  if(GetParam() > 0)
 | 
				
			||||||
 | 
					    EXPECT_GT(kf_count_, 1);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(KeyframeTest, TestDisableKeyframes) {
 | 
				
			||||||
 | 
					  cfg_.kf_mode = VPX_KF_DISABLED;
 | 
				
			||||||
 | 
					  kf_count_max_ = 1;  // early exit failed tests.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ::libvpx_test::RandomVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  EXPECT_EQ(1, kf_count_);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(KeyframeTest, TestForceKeyframe) {
 | 
				
			||||||
 | 
					  cfg_.kf_mode = VPX_KF_DISABLED;
 | 
				
			||||||
 | 
					  kf_do_force_kf_ = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ::libvpx_test::DummyVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // verify that every third frame is a keyframe.
 | 
				
			||||||
 | 
					  for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
 | 
				
			||||||
 | 
					       iter != kf_pts_list_.end(); ++iter) {
 | 
				
			||||||
 | 
					    ASSERT_EQ(0, *iter % 3) << "Unexpected keyframe at frame " << *iter;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(KeyframeTest, TestKeyframeMaxDistance) {
 | 
				
			||||||
 | 
					  cfg_.kf_max_dist = 25;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ::libvpx_test::DummyVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // verify that keyframe interval matches kf_max_dist
 | 
				
			||||||
 | 
					  for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
 | 
				
			||||||
 | 
					       iter != kf_pts_list_.end(); ++iter) {
 | 
				
			||||||
 | 
					    ASSERT_EQ(0, *iter % 25) << "Unexpected keyframe at frame " << *iter;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(KeyframeTest, TestAutoKeyframe) {
 | 
				
			||||||
 | 
					  cfg_.kf_mode = VPX_KF_AUTO;
 | 
				
			||||||
 | 
					  kf_do_force_kf_ = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Force a deterministic speed step in Real Time mode, as the faster modes
 | 
				
			||||||
 | 
					  // may not produce a keyframe like we expect. This is necessary when running
 | 
				
			||||||
 | 
					  // on very slow environments (like Valgrind). The step -11 was determined
 | 
				
			||||||
 | 
					  // experimentally as the fastest mode that still throws the keyframe.
 | 
				
			||||||
 | 
					  if (deadline_ == VPX_DL_REALTIME)
 | 
				
			||||||
 | 
					    set_cpu_used_ = -11;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // This clip has a cut scene every 30 frames -> Frame 0, 30, 60, 90, 120.
 | 
				
			||||||
 | 
					  // I check only the first 40 frames to make sure there's a keyframe at frame
 | 
				
			||||||
 | 
					  // 0 and 30.
 | 
				
			||||||
 | 
					  ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
 | 
				
			||||||
 | 
					                                       30, 1, 0, 40);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // In realtime mode - auto placed keyframes are exceedingly rare,  don't
 | 
				
			||||||
 | 
					  // bother with this check
 | 
				
			||||||
 | 
					  if(GetParam() > 0)
 | 
				
			||||||
 | 
					    EXPECT_EQ(2u, kf_pts_list_.size()) << " Not the right number of keyframes ";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Verify that keyframes match the file keyframes in the file.
 | 
				
			||||||
 | 
					  for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
 | 
				
			||||||
 | 
					       iter != kf_pts_list_.end(); ++iter) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (deadline_ == VPX_DL_REALTIME && *iter > 0)
 | 
				
			||||||
 | 
					      EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame "
 | 
				
			||||||
 | 
					        << *iter;
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(AllModes, KeyframeTest, ALL_TEST_MODES);
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										107
									
								
								test/pp_filter_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										107
									
								
								test/pp_filter_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,107 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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/register_state_check.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*post_proc_func_t)(unsigned char *src_ptr,
 | 
				
			||||||
 | 
					                                 unsigned char *dst_ptr,
 | 
				
			||||||
 | 
					                                 int src_pixels_per_line,
 | 
				
			||||||
 | 
					                                 int dst_pixels_per_line,
 | 
				
			||||||
 | 
					                                 int cols,
 | 
				
			||||||
 | 
					                                 unsigned char *flimit,
 | 
				
			||||||
 | 
					                                 int size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class Vp8PostProcessingFilterTest
 | 
				
			||||||
 | 
					    : public ::testing::TestWithParam<post_proc_func_t> {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Test routine for the VP8 post-processing function
 | 
				
			||||||
 | 
					// vp8_post_proc_down_and_across_mb_row_c.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(Vp8PostProcessingFilterTest, FilterOutputCheck) {
 | 
				
			||||||
 | 
					  // Size of the underlying data block that will be filtered.
 | 
				
			||||||
 | 
					  const int block_width  = 16;
 | 
				
			||||||
 | 
					  const int block_height = 16;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 5-tap filter needs 2 padding rows above and below the block in the input.
 | 
				
			||||||
 | 
					  const int input_width = block_width;
 | 
				
			||||||
 | 
					  const int input_height = block_height + 4;
 | 
				
			||||||
 | 
					  const int input_stride = input_width;
 | 
				
			||||||
 | 
					  const int input_size = input_width * input_height;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Filter extends output block by 8 samples at left and right edges.
 | 
				
			||||||
 | 
					  const int output_width = block_width + 16;
 | 
				
			||||||
 | 
					  const int output_height = block_height;
 | 
				
			||||||
 | 
					  const int output_stride = output_width;
 | 
				
			||||||
 | 
					  const int output_size = output_width * output_height;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  uint8_t *const src_image =
 | 
				
			||||||
 | 
					      reinterpret_cast<uint8_t*>(vpx_calloc(input_size, 1));
 | 
				
			||||||
 | 
					  uint8_t *const dst_image =
 | 
				
			||||||
 | 
					      reinterpret_cast<uint8_t*>(vpx_calloc(output_size, 1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 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 dst_image_ptr = dst_image + 8;
 | 
				
			||||||
 | 
					  uint8_t *const flimits = reinterpret_cast<uint8_t *>(vpx_memalign(16, block_width));
 | 
				
			||||||
 | 
					  (void)vpx_memset(flimits, 255, block_width);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Initialize pixels in the input:
 | 
				
			||||||
 | 
					  //   block pixels to value 1,
 | 
				
			||||||
 | 
					  //   border pixels to value 10.
 | 
				
			||||||
 | 
					  (void)vpx_memset(src_image, 10, input_size);
 | 
				
			||||||
 | 
					  uint8_t *pixel_ptr = src_image_ptr;
 | 
				
			||||||
 | 
					  for (int i = 0; i < block_height; ++i) {
 | 
				
			||||||
 | 
					    for (int j = 0; j < block_width; ++j) {
 | 
				
			||||||
 | 
					      pixel_ptr[j] = 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    pixel_ptr += input_stride;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Initialize pixels in the output to 99.
 | 
				
			||||||
 | 
					  (void)vpx_memset(dst_image, 99, output_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  REGISTER_STATE_CHECK(GetParam()(src_image_ptr, dst_image_ptr, input_stride,
 | 
				
			||||||
 | 
					                                  output_stride, block_width, flimits, 16));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static const uint8_t expected_data[block_height] = {
 | 
				
			||||||
 | 
					    4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  pixel_ptr = dst_image_ptr;
 | 
				
			||||||
 | 
					  for (int i = 0; i < block_height; ++i) {
 | 
				
			||||||
 | 
					    for (int j = 0; j < block_width; ++j) {
 | 
				
			||||||
 | 
					      EXPECT_EQ(expected_data[i], pixel_ptr[j])
 | 
				
			||||||
 | 
					          << "Vp8PostProcessingFilterTest failed with invalid filter output";
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    pixel_ptr += output_stride;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_free(src_image);
 | 
				
			||||||
 | 
					  vpx_free(dst_image);
 | 
				
			||||||
 | 
					  vpx_free(flimits);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, Vp8PostProcessingFilterTest,
 | 
				
			||||||
 | 
					    ::testing::Values(vp8_post_proc_down_and_across_mb_row_c));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE2, Vp8PostProcessingFilterTest,
 | 
				
			||||||
 | 
					    ::testing::Values(vp8_post_proc_down_and_across_mb_row_sse2));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										95
									
								
								test/register_state_check.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								test/register_state_check.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,95 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 LIBVPX_TEST_REGISTER_STATE_CHECK_H_
 | 
				
			||||||
 | 
					#define LIBVPX_TEST_REGISTER_STATE_CHECK_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef _WIN64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define _WIN32_LEAN_AND_MEAN
 | 
				
			||||||
 | 
					#include <windows.h>
 | 
				
			||||||
 | 
					#include <winnt.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace testing {
 | 
				
			||||||
 | 
					namespace internal {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inline bool operator==(const M128A& lhs, const M128A& rhs) {
 | 
				
			||||||
 | 
					  return (lhs.Low == rhs.Low && lhs.High == rhs.High);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace internal
 | 
				
			||||||
 | 
					}  // namespace testing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Compares the state of xmm[6-15] at construction with their state at
 | 
				
			||||||
 | 
					// destruction. These registers should be preserved by the callee on
 | 
				
			||||||
 | 
					// Windows x64.
 | 
				
			||||||
 | 
					// Usage:
 | 
				
			||||||
 | 
					// {
 | 
				
			||||||
 | 
					//   RegisterStateCheck reg_check;
 | 
				
			||||||
 | 
					//   FunctionToVerify();
 | 
				
			||||||
 | 
					// }
 | 
				
			||||||
 | 
					class RegisterStateCheck {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  RegisterStateCheck() { initialized_ = StoreRegisters(&pre_context_); }
 | 
				
			||||||
 | 
					  ~RegisterStateCheck() { EXPECT_TRUE(Check()); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  static bool StoreRegisters(CONTEXT* const context) {
 | 
				
			||||||
 | 
					    const HANDLE this_thread = GetCurrentThread();
 | 
				
			||||||
 | 
					    EXPECT_TRUE(this_thread != NULL);
 | 
				
			||||||
 | 
					    context->ContextFlags = CONTEXT_FLOATING_POINT;
 | 
				
			||||||
 | 
					    const bool context_saved = GetThreadContext(this_thread, context) == TRUE;
 | 
				
			||||||
 | 
					    EXPECT_TRUE(context_saved) << "GetLastError: " << GetLastError();
 | 
				
			||||||
 | 
					    return context_saved;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Compares the register state. Returns true if the states match.
 | 
				
			||||||
 | 
					  bool Check() const {
 | 
				
			||||||
 | 
					    if (!initialized_) return false;
 | 
				
			||||||
 | 
					    CONTEXT post_context;
 | 
				
			||||||
 | 
					    if (!StoreRegisters(&post_context)) return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const M128A* xmm_pre = &pre_context_.Xmm6;
 | 
				
			||||||
 | 
					    const M128A* xmm_post = &post_context.Xmm6;
 | 
				
			||||||
 | 
					    for (int i = 6; i <= 15; ++i) {
 | 
				
			||||||
 | 
					      EXPECT_EQ(*xmm_pre, *xmm_post) << "xmm" << i << " has been modified!";
 | 
				
			||||||
 | 
					      ++xmm_pre;
 | 
				
			||||||
 | 
					      ++xmm_post;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return !testing::Test::HasNonfatalFailure();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  bool initialized_;
 | 
				
			||||||
 | 
					  CONTEXT pre_context_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define REGISTER_STATE_CHECK(statement) do { \
 | 
				
			||||||
 | 
					  libvpx_test::RegisterStateCheck reg_check; \
 | 
				
			||||||
 | 
					  statement;                               \
 | 
				
			||||||
 | 
					} while (false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#else  // !_WIN64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class RegisterStateCheck {};
 | 
				
			||||||
 | 
					#define REGISTER_STATE_CHECK(statement) statement
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // _WIN64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // LIBVPX_TEST_REGISTER_STATE_CHECK_H_
 | 
				
			||||||
							
								
								
									
										104
									
								
								test/resize_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								test/resize_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,104 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 <climits>
 | 
				
			||||||
 | 
					#include <vector>
 | 
				
			||||||
 | 
					#include "test/encode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/video_source.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const unsigned int kInitialWidth = 320;
 | 
				
			||||||
 | 
					const unsigned int kInitialHeight = 240;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unsigned int ScaleForFrameNumber(unsigned int frame, unsigned int val) {
 | 
				
			||||||
 | 
					  if (frame < 10)
 | 
				
			||||||
 | 
					    return val;
 | 
				
			||||||
 | 
					  if (frame < 20)
 | 
				
			||||||
 | 
					    return val / 2;
 | 
				
			||||||
 | 
					  if (frame < 30)
 | 
				
			||||||
 | 
					    return val * 2 / 3;
 | 
				
			||||||
 | 
					  if (frame < 40)
 | 
				
			||||||
 | 
					    return val / 4;
 | 
				
			||||||
 | 
					  if (frame < 50)
 | 
				
			||||||
 | 
					    return val * 7 / 8;
 | 
				
			||||||
 | 
					  return val;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ResizingVideoSource : public ::libvpx_test::DummyVideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  ResizingVideoSource() {
 | 
				
			||||||
 | 
					    SetSize(kInitialWidth, kInitialHeight);
 | 
				
			||||||
 | 
					    limit_ = 60;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  virtual void Next() {
 | 
				
			||||||
 | 
					    ++frame_;
 | 
				
			||||||
 | 
					    SetSize(ScaleForFrameNumber(frame_, kInitialWidth),
 | 
				
			||||||
 | 
					            ScaleForFrameNumber(frame_, kInitialHeight));
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ResizeTest : public ::libvpx_test::EncoderTest,
 | 
				
			||||||
 | 
					  public ::testing::TestWithParam<enum libvpx_test::TestMode> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  struct FrameInfo {
 | 
				
			||||||
 | 
					    FrameInfo(vpx_codec_pts_t _pts, unsigned int _w, unsigned int _h)
 | 
				
			||||||
 | 
					        : pts(_pts), w(_w), h(_h) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vpx_codec_pts_t pts;
 | 
				
			||||||
 | 
					    unsigned int    w;
 | 
				
			||||||
 | 
					    unsigned int    h;
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    InitializeConfig();
 | 
				
			||||||
 | 
					    SetMode(GetParam());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual bool Continue() const {
 | 
				
			||||||
 | 
					    return !HasFatalFailure() && !abort_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
 | 
				
			||||||
 | 
					    if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) {
 | 
				
			||||||
 | 
					      const unsigned char *buf =
 | 
				
			||||||
 | 
					          reinterpret_cast<const unsigned char *>(pkt->data.frame.buf);
 | 
				
			||||||
 | 
					      const unsigned int w = (buf[6] | (buf[7] << 8)) & 0x3fff;
 | 
				
			||||||
 | 
					      const unsigned int h = (buf[8] | (buf[9] << 8)) & 0x3fff;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      frame_info_list_.push_back(FrameInfo(pkt->data.frame.pts, w, h));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  std::vector< FrameInfo > frame_info_list_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(ResizeTest, TestExternalResizeWorks) {
 | 
				
			||||||
 | 
					  ResizingVideoSource video;
 | 
				
			||||||
 | 
					  ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (std::vector<FrameInfo>::iterator info = frame_info_list_.begin();
 | 
				
			||||||
 | 
					       info != frame_info_list_.end(); ++info) {
 | 
				
			||||||
 | 
					    const vpx_codec_pts_t pts = info->pts;
 | 
				
			||||||
 | 
					    const unsigned int expected_w = ScaleForFrameNumber(pts, kInitialWidth);
 | 
				
			||||||
 | 
					    const unsigned int expected_h = ScaleForFrameNumber(pts, kInitialHeight);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    EXPECT_EQ(expected_w, info->w)
 | 
				
			||||||
 | 
					        << "Frame " << pts << "had unexpected width";
 | 
				
			||||||
 | 
					    EXPECT_EQ(expected_h, info->h)
 | 
				
			||||||
 | 
					        << "Frame " << pts << "had unexpected height";
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(OnePass, ResizeTest, ONE_PASS_TEST_MODES);
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										253
									
								
								test/sad_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										253
									
								
								test/sad_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,253 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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.h>
 | 
				
			||||||
 | 
					#include <limits.h>
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "./vpx_config.h"
 | 
				
			||||||
 | 
					#include "./vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vp8/common/blockd.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "test/util.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef unsigned int (*sad_m_by_n_fn_t)(const unsigned char *source_ptr,
 | 
				
			||||||
 | 
					                                        int source_stride,
 | 
				
			||||||
 | 
					                                        const unsigned char *reference_ptr,
 | 
				
			||||||
 | 
					                                        int reference_stride,
 | 
				
			||||||
 | 
					                                        unsigned int max_sad);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					class SADTest : public PARAMS(int, int, sad_m_by_n_fn_t) {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  static void SetUpTestCase() {
 | 
				
			||||||
 | 
					    source_data_ = reinterpret_cast<uint8_t*>(
 | 
				
			||||||
 | 
					        vpx_memalign(kDataAlignment, kDataBufferSize));
 | 
				
			||||||
 | 
					    reference_data_ = reinterpret_cast<uint8_t*>(
 | 
				
			||||||
 | 
					        vpx_memalign(kDataAlignment, kDataBufferSize));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static void TearDownTestCase() {
 | 
				
			||||||
 | 
					    vpx_free(source_data_);
 | 
				
			||||||
 | 
					    source_data_ = NULL;
 | 
				
			||||||
 | 
					    vpx_free(reference_data_);
 | 
				
			||||||
 | 
					    reference_data_ = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  static const int kDataAlignment = 16;
 | 
				
			||||||
 | 
					  static const int kDataBufferSize = 16 * 32;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    sad_fn_ = GET_PARAM(2);
 | 
				
			||||||
 | 
					    height_ = GET_PARAM(1);
 | 
				
			||||||
 | 
					    width_ = GET_PARAM(0);
 | 
				
			||||||
 | 
					    source_stride_ = width_ * 2;
 | 
				
			||||||
 | 
					    reference_stride_ = width_ * 2;
 | 
				
			||||||
 | 
					    rnd_.Reset(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  sad_m_by_n_fn_t sad_fn_;
 | 
				
			||||||
 | 
					  virtual unsigned int SAD(unsigned int max_sad) {
 | 
				
			||||||
 | 
					    unsigned int ret;
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(ret = sad_fn_(source_data_, source_stride_,
 | 
				
			||||||
 | 
					                                       reference_data_, reference_stride_,
 | 
				
			||||||
 | 
					                                       max_sad));
 | 
				
			||||||
 | 
					    return ret;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Sum of Absolute Differences. Given two blocks, calculate the absolute
 | 
				
			||||||
 | 
					  // difference between two pixels in the same relative location; accumulate.
 | 
				
			||||||
 | 
					  unsigned int ReferenceSAD(unsigned int max_sad) {
 | 
				
			||||||
 | 
					    unsigned int sad = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (int h = 0; h < height_; ++h) {
 | 
				
			||||||
 | 
					      for (int w = 0; w < width_; ++w) {
 | 
				
			||||||
 | 
					        sad += abs(source_data_[h * source_stride_ + w]
 | 
				
			||||||
 | 
					               - reference_data_[h * reference_stride_ + w]);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      if (sad > max_sad) {
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return sad;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void FillConstant(uint8_t *data, int stride, uint8_t fill_constant) {
 | 
				
			||||||
 | 
					    for (int h = 0; h < height_; ++h) {
 | 
				
			||||||
 | 
					      for (int w = 0; w < width_; ++w) {
 | 
				
			||||||
 | 
					        data[h * stride + w] = fill_constant;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void FillRandom(uint8_t *data, int stride) {
 | 
				
			||||||
 | 
					    for (int h = 0; h < height_; ++h) {
 | 
				
			||||||
 | 
					      for (int w = 0; w < width_; ++w) {
 | 
				
			||||||
 | 
					        data[h * stride + w] = rnd_.Rand8();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void CheckSad(unsigned int max_sad) {
 | 
				
			||||||
 | 
					    unsigned int reference_sad, exp_sad;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    reference_sad = ReferenceSAD(max_sad);
 | 
				
			||||||
 | 
					    exp_sad = SAD(max_sad);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (reference_sad <= max_sad) {
 | 
				
			||||||
 | 
					      ASSERT_EQ(exp_sad, reference_sad);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      // Alternative implementations are not required to check max_sad
 | 
				
			||||||
 | 
					      ASSERT_GE(exp_sad, reference_sad);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Handle blocks up to 16x16 with stride up to 32
 | 
				
			||||||
 | 
					  int height_, width_;
 | 
				
			||||||
 | 
					  static uint8_t* source_data_;
 | 
				
			||||||
 | 
					  int source_stride_;
 | 
				
			||||||
 | 
					  static uint8_t* reference_data_;
 | 
				
			||||||
 | 
					  int reference_stride_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACMRandom rnd_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					uint8_t* SADTest::source_data_ = NULL;
 | 
				
			||||||
 | 
					uint8_t* SADTest::reference_data_ = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, MaxRef) {
 | 
				
			||||||
 | 
					  FillConstant(source_data_, source_stride_, 0);
 | 
				
			||||||
 | 
					  FillConstant(reference_data_, reference_stride_, 255);
 | 
				
			||||||
 | 
					  CheckSad(UINT_MAX);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, MaxSrc) {
 | 
				
			||||||
 | 
					  FillConstant(source_data_, source_stride_, 255);
 | 
				
			||||||
 | 
					  FillConstant(reference_data_, reference_stride_, 0);
 | 
				
			||||||
 | 
					  CheckSad(UINT_MAX);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, ShortRef) {
 | 
				
			||||||
 | 
					  int tmp_stride = reference_stride_;
 | 
				
			||||||
 | 
					  reference_stride_ >>= 1;
 | 
				
			||||||
 | 
					  FillRandom(source_data_, source_stride_);
 | 
				
			||||||
 | 
					  FillRandom(reference_data_, reference_stride_);
 | 
				
			||||||
 | 
					  CheckSad(UINT_MAX);
 | 
				
			||||||
 | 
					  reference_stride_ = tmp_stride;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, UnalignedRef) {
 | 
				
			||||||
 | 
					  // The reference frame, but not the source frame, may be unaligned for
 | 
				
			||||||
 | 
					  // certain types of searches.
 | 
				
			||||||
 | 
					  int tmp_stride = reference_stride_;
 | 
				
			||||||
 | 
					  reference_stride_ -= 1;
 | 
				
			||||||
 | 
					  FillRandom(source_data_, source_stride_);
 | 
				
			||||||
 | 
					  FillRandom(reference_data_, reference_stride_);
 | 
				
			||||||
 | 
					  CheckSad(UINT_MAX);
 | 
				
			||||||
 | 
					  reference_stride_ = tmp_stride;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, ShortSrc) {
 | 
				
			||||||
 | 
					  int tmp_stride = source_stride_;
 | 
				
			||||||
 | 
					  source_stride_ >>= 1;
 | 
				
			||||||
 | 
					  FillRandom(source_data_, source_stride_);
 | 
				
			||||||
 | 
					  FillRandom(reference_data_, reference_stride_);
 | 
				
			||||||
 | 
					  CheckSad(UINT_MAX);
 | 
				
			||||||
 | 
					  source_stride_ = tmp_stride;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SADTest, MaxSAD) {
 | 
				
			||||||
 | 
					  // Verify that, when max_sad is set, the implementation does not return a
 | 
				
			||||||
 | 
					  // value lower than the reference.
 | 
				
			||||||
 | 
					  FillConstant(source_data_, source_stride_, 255);
 | 
				
			||||||
 | 
					  FillConstant(reference_data_, reference_stride_, 0);
 | 
				
			||||||
 | 
					  CheckSad(128);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using std::tr1::make_tuple;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_c = vp8_sad16x16_c;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x16_c = vp8_sad8x16_c;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x8_c = vp8_sad16x8_c;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x8_c = vp8_sad8x8_c;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_4x4_c = vp8_sad4x4_c;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_c),
 | 
				
			||||||
 | 
					                        make_tuple(8, 16, sad_8x16_c),
 | 
				
			||||||
 | 
					                        make_tuple(16, 8, sad_16x8_c),
 | 
				
			||||||
 | 
					                        make_tuple(8, 8, sad_8x8_c),
 | 
				
			||||||
 | 
					                        make_tuple(4, 4, sad_4x4_c)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// ARM tests
 | 
				
			||||||
 | 
					#if HAVE_MEDIA
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_armv6)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_NEON
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_neon = vp8_sad16x16_neon;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x16_neon = vp8_sad8x16_neon;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x8_neon = vp8_sad16x8_neon;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x8_neon = vp8_sad8x8_neon;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_4x4_neon = vp8_sad4x4_neon;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_neon),
 | 
				
			||||||
 | 
					                        make_tuple(8, 16, sad_8x16_neon),
 | 
				
			||||||
 | 
					                        make_tuple(16, 8, sad_16x8_neon),
 | 
				
			||||||
 | 
					                        make_tuple(8, 8, sad_8x8_neon),
 | 
				
			||||||
 | 
					                        make_tuple(4, 4, sad_4x4_neon)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// X86 tests
 | 
				
			||||||
 | 
					#if HAVE_MMX
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_mmx = vp8_sad16x16_mmx;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x16_mmx = vp8_sad8x16_mmx;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x8_mmx = vp8_sad16x8_mmx;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x8_mmx = vp8_sad8x8_mmx;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_4x4_mmx = vp8_sad4x4_mmx;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(MMX, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_mmx),
 | 
				
			||||||
 | 
					                        make_tuple(8, 16, sad_8x16_mmx),
 | 
				
			||||||
 | 
					                        make_tuple(16, 8, sad_16x8_mmx),
 | 
				
			||||||
 | 
					                        make_tuple(8, 8, sad_8x8_mmx),
 | 
				
			||||||
 | 
					                        make_tuple(4, 4, sad_4x4_mmx)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_wmt = vp8_sad16x16_wmt;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x16_wmt = vp8_sad8x16_wmt;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x8_wmt = vp8_sad16x8_wmt;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_8x8_wmt = vp8_sad8x8_wmt;
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_4x4_wmt = vp8_sad4x4_wmt;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE2, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_wmt),
 | 
				
			||||||
 | 
					                        make_tuple(8, 16, sad_8x16_wmt),
 | 
				
			||||||
 | 
					                        make_tuple(16, 8, sad_16x8_wmt),
 | 
				
			||||||
 | 
					                        make_tuple(8, 8, sad_8x8_wmt),
 | 
				
			||||||
 | 
					                        make_tuple(4, 4, sad_4x4_wmt)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSSE3
 | 
				
			||||||
 | 
					const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
 | 
				
			||||||
 | 
					                        make_tuple(16, 16, sad_16x16_sse3)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										182
									
								
								test/set_roi.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										182
									
								
								test/set_roi.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,182 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 <stddef.h>
 | 
				
			||||||
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					#include <sys/types.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vp8/encoder/onyx_int.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST(Vp8RoiMapTest, ParameterCheck) {
 | 
				
			||||||
 | 
					  int delta_q[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 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const int internalq_trans[] = {
 | 
				
			||||||
 | 
					    0,   1,  2,  3,  4,  5,  7,  8,
 | 
				
			||||||
 | 
					    9,  10, 12, 13, 15, 17, 18, 19,
 | 
				
			||||||
 | 
					    20,  21, 23, 24, 25, 26, 27, 28,
 | 
				
			||||||
 | 
					    29,  30, 31, 33, 35, 37, 39, 41,
 | 
				
			||||||
 | 
					    43,  45, 47, 49, 51, 53, 55, 57,
 | 
				
			||||||
 | 
					    59,  61, 64, 67, 70, 73, 76, 79,
 | 
				
			||||||
 | 
					    82,  85, 88, 91, 94, 97, 100, 103,
 | 
				
			||||||
 | 
					    106, 109, 112, 115, 118, 121, 124, 127,
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Initialize elements of cpi with valid defaults.
 | 
				
			||||||
 | 
					  VP8_COMP cpi;
 | 
				
			||||||
 | 
					  cpi.mb.e_mbd.mb_segement_abs_delta = SEGMENT_DELTADATA;
 | 
				
			||||||
 | 
					  cpi.cyclic_refresh_mode_enabled = 0;
 | 
				
			||||||
 | 
					  cpi.mb.e_mbd.segmentation_enabled = 0;
 | 
				
			||||||
 | 
					  cpi.mb.e_mbd.update_mb_segmentation_map = 0;
 | 
				
			||||||
 | 
					  cpi.mb.e_mbd.update_mb_segmentation_data = 0;
 | 
				
			||||||
 | 
					  cpi.common.mb_rows = 240 >> 4;
 | 
				
			||||||
 | 
					  cpi.common.mb_cols = 320 >> 4;
 | 
				
			||||||
 | 
					  const int mbs = (cpi.common.mb_rows * cpi.common.mb_cols);
 | 
				
			||||||
 | 
					  vpx_memset(cpi.segment_feature_data, 0, sizeof(cpi.segment_feature_data));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Segment map
 | 
				
			||||||
 | 
					  cpi.segmentation_map = reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Allocate memory for the source memory map.
 | 
				
			||||||
 | 
					  unsigned char *roi_map =
 | 
				
			||||||
 | 
					    reinterpret_cast<unsigned char *>(vpx_calloc(mbs, 1));
 | 
				
			||||||
 | 
					  vpx_memset(&roi_map[mbs >> 2], 1, (mbs >> 2));
 | 
				
			||||||
 | 
					  vpx_memset(&roi_map[mbs >> 1], 2, (mbs >> 2));
 | 
				
			||||||
 | 
					  vpx_memset(&roi_map[mbs -(mbs >> 2)], 3, (mbs >> 2));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Do a test call with valid parameters.
 | 
				
			||||||
 | 
					  int roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
 | 
				
			||||||
 | 
					                                  cpi.common.mb_cols, delta_q, delta_lf,
 | 
				
			||||||
 | 
					                                  threshold);
 | 
				
			||||||
 | 
					  EXPECT_EQ(0, roi_retval)
 | 
				
			||||||
 | 
					        << "vp8_set_roimap roi failed with default test parameters";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Check that the values in the cpi structure get set as expected.
 | 
				
			||||||
 | 
					  if (roi_retval == 0) {
 | 
				
			||||||
 | 
					    // Check that the segment map got set.
 | 
				
			||||||
 | 
					    const int mapcompare = memcmp(roi_map, cpi.segmentation_map, mbs);
 | 
				
			||||||
 | 
					    EXPECT_EQ(0, mapcompare) << "segment map error";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check the q deltas (note the need to translate into
 | 
				
			||||||
 | 
					    // the interanl range of 0-127.
 | 
				
			||||||
 | 
					    for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
 | 
				
			||||||
 | 
					      const int transq = internalq_trans[abs(delta_q[i])];
 | 
				
			||||||
 | 
					      if (abs(cpi.segment_feature_data[MB_LVL_ALT_Q][i]) != transq) {
 | 
				
			||||||
 | 
					          EXPECT_EQ(transq, cpi.segment_feature_data[MB_LVL_ALT_Q][i])
 | 
				
			||||||
 | 
					                    << "segment delta_q  error";
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check the loop filter deltas
 | 
				
			||||||
 | 
					    for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
 | 
				
			||||||
 | 
					      if (cpi.segment_feature_data[MB_LVL_ALT_LF][i] != delta_lf[i]) {
 | 
				
			||||||
 | 
					        EXPECT_EQ(delta_lf[i], cpi.segment_feature_data[MB_LVL_ALT_LF][i])
 | 
				
			||||||
 | 
					                  << "segment delta_lf error";
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check the breakout thresholds
 | 
				
			||||||
 | 
					    for (int i = 0; i < MAX_MB_SEGMENTS; ++i) {
 | 
				
			||||||
 | 
					      unsigned int breakout =
 | 
				
			||||||
 | 
					        static_cast<unsigned int>(cpi.segment_encode_breakout[i]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      if (threshold[i] != breakout) {
 | 
				
			||||||
 | 
					        EXPECT_EQ(threshold[i], breakout)
 | 
				
			||||||
 | 
					                  << "breakout threshold error";
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Segmentation, and segmentation update flages should be set.
 | 
				
			||||||
 | 
					    EXPECT_EQ(1, cpi.mb.e_mbd.segmentation_enabled)
 | 
				
			||||||
 | 
					              << "segmentation_enabled error";
 | 
				
			||||||
 | 
					    EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_map)
 | 
				
			||||||
 | 
					              << "update_mb_segmentation_map error";
 | 
				
			||||||
 | 
					    EXPECT_EQ(1, cpi.mb.e_mbd.update_mb_segmentation_data)
 | 
				
			||||||
 | 
					              << "update_mb_segmentation_data error";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Try a range of delta q and lf parameters (some legal, some not)
 | 
				
			||||||
 | 
					    for (int i = 0; i < 1000; ++i) {
 | 
				
			||||||
 | 
					      int rand_deltas[4];
 | 
				
			||||||
 | 
					      int deltas_valid;
 | 
				
			||||||
 | 
					      rand_deltas[0] = (rand() % 160) - 80;
 | 
				
			||||||
 | 
					      rand_deltas[1] = (rand() % 160) - 80;
 | 
				
			||||||
 | 
					      rand_deltas[2] = (rand() % 160) - 80;
 | 
				
			||||||
 | 
					      rand_deltas[3] = (rand() % 160) - 80;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      deltas_valid = ((abs(rand_deltas[0]) <= 63) &&
 | 
				
			||||||
 | 
					                      (abs(rand_deltas[1]) <= 63) &&
 | 
				
			||||||
 | 
					                      (abs(rand_deltas[2]) <= 63) &&
 | 
				
			||||||
 | 
					                      (abs(rand_deltas[3]) <= 63)) ? 0 : -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Test with random delta q values.
 | 
				
			||||||
 | 
					      roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
 | 
				
			||||||
 | 
					                                  cpi.common.mb_cols, rand_deltas,
 | 
				
			||||||
 | 
					                                  delta_lf, threshold);
 | 
				
			||||||
 | 
					      EXPECT_EQ(deltas_valid, roi_retval) << "dq range check error";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // One delta_q error shown at a time
 | 
				
			||||||
 | 
					      if (deltas_valid != roi_retval)
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Test with random loop filter values.
 | 
				
			||||||
 | 
					      roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
 | 
				
			||||||
 | 
					                                  cpi.common.mb_cols, delta_q,
 | 
				
			||||||
 | 
					                                  rand_deltas, threshold);
 | 
				
			||||||
 | 
					      EXPECT_EQ(deltas_valid, roi_retval) << "dlf range check error";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // One delta loop filter error shown at a time
 | 
				
			||||||
 | 
					      if (deltas_valid != roi_retval)
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Test that we report and error if cyclic refresh is enabled.
 | 
				
			||||||
 | 
					    cpi.cyclic_refresh_mode_enabled = 1;
 | 
				
			||||||
 | 
					    roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
 | 
				
			||||||
 | 
					                                cpi.common.mb_cols, delta_q,
 | 
				
			||||||
 | 
					                                delta_lf, threshold);
 | 
				
			||||||
 | 
					    EXPECT_EQ(-1, roi_retval) << "cyclic refresh check error";
 | 
				
			||||||
 | 
					    cpi.cyclic_refresh_mode_enabled = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Test invalid number of rows or colums.
 | 
				
			||||||
 | 
					    roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows + 1,
 | 
				
			||||||
 | 
					                                cpi.common.mb_cols, delta_q,
 | 
				
			||||||
 | 
					                                delta_lf, threshold);
 | 
				
			||||||
 | 
					    EXPECT_EQ(-1, roi_retval) << "MB rows bounds check error";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    roi_retval = vp8_set_roimap(&cpi, roi_map, cpi.common.mb_rows,
 | 
				
			||||||
 | 
					                                cpi.common.mb_cols - 1, delta_q,
 | 
				
			||||||
 | 
					                                delta_lf, threshold);
 | 
				
			||||||
 | 
					    EXPECT_EQ(-1, roi_retval) << "MB cols bounds check error";
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Free allocated memory
 | 
				
			||||||
 | 
					  if (cpi.segmentation_map)
 | 
				
			||||||
 | 
					    vpx_free(cpi.segmentation_map);
 | 
				
			||||||
 | 
					  if (roi_map)
 | 
				
			||||||
 | 
					    vpx_free(roi_map);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										224
									
								
								test/sixtap_predict_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										224
									
								
								test/sixtap_predict_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,224 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					*  Copyright (c) 2012 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 "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					#include "test/util.h"
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "./vpx_config.h"
 | 
				
			||||||
 | 
					#include "./vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*sixtap_predict_fn_t)(uint8_t *src_ptr,
 | 
				
			||||||
 | 
					                                    int  src_pixels_per_line,
 | 
				
			||||||
 | 
					                                    int  xoffset,
 | 
				
			||||||
 | 
					                                    int  yoffset,
 | 
				
			||||||
 | 
					                                    uint8_t *dst_ptr,
 | 
				
			||||||
 | 
					                                    int  dst_pitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class SixtapPredictTest : public PARAMS(int, int, sixtap_predict_fn_t) {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  static void SetUpTestCase() {
 | 
				
			||||||
 | 
					    src_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kSrcSize));
 | 
				
			||||||
 | 
					    dst_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kDstSize));
 | 
				
			||||||
 | 
					    dst_c_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kDstSize));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  static void TearDownTestCase() {
 | 
				
			||||||
 | 
					    vpx_free(src_);
 | 
				
			||||||
 | 
					    src_ = NULL;
 | 
				
			||||||
 | 
					    vpx_free(dst_);
 | 
				
			||||||
 | 
					    dst_ = NULL;
 | 
				
			||||||
 | 
					    vpx_free(dst_c_);
 | 
				
			||||||
 | 
					    dst_c_ = NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  // Make test arrays big enough for 16x16 functions. Six-tap filters
 | 
				
			||||||
 | 
					  // need 5 extra pixels outside of the macroblock.
 | 
				
			||||||
 | 
					  static const int kSrcStride = 21;
 | 
				
			||||||
 | 
					  static const int kDstStride = 16;
 | 
				
			||||||
 | 
					  static const int kDataAlignment = 16;
 | 
				
			||||||
 | 
					  static const int kSrcSize = kSrcStride * kSrcStride + 1;
 | 
				
			||||||
 | 
					  static const int kDstSize = kDstStride * kDstStride;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void SetUp() {
 | 
				
			||||||
 | 
					    width_ = GET_PARAM(0);
 | 
				
			||||||
 | 
					    height_ = GET_PARAM(1);
 | 
				
			||||||
 | 
					    sixtap_predict_ = GET_PARAM(2);
 | 
				
			||||||
 | 
					    memset(src_, 0, sizeof(src_));
 | 
				
			||||||
 | 
					    memset(dst_, 0, sizeof(dst_));
 | 
				
			||||||
 | 
					    memset(dst_c_, 0, sizeof(dst_c_));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int width_;
 | 
				
			||||||
 | 
					  int height_;
 | 
				
			||||||
 | 
					  sixtap_predict_fn_t sixtap_predict_;
 | 
				
			||||||
 | 
					  // The src stores the macroblock we will filter on, and makes it 1 byte larger
 | 
				
			||||||
 | 
					  // in order to test unaligned access. The result is stored in dst and dst_c(c
 | 
				
			||||||
 | 
					  // reference code result).
 | 
				
			||||||
 | 
					  static uint8_t* src_;
 | 
				
			||||||
 | 
					  static uint8_t* dst_;
 | 
				
			||||||
 | 
					  static uint8_t* dst_c_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					uint8_t* SixtapPredictTest::src_ = NULL;
 | 
				
			||||||
 | 
					uint8_t* SixtapPredictTest::dst_ = NULL;
 | 
				
			||||||
 | 
					uint8_t* SixtapPredictTest::dst_c_ = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SixtapPredictTest, TestWithPresetData) {
 | 
				
			||||||
 | 
					  // Test input
 | 
				
			||||||
 | 
					  static const uint8_t test_data[kSrcSize] = {
 | 
				
			||||||
 | 
					    216, 184, 4, 191, 82, 92, 41, 0, 1, 226, 236, 172, 20, 182, 42, 226, 177,
 | 
				
			||||||
 | 
					    79, 94, 77, 179, 203, 206, 198, 22, 192, 19, 75, 17, 192, 44, 233, 120,
 | 
				
			||||||
 | 
					    48, 168, 203, 141, 210, 203, 143, 180, 184, 59, 201, 110, 102, 171, 32,
 | 
				
			||||||
 | 
					    182, 10, 109, 105, 213, 60, 47, 236, 253, 67, 55, 14, 3, 99, 247, 124,
 | 
				
			||||||
 | 
					    148, 159, 71, 34, 114, 19, 177, 38, 203, 237, 239, 58, 83, 155, 91, 10,
 | 
				
			||||||
 | 
					    166, 201, 115, 124, 5, 163, 104, 2, 231, 160, 16, 234, 4, 8, 103, 153,
 | 
				
			||||||
 | 
					    167, 174, 187, 26, 193, 109, 64, 141, 90, 48, 200, 174, 204, 36, 184,
 | 
				
			||||||
 | 
					    114, 237, 43, 238, 242, 207, 86, 245, 182, 247, 6, 161, 251, 14, 8, 148,
 | 
				
			||||||
 | 
					    182, 182, 79, 208, 120, 188, 17, 6, 23, 65, 206, 197, 13, 242, 126, 128,
 | 
				
			||||||
 | 
					    224, 170, 110, 211, 121, 197, 200, 47, 188, 207, 208, 184, 221, 216, 76,
 | 
				
			||||||
 | 
					    148, 143, 156, 100, 8, 89, 117, 14, 112, 183, 221, 54, 197, 208, 180, 69,
 | 
				
			||||||
 | 
					    176, 94, 180, 131, 215, 121, 76, 7, 54, 28, 216, 238, 249, 176, 58, 142,
 | 
				
			||||||
 | 
					    64, 215, 242, 72, 49, 104, 87, 161, 32, 52, 216, 230, 4, 141, 44, 181,
 | 
				
			||||||
 | 
					    235, 224, 57, 195, 89, 134, 203, 144, 162, 163, 126, 156, 84, 185, 42,
 | 
				
			||||||
 | 
					    148, 145, 29, 221, 194, 134, 52, 100, 166, 105, 60, 140, 110, 201, 184,
 | 
				
			||||||
 | 
					    35, 181, 153, 93, 121, 243, 227, 68, 131, 134, 232, 2, 35, 60, 187, 77,
 | 
				
			||||||
 | 
					    209, 76, 106, 174, 15, 241, 227, 115, 151, 77, 175, 36, 187, 121, 221,
 | 
				
			||||||
 | 
					    223, 47, 118, 61, 168, 105, 32, 237, 236, 167, 213, 238, 202, 17, 170,
 | 
				
			||||||
 | 
					    24, 226, 247, 131, 145, 6, 116, 117, 121, 11, 194, 41, 48, 126, 162, 13,
 | 
				
			||||||
 | 
					    93, 209, 131, 154, 122, 237, 187, 103, 217, 99, 60, 200, 45, 78, 115, 69,
 | 
				
			||||||
 | 
					    49, 106, 200, 194, 112, 60, 56, 234, 72, 251, 19, 120, 121, 182, 134, 215,
 | 
				
			||||||
 | 
					    135, 10, 114, 2, 247, 46, 105, 209, 145, 165, 153, 191, 243, 12, 5, 36,
 | 
				
			||||||
 | 
					    119, 206, 231, 231, 11, 32, 209, 83, 27, 229, 204, 149, 155, 83, 109, 35,
 | 
				
			||||||
 | 
					    93, 223, 37, 84, 14, 142, 37, 160, 52, 191, 96, 40, 204, 101, 77, 67, 52,
 | 
				
			||||||
 | 
					    53, 43, 63, 85, 253, 147, 113, 226, 96, 6, 125, 179, 115, 161, 17, 83,
 | 
				
			||||||
 | 
					    198, 101, 98, 85, 139, 3, 137, 75, 99, 178, 23, 201, 255, 91, 253, 52,
 | 
				
			||||||
 | 
					    134, 60, 138, 131, 208, 251, 101, 48, 2, 227, 228, 118, 132, 245, 202,
 | 
				
			||||||
 | 
					    75, 91, 44, 160, 231, 47, 41, 50, 147, 220, 74, 92, 219, 165, 89, 16
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Expected result
 | 
				
			||||||
 | 
					  static const uint8_t expected_dst[kDstSize] = {
 | 
				
			||||||
 | 
					    117, 102, 74, 135, 42, 98, 175, 206, 70, 73, 222, 197, 50, 24, 39, 49, 38,
 | 
				
			||||||
 | 
					    105, 90, 47, 169, 40, 171, 215, 200, 73, 109, 141, 53, 85, 177, 164, 79,
 | 
				
			||||||
 | 
					    208, 124, 89, 212, 18, 81, 145, 151, 164, 217, 153, 91, 154, 102, 102,
 | 
				
			||||||
 | 
					    159, 75, 164, 152, 136, 51, 213, 219, 186, 116, 193, 224, 186, 36, 231,
 | 
				
			||||||
 | 
					    208, 84, 211, 155, 167, 35, 59, 42, 76, 216, 149, 73, 201, 78, 149, 184,
 | 
				
			||||||
 | 
					    100, 96, 196, 189, 198, 188, 235, 195, 117, 129, 120, 129, 49, 25, 133,
 | 
				
			||||||
 | 
					    113, 69, 221, 114, 70, 143, 99, 157, 108, 189, 140, 78, 6, 55, 65, 240,
 | 
				
			||||||
 | 
					    255, 245, 184, 72, 90, 100, 116, 131, 39, 60, 234, 167, 33, 160, 88, 185,
 | 
				
			||||||
 | 
					    200, 157, 159, 176, 127, 151, 138, 102, 168, 106, 170, 86, 82, 219, 189,
 | 
				
			||||||
 | 
					    76, 33, 115, 197, 106, 96, 198, 136, 97, 141, 237, 151, 98, 137, 191,
 | 
				
			||||||
 | 
					    185, 2, 57, 95, 142, 91, 255, 185, 97, 137, 76, 162, 94, 173, 131, 193,
 | 
				
			||||||
 | 
					    161, 81, 106, 72, 135, 222, 234, 137, 66, 137, 106, 243, 210, 147, 95,
 | 
				
			||||||
 | 
					    15, 137, 110, 85, 66, 16, 96, 167, 147, 150, 173, 203, 140, 118, 196,
 | 
				
			||||||
 | 
					    84, 147, 160, 19, 95, 101, 123, 74, 132, 202, 82, 166, 12, 131, 166,
 | 
				
			||||||
 | 
					    189, 170, 159, 85, 79, 66, 57, 152, 132, 203, 194, 0, 1, 56, 146, 180,
 | 
				
			||||||
 | 
					    224, 156, 28, 83, 181, 79, 76, 80, 46, 160, 175, 59, 106, 43, 87, 75,
 | 
				
			||||||
 | 
					    136, 85, 189, 46, 71, 200, 90
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  uint8_t *src = const_cast<uint8_t*>(test_data);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  REGISTER_STATE_CHECK(sixtap_predict_(&src[kSrcStride * 2 + 2 + 1], kSrcStride,
 | 
				
			||||||
 | 
					                                       2, 2, dst_, kDstStride));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for (int i = 0; i < height_; ++i)
 | 
				
			||||||
 | 
					    for (int j = 0; j < width_; ++j)
 | 
				
			||||||
 | 
					      ASSERT_EQ(expected_dst[i * kDstStride + j], dst_[i * kDstStride + j])
 | 
				
			||||||
 | 
					          << "i==" << (i * width_ + j);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SixtapPredictTest, TestWithRandomData) {
 | 
				
			||||||
 | 
					  ACMRandom rnd(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					  for (int i = 0; i < kSrcSize; ++i)
 | 
				
			||||||
 | 
					    src_[i] = rnd.Rand8();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Run tests for all possible offsets.
 | 
				
			||||||
 | 
					  for (int xoffset = 0; xoffset < 8; ++xoffset) {
 | 
				
			||||||
 | 
					    for (int yoffset = 0; yoffset < 8; ++yoffset) {
 | 
				
			||||||
 | 
					      // Call c reference function.
 | 
				
			||||||
 | 
					      // Move start point to next pixel to test if the function reads
 | 
				
			||||||
 | 
					      // unaligned data correctly.
 | 
				
			||||||
 | 
					      vp8_sixtap_predict16x16_c(&src_[kSrcStride * 2 + 2 + 1], kSrcStride,
 | 
				
			||||||
 | 
					                                xoffset, yoffset, dst_c_, kDstStride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      // Run test.
 | 
				
			||||||
 | 
					      REGISTER_STATE_CHECK(
 | 
				
			||||||
 | 
					          sixtap_predict_(&src_[kSrcStride * 2 + 2 + 1], kSrcStride,
 | 
				
			||||||
 | 
					                          xoffset, yoffset, dst_, kDstStride));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      for (int i = 0; i < height_; ++i)
 | 
				
			||||||
 | 
					        for (int j = 0; j < width_; ++j)
 | 
				
			||||||
 | 
					          ASSERT_EQ(dst_c_[i * kDstStride + j], dst_[i * kDstStride + j])
 | 
				
			||||||
 | 
					              << "i==" << (i * width_ + j);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using std::tr1::make_tuple;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_16x16_c = vp8_sixtap_predict16x16_c;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x8_c = vp8_sixtap_predict8x8_c;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x4_c = vp8_sixtap_predict8x4_c;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_4x4_c = vp8_sixtap_predict4x4_c;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(
 | 
				
			||||||
 | 
					    C, SixtapPredictTest, ::testing::Values(
 | 
				
			||||||
 | 
					        make_tuple(16, 16, sixtap_16x16_c),
 | 
				
			||||||
 | 
					        make_tuple(8, 8, sixtap_8x8_c),
 | 
				
			||||||
 | 
					        make_tuple(8, 4, sixtap_8x4_c),
 | 
				
			||||||
 | 
					        make_tuple(4, 4, sixtap_4x4_c)));
 | 
				
			||||||
 | 
					#if HAVE_MMX
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_16x16_mmx = vp8_sixtap_predict16x16_mmx;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x8_mmx = vp8_sixtap_predict8x8_mmx;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x4_mmx = vp8_sixtap_predict8x4_mmx;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_4x4_mmx = vp8_sixtap_predict4x4_mmx;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(
 | 
				
			||||||
 | 
					    MMX, SixtapPredictTest, ::testing::Values(
 | 
				
			||||||
 | 
					        make_tuple(16, 16, sixtap_16x16_mmx),
 | 
				
			||||||
 | 
					        make_tuple(8, 8, sixtap_8x8_mmx),
 | 
				
			||||||
 | 
					        make_tuple(8, 4, sixtap_8x4_mmx),
 | 
				
			||||||
 | 
					        make_tuple(4, 4, sixtap_4x4_mmx)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_16x16_sse2 = vp8_sixtap_predict16x16_sse2;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x8_sse2 = vp8_sixtap_predict8x8_sse2;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x4_sse2 = vp8_sixtap_predict8x4_sse2;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(
 | 
				
			||||||
 | 
					    SSE2, SixtapPredictTest, ::testing::Values(
 | 
				
			||||||
 | 
					        make_tuple(16, 16, sixtap_16x16_sse2),
 | 
				
			||||||
 | 
					        make_tuple(8, 8, sixtap_8x8_sse2),
 | 
				
			||||||
 | 
					        make_tuple(8, 4, sixtap_8x4_sse2)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#if HAVE_SSSE3
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_16x16_ssse3 = vp8_sixtap_predict16x16_ssse3;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x8_ssse3 = vp8_sixtap_predict8x8_ssse3;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_8x4_ssse3 = vp8_sixtap_predict8x4_ssse3;
 | 
				
			||||||
 | 
					const sixtap_predict_fn_t sixtap_4x4_ssse3 = vp8_sixtap_predict4x4_ssse3;
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(
 | 
				
			||||||
 | 
					    SSSE3, SixtapPredictTest, ::testing::Values(
 | 
				
			||||||
 | 
					        make_tuple(16, 16, sixtap_16x16_ssse3),
 | 
				
			||||||
 | 
					        make_tuple(8, 8, sixtap_8x8_ssse3),
 | 
				
			||||||
 | 
					        make_tuple(8, 4, sixtap_8x4_ssse3),
 | 
				
			||||||
 | 
					        make_tuple(4, 4, sixtap_4x4_ssse3)));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										114
									
								
								test/subtract_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								test/subtract_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,114 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "test/register_state_check.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vp8/common/blockd.h"
 | 
				
			||||||
 | 
					#include "vp8/encoder/block.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class SubtractBlockTest : public ::testing::TestWithParam<subtract_b_fn_t> {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					using libvpx_test::ACMRandom;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					TEST_P(SubtractBlockTest, SimpleSubtract) {
 | 
				
			||||||
 | 
					  ACMRandom rnd(ACMRandom::DeterministicSeed());
 | 
				
			||||||
 | 
					  BLOCK be;
 | 
				
			||||||
 | 
					  BLOCKD bd;
 | 
				
			||||||
 | 
					  // in libvpx, this stride is always 16
 | 
				
			||||||
 | 
					  const int kDiffPredStride = 16;
 | 
				
			||||||
 | 
					  const int kSrcStride[] = {32, 16, 8, 4, 0};
 | 
				
			||||||
 | 
					  const int kBlockWidth = 4;
 | 
				
			||||||
 | 
					  const int kBlockHeight = 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Allocate... align to 16 for mmx/sse tests
 | 
				
			||||||
 | 
					  uint8_t *source = reinterpret_cast<uint8_t*>(
 | 
				
			||||||
 | 
					      vpx_memalign(16, kBlockHeight * kSrcStride[0] * sizeof(*source)));
 | 
				
			||||||
 | 
					  be.src_diff = reinterpret_cast<int16_t*>(
 | 
				
			||||||
 | 
					      vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*be.src_diff)));
 | 
				
			||||||
 | 
					  bd.predictor = reinterpret_cast<unsigned char*>(
 | 
				
			||||||
 | 
					      vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*bd.predictor)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  for(int i = 0; kSrcStride[i] > 0; ++i) {
 | 
				
			||||||
 | 
					    // start at block0
 | 
				
			||||||
 | 
					    be.src = 0;
 | 
				
			||||||
 | 
					    be.base_src = &source;
 | 
				
			||||||
 | 
					    be.src_stride = kSrcStride[i];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // set difference
 | 
				
			||||||
 | 
					    int16_t *src_diff = be.src_diff;
 | 
				
			||||||
 | 
					    for (int r = 0; r < kBlockHeight; ++r) {
 | 
				
			||||||
 | 
					      for (int c = 0; c < kBlockWidth; ++c) {
 | 
				
			||||||
 | 
					        src_diff[c] = 0xa5a5;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      src_diff += kDiffPredStride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // set destination
 | 
				
			||||||
 | 
					    uint8_t *base_src = *be.base_src;
 | 
				
			||||||
 | 
					    for (int r = 0; r < kBlockHeight; ++r) {
 | 
				
			||||||
 | 
					      for (int c = 0; c < kBlockWidth; ++c) {
 | 
				
			||||||
 | 
					        base_src[c] = rnd.Rand8();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      base_src += be.src_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // set predictor
 | 
				
			||||||
 | 
					    uint8_t *predictor = bd.predictor;
 | 
				
			||||||
 | 
					    for (int r = 0; r < kBlockHeight; ++r) {
 | 
				
			||||||
 | 
					      for (int c = 0; c < kBlockWidth; ++c) {
 | 
				
			||||||
 | 
					        predictor[c] = rnd.Rand8();
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      predictor += kDiffPredStride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    REGISTER_STATE_CHECK(GetParam()(&be, &bd, kDiffPredStride));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    base_src = *be.base_src;
 | 
				
			||||||
 | 
					    src_diff = be.src_diff;
 | 
				
			||||||
 | 
					    predictor = bd.predictor;
 | 
				
			||||||
 | 
					    for (int r = 0; r < kBlockHeight; ++r) {
 | 
				
			||||||
 | 
					      for (int c = 0; c < kBlockWidth; ++c) {
 | 
				
			||||||
 | 
					        EXPECT_EQ(base_src[c], (src_diff[c] + predictor[c])) << "r = " << r
 | 
				
			||||||
 | 
					                                                             << ", c = " << c;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      src_diff += kDiffPredStride;
 | 
				
			||||||
 | 
					      predictor += kDiffPredStride;
 | 
				
			||||||
 | 
					      base_src += be.src_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  vpx_free(be.src_diff);
 | 
				
			||||||
 | 
					  vpx_free(source);
 | 
				
			||||||
 | 
					  vpx_free(bd.predictor);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(C, SubtractBlockTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(vp8_subtract_b_c));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_MMX
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(vp8_subtract_b_mmx));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest,
 | 
				
			||||||
 | 
					                        ::testing::Values(vp8_subtract_b_sse2));
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										123
									
								
								test/test-data.sha1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								test/test-data.sha1
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,123 @@
 | 
				
			|||||||
 | 
					d5dfb0151c9051f8c85999255645d7a23916d3c0  hantro_collage_w352h288.yuv
 | 
				
			||||||
 | 
					5184c46ddca8b1fadd16742e8500115bc8f749da  vp80-00-comprehensive-001.ivf
 | 
				
			||||||
 | 
					65bf1bbbced81b97bd030f376d1b7f61a224793f  vp80-00-comprehensive-002.ivf
 | 
				
			||||||
 | 
					906b4c1e99eb734504c504b3f1ad8052137ce672  vp80-00-comprehensive-003.ivf
 | 
				
			||||||
 | 
					ec144b1af53af895db78355785650b96dd3f0ade  vp80-00-comprehensive-004.ivf
 | 
				
			||||||
 | 
					afc7091785c62f1c121c4554a2830c30704587d9  vp80-00-comprehensive-005.ivf
 | 
				
			||||||
 | 
					42ea9d55c818145d06a9b633b8e85c6a6164fd3e  vp80-00-comprehensive-006.ivf
 | 
				
			||||||
 | 
					e5b3a73ab79fe024c14309d653d6bed92902ee3b  vp80-00-comprehensive-007.ivf
 | 
				
			||||||
 | 
					f3c50a58875930adfb84525c0ef59d7e4c08540c  vp80-00-comprehensive-008.ivf
 | 
				
			||||||
 | 
					4b2841fdb83db51ae322096ae468bbb9dc2c8362  vp80-00-comprehensive-009.ivf
 | 
				
			||||||
 | 
					efbff736e3a91ab6a98c5bc2dce65d645944c7b1  vp80-00-comprehensive-010.ivf
 | 
				
			||||||
 | 
					6b315102cae008d22a3d2c231be92cb704a222f8  vp80-00-comprehensive-011.ivf
 | 
				
			||||||
 | 
					f3214a4fea14c2d5ec689936c1613f274c859ee8  vp80-00-comprehensive-012.ivf
 | 
				
			||||||
 | 
					e4094e96d308c8a35b74c480a43d853c5294cd34  vp80-00-comprehensive-013.ivf
 | 
				
			||||||
 | 
					5b0adfaf60a69e0aaf3ec021a39d0a68fc0e1b5a  vp80-00-comprehensive-014.ivf
 | 
				
			||||||
 | 
					e8467688ddf26b5000664f904faf0d70506aa653  vp80-00-comprehensive-015.ivf
 | 
				
			||||||
 | 
					aab55582337dfd2a39ff54fb2576a91910d49337  vp80-00-comprehensive-016.ivf
 | 
				
			||||||
 | 
					1ba24724f80203c9bae4f1d0f99d534721980016  vp80-00-comprehensive-017.ivf
 | 
				
			||||||
 | 
					143a15512b46f436280ddb4d0e6411eb4af434f2  vp80-00-comprehensive-018.ivf
 | 
				
			||||||
 | 
					c5baeaf5714fdfb3a8bc960a8e33ac438e83b16b  vp80-01-intra-1400.ivf
 | 
				
			||||||
 | 
					f383955229afe3408453e316d11553d923ca60d5  vp80-01-intra-1411.ivf
 | 
				
			||||||
 | 
					84e1f4343f174c9f3c83f834bac3196fb325bf2c  vp80-01-intra-1416.ivf
 | 
				
			||||||
 | 
					fb6e712a47dd57a28a3727d2ae2c97a8b7c7ca51  vp80-01-intra-1417.ivf
 | 
				
			||||||
 | 
					71ea772d3e9d315b8cbecf41207b8a237c34853b  vp80-02-inter-1402.ivf
 | 
				
			||||||
 | 
					d85dbc4271525dcd128c503f936fe69091d1f8d0  vp80-02-inter-1412.ivf
 | 
				
			||||||
 | 
					d4e5d3ad56511867d025f93724d090f92ba6ec3d  vp80-02-inter-1418.ivf
 | 
				
			||||||
 | 
					91791cbcc37c60f35dbd8090bacb54e5ec6dd4fa  vp80-02-inter-1424.ivf
 | 
				
			||||||
 | 
					17fbfe2fea70f6e2f3fa6ca4efaae6c0b03b5f02  vp80-03-segmentation-01.ivf
 | 
				
			||||||
 | 
					3c3600dbbcde08e20d54c66fe3b7eadd4f09bdbb  vp80-03-segmentation-02.ivf
 | 
				
			||||||
 | 
					c156778d5340967d4b369c490848076e92f1f875  vp80-03-segmentation-03.ivf
 | 
				
			||||||
 | 
					d25dcff6c60e87a1af70945b8911b6b4998533b0  vp80-03-segmentation-04.ivf
 | 
				
			||||||
 | 
					362baba2ce454c9db21218f35e81c27a5ed0b730  vp80-03-segmentation-1401.ivf
 | 
				
			||||||
 | 
					d223ae7ee748ce07e74c4679bfd219e84aa9f4b0  vp80-03-segmentation-1403.ivf
 | 
				
			||||||
 | 
					033adf7f3a13836a3f1cffcb87c1972900f2b5c6  vp80-03-segmentation-1407.ivf
 | 
				
			||||||
 | 
					4d51dfbf9f3e2c590ec99d1d6f59dd731d04375f  vp80-03-segmentation-1408.ivf
 | 
				
			||||||
 | 
					f37a62b197c2600d75e0ccfbb31b60efdedac251  vp80-03-segmentation-1409.ivf
 | 
				
			||||||
 | 
					eb25bd7bfba5b2f6935018a930f42d123b1e7fcd  vp80-03-segmentation-1410.ivf
 | 
				
			||||||
 | 
					b9d5c436663a30c27cfff84b53a002e501258843  vp80-03-segmentation-1413.ivf
 | 
				
			||||||
 | 
					6da92b9d1a180cc3a8afe348ab12258f5a37be1a  vp80-03-segmentation-1414.ivf
 | 
				
			||||||
 | 
					a4f5842602886bd669f115f93d8a35c035cb0948  vp80-03-segmentation-1415.ivf
 | 
				
			||||||
 | 
					f295dceb8ef278b77251b3f9df8aee22e161d547  vp80-03-segmentation-1425.ivf
 | 
				
			||||||
 | 
					198dbf9f36f733200e432664cc8c5752d59779de  vp80-03-segmentation-1426.ivf
 | 
				
			||||||
 | 
					7704804e32f5de976803929934a7fafe101ac7b0  vp80-03-segmentation-1427.ivf
 | 
				
			||||||
 | 
					831ccd862ea95ca025d2f3bd8b88678752f5416d  vp80-03-segmentation-1432.ivf
 | 
				
			||||||
 | 
					b3c11978529289f9109f2766fcaba3ebc40e11ef  vp80-03-segmentation-1435.ivf
 | 
				
			||||||
 | 
					a835a731f5520ebfc1002c40121264d0020559ac  vp80-03-segmentation-1436.ivf
 | 
				
			||||||
 | 
					1d1732942f773bb2a5775fcb9689b1579ce28eab  vp80-03-segmentation-1437.ivf
 | 
				
			||||||
 | 
					db04799adfe089dfdf74dbd43cc05ede7161f99e  vp80-03-segmentation-1441.ivf
 | 
				
			||||||
 | 
					7caf39b3f20cfd52b998210878062e52a5edf1e6  vp80-03-segmentation-1442.ivf
 | 
				
			||||||
 | 
					3607f6bb4ee106c38fa1ea370dc4ff8b8cde2261  vp80-04-partitions-1404.ivf
 | 
				
			||||||
 | 
					93cc323b6b6867f1b12dd48773424549c6960a6b  vp80-04-partitions-1405.ivf
 | 
				
			||||||
 | 
					047eedb14b865bdac8a3538e63801054e0295e9c  vp80-04-partitions-1406.ivf
 | 
				
			||||||
 | 
					0f1233bd2bc33f56ce5e495dbd455d122339f384  vp80-05-sharpness-1428.ivf
 | 
				
			||||||
 | 
					51767fc136488a9535c2a4c38067c542ee2048df  vp80-05-sharpness-1429.ivf
 | 
				
			||||||
 | 
					9805aa107672de25d6fb8c35e20d06deca5efe18  vp80-05-sharpness-1430.ivf
 | 
				
			||||||
 | 
					61db6b965f9c27aebe71b85bf2d5877e58e4bbdf  vp80-05-sharpness-1431.ivf
 | 
				
			||||||
 | 
					10420d266290d2923555f84af38eeb96edbd3ae8  vp80-05-sharpness-1433.ivf
 | 
				
			||||||
 | 
					3ed24f9a80cddfdf75824ba95cdb4ff9286cb443  vp80-05-sharpness-1434.ivf
 | 
				
			||||||
 | 
					c87599cbecd72d4cd4f7ace3313b7a6bc6eb8163  vp80-05-sharpness-1438.ivf
 | 
				
			||||||
 | 
					aff51d865c2621b60510459244ea83e958e4baed  vp80-05-sharpness-1439.ivf
 | 
				
			||||||
 | 
					da386e72b19b5485a6af199c5eb60ef25e510dd1  vp80-05-sharpness-1440.ivf
 | 
				
			||||||
 | 
					6759a095203d96ccd267ce09b1b050b8cc4c2f1f  vp80-05-sharpness-1443.ivf
 | 
				
			||||||
 | 
					db55ec7fd02c864ba996ff060b25b1e08611330b  vp80-00-comprehensive-001.ivf.md5
 | 
				
			||||||
 | 
					29db0ad011cba1e45f856d5623cd38dac3e3bf19  vp80-00-comprehensive-002.ivf.md5
 | 
				
			||||||
 | 
					e84f258f69e173e7d68f8f8c037a0a3766902182  vp80-00-comprehensive-003.ivf.md5
 | 
				
			||||||
 | 
					eb7912eaf69559a16fd82bc3f5fb1524cf4a4466  vp80-00-comprehensive-004.ivf.md5
 | 
				
			||||||
 | 
					4206f71c94894bd5b5b376f6c09b3817dbc65206  vp80-00-comprehensive-005.ivf.md5
 | 
				
			||||||
 | 
					4f89b356f6f2fecb928f330a10f804f00f5325f5  vp80-00-comprehensive-006.ivf.md5
 | 
				
			||||||
 | 
					2813236a32964dd8007e17648bcf035a20fcda6c  vp80-00-comprehensive-007.ivf.md5
 | 
				
			||||||
 | 
					10746c72098f872803c900e17c5680e451f5f498  vp80-00-comprehensive-008.ivf.md5
 | 
				
			||||||
 | 
					39a23d0692ce64421a7bb7cdf6ccec5928d37fff  vp80-00-comprehensive-009.ivf.md5
 | 
				
			||||||
 | 
					f6e3de8931a0cc659bda8fbc14050346955e72d4  vp80-00-comprehensive-010.ivf.md5
 | 
				
			||||||
 | 
					101683ec195b6e944f7cd1e468fc8921439363e6  vp80-00-comprehensive-011.ivf.md5
 | 
				
			||||||
 | 
					1f592751ce46d8688998fa0fa4fbdcda0fd4058c  vp80-00-comprehensive-012.ivf.md5
 | 
				
			||||||
 | 
					6066176f90ca790251e795fca1a5797d59999841  vp80-00-comprehensive-013.ivf.md5
 | 
				
			||||||
 | 
					2656da94ba93691f23edc4d60b3a09e2be46c217  vp80-00-comprehensive-014.ivf.md5
 | 
				
			||||||
 | 
					c6e0d5f5d61460c8ac8edfa4e701f10312c03133  vp80-00-comprehensive-015.ivf.md5
 | 
				
			||||||
 | 
					ee60fee501d8493e34e8d6a1fe315b51ed09b24a  vp80-00-comprehensive-016.ivf.md5
 | 
				
			||||||
 | 
					9f1914ceffcad4546c0a29de3ef591d8bea304dc  vp80-00-comprehensive-017.ivf.md5
 | 
				
			||||||
 | 
					e0305178fe288a9fd8082b39e2d03181edb19054  vp80-00-comprehensive-018.ivf.md5
 | 
				
			||||||
 | 
					612494da2fa799cc9d76dcdd835ae6c7cb2e5c05  vp80-01-intra-1400.ivf.md5
 | 
				
			||||||
 | 
					48ea06097ac8269c5e8c2131d3d0639f431fcf0e  vp80-01-intra-1411.ivf.md5
 | 
				
			||||||
 | 
					6e2ab4e7677ad0ba868083ca6bc387ee922b400c  vp80-01-intra-1416.ivf.md5
 | 
				
			||||||
 | 
					eca0a90348959ce3854142f8d8641b13050e8349  vp80-01-intra-1417.ivf.md5
 | 
				
			||||||
 | 
					920feea203145d5c2258a91c4e6991934a79a99e  vp80-02-inter-1402.ivf.md5
 | 
				
			||||||
 | 
					f71d97909fe2b3dd65be7e1f56c72237f0cef200  vp80-02-inter-1412.ivf.md5
 | 
				
			||||||
 | 
					e911254569a30bbb2a237ff8b79f69ed9da0672d  vp80-02-inter-1418.ivf.md5
 | 
				
			||||||
 | 
					58c789c50c9bb9cc90580bed291164a0939d28ba  vp80-02-inter-1424.ivf.md5
 | 
				
			||||||
 | 
					ff3e2f441327b9c20a0b37c524e0f5a48a36de7b  vp80-03-segmentation-01.ivf.md5
 | 
				
			||||||
 | 
					0791f417f076a542ae66fbc3426ab4d94cbd6c75  vp80-03-segmentation-02.ivf.md5
 | 
				
			||||||
 | 
					722e50f1a6a91c34302d68681faffc1c26d1cc57  vp80-03-segmentation-03.ivf.md5
 | 
				
			||||||
 | 
					c701f1885bcfb27fb8e70cc65606b289172ef889  vp80-03-segmentation-04.ivf.md5
 | 
				
			||||||
 | 
					f79bc9ec189a2b4807632a3d0c5bf04a178b5300  vp80-03-segmentation-1401.ivf.md5
 | 
				
			||||||
 | 
					b9aa4c74c0219b639811c44760d0b24cd8bb436a  vp80-03-segmentation-1403.ivf.md5
 | 
				
			||||||
 | 
					70d5a2207ca1891bcaebd5cf6dd88ce8d57b4334  vp80-03-segmentation-1407.ivf.md5
 | 
				
			||||||
 | 
					265f962ee781531f9a93b9309461316fd32b2a1d  vp80-03-segmentation-1408.ivf.md5
 | 
				
			||||||
 | 
					0c4ecbbd6dc042d30e626d951b65f460dd6cd563  vp80-03-segmentation-1409.ivf.md5
 | 
				
			||||||
 | 
					cf779af36a937f06570a0fca9db64ba133451dee  vp80-03-segmentation-1410.ivf.md5
 | 
				
			||||||
 | 
					0e6c5036d51ab078842f133934926c598a9cff02  vp80-03-segmentation-1413.ivf.md5
 | 
				
			||||||
 | 
					eb3930aaf229116c80d507516c34759c3f6cdf69  vp80-03-segmentation-1414.ivf.md5
 | 
				
			||||||
 | 
					123d6c0f72ee87911c4ae7538e87b7d163b22d6c  vp80-03-segmentation-1415.ivf.md5
 | 
				
			||||||
 | 
					e70551d1a38920e097a5d8782390b79ecaeb7505  vp80-03-segmentation-1425.ivf.md5
 | 
				
			||||||
 | 
					44e8f4117e46dbb302b2cfd81171cc1a1846e431  vp80-03-segmentation-1426.ivf.md5
 | 
				
			||||||
 | 
					52636e54aee5f95bbace37021bd67de5db767e9a  vp80-03-segmentation-1427.ivf.md5
 | 
				
			||||||
 | 
					b1ad3eff20215c28e295b15ef3636ed926d59cba  vp80-03-segmentation-1432.ivf.md5
 | 
				
			||||||
 | 
					24c22a552fa28a90e5978f67f57181cc2d7546d7  vp80-03-segmentation-1435.ivf.md5
 | 
				
			||||||
 | 
					96c49c390abfced18a7a8c9b9ea10af778e10edb  vp80-03-segmentation-1436.ivf.md5
 | 
				
			||||||
 | 
					f95eb6214571434f1f73ab7833b9ccdf47588020  vp80-03-segmentation-1437.ivf.md5
 | 
				
			||||||
 | 
					1c0700ca27c9b0090a7747a4b0b4dc21d1843181  vp80-03-segmentation-1441.ivf.md5
 | 
				
			||||||
 | 
					81d4f23ca32667ee958bae579c8f5e97ba72eb97  vp80-03-segmentation-1442.ivf.md5
 | 
				
			||||||
 | 
					272efcef07a3a30fbca51bfd566063d8258ec0be  vp80-04-partitions-1404.ivf.md5
 | 
				
			||||||
 | 
					66ed219ab812ac801b256d35cf495d193d4cf478  vp80-04-partitions-1405.ivf.md5
 | 
				
			||||||
 | 
					36083f37f56f502bd60ec5e07502ee9e6b8699b0  vp80-04-partitions-1406.ivf.md5
 | 
				
			||||||
 | 
					6ca909bf168a64c09415626294665dc1be3d1973  vp80-05-sharpness-1428.ivf.md5
 | 
				
			||||||
 | 
					1667d2ee2334e5fdea8a8a866f4ccf3cf76f033a  vp80-05-sharpness-1429.ivf.md5
 | 
				
			||||||
 | 
					71bcbe5357d36a19df5b07fbe3e27bffa8893f0a  vp80-05-sharpness-1430.ivf.md5
 | 
				
			||||||
 | 
					89a09b1dffce2d55770a89e58d9925c70ef79bf8  vp80-05-sharpness-1431.ivf.md5
 | 
				
			||||||
 | 
					08444a18b4e6ba3450c0796dd728d48c399a2dc9  vp80-05-sharpness-1433.ivf.md5
 | 
				
			||||||
 | 
					6d6223719a90c13e848aa2a8a6642098cdb5977a  vp80-05-sharpness-1434.ivf.md5
 | 
				
			||||||
 | 
					41d70bb5fa45bc88da1604a0af466930b8dd77b5  vp80-05-sharpness-1438.ivf.md5
 | 
				
			||||||
 | 
					086c56378df81b6cee264d7540a7b8f2b405c7a4  vp80-05-sharpness-1439.ivf.md5
 | 
				
			||||||
 | 
					d32dc2c4165eb266ea4c23c14a45459b363def32  vp80-05-sharpness-1440.ivf.md5
 | 
				
			||||||
 | 
					8c69dc3d8e563f56ffab5ad1e400d9e689dd23df  vp80-05-sharpness-1443.ivf.md5
 | 
				
			||||||
							
								
								
									
										179
									
								
								test/test.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										179
									
								
								test/test.mk
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,179 @@
 | 
				
			|||||||
 | 
					LIBVPX_TEST_SRCS-yes += acm_random.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes += register_state_check.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes += test.mk
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes += test_libvpx.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes += util.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes += video_source.h
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					## BLACK BOX TESTS
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					## Black box tests only use the public API.
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += altref_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += config_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += datarate_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += encode_test_driver.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += encode_test_driver.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += error_resilience_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += i420_video_source.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += resize_test.cc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += ../md5_utils.h ../md5_utils.c
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += decode_test_driver.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += decode_test_driver.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += ivf_video_source.h
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += test_vector_test.cc
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					## WHITE BOX TESTS
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					## Whitebox tests invoke functions not exposed via the public API. Certain
 | 
				
			||||||
 | 
					## shared library builds don't make these functions accessible.
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_SHARED),)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# These tests require both the encoder and decoder to be built.
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes)
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes                   += boolcoder_test.cc
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += fdct4x4_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes                   += idctllm_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes                   += intrapred_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC)    += pp_filter_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes                   += sad_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += set_roi.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-yes                   += sixtap_predict_test.cc
 | 
				
			||||||
 | 
					LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += subtract_test.cc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					## TEST DATA
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_ENCODER) += hantro_collage_w352h288.yuv
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf
 | 
				
			||||||
 | 
					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-1440.ivf
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf
 | 
				
			||||||
 | 
					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-003.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf.md5
 | 
				
			||||||
 | 
					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-1440.ivf.md5
 | 
				
			||||||
 | 
					LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf.md5
 | 
				
			||||||
							
								
								
									
										45
									
								
								test/test_libvpx.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								test/test_libvpx.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_config.h"
 | 
				
			||||||
 | 
					#if ARCH_X86 || ARCH_X86_64
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "vpx_ports/x86.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void append_gtest_filter(const char *str) {
 | 
				
			||||||
 | 
					  std::string filter = ::testing::FLAGS_gtest_filter;
 | 
				
			||||||
 | 
					  filter += str;
 | 
				
			||||||
 | 
					  ::testing::FLAGS_gtest_filter = filter;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int main(int argc, char **argv) {
 | 
				
			||||||
 | 
					  ::testing::InitGoogleTest(&argc, argv);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if ARCH_X86 || ARCH_X86_64
 | 
				
			||||||
 | 
					  const int simd_caps = x86_simd_caps();
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_MMX))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-MMX/*");
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_SSE))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-SSE/*");
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_SSE2))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-SSE2/*");
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_SSE3))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-SSE3/*");
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_SSSE3))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-SSSE3/*");
 | 
				
			||||||
 | 
					  if(!(simd_caps & HAS_SSE4_1))
 | 
				
			||||||
 | 
					    append_gtest_filter(":-SSE4_1/*");
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return RUN_ALL_TESTS();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										144
									
								
								test/test_vector_test.cc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								test/test_vector_test.cc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,144 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 Copyright (c) 2012 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 <cstdio>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include "third_party/googletest/src/include/gtest/gtest.h"
 | 
				
			||||||
 | 
					#include "test/decode_test_driver.h"
 | 
				
			||||||
 | 
					#include "test/ivf_video_source.h"
 | 
				
			||||||
 | 
					extern "C" {
 | 
				
			||||||
 | 
					#include "./md5_utils.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(_MSC_VER)
 | 
				
			||||||
 | 
					#define snprintf sprintf_s
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace {
 | 
				
			||||||
 | 
					// There are 61 test vectors in total.
 | 
				
			||||||
 | 
					const char *kTestVectors[] = {
 | 
				
			||||||
 | 
					  "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"
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class TestVectorTest : public libvpx_test::DecoderTest,
 | 
				
			||||||
 | 
					    public ::testing::TestWithParam<const char*> {
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  TestVectorTest() : md5_file_(NULL) {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~TestVectorTest() {
 | 
				
			||||||
 | 
					    if (md5_file_)
 | 
				
			||||||
 | 
					      fclose(md5_file_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void OpenMD5File(const std::string& md5_file_name_) {
 | 
				
			||||||
 | 
					    md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
 | 
				
			||||||
 | 
					    ASSERT_TRUE(md5_file_) << "Md5 file open failed. Filename: "
 | 
				
			||||||
 | 
					        << md5_file_name_;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void DecompressedFrameHook(const vpx_image_t& img,
 | 
				
			||||||
 | 
					                                     const unsigned int frame_number) {
 | 
				
			||||||
 | 
					    char expected_md5[33];
 | 
				
			||||||
 | 
					    char junk[128];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Read correct md5 checksums.
 | 
				
			||||||
 | 
					    const int res = fscanf(md5_file_, "%s  %s", expected_md5, junk);
 | 
				
			||||||
 | 
					    ASSERT_NE(res, EOF) << "Read md5 data failed";
 | 
				
			||||||
 | 
					    expected_md5[32] = '\0';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    MD5Context md5;
 | 
				
			||||||
 | 
					    MD5Init(&md5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Compute and update md5 for each raw in decompressed data.
 | 
				
			||||||
 | 
					    for (int plane = 0; plane < 3; ++plane) {
 | 
				
			||||||
 | 
					      uint8_t *buf = img.planes[plane];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      for (unsigned int y = 0; y < (plane ? (img.d_h + 1) >> 1 : img.d_h);
 | 
				
			||||||
 | 
					           ++y) {
 | 
				
			||||||
 | 
					        MD5Update(&md5, buf, (plane ? (img.d_w + 1) >> 1 : img.d_w));
 | 
				
			||||||
 | 
					        buf += img.stride[plane];
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    uint8_t md5_sum[16];
 | 
				
			||||||
 | 
					    MD5Final(md5_sum, &md5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    char actual_md5[33];
 | 
				
			||||||
 | 
					    // Convert to get the actual md5.
 | 
				
			||||||
 | 
					    for (int i = 0; i < 16; i++) {
 | 
				
			||||||
 | 
					      snprintf(&actual_md5[i * 2], sizeof(actual_md5) - i * 2, "%02x",
 | 
				
			||||||
 | 
					               md5_sum[i]);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    actual_md5[32] = '\0';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // Check md5 match.
 | 
				
			||||||
 | 
					    ASSERT_STREQ(expected_md5, actual_md5)
 | 
				
			||||||
 | 
					        << "Md5 checksums don't match: frame number = " << frame_number;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 private:
 | 
				
			||||||
 | 
					  FILE *md5_file_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// This test runs through the whole set of test vectors, and decodes them.
 | 
				
			||||||
 | 
					// 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(TestVectorTest, MD5Match) {
 | 
				
			||||||
 | 
					  const std::string filename = GetParam();
 | 
				
			||||||
 | 
					  // Open compressed video file.
 | 
				
			||||||
 | 
					  libvpx_test::IVFVideoSource video(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));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INSTANTIATE_TEST_CASE_P(TestVectorSequence, TestVectorTest,
 | 
				
			||||||
 | 
					                        ::testing::ValuesIn(kTestVectors));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace
 | 
				
			||||||
							
								
								
									
										18
									
								
								test/util.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								test/util.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_UTIL_H_
 | 
				
			||||||
 | 
					#define TEST_UTIL_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Macros
 | 
				
			||||||
 | 
					#define PARAMS(...) ::testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >
 | 
				
			||||||
 | 
					#define GET_PARAM(k) std::tr1::get< k >(GetParam())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_UTIL_H_
 | 
				
			||||||
							
								
								
									
										175
									
								
								test/video_source.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										175
									
								
								test/video_source.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,175 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					#define TEST_VIDEO_SOURCE_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <cstdio>
 | 
				
			||||||
 | 
					#include <cstdlib>
 | 
				
			||||||
 | 
					#include <string>
 | 
				
			||||||
 | 
					#include "test/acm_random.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_encoder.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace libvpx_test {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static FILE *OpenTestDataFile(const std::string& file_name) {
 | 
				
			||||||
 | 
					  std::string path_to_source = file_name;
 | 
				
			||||||
 | 
					  const char *kDataPath = getenv("LIBVPX_TEST_DATA_PATH");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (kDataPath) {
 | 
				
			||||||
 | 
					    path_to_source = kDataPath;
 | 
				
			||||||
 | 
					    path_to_source += "/";
 | 
				
			||||||
 | 
					    path_to_source += file_name;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return fopen(path_to_source.c_str(), "rb");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Abstract base class for test video sources, which provide a stream of
 | 
				
			||||||
 | 
					// vpx_image_t images with associated timestamps and duration.
 | 
				
			||||||
 | 
					class VideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  virtual ~VideoSource() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Prepare the stream for reading, rewind/open as necessary.
 | 
				
			||||||
 | 
					  virtual void Begin() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Advance the cursor to the next frame
 | 
				
			||||||
 | 
					  virtual void Next() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the current video frame, or NULL on End-Of-Stream.
 | 
				
			||||||
 | 
					  virtual vpx_image_t *img() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the presentation timestamp of the current frame.
 | 
				
			||||||
 | 
					  virtual vpx_codec_pts_t pts() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the current frame's duration
 | 
				
			||||||
 | 
					  virtual unsigned long duration() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the timebase for the stream
 | 
				
			||||||
 | 
					  virtual vpx_rational_t timebase() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the current frame counter, starting at 0.
 | 
				
			||||||
 | 
					  virtual unsigned int frame() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Get the current file limit.
 | 
				
			||||||
 | 
					  virtual unsigned int limit() const = 0;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class DummyVideoSource : public VideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  DummyVideoSource() : img_(NULL), limit_(100), width_(0), height_(0) {
 | 
				
			||||||
 | 
					    SetSize(80, 64);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual ~DummyVideoSource() { vpx_img_free(img_); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Begin() {
 | 
				
			||||||
 | 
					    frame_ = 0;
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Next() {
 | 
				
			||||||
 | 
					    ++frame_;
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual vpx_image_t *img() const {
 | 
				
			||||||
 | 
					    return (frame_ < limit_) ? img_ : NULL;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Models a stream where Timebase = 1/FPS, so pts == frame.
 | 
				
			||||||
 | 
					  virtual vpx_codec_pts_t pts() const { return frame_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned long duration() const { return 1; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual vpx_rational_t timebase() const {
 | 
				
			||||||
 | 
					    const vpx_rational_t t = {1, 30};
 | 
				
			||||||
 | 
					    return t;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned int frame() const { return frame_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual unsigned int limit() const { return limit_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  void SetSize(unsigned int width, unsigned int height) {
 | 
				
			||||||
 | 
					    if (width != width_ || height != height_) {
 | 
				
			||||||
 | 
					      vpx_img_free(img_);
 | 
				
			||||||
 | 
					      raw_sz_ = ((width + 31)&~31) * height * 3 / 2;
 | 
				
			||||||
 | 
					      img_ = vpx_img_alloc(NULL, VPX_IMG_FMT_VPXI420, width, height, 32);
 | 
				
			||||||
 | 
					      width_ = width;
 | 
				
			||||||
 | 
					      height_ = height;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  virtual void FillFrame() { memset(img_->img_data, 0, raw_sz_); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  vpx_image_t *img_;
 | 
				
			||||||
 | 
					  size_t       raw_sz_;
 | 
				
			||||||
 | 
					  unsigned int limit_;
 | 
				
			||||||
 | 
					  unsigned int frame_;
 | 
				
			||||||
 | 
					  unsigned int width_;
 | 
				
			||||||
 | 
					  unsigned int height_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class RandomVideoSource : public DummyVideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  RandomVideoSource(int seed = ACMRandom::DeterministicSeed())
 | 
				
			||||||
 | 
					      : rnd_(seed),
 | 
				
			||||||
 | 
					        seed_(seed) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 protected:
 | 
				
			||||||
 | 
					  // Reset the RNG to get a matching stream for the second pass
 | 
				
			||||||
 | 
					  virtual void Begin() {
 | 
				
			||||||
 | 
					    frame_ = 0;
 | 
				
			||||||
 | 
					    rnd_.Reset(seed_);
 | 
				
			||||||
 | 
					    FillFrame();
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 15 frames of noise, followed by 15 static frames. Reset to 0 rather
 | 
				
			||||||
 | 
					  // than holding previous frames to encourage keyframes to be thrown.
 | 
				
			||||||
 | 
					  virtual void FillFrame() {
 | 
				
			||||||
 | 
					    if (frame_ % 30 < 15)
 | 
				
			||||||
 | 
					      for (size_t i = 0; i < raw_sz_; ++i)
 | 
				
			||||||
 | 
					        img_->img_data[i] = rnd_.Rand8();
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      memset(img_->img_data, 0, raw_sz_);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ACMRandom rnd_;
 | 
				
			||||||
 | 
					  int seed_;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Abstract base class for test video sources, which provide a stream of
 | 
				
			||||||
 | 
					// decompressed images to the decoder.
 | 
				
			||||||
 | 
					class CompressedVideoSource {
 | 
				
			||||||
 | 
					 public:
 | 
				
			||||||
 | 
					  virtual ~CompressedVideoSource() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual void Init() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Prepare the stream for reading, rewind/open as necessary.
 | 
				
			||||||
 | 
					  virtual void Begin() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Advance the cursor to the next frame
 | 
				
			||||||
 | 
					  virtual void Next() = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual const uint8_t *cxdata() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual const unsigned int frame_size() const = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  virtual const unsigned int frame_number() const = 0;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}  // namespace libvpx_test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif  // TEST_VIDEO_SOURCE_H_
 | 
				
			||||||
							
								
								
									
										2
									
								
								third_party/libyuv/source/scale.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								third_party/libyuv/source/scale.c
									
									
									
									
										vendored
									
									
								
							@@ -60,7 +60,7 @@ void SetUseReferenceImpl(int use) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
 | 
					#if defined(__ARM_NEON__) && !defined(YUV_DISABLE_ASM)
 | 
				
			||||||
#define HAS_SCALEROWDOWN2_NEON
 | 
					#define HAS_SCALEROWDOWN2_NEON
 | 
				
			||||||
void ScaleRowDown2_NEON(const uint8* src_ptr, int src_stride,
 | 
					void ScaleRowDown2_NEON(const uint8* src_ptr, int  src_stride,
 | 
				
			||||||
                        uint8* dst, int dst_width) {
 | 
					                        uint8* dst, int dst_width) {
 | 
				
			||||||
  asm volatile (
 | 
					  asm volatile (
 | 
				
			||||||
    "1:                                        \n"
 | 
					    "1:                                        \n"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										160
									
								
								tools/ftfy.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										160
									
								
								tools/ftfy.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,160 @@
 | 
				
			|||||||
 | 
					#!/bin/sh
 | 
				
			||||||
 | 
					self="$0"
 | 
				
			||||||
 | 
					dirname_self=$(dirname "$self")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					usage() {
 | 
				
			||||||
 | 
					  cat <<EOF >&2
 | 
				
			||||||
 | 
					Usage: $self [option]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This script applies a whitespace transformation to the commit at HEAD. If no
 | 
				
			||||||
 | 
					options are given, then the modified files are left in the working tree.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Options:
 | 
				
			||||||
 | 
					  -h, --help     Shows this message
 | 
				
			||||||
 | 
					  -n, --dry-run  Shows a diff of the changes to be made.
 | 
				
			||||||
 | 
					  --amend        Squashes the changes into the commit at HEAD
 | 
				
			||||||
 | 
					                     This option will also reformat the commit message.
 | 
				
			||||||
 | 
					  --commit       Creates a new commit containing only the whitespace changes
 | 
				
			||||||
 | 
					  --msg-only     Reformat the commit message only, ignore the patch itself.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					  rm -f ${CLEAN_FILES}
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					log() {
 | 
				
			||||||
 | 
					  echo "${self##*/}: $@" >&2
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vpx_style() {
 | 
				
			||||||
 | 
					  astyle --style=bsd --min-conditional-indent=0 --break-blocks \
 | 
				
			||||||
 | 
					         --pad-oper --pad-header --unpad-paren \
 | 
				
			||||||
 | 
					         --align-pointer=name \
 | 
				
			||||||
 | 
					         --indent-preprocessor --convert-tabs --indent-labels \
 | 
				
			||||||
 | 
					         --suffix=none --quiet "$@"
 | 
				
			||||||
 | 
					  sed -i "" 's/[[:space:]]\{1,\},/,/g' "$@"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					apply() {
 | 
				
			||||||
 | 
					  [ $INTERSECT_RESULT -ne 0 ] && patch -p1 < "$1"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					commit() {
 | 
				
			||||||
 | 
					  LAST_CHANGEID=$(git show | awk '/Change-Id:/{print $2}')
 | 
				
			||||||
 | 
					  if [ -z "$LAST_CHANGEID" ]; then
 | 
				
			||||||
 | 
					    log "HEAD doesn't have a Change-Id, unable to generate a new commit"
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Build a deterministic Change-Id from the parent's
 | 
				
			||||||
 | 
					  NEW_CHANGEID=${LAST_CHANGEID}-styled
 | 
				
			||||||
 | 
					  NEW_CHANGEID=I$(echo $NEW_CHANGEID | git hash-object --stdin)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Commit, preserving authorship from the parent commit.
 | 
				
			||||||
 | 
					  git commit -a -C HEAD > /dev/null
 | 
				
			||||||
 | 
					  git commit --amend -F- << EOF
 | 
				
			||||||
 | 
					Cosmetic: Fix whitespace in change ${LAST_CHANGEID:0:9}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Change-Id: ${NEW_CHANGEID}
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					show_commit_msg_diff() {
 | 
				
			||||||
 | 
					  if [ $DIFF_MSG_RESULT -ne 0 ]; then
 | 
				
			||||||
 | 
					    log "Modified commit message:"
 | 
				
			||||||
 | 
					    diff -u "$ORIG_COMMIT_MSG" "$NEW_COMMIT_MSG" | tail -n +3
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					amend() {
 | 
				
			||||||
 | 
					  show_commit_msg_diff
 | 
				
			||||||
 | 
					  if [ $DIFF_MSG_RESULT -ne 0 ] || [ $INTERSECT_RESULT -ne 0 ]; then
 | 
				
			||||||
 | 
					    git commit -a --amend -F "$NEW_COMMIT_MSG"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					diff_msg() {
 | 
				
			||||||
 | 
					  git log -1 --format=%B > "$ORIG_COMMIT_MSG"
 | 
				
			||||||
 | 
					  "${dirname_self}"/wrap-commit-msg.py \
 | 
				
			||||||
 | 
					      < "$ORIG_COMMIT_MSG" > "$NEW_COMMIT_MSG"
 | 
				
			||||||
 | 
					  cmp -s "$ORIG_COMMIT_MSG" "$NEW_COMMIT_MSG"
 | 
				
			||||||
 | 
					  DIFF_MSG_RESULT=$?
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Temporary files
 | 
				
			||||||
 | 
					ORIG_DIFF=orig.diff.$$
 | 
				
			||||||
 | 
					MODIFIED_DIFF=modified.diff.$$
 | 
				
			||||||
 | 
					FINAL_DIFF=final.diff.$$
 | 
				
			||||||
 | 
					ORIG_COMMIT_MSG=orig.commit-msg.$$
 | 
				
			||||||
 | 
					NEW_COMMIT_MSG=new.commit-msg.$$
 | 
				
			||||||
 | 
					CLEAN_FILES="${ORIG_DIFF} ${MODIFIED_DIFF} ${FINAL_DIFF}"
 | 
				
			||||||
 | 
					CLEAN_FILES="${CLEAN_FILES} ${ORIG_COMMIT_MSG} ${NEW_COMMIT_MSG}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Preconditions
 | 
				
			||||||
 | 
					[ $# -lt 2 ] || usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check that astyle supports pad-header and align-pointer=name
 | 
				
			||||||
 | 
					if ! astyle --pad-header --align-pointer=name < /dev/null; then
 | 
				
			||||||
 | 
					  log "Install astyle v1.24 or newer"
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if ! git diff --quiet HEAD; then
 | 
				
			||||||
 | 
					  log "Working tree is dirty, commit your changes first"
 | 
				
			||||||
 | 
					  exit 1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Need to be in the root
 | 
				
			||||||
 | 
					cd "$(git rev-parse --show-toplevel)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Collect the original diff
 | 
				
			||||||
 | 
					git show > "${ORIG_DIFF}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Apply the style guide on new and modified files and collect its diff
 | 
				
			||||||
 | 
					for f in $(git diff HEAD^ --name-only -M90 --diff-filter=AM \
 | 
				
			||||||
 | 
					           | grep '\.[ch]$'); do
 | 
				
			||||||
 | 
					  case "$f" in
 | 
				
			||||||
 | 
					    third_party/*) continue;;
 | 
				
			||||||
 | 
					    nestegg/*) continue;;
 | 
				
			||||||
 | 
					  esac
 | 
				
			||||||
 | 
					  vpx_style "$f"
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					git diff --no-color --no-ext-diff > "${MODIFIED_DIFF}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Intersect the two diffs
 | 
				
			||||||
 | 
					"${dirname_self}"/intersect-diffs.py \
 | 
				
			||||||
 | 
					    "${ORIG_DIFF}" "${MODIFIED_DIFF}" > "${FINAL_DIFF}"
 | 
				
			||||||
 | 
					INTERSECT_RESULT=$?
 | 
				
			||||||
 | 
					git reset --hard >/dev/null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Fixup the commit message
 | 
				
			||||||
 | 
					diff_msg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Handle options
 | 
				
			||||||
 | 
					if [ -n "$1" ]; then
 | 
				
			||||||
 | 
					  case "$1" in
 | 
				
			||||||
 | 
					    -h|--help) usage;;
 | 
				
			||||||
 | 
					    -n|--dry-run) cat "${FINAL_DIFF}"; show_commit_msg_diff;;
 | 
				
			||||||
 | 
					    --commit) apply "${FINAL_DIFF}"; commit;;
 | 
				
			||||||
 | 
					    --amend) apply "${FINAL_DIFF}"; amend;;
 | 
				
			||||||
 | 
					    --msg-only) amend;;
 | 
				
			||||||
 | 
					    *) usage;;
 | 
				
			||||||
 | 
					  esac
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  apply "${FINAL_DIFF}"
 | 
				
			||||||
 | 
					  if ! git diff --quiet; then
 | 
				
			||||||
 | 
					    log "Formatting changes applied, verify and commit."
 | 
				
			||||||
 | 
					    log "See also: http://www.webmproject.org/code/contribute/conventions/"
 | 
				
			||||||
 | 
					    git diff --stat
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -f ${CLEAN_FILES}
 | 
				
			||||||
							
								
								
									
										188
									
								
								tools/intersect-diffs.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										188
									
								
								tools/intersect-diffs.py
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,188 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					##  Copyright (c) 2012 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.
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					"""Calculates the "intersection" of two unified diffs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Given two diffs, A and B, it finds all hunks in B that had non-context lines
 | 
				
			||||||
 | 
					in A and prints them to stdout. This is useful to determine the hunks in B that
 | 
				
			||||||
 | 
					are relevant to A. The resulting file can be applied with patch(1) on top of A.
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__author__ = "jkoleszar@google.com"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import re
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class DiffLines(object):
 | 
				
			||||||
 | 
					    """A container for one half of a diff."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def __init__(self, filename, offset, length):
 | 
				
			||||||
 | 
					        self.filename = filename
 | 
				
			||||||
 | 
					        self.offset = offset
 | 
				
			||||||
 | 
					        self.length = length
 | 
				
			||||||
 | 
					        self.lines = []
 | 
				
			||||||
 | 
					        self.delta_line_nums = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def Append(self, line):
 | 
				
			||||||
 | 
					        l = len(self.lines)
 | 
				
			||||||
 | 
					        if line[0] != " ":
 | 
				
			||||||
 | 
					            self.delta_line_nums.append(self.offset + l)
 | 
				
			||||||
 | 
					        self.lines.append(line[1:])
 | 
				
			||||||
 | 
					        assert l+1 <= self.length
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def Complete(self):
 | 
				
			||||||
 | 
					        return len(self.lines) == self.length
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def __contains__(self, item):
 | 
				
			||||||
 | 
					        return item >= self.offset and item <= self.offset + self.length - 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class DiffHunk(object):
 | 
				
			||||||
 | 
					    """A container for one diff hunk, consisting of two DiffLines."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def __init__(self, header, file_a, file_b, start_a, len_a, start_b, len_b):
 | 
				
			||||||
 | 
					        self.header = header
 | 
				
			||||||
 | 
					        self.left = DiffLines(file_a, start_a, len_a)
 | 
				
			||||||
 | 
					        self.right = DiffLines(file_b, start_b, len_b)
 | 
				
			||||||
 | 
					        self.lines = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def Append(self, line):
 | 
				
			||||||
 | 
					        """Adds a line to the DiffHunk and its DiffLines children."""
 | 
				
			||||||
 | 
					        if line[0] == "-":
 | 
				
			||||||
 | 
					            self.left.Append(line)
 | 
				
			||||||
 | 
					        elif line[0] == "+":
 | 
				
			||||||
 | 
					            self.right.Append(line)
 | 
				
			||||||
 | 
					        elif line[0] == " ":
 | 
				
			||||||
 | 
					            self.left.Append(line)
 | 
				
			||||||
 | 
					            self.right.Append(line)
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            assert False, ("Unrecognized character at start of diff line "
 | 
				
			||||||
 | 
					                           "%r" % line[0])
 | 
				
			||||||
 | 
					        self.lines.append(line)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def Complete(self):
 | 
				
			||||||
 | 
					        return self.left.Complete() and self.right.Complete()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def __repr__(self):
 | 
				
			||||||
 | 
					        return "DiffHunk(%s, %s, len %d)" % (
 | 
				
			||||||
 | 
					            self.left.filename, self.right.filename,
 | 
				
			||||||
 | 
					            max(self.left.length, self.right.length))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def ParseDiffHunks(stream):
 | 
				
			||||||
 | 
					    """Walk a file-like object, yielding DiffHunks as they're parsed."""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    file_regex = re.compile(r"(\+\+\+|---) (\S+)")
 | 
				
			||||||
 | 
					    range_regex = re.compile(r"@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))?")
 | 
				
			||||||
 | 
					    hunk = None
 | 
				
			||||||
 | 
					    while True:
 | 
				
			||||||
 | 
					        line = stream.readline()
 | 
				
			||||||
 | 
					        if not line:
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if hunk is None:
 | 
				
			||||||
 | 
					            # Parse file names
 | 
				
			||||||
 | 
					            diff_file = file_regex.match(line)
 | 
				
			||||||
 | 
					            if diff_file:
 | 
				
			||||||
 | 
					              if line.startswith("---"):
 | 
				
			||||||
 | 
					                  a_line = line
 | 
				
			||||||
 | 
					                  a = diff_file.group(2)
 | 
				
			||||||
 | 
					                  continue
 | 
				
			||||||
 | 
					              if line.startswith("+++"):
 | 
				
			||||||
 | 
					                  b_line = line
 | 
				
			||||||
 | 
					                  b = diff_file.group(2)
 | 
				
			||||||
 | 
					                  continue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # Parse offset/lengths
 | 
				
			||||||
 | 
					            diffrange = range_regex.match(line)
 | 
				
			||||||
 | 
					            if diffrange:
 | 
				
			||||||
 | 
					                if diffrange.group(2):
 | 
				
			||||||
 | 
					                    start_a = int(diffrange.group(1))
 | 
				
			||||||
 | 
					                    len_a = int(diffrange.group(3))
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    start_a = 1
 | 
				
			||||||
 | 
					                    len_a = int(diffrange.group(1))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if diffrange.group(5):
 | 
				
			||||||
 | 
					                    start_b = int(diffrange.group(4))
 | 
				
			||||||
 | 
					                    len_b = int(diffrange.group(6))
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    start_b = 1
 | 
				
			||||||
 | 
					                    len_b = int(diffrange.group(4))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                header = [a_line, b_line, line]
 | 
				
			||||||
 | 
					                hunk = DiffHunk(header, a, b, start_a, len_a, start_b, len_b)
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            # Add the current line to the hunk
 | 
				
			||||||
 | 
					            hunk.Append(line)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            # See if the whole hunk has been parsed. If so, yield it and prepare
 | 
				
			||||||
 | 
					            # for the next hunk.
 | 
				
			||||||
 | 
					            if hunk.Complete():
 | 
				
			||||||
 | 
					                yield hunk
 | 
				
			||||||
 | 
					                hunk = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Partial hunks are a parse error
 | 
				
			||||||
 | 
					    assert hunk is None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def FormatDiffHunks(hunks):
 | 
				
			||||||
 | 
					    """Re-serialize a list of DiffHunks."""
 | 
				
			||||||
 | 
					    r = []
 | 
				
			||||||
 | 
					    last_header = None
 | 
				
			||||||
 | 
					    for hunk in hunks:
 | 
				
			||||||
 | 
					        this_header = hunk.header[0:2]
 | 
				
			||||||
 | 
					        if last_header != this_header:
 | 
				
			||||||
 | 
					            r.extend(hunk.header)
 | 
				
			||||||
 | 
					            last_header = this_header
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            r.extend(hunk.header[2])
 | 
				
			||||||
 | 
					        r.extend(hunk.lines)
 | 
				
			||||||
 | 
					        r.append("\n")
 | 
				
			||||||
 | 
					    return "".join(r)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def ZipHunks(rhs_hunks, lhs_hunks):
 | 
				
			||||||
 | 
					    """Join two hunk lists on filename."""
 | 
				
			||||||
 | 
					    for rhs_hunk in rhs_hunks:
 | 
				
			||||||
 | 
					        rhs_file = rhs_hunk.right.filename.split("/")[1:]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        for lhs_hunk in lhs_hunks:
 | 
				
			||||||
 | 
					            lhs_file = lhs_hunk.left.filename.split("/")[1:]
 | 
				
			||||||
 | 
					            if lhs_file != rhs_file:
 | 
				
			||||||
 | 
					                continue
 | 
				
			||||||
 | 
					            yield (rhs_hunk, lhs_hunk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def main():
 | 
				
			||||||
 | 
					    old_hunks = [x for x in ParseDiffHunks(open(sys.argv[1], "r"))]
 | 
				
			||||||
 | 
					    new_hunks = [x for x in ParseDiffHunks(open(sys.argv[2], "r"))]
 | 
				
			||||||
 | 
					    out_hunks = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Join the right hand side of the older diff with the left hand side of the
 | 
				
			||||||
 | 
					    # newer diff.
 | 
				
			||||||
 | 
					    for old_hunk, new_hunk in ZipHunks(old_hunks, new_hunks):
 | 
				
			||||||
 | 
					        if new_hunk in out_hunks:
 | 
				
			||||||
 | 
					            continue
 | 
				
			||||||
 | 
					        old_lines = old_hunk.right
 | 
				
			||||||
 | 
					        new_lines = new_hunk.left
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Determine if this hunk overlaps any non-context line from the other
 | 
				
			||||||
 | 
					        for i in old_lines.delta_line_nums:
 | 
				
			||||||
 | 
					            if i in new_lines:
 | 
				
			||||||
 | 
					                out_hunks.append(new_hunk)
 | 
				
			||||||
 | 
					                break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if out_hunks:
 | 
				
			||||||
 | 
					        print FormatDiffHunks(out_hunks)
 | 
				
			||||||
 | 
					        sys.exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == "__main__":
 | 
				
			||||||
 | 
					    main()
 | 
				
			||||||
							
								
								
									
										70
									
								
								tools/wrap-commit-msg.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										70
									
								
								tools/wrap-commit-msg.py
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,70 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env python
 | 
				
			||||||
 | 
					##  Copyright (c) 2012 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.
 | 
				
			||||||
 | 
					##
 | 
				
			||||||
 | 
					"""Wraps paragraphs of text, preserving manual formatting
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This is like fold(1), but has the special convention of not modifying lines
 | 
				
			||||||
 | 
					that start with whitespace. This allows you to intersperse blocks with
 | 
				
			||||||
 | 
					special formatting, like code blocks, with written prose. The prose will
 | 
				
			||||||
 | 
					be wordwrapped, and the manual formatting will be preserved.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 * This won't handle the case of a bulleted (or ordered) list specially, so
 | 
				
			||||||
 | 
					   manual wrapping must be done.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Occasionally it's useful to put something with explicit formatting that
 | 
				
			||||||
 | 
					doesn't look at all like a block of text inline.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  indicator = has_leading_whitespace(line);
 | 
				
			||||||
 | 
					  if (indicator)
 | 
				
			||||||
 | 
					    preserve_formatting(line);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The intent is that this docstring would make it through the transform
 | 
				
			||||||
 | 
					and still be legible and presented as it is in the source. If additional
 | 
				
			||||||
 | 
					cases are handled, update this doc to describe the effect.
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__author__ = "jkoleszar@google.com"
 | 
				
			||||||
 | 
					import textwrap
 | 
				
			||||||
 | 
					import sys
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def wrap(text):
 | 
				
			||||||
 | 
					    if text:
 | 
				
			||||||
 | 
					        return textwrap.fill(text, break_long_words=False) + '\n'
 | 
				
			||||||
 | 
					    return ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def main(fileobj):
 | 
				
			||||||
 | 
					    text = ""
 | 
				
			||||||
 | 
					    output = ""
 | 
				
			||||||
 | 
					    while True:
 | 
				
			||||||
 | 
					        line = fileobj.readline()
 | 
				
			||||||
 | 
					        if not line:
 | 
				
			||||||
 | 
					            break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if line.lstrip() == line:
 | 
				
			||||||
 | 
					            text += line
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            output += wrap(text)
 | 
				
			||||||
 | 
					            text=""
 | 
				
			||||||
 | 
					            output += line
 | 
				
			||||||
 | 
					    output += wrap(text)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Replace the file or write to stdout.
 | 
				
			||||||
 | 
					    if fileobj == sys.stdin:
 | 
				
			||||||
 | 
					        fileobj = sys.stdout
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        fileobj.seek(0)
 | 
				
			||||||
 | 
					        fileobj.truncate(0)
 | 
				
			||||||
 | 
					    fileobj.write(output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == "__main__":
 | 
				
			||||||
 | 
					    if len(sys.argv) > 1:
 | 
				
			||||||
 | 
					        main(open(sys.argv[1], "r+"))
 | 
				
			||||||
 | 
					    else:
 | 
				
			||||||
 | 
					        main(sys.stdin)
 | 
				
			||||||
							
								
								
									
										10
									
								
								usage.dox
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								usage.dox
									
									
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
/*!\page usage Usage
 | 
					/*!\page usage Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    The vpx Multi-Format codec SDK provides a unified interface amongst its
 | 
					    The vpx multi-format codec SDK provides a unified interface amongst its
 | 
				
			||||||
    supported codecs. This abstraction allows applications using this SDK to
 | 
					    supported codecs. This abstraction allows applications using this SDK to
 | 
				
			||||||
    easily support multiple video formats with minimal code duplication or
 | 
					    easily support multiple video formats with minimal code duplication or
 | 
				
			||||||
    "special casing." This section describes the interface common to all codecs.
 | 
					    "special casing." This section describes the interface common to all codecs.
 | 
				
			||||||
@@ -14,8 +14,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    Fore more information on decoder and encoder specific usage, see the
 | 
					    Fore more information on decoder and encoder specific usage, see the
 | 
				
			||||||
    following pages:
 | 
					    following pages:
 | 
				
			||||||
    \if decoder - \subpage usage_decode \endif
 | 
					    \if decoder
 | 
				
			||||||
    \if decoder - \subpage usage_encode \endif
 | 
					    - \subpage usage_decode
 | 
				
			||||||
 | 
					    \endif
 | 
				
			||||||
 | 
					    \if decoder
 | 
				
			||||||
 | 
					    - \subpage usage_encode
 | 
				
			||||||
 | 
					    \endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    \section usage_types Important Data Types
 | 
					    \section usage_types Important Data Types
 | 
				
			||||||
    There are two important data structures to consider in this interface.
 | 
					    There are two important data structures to consider in this interface.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,43 +17,31 @@
 | 
				
			|||||||
#include "entropymode.h"
 | 
					#include "entropymode.h"
 | 
				
			||||||
#include "systemdependent.h"
 | 
					#include "systemdependent.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
extern  void vp8_init_scan_order_mask();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void update_mode_info_border(MODE_INFO *mi, int rows, int cols)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i;
 | 
					 | 
				
			||||||
    vpx_memset(mi - cols - 2, 0, sizeof(MODE_INFO) * (cols + 1));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (i = 0; i < rows; i++)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /* TODO(holmer): Bug? This updates the last element of each row
 | 
					 | 
				
			||||||
         * rather than the border element!
 | 
					 | 
				
			||||||
         */
 | 
					 | 
				
			||||||
        vpx_memset(&mi[i*cols-1], 0, sizeof(MODE_INFO));
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_de_alloc_frame_buffers(VP8_COMMON *oci)
 | 
					void vp8_de_alloc_frame_buffers(VP8_COMMON *oci)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (i = 0; i < NUM_YV12_BUFFERS; i++)
 | 
					    for (i = 0; i < NUM_YV12_BUFFERS; i++)
 | 
				
			||||||
        vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]);
 | 
					        vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame);
 | 
					    vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame);
 | 
				
			||||||
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
    vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer);
 | 
					    vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer);
 | 
				
			||||||
    if (oci->post_proc_buffer_int_used)
 | 
					    if (oci->post_proc_buffer_int_used)
 | 
				
			||||||
        vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer_int);
 | 
					        vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer_int);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vpx_free(oci->pp_limits_buffer);
 | 
				
			||||||
 | 
					    oci->pp_limits_buffer = NULL;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vpx_free(oci->above_context);
 | 
					    vpx_free(oci->above_context);
 | 
				
			||||||
    vpx_free(oci->mip);
 | 
					    vpx_free(oci->mip);
 | 
				
			||||||
 | 
					#if CONFIG_ERROR_CONCEALMENT
 | 
				
			||||||
    vpx_free(oci->prev_mip);
 | 
					    vpx_free(oci->prev_mip);
 | 
				
			||||||
 | 
					    oci->prev_mip = NULL;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oci->above_context = 0;
 | 
					    oci->above_context = NULL;
 | 
				
			||||||
    oci->mip = 0;
 | 
					    oci->mip = NULL;
 | 
				
			||||||
    oci->prev_mip = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 | 
					int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 | 
				
			||||||
@@ -75,10 +63,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 | 
				
			|||||||
        oci->fb_idx_ref_cnt[i] = 0;
 | 
					        oci->fb_idx_ref_cnt[i] = 0;
 | 
				
			||||||
        oci->yv12_fb[i].flags = 0;
 | 
					        oci->yv12_fb[i].flags = 0;
 | 
				
			||||||
        if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0)
 | 
					        if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0)
 | 
				
			||||||
        {
 | 
					            goto allocation_fail;
 | 
				
			||||||
            vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
            return 1;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oci->new_fb_idx = 0;
 | 
					    oci->new_fb_idx = 0;
 | 
				
			||||||
@@ -92,18 +77,7 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 | 
				
			|||||||
    oci->fb_idx_ref_cnt[3] = 1;
 | 
					    oci->fb_idx_ref_cnt[3] = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame,   width, 16, VP8BORDERINPIXELS) < 0)
 | 
					    if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame,   width, 16, VP8BORDERINPIXELS) < 0)
 | 
				
			||||||
    {
 | 
					        goto allocation_fail;
 | 
				
			||||||
        vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    oci->post_proc_buffer_int_used = 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oci->mb_rows = height >> 4;
 | 
					    oci->mb_rows = height >> 4;
 | 
				
			||||||
    oci->mb_cols = width >> 4;
 | 
					    oci->mb_cols = width >> 4;
 | 
				
			||||||
@@ -112,44 +86,43 @@ int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height)
 | 
				
			|||||||
    oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
 | 
					    oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!oci->mip)
 | 
					    if (!oci->mip)
 | 
				
			||||||
    {
 | 
					        goto allocation_fail;
 | 
				
			||||||
        vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oci->mi = oci->mip + oci->mode_info_stride + 1;
 | 
					    oci->mi = oci->mip + oci->mode_info_stride + 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* allocate memory for last frame MODE_INFO array */
 | 
					    /* Allocation of previous mode info will be done in vp8_decode_frame()
 | 
				
			||||||
#if CONFIG_ERROR_CONCEALMENT
 | 
					     * as it is a decoder only data */
 | 
				
			||||||
    oci->prev_mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (!oci->prev_mip)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1;
 | 
					 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
    oci->prev_mip = NULL;
 | 
					 | 
				
			||||||
    oci->prev_mi = NULL;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1);
 | 
					    oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!oci->above_context)
 | 
					    if (!oci->above_context)
 | 
				
			||||||
    {
 | 
					        goto allocation_fail;
 | 
				
			||||||
        vp8_de_alloc_frame_buffers(oci);
 | 
					 | 
				
			||||||
        return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    update_mode_info_border(oci->mi, oci->mb_rows, oci->mb_cols);
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
#if CONFIG_ERROR_CONCEALMENT
 | 
					    if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0)
 | 
				
			||||||
    update_mode_info_border(oci->prev_mi, oci->mb_rows, oci->mb_cols);
 | 
					        goto allocation_fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    oci->post_proc_buffer_int_used = 0;
 | 
				
			||||||
 | 
					    vpx_memset(&oci->postproc_state, 0, sizeof(oci->postproc_state));
 | 
				
			||||||
 | 
					    vpx_memset(oci->post_proc_buffer.buffer_alloc, 128,
 | 
				
			||||||
 | 
					               oci->post_proc_buffer.frame_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Allocate buffer to store post-processing filter coefficients.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * Note: Round up mb_cols to support SIMD reads
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    oci->pp_limits_buffer = vpx_memalign(16, 24 * ((oci->mb_cols + 1) & ~1));
 | 
				
			||||||
 | 
					    if (!oci->pp_limits_buffer)
 | 
				
			||||||
 | 
					        goto allocation_fail;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					allocation_fail:
 | 
				
			||||||
 | 
					    vp8_de_alloc_frame_buffers(oci);
 | 
				
			||||||
 | 
					    return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_setup_version(VP8_COMMON *cm)
 | 
					void vp8_setup_version(VP8_COMMON *cm)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    switch (cm->version)
 | 
					    switch (cm->version)
 | 
				
			||||||
@@ -203,7 +176,7 @@ void vp8_create_common(VP8_COMMON *oci)
 | 
				
			|||||||
    oci->clr_type = REG_YUV;
 | 
					    oci->clr_type = REG_YUV;
 | 
				
			||||||
    oci->clamp_type = RECON_CLAMP_REQUIRED;
 | 
					    oci->clamp_type = RECON_CLAMP_REQUIRED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Initialise reference frame sign bias structure to defaults */
 | 
					    /* Initialize reference frame sign bias structure to defaults */
 | 
				
			||||||
    vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
 | 
					    vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Default disable buffer to buffer copying */
 | 
					    /* Default disable buffer to buffer copying */
 | 
				
			||||||
@@ -215,13 +188,3 @@ void vp8_remove_common(VP8_COMMON *oci)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    vp8_de_alloc_frame_buffers(oci);
 | 
					    vp8_de_alloc_frame_buffers(oci);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_initialize_common()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    vp8_coef_tree_initialize();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    vp8_entropy_mode_init();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    vp8_init_scan_order_mask();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,15 +18,23 @@
 | 
				
			|||||||
    AREA ||.text||, CODE, READONLY, ALIGN=2
 | 
					    AREA ||.text||, CODE, READONLY, ALIGN=2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;void vp8_intra4x4_predict(unsigned char *src, int src_stride, int b_mode,
 | 
					;void vp8_intra4x4_predict_armv6(unsigned char *Above, unsigned char *yleft,
 | 
				
			||||||
;                          unsigned char *dst, int dst_stride)
 | 
					;                                B_PREDICTION_MODE left_stride, int b_mode,
 | 
				
			||||||
 | 
					;                                unsigned char *dst, int dst_stride,
 | 
				
			||||||
 | 
					;                                unsigned char top_left)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					; r0: *Above
 | 
				
			||||||
 | 
					; r1: *yleft
 | 
				
			||||||
 | 
					; r2: left_stride
 | 
				
			||||||
 | 
					; r3: b_mode
 | 
				
			||||||
 | 
					; sp + #40: dst
 | 
				
			||||||
 | 
					; sp + #44: dst_stride
 | 
				
			||||||
 | 
					; sp + #48: top_left
 | 
				
			||||||
|vp8_intra4x4_predict_armv6| PROC
 | 
					|vp8_intra4x4_predict_armv6| PROC
 | 
				
			||||||
    push        {r4-r12, lr}
 | 
					    push        {r4-r12, lr}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    cmp         r3, #10
 | 
				
			||||||
    cmp         r2, #10
 | 
					    addlt       pc, pc, r3, lsl #2       ; position independent switch
 | 
				
			||||||
    addlt       pc, pc, r2, lsl #2       ; position independent switch
 | 
					 | 
				
			||||||
    pop         {r4-r12, pc}             ; default
 | 
					    pop         {r4-r12, pc}             ; default
 | 
				
			||||||
    b           b_dc_pred
 | 
					    b           b_dc_pred
 | 
				
			||||||
    b           b_tm_pred
 | 
					    b           b_tm_pred
 | 
				
			||||||
@@ -41,13 +49,13 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
b_dc_pred
 | 
					b_dc_pred
 | 
				
			||||||
    ; load values
 | 
					    ; load values
 | 
				
			||||||
    ldr         r8, [r0, -r1]            ; Above
 | 
					    ldr         r8, [r0]                 ; Above
 | 
				
			||||||
    ldrb        r4, [r0, #-1]!           ; Left[0]
 | 
					    ldrb        r4, [r1], r2             ; Left[0]
 | 
				
			||||||
    mov         r9, #0
 | 
					    mov         r9, #0
 | 
				
			||||||
    ldrb        r5, [r0, r1]             ; Left[1]
 | 
					    ldrb        r5, [r1], r2             ; Left[1]
 | 
				
			||||||
    ldrb        r6, [r0, r1, lsl #1]!    ; Left[2]
 | 
					    ldrb        r6, [r1], r2             ; Left[2]
 | 
				
			||||||
    usad8       r12, r8, r9
 | 
					    usad8       r12, r8, r9
 | 
				
			||||||
    ldrb        r7, [r0, r1]             ; Left[3]
 | 
					    ldrb        r7, [r1]                 ; Left[3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; calculate dc
 | 
					    ; calculate dc
 | 
				
			||||||
    add         r4, r4, r5
 | 
					    add         r4, r4, r5
 | 
				
			||||||
@@ -55,31 +63,30 @@ b_dc_pred
 | 
				
			|||||||
    add         r4, r4, r7
 | 
					    add         r4, r4, r7
 | 
				
			||||||
    add         r4, r4, r12
 | 
					    add         r4, r4, r12
 | 
				
			||||||
    add         r4, r4, #4
 | 
					    add         r4, r4, #4
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; load stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
    mov         r12, r4, asr #3         ; (expected_dc + 4) >> 3
 | 
					    mov         r12, r4, asr #3         ; (expected_dc + 4) >> 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r12, r12, r12, lsl #8
 | 
					    add         r12, r12, r12, lsl #8
 | 
				
			||||||
    add         r3, r3, r0
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
    add         r12, r12, r12, lsl #16
 | 
					    add         r12, r12, r12, lsl #16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; store values
 | 
					    ; store values
 | 
				
			||||||
    str         r12, [r3, -r0]
 | 
					    str         r12, [r3], r0
 | 
				
			||||||
 | 
					    str         r12, [r3], r0
 | 
				
			||||||
 | 
					    str         r12, [r3], r0
 | 
				
			||||||
    str         r12, [r3]
 | 
					    str         r12, [r3]
 | 
				
			||||||
    str         r12, [r3, r0]
 | 
					 | 
				
			||||||
    str         r12, [r3, r0, lsl #1]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_tm_pred
 | 
					b_tm_pred
 | 
				
			||||||
    sub         r10, r0, #1             ; Left
 | 
					    ldr         r8, [r0]                ; Above
 | 
				
			||||||
    ldr         r8, [r0, -r1]           ; Above
 | 
					    ldrb        r9, [sp, #48]           ; top_left
 | 
				
			||||||
    ldrb        r9, [r10, -r1]          ; top_left
 | 
					    ldrb        r4, [r1], r2            ; Left[0]
 | 
				
			||||||
    ldrb        r4, [r0, #-1]!          ; Left[0]
 | 
					    ldrb        r5, [r1], r2            ; Left[1]
 | 
				
			||||||
    ldrb        r5, [r10, r1]!          ; Left[1]
 | 
					    ldrb        r6, [r1], r2            ; Left[2]
 | 
				
			||||||
    ldrb        r6, [r0, r1, lsl #1]    ; Left[2]
 | 
					    ldrb        r7, [r1]                ; Left[3]
 | 
				
			||||||
    ldrb        r7, [r10, r1, lsl #1]   ; Left[3]
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; load stride
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r9, r9, r9, lsl #16     ; [tl|tl]
 | 
					    add         r9, r9, r9, lsl #16     ; [tl|tl]
 | 
				
			||||||
    uxtb16      r10, r8                 ; a[2|0]
 | 
					    uxtb16      r10, r8                 ; a[2|0]
 | 
				
			||||||
@@ -126,25 +133,26 @@ b_tm_pred
 | 
				
			|||||||
    str         r12, [r3], r0
 | 
					    str         r12, [r3], r0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r12, r4, r5, lsl #8     ; [3|2|1|0]
 | 
					    add         r12, r4, r5, lsl #8     ; [3|2|1|0]
 | 
				
			||||||
    str         r12, [r3], r0
 | 
					    str         r12, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_ve_pred
 | 
					b_ve_pred
 | 
				
			||||||
    ldr         r8, [r0, -r1]!          ; a[3|2|1|0]
 | 
					    ldr         r8, [r0]                ; a[3|2|1|0]
 | 
				
			||||||
    ldr         r11, c00FF00FF
 | 
					    ldr         r11, c00FF00FF
 | 
				
			||||||
    ldrb        r9, [r0, #-1]           ; top_left
 | 
					    ldrb        r9, [sp, #48]           ; top_left
 | 
				
			||||||
    ldrb        r10, [r0, #4]           ; a[4]
 | 
					    ldrb        r10, [r0, #4]           ; a[4]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, c00020002
 | 
					    ldr         r0, c00020002
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uxtb16      r4, r8                  ; a[2|0]
 | 
					    uxtb16      r4, r8                  ; a[2|0]
 | 
				
			||||||
    uxtb16      r5, r8, ror #8          ; a[3|1]
 | 
					    uxtb16      r5, r8, ror #8          ; a[3|1]
 | 
				
			||||||
    ldr         r2, [sp, #40]           ; stride
 | 
					    ldr         r2, [sp, #44]           ; dst_stride
 | 
				
			||||||
    pkhbt       r9, r9, r5, lsl #16     ; a[1|-1]
 | 
					    pkhbt       r9, r9, r5, lsl #16     ; a[1|-1]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r9, r9, r4, lsl #1      ;[a[1]+2*a[2]       | tl+2*a[0]       ]
 | 
					    add         r9, r9, r4, lsl #1      ;[a[1]+2*a[2]       | tl+2*a[0]       ]
 | 
				
			||||||
    uxtab16     r9, r9, r5              ;[a[1]+2*a[2]+a[3]  | tl+2*a[0]+a[1]  ]
 | 
					    uxtab16     r9, r9, r5              ;[a[1]+2*a[2]+a[3]  | tl+2*a[0]+a[1]  ]
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
    uxtab16     r9, r9, r0              ;[a[1]+2*a[2]+a[3]+2| tl+2*a[0]+a[1]+2]
 | 
					    uxtab16     r9, r9, r0              ;[a[1]+2*a[2]+a[3]+2| tl+2*a[0]+a[1]+2]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r0, r0, r10, lsl #16    ;[a[4]+2            |                 2]
 | 
					    add         r0, r0, r10, lsl #16    ;[a[4]+2            |                 2]
 | 
				
			||||||
@@ -154,25 +162,23 @@ b_ve_pred
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    and         r9, r11, r9, asr #2
 | 
					    and         r9, r11, r9, asr #2
 | 
				
			||||||
    and         r4, r11, r4, asr #2
 | 
					    and         r4, r11, r4, asr #2
 | 
				
			||||||
    add         r3, r3, r2              ; dst + dst_stride
 | 
					 | 
				
			||||||
    add         r9, r9, r4, lsl #8
 | 
					    add         r9, r9, r4, lsl #8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; store values
 | 
					    ; store values
 | 
				
			||||||
    str         r9, [r3, -r2]
 | 
					    str         r9, [r3], r2
 | 
				
			||||||
 | 
					    str         r9, [r3], r2
 | 
				
			||||||
 | 
					    str         r9, [r3], r2
 | 
				
			||||||
    str         r9, [r3]
 | 
					    str         r9, [r3]
 | 
				
			||||||
    str         r9, [r3, r2]
 | 
					 | 
				
			||||||
    str         r9, [r3, r2, lsl #1]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_he_pred
 | 
					b_he_pred
 | 
				
			||||||
    sub         r10, r0, #1             ; Left
 | 
					    ldrb        r4, [r1], r2            ; Left[0]
 | 
				
			||||||
    ldrb        r4, [r0, #-1]!          ; Left[0]
 | 
					    ldrb        r8, [sp, #48]           ; top_left
 | 
				
			||||||
    ldrb        r8, [r10, -r1]          ; top_left
 | 
					    ldrb        r5, [r1], r2            ; Left[1]
 | 
				
			||||||
    ldrb        r5, [r10, r1]!          ; Left[1]
 | 
					    ldrb        r6, [r1], r2            ; Left[2]
 | 
				
			||||||
    ldrb        r6, [r0, r1, lsl #1]    ; Left[2]
 | 
					    ldrb        r7, [r1]                ; Left[3]
 | 
				
			||||||
    ldrb        r7, [r10, r1, lsl #1]   ; Left[3]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r8, r8, r4              ; tl   + l[0]
 | 
					    add         r8, r8, r4              ; tl   + l[0]
 | 
				
			||||||
    add         r9, r4, r5              ; l[0] + l[1]
 | 
					    add         r9, r4, r5              ; l[0] + l[1]
 | 
				
			||||||
@@ -197,7 +203,8 @@ b_he_pred
 | 
				
			|||||||
    pkhtb       r10, r10, r10, asr #16  ; l[-|2|-|2]
 | 
					    pkhtb       r10, r10, r10, asr #16  ; l[-|2|-|2]
 | 
				
			||||||
    pkhtb       r11, r11, r11, asr #16  ; l[-|3|-|3]
 | 
					    pkhtb       r11, r11, r11, asr #16  ; l[-|3|-|3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r8, r8, r8, lsl #8      ; l[0|0|0|0]
 | 
					    add         r8, r8, r8, lsl #8      ; l[0|0|0|0]
 | 
				
			||||||
    add         r9, r9, r9, lsl #8      ; l[1|1|1|1]
 | 
					    add         r9, r9, r9, lsl #8      ; l[1|1|1|1]
 | 
				
			||||||
@@ -206,16 +213,16 @@ b_he_pred
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ; store values
 | 
					    ; store values
 | 
				
			||||||
    str         r8, [r3], r0
 | 
					    str         r8, [r3], r0
 | 
				
			||||||
    str         r9, [r3]
 | 
					    str         r9, [r3], r0
 | 
				
			||||||
    str         r10, [r3, r0]
 | 
					    str         r10, [r3], r0
 | 
				
			||||||
    str         r11, [r3, r0, lsl #1]
 | 
					    str         r11, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_ld_pred
 | 
					b_ld_pred
 | 
				
			||||||
    ldr         r4, [r0, -r1]!          ; Above
 | 
					    ldr         r4, [r0]                ; Above[0-3]
 | 
				
			||||||
    ldr         r12, c00020002
 | 
					    ldr         r12, c00020002
 | 
				
			||||||
    ldr         r5, [r0, #4]
 | 
					    ldr         r5, [r0, #4]            ; Above[4-7]
 | 
				
			||||||
    ldr         lr,  c00FF00FF
 | 
					    ldr         lr,  c00FF00FF
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uxtb16      r6, r4                  ; a[2|0]
 | 
					    uxtb16      r6, r4                  ; a[2|0]
 | 
				
			||||||
@@ -225,7 +232,6 @@ b_ld_pred
 | 
				
			|||||||
    pkhtb       r10, r6, r8             ; a[2|4]
 | 
					    pkhtb       r10, r6, r8             ; a[2|4]
 | 
				
			||||||
    pkhtb       r11, r7, r9             ; a[3|5]
 | 
					    pkhtb       r11, r7, r9             ; a[3|5]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    add         r4, r6, r7, lsl #1      ; [a2+2*a3      |      a0+2*a1]
 | 
					    add         r4, r6, r7, lsl #1      ; [a2+2*a3      |      a0+2*a1]
 | 
				
			||||||
    add         r4, r4, r10, ror #16    ; [a2+2*a3+a4   |   a0+2*a1+a2]
 | 
					    add         r4, r4, r10, ror #16    ; [a2+2*a3+a4   |   a0+2*a1+a2]
 | 
				
			||||||
    uxtab16     r4, r4, r12             ; [a2+2*a3+a4+2 | a0+2*a1+a2+2]
 | 
					    uxtab16     r4, r4, r12             ; [a2+2*a3+a4+2 | a0+2*a1+a2+2]
 | 
				
			||||||
@@ -244,7 +250,8 @@ b_ld_pred
 | 
				
			|||||||
    add         r7, r7, r9, asr #16     ; [                 a5+2*a6+a7]
 | 
					    add         r7, r7, r9, asr #16     ; [                 a5+2*a6+a7]
 | 
				
			||||||
    uxtah       r7, r7, r12             ; [               a5+2*a6+a7+2]
 | 
					    uxtah       r7, r7, r12             ; [               a5+2*a6+a7+2]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; scale down
 | 
					    ; scale down
 | 
				
			||||||
    and         r4, lr, r4, asr #2
 | 
					    and         r4, lr, r4, asr #2
 | 
				
			||||||
@@ -266,18 +273,17 @@ b_ld_pred
 | 
				
			|||||||
    mov         r6, r6, lsr #16
 | 
					    mov         r6, r6, lsr #16
 | 
				
			||||||
    mov         r11, r10, lsr #8
 | 
					    mov         r11, r10, lsr #8
 | 
				
			||||||
    add         r11, r11, r6, lsl #24   ; [6|5|4|3]
 | 
					    add         r11, r11, r6, lsl #24   ; [6|5|4|3]
 | 
				
			||||||
    str         r11, [r3], r0
 | 
					    str         r11, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_rd_pred
 | 
					b_rd_pred
 | 
				
			||||||
    sub         r12, r0, r1             ; Above = src - src_stride
 | 
					    ldrb        r7, [r1], r2            ; l[0] = pp[3]
 | 
				
			||||||
    ldrb        r7, [r0, #-1]!          ; l[0] = pp[3]
 | 
					    ldr         lr, [r0]                ; Above = pp[8|7|6|5]
 | 
				
			||||||
    ldr         lr, [r12]               ; Above = pp[8|7|6|5]
 | 
					    ldrb        r8, [sp, #48]           ; tl   = pp[4]
 | 
				
			||||||
    ldrb        r8, [r12, #-1]!         ; tl   = pp[4]
 | 
					    ldrb        r6, [r1], r2            ; l[1] = pp[2]
 | 
				
			||||||
    ldrb        r6, [r12, r1, lsl #1]   ; l[1] = pp[2]
 | 
					    ldrb        r5, [r1], r2            ; l[2] = pp[1]
 | 
				
			||||||
    ldrb        r5, [r0, r1, lsl #1]    ; l[2] = pp[1]
 | 
					    ldrb        r4, [r1], r2            ; l[3] = pp[0]
 | 
				
			||||||
    ldrb        r4, [r12, r1, lsl #2]   ; l[3] = pp[0]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uxtb16      r9, lr                  ; p[7|5]
 | 
					    uxtb16      r9, lr                  ; p[7|5]
 | 
				
			||||||
@@ -307,7 +313,8 @@ b_rd_pred
 | 
				
			|||||||
    add         r7, r7, r10             ; [p6+2*p7+p8   |   p4+2*p5+p6]
 | 
					    add         r7, r7, r10             ; [p6+2*p7+p8   |   p4+2*p5+p6]
 | 
				
			||||||
    uxtab16     r7, r7, r12             ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
 | 
					    uxtab16     r7, r7, r12             ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; scale down
 | 
					    ; scale down
 | 
				
			||||||
    and         r7, lr, r7, asr #2
 | 
					    and         r7, lr, r7, asr #2
 | 
				
			||||||
@@ -328,18 +335,17 @@ b_rd_pred
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    mov         r11, r10, lsl #8        ; [3|2|1|-]
 | 
					    mov         r11, r10, lsl #8        ; [3|2|1|-]
 | 
				
			||||||
    uxtab       r11, r11, r4            ; [3|2|1|0]
 | 
					    uxtab       r11, r11, r4            ; [3|2|1|0]
 | 
				
			||||||
    str         r11, [r3], r0
 | 
					    str         r11, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_vr_pred
 | 
					b_vr_pred
 | 
				
			||||||
    sub         r12, r0, r1             ; Above = src - src_stride
 | 
					    ldrb        r7, [r1], r2            ; l[0] = pp[3]
 | 
				
			||||||
    ldrb        r7, [r0, #-1]!          ; l[0] = pp[3]
 | 
					    ldr         lr, [r0]                ; Above = pp[8|7|6|5]
 | 
				
			||||||
    ldr         lr, [r12]               ; Above = pp[8|7|6|5]
 | 
					    ldrb        r8, [sp, #48]           ; tl   = pp[4]
 | 
				
			||||||
    ldrb        r8, [r12, #-1]!         ; tl   = pp[4]
 | 
					    ldrb        r6, [r1], r2            ; l[1] = pp[2]
 | 
				
			||||||
    ldrb        r6, [r12, r1, lsl #1]   ; l[1] = pp[2]
 | 
					    ldrb        r5, [r1], r2            ; l[2] = pp[1]
 | 
				
			||||||
    ldrb        r5, [r0, r1, lsl #1]    ; l[2] = pp[1]
 | 
					    ldrb        r4, [r1]                ; l[3] = pp[0]
 | 
				
			||||||
    ldrb        r4, [r12, r1, lsl #2]   ; l[3] = pp[0]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r5, r5, r7, lsl #16     ; p[3|1]
 | 
					    add         r5, r5, r7, lsl #16     ; p[3|1]
 | 
				
			||||||
    add         r6, r6, r8, lsl #16     ; p[4|2]
 | 
					    add         r6, r6, r8, lsl #16     ; p[4|2]
 | 
				
			||||||
@@ -376,7 +382,8 @@ b_vr_pred
 | 
				
			|||||||
    add         r8, r8, r10             ; [p6+2*p7+p8   |   p4+2*p5+p6]
 | 
					    add         r8, r8, r10             ; [p6+2*p7+p8   |   p4+2*p5+p6]
 | 
				
			||||||
    uxtab16     r8, r8, r12             ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
 | 
					    uxtab16     r8, r8, r12             ; [p6+2*p7+p8+2 | p4+2*p5+p6+2]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; scale down
 | 
					    ; scale down
 | 
				
			||||||
    and         r5, lr, r5, asr #2      ; [B|A]
 | 
					    and         r5, lr, r5, asr #2      ; [B|A]
 | 
				
			||||||
@@ -397,14 +404,14 @@ b_vr_pred
 | 
				
			|||||||
    pkhtb       r10, r7, r5, asr #16    ; [-|H|-|B]
 | 
					    pkhtb       r10, r7, r5, asr #16    ; [-|H|-|B]
 | 
				
			||||||
    str         r2, [r3], r0
 | 
					    str         r2, [r3], r0
 | 
				
			||||||
    add         r12, r12, r10, lsl #8   ; [H|D|B|A]
 | 
					    add         r12, r12, r10, lsl #8   ; [H|D|B|A]
 | 
				
			||||||
    str         r12, [r3], r0
 | 
					    str         r12, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_vl_pred
 | 
					b_vl_pred
 | 
				
			||||||
    ldr         r4, [r0, -r1]!          ; [3|2|1|0]
 | 
					    ldr         r4, [r0]                ; [3|2|1|0] = Above[0-3]
 | 
				
			||||||
    ldr         r12, c00020002
 | 
					    ldr         r12, c00020002
 | 
				
			||||||
    ldr         r5, [r0, #4]            ; [7|6|5|4]
 | 
					    ldr         r5, [r0, #4]            ; [7|6|5|4] = Above[4-7]
 | 
				
			||||||
    ldr         lr,  c00FF00FF
 | 
					    ldr         lr,  c00FF00FF
 | 
				
			||||||
    ldr         r2,  c00010001
 | 
					    ldr         r2,  c00010001
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -441,7 +448,8 @@ b_vl_pred
 | 
				
			|||||||
    add         r9, r9, r11             ; [p5+2*p6+p7   |   p3+2*p4+p5]
 | 
					    add         r9, r9, r11             ; [p5+2*p6+p7   |   p3+2*p4+p5]
 | 
				
			||||||
    uxtab16     r9, r9, r12             ; [p5+2*p6+p7+2 | p3+2*p4+p5+2]
 | 
					    uxtab16     r9, r9, r12             ; [p5+2*p6+p7+2 | p3+2*p4+p5+2]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         r0, [sp, #40]           ; stride
 | 
					    ldr         r0, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ; scale down
 | 
					    ; scale down
 | 
				
			||||||
    and         r5, lr, r5, asr #2      ; [D|C]
 | 
					    and         r5, lr, r5, asr #2      ; [D|C]
 | 
				
			||||||
@@ -449,7 +457,6 @@ b_vl_pred
 | 
				
			|||||||
    and         r8, lr, r8, asr #2      ; [I|D]
 | 
					    and         r8, lr, r8, asr #2      ; [I|D]
 | 
				
			||||||
    and         r9, lr, r9, asr #2      ; [J|H]
 | 
					    and         r9, lr, r9, asr #2      ; [J|H]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    add         r10, r4, r6, lsl #8     ; [F|B|E|A]
 | 
					    add         r10, r4, r6, lsl #8     ; [F|B|E|A]
 | 
				
			||||||
    str         r10, [r3], r0
 | 
					    str         r10, [r3], r0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -463,18 +470,17 @@ b_vl_pred
 | 
				
			|||||||
    str         r12, [r3], r0
 | 
					    str         r12, [r3], r0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r10, r7, r10, lsl #8    ; [J|H|D|G]
 | 
					    add         r10, r7, r10, lsl #8    ; [J|H|D|G]
 | 
				
			||||||
    str         r10, [r3], r0
 | 
					    str         r10, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_hd_pred
 | 
					b_hd_pred
 | 
				
			||||||
    sub         r12, r0, r1             ; Above = src - src_stride
 | 
					    ldrb        r7, [r1], r2            ; l[0] = pp[3]
 | 
				
			||||||
    ldrb        r7, [r0, #-1]!          ; l[0] = pp[3]
 | 
					    ldr         lr, [r0]                ; Above = pp[8|7|6|5]
 | 
				
			||||||
    ldr         lr, [r12]               ; Above = pp[8|7|6|5]
 | 
					    ldrb        r8, [sp, #48]           ; tl   = pp[4]
 | 
				
			||||||
    ldrb        r8, [r12, #-1]!         ; tl   = pp[4]
 | 
					    ldrb        r6, [r1], r2            ; l[1] = pp[2]
 | 
				
			||||||
    ldrb        r6, [r0, r1]            ; l[1] = pp[2]
 | 
					    ldrb        r5, [r1], r2            ; l[2] = pp[1]
 | 
				
			||||||
    ldrb        r5, [r0, r1, lsl #1]    ; l[2] = pp[1]
 | 
					    ldrb        r4, [r1]                ; l[3] = pp[0]
 | 
				
			||||||
    ldrb        r4, [r12, r1, lsl #2]   ; l[3] = pp[0]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    uxtb16      r9, lr                  ; p[7|5]
 | 
					    uxtb16      r9, lr                  ; p[7|5]
 | 
				
			||||||
    uxtb16      r10, lr, ror #8         ; p[8|6]
 | 
					    uxtb16      r10, lr, ror #8         ; p[8|6]
 | 
				
			||||||
@@ -492,7 +498,6 @@ b_hd_pred
 | 
				
			|||||||
    pkhtb       r1, r9, r10             ; p[7|6]
 | 
					    pkhtb       r1, r9, r10             ; p[7|6]
 | 
				
			||||||
    pkhbt       r10, r8, r10, lsl #16   ; p[6|5]
 | 
					    pkhbt       r10, r8, r10, lsl #16   ; p[6|5]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    uadd16      r11, r4, r5             ; [p1+p2        |        p0+p1]
 | 
					    uadd16      r11, r4, r5             ; [p1+p2        |        p0+p1]
 | 
				
			||||||
    uhadd16     r11, r11, r2            ; [(p1+p2+1)>>1 | (p0+p1+1)>>1]
 | 
					    uhadd16     r11, r11, r2            ; [(p1+p2+1)>>1 | (p0+p1+1)>>1]
 | 
				
			||||||
                                        ; [B|A]
 | 
					                                        ; [B|A]
 | 
				
			||||||
@@ -518,7 +523,8 @@ b_hd_pred
 | 
				
			|||||||
    and         r5, lr, r5, asr #2      ; [H|G]
 | 
					    and         r5, lr, r5, asr #2      ; [H|G]
 | 
				
			||||||
    and         r6, lr, r6, asr #2      ; [J|I]
 | 
					    and         r6, lr, r6, asr #2      ; [J|I]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr         lr, [sp, #40]           ; stride
 | 
					    ldr         lr, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pkhtb       r2, r0, r6              ; [-|F|-|I]
 | 
					    pkhtb       r2, r0, r6              ; [-|F|-|I]
 | 
				
			||||||
    pkhtb       r12, r6, r5, asr #16    ; [-|J|-|H]
 | 
					    pkhtb       r12, r6, r5, asr #16    ; [-|J|-|H]
 | 
				
			||||||
@@ -527,7 +533,6 @@ b_hd_pred
 | 
				
			|||||||
    mov         r12, r12, ror #24       ; [J|I|H|F]
 | 
					    mov         r12, r12, ror #24       ; [J|I|H|F]
 | 
				
			||||||
    str         r12, [r3], lr
 | 
					    str         r12, [r3], lr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    mov         r7, r11, asr #16        ; [-|-|-|B]
 | 
					    mov         r7, r11, asr #16        ; [-|-|-|B]
 | 
				
			||||||
    str         r2, [r3], lr
 | 
					    str         r2, [r3], lr
 | 
				
			||||||
    add         r7, r7, r0, lsl #16     ; [-|E|-|B]
 | 
					    add         r7, r7, r0, lsl #16     ; [-|E|-|B]
 | 
				
			||||||
@@ -536,21 +541,20 @@ b_hd_pred
 | 
				
			|||||||
    str         r7, [r3], lr
 | 
					    str         r7, [r3], lr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r5, r11, r4, lsl #8     ; [D|B|C|A]
 | 
					    add         r5, r11, r4, lsl #8     ; [D|B|C|A]
 | 
				
			||||||
    str         r5, [r3], lr
 | 
					    str         r5, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
b_hu_pred
 | 
					b_hu_pred
 | 
				
			||||||
    ldrb        r4, [r0, #-1]!          ; Left[0]
 | 
					    ldrb        r4, [r1], r2            ; Left[0]
 | 
				
			||||||
    ldr         r12, c00020002
 | 
					    ldr         r12, c00020002
 | 
				
			||||||
    ldrb        r5, [r0, r1]!           ; Left[1]
 | 
					    ldrb        r5, [r1], r2            ; Left[1]
 | 
				
			||||||
    ldr         lr,  c00FF00FF
 | 
					    ldr         lr,  c00FF00FF
 | 
				
			||||||
    ldrb        r6, [r0, r1]!           ; Left[2]
 | 
					    ldrb        r6, [r1], r2            ; Left[2]
 | 
				
			||||||
    ldr         r2,  c00010001
 | 
					    ldr         r2,  c00010001
 | 
				
			||||||
    ldrb        r7, [r0, r1]            ; Left[3]
 | 
					    ldrb        r7, [r1]                ; Left[3]
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r4, r4, r5, lsl #16     ; [1|0]
 | 
					    add         r4, r4, r5, lsl #16     ; [1|0]
 | 
				
			||||||
    add         r5, r5, r6, lsl #16     ; [2|1]
 | 
					    add         r5, r5, r6, lsl #16     ; [2|1]
 | 
				
			||||||
@@ -563,7 +567,8 @@ b_hu_pred
 | 
				
			|||||||
    add         r4, r4, r5, lsl #1      ; [p1+2*p2      |      p0+2*p1]
 | 
					    add         r4, r4, r5, lsl #1      ; [p1+2*p2      |      p0+2*p1]
 | 
				
			||||||
    add         r4, r4, r9              ; [p1+2*p2+p3   |   p0+2*p1+p2]
 | 
					    add         r4, r4, r9              ; [p1+2*p2+p3   |   p0+2*p1+p2]
 | 
				
			||||||
    uxtab16     r4, r4, r12             ; [p1+2*p2+p3+2 | p0+2*p1+p2+2]
 | 
					    uxtab16     r4, r4, r12             ; [p1+2*p2+p3+2 | p0+2*p1+p2+2]
 | 
				
			||||||
    ldr         r2, [sp, #40]           ; stride
 | 
					    ldr         r2, [sp, #44]           ; dst_stride
 | 
				
			||||||
 | 
					    ldr         r3, [sp, #40]           ; dst
 | 
				
			||||||
    and         r4, lr, r4, asr #2      ; [D|C]
 | 
					    and         r4, lr, r4, asr #2      ; [D|C]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    add         r10, r6, r7             ; [p2+p3]
 | 
					    add         r10, r6, r7             ; [p2+p3]
 | 
				
			||||||
@@ -587,9 +592,9 @@ b_hu_pred
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    add         r10, r11, lsl #8        ; [-|-|F|E]
 | 
					    add         r10, r11, lsl #8        ; [-|-|F|E]
 | 
				
			||||||
    add         r10, r10, r9, lsl #16   ; [G|G|F|E]
 | 
					    add         r10, r10, r9, lsl #16   ; [G|G|F|E]
 | 
				
			||||||
    str         r10, [r3]
 | 
					    str         r10, [r3], r2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    str         r7, [r3, r2]
 | 
					    str         r7, [r3]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pop        {r4-r12, pc}
 | 
					    pop        {r4-r12, pc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,7 +46,7 @@
 | 
				
			|||||||
    vst1.32         {d2[1]}, [r3], r12
 | 
					    vst1.32         {d2[1]}, [r3], r12
 | 
				
			||||||
    vst1.32         {d4[0]}, [r3], r12
 | 
					    vst1.32         {d4[0]}, [r3], r12
 | 
				
			||||||
    vst1.32         {d4[1]}, [r3]
 | 
					    vst1.32         {d4[1]}, [r3]
 | 
				
			||||||
 
 | 
					
 | 
				
			||||||
    bx              lr
 | 
					    bx              lr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ENDP
 | 
					    ENDP
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,11 @@
 | 
				
			|||||||
;
 | 
					;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bilinear_taps_coeff
 | 
				
			||||||
 | 
					    DCD     128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;-----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    EXPORT  |vp8_sub_pixel_variance16x16_neon_func|
 | 
					    EXPORT  |vp8_sub_pixel_variance16x16_neon_func|
 | 
				
			||||||
    ARM
 | 
					    ARM
 | 
				
			||||||
    REQUIRE8
 | 
					    REQUIRE8
 | 
				
			||||||
@@ -27,7 +32,7 @@
 | 
				
			|||||||
|vp8_sub_pixel_variance16x16_neon_func| PROC
 | 
					|vp8_sub_pixel_variance16x16_neon_func| PROC
 | 
				
			||||||
    push            {r4-r6, lr}
 | 
					    push            {r4-r6, lr}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr             r12, _BilinearTaps_coeff_
 | 
					    adr             r12, bilinear_taps_coeff
 | 
				
			||||||
    ldr             r4, [sp, #16]           ;load *dst_ptr from stack
 | 
					    ldr             r4, [sp, #16]           ;load *dst_ptr from stack
 | 
				
			||||||
    ldr             r5, [sp, #20]           ;load dst_pixels_per_line from stack
 | 
					    ldr             r5, [sp, #20]           ;load dst_pixels_per_line from stack
 | 
				
			||||||
    ldr             r6, [sp, #24]           ;load *sse from stack
 | 
					    ldr             r6, [sp, #24]           ;load *sse from stack
 | 
				
			||||||
@@ -415,11 +420,4 @@ sub_pixel_variance16x16_neon_loop
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    ENDP
 | 
					    ENDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;-----------------
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
_BilinearTaps_coeff_
 | 
					 | 
				
			||||||
    DCD     bilinear_taps_coeff
 | 
					 | 
				
			||||||
bilinear_taps_coeff
 | 
					 | 
				
			||||||
    DCD     128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    END
 | 
					    END
 | 
				
			||||||
@@ -27,7 +27,7 @@
 | 
				
			|||||||
|vp8_sub_pixel_variance8x8_neon| PROC
 | 
					|vp8_sub_pixel_variance8x8_neon| PROC
 | 
				
			||||||
    push            {r4-r5, lr}
 | 
					    push            {r4-r5, lr}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ldr             r12, _BilinearTaps_coeff_
 | 
					    adr             r12, bilinear_taps_coeff
 | 
				
			||||||
    ldr             r4, [sp, #12]           ;load *dst_ptr from stack
 | 
					    ldr             r4, [sp, #12]           ;load *dst_ptr from stack
 | 
				
			||||||
    ldr             r5, [sp, #16]           ;load dst_pixels_per_line from stack
 | 
					    ldr             r5, [sp, #16]           ;load dst_pixels_per_line from stack
 | 
				
			||||||
    ldr             lr, [sp, #20]           ;load *sse from stack
 | 
					    ldr             lr, [sp, #20]           ;load *sse from stack
 | 
				
			||||||
@@ -216,8 +216,6 @@ sub_pixel_variance8x8_neon_loop
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
;-----------------
 | 
					;-----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
_BilinearTaps_coeff_
 | 
					 | 
				
			||||||
    DCD     bilinear_taps_coeff
 | 
					 | 
				
			||||||
bilinear_taps_coeff
 | 
					bilinear_taps_coeff
 | 
				
			||||||
    DCD     128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
 | 
					    DCD     128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -10,7 +10,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "vpx_config.h"
 | 
					#include "vpx_config.h"
 | 
				
			||||||
#include "vpx_rtcd.h"
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
#include "vp8/encoder/variance.h"
 | 
					#include "vp8/common/variance.h"
 | 
				
			||||||
#include "vp8/common/filter.h"
 | 
					#include "vp8/common/filter.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if HAVE_MEDIA
 | 
					#if HAVE_MEDIA
 | 
				
			||||||
@@ -97,6 +97,17 @@ unsigned int vp8_sub_pixel_variance16x16_armv6
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#if HAVE_NEON
 | 
					#if HAVE_NEON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern unsigned int vp8_sub_pixel_variance16x16_neon_func
 | 
				
			||||||
 | 
					(
 | 
				
			||||||
 | 
					    const unsigned char  *src_ptr,
 | 
				
			||||||
 | 
					    int  src_pixels_per_line,
 | 
				
			||||||
 | 
					    int  xoffset,
 | 
				
			||||||
 | 
					    int  yoffset,
 | 
				
			||||||
 | 
					    const unsigned char *dst_ptr,
 | 
				
			||||||
 | 
					    int dst_pixels_per_line,
 | 
				
			||||||
 | 
					    unsigned int *sse
 | 
				
			||||||
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
unsigned int vp8_sub_pixel_variance16x16_neon
 | 
					unsigned int vp8_sub_pixel_variance16x16_neon
 | 
				
			||||||
(
 | 
					(
 | 
				
			||||||
    const unsigned char  *src_ptr,
 | 
					    const unsigned char  *src_ptr,
 | 
				
			||||||
@@ -15,6 +15,10 @@
 | 
				
			|||||||
#include "vpx_scale/yv12config.h"
 | 
					#include "vpx_scale/yv12config.h"
 | 
				
			||||||
#include "vp8/common/blockd.h"
 | 
					#include "vp8/common/blockd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
 | 
					#include "postproc.h"
 | 
				
			||||||
 | 
					#endif /* CONFIG_POSTPROC */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* vpx_scale */
 | 
					/* vpx_scale */
 | 
				
			||||||
@@ -30,6 +34,11 @@ DEFINE(yv12_buffer_config_v_buffer,             offsetof(YV12_BUFFER_CONFIG, v_b
 | 
				
			|||||||
DEFINE(yv12_buffer_config_border,               offsetof(YV12_BUFFER_CONFIG, border));
 | 
					DEFINE(yv12_buffer_config_border,               offsetof(YV12_BUFFER_CONFIG, border));
 | 
				
			||||||
DEFINE(VP8BORDERINPIXELS_VAL,                   VP8BORDERINPIXELS);
 | 
					DEFINE(VP8BORDERINPIXELS_VAL,                   VP8BORDERINPIXELS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
 | 
					/* mfqe.c / filter_by_weight */
 | 
				
			||||||
 | 
					DEFINE(MFQE_PRECISION_VAL,                      MFQE_PRECISION);
 | 
				
			||||||
 | 
					#endif /* CONFIG_POSTPROC */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* add asserts for any offset that is not supported by assembly code */
 | 
					/* add asserts for any offset that is not supported by assembly code */
 | 
				
			||||||
@@ -53,3 +62,10 @@ ct_assert(B_HU_PRED, B_HU_PRED == 9);
 | 
				
			|||||||
/* vp8_yv12_extend_frame_borders_neon makes several assumptions based on this */
 | 
					/* vp8_yv12_extend_frame_borders_neon makes several assumptions based on this */
 | 
				
			||||||
ct_assert(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS == 32)
 | 
					ct_assert(VP8BORDERINPIXELS_VAL, VP8BORDERINPIXELS == 32)
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_SSE2
 | 
				
			||||||
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
 | 
					/* vp8_filter_by_weight16x16 and 8x8 */
 | 
				
			||||||
 | 
					ct_assert(MFQE_PRECISION_VAL, MFQE_PRECISION == 4)
 | 
				
			||||||
 | 
					#endif /* CONFIG_POSTPROC */
 | 
				
			||||||
 | 
					#endif /* HAVE_SSE2 */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -150,32 +150,43 @@ typedef enum
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
typedef struct
 | 
					typedef struct
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    MB_PREDICTION_MODE mode, uv_mode;
 | 
					    uint8_t mode, uv_mode;
 | 
				
			||||||
    MV_REFERENCE_FRAME ref_frame;
 | 
					    uint8_t ref_frame;
 | 
				
			||||||
 | 
					    uint8_t is_4x4;
 | 
				
			||||||
    int_mv mv;
 | 
					    int_mv mv;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    unsigned char partitioning;
 | 
					    uint8_t partitioning;
 | 
				
			||||||
    unsigned char mb_skip_coeff;                                /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
 | 
					    uint8_t mb_skip_coeff;                                /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
 | 
				
			||||||
    unsigned char need_to_clamp_mvs;
 | 
					    uint8_t need_to_clamp_mvs;
 | 
				
			||||||
    unsigned char segment_id;                  /* Which set of segmentation parameters should be used for this MB */
 | 
					    uint8_t segment_id;                  /* Which set of segmentation parameters should be used for this MB */
 | 
				
			||||||
} MB_MODE_INFO;
 | 
					} MB_MODE_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct
 | 
					typedef struct modeinfo
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    MB_MODE_INFO mbmi;
 | 
					    MB_MODE_INFO mbmi;
 | 
				
			||||||
    union b_mode_info bmi[16];
 | 
					    union b_mode_info bmi[16];
 | 
				
			||||||
} MODE_INFO;
 | 
					} MODE_INFO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if CONFIG_MULTI_RES_ENCODING
 | 
					#if CONFIG_MULTI_RES_ENCODING
 | 
				
			||||||
/* The information needed to be stored for higher-resolution encoder */
 | 
					/* The mb-level information needed to be stored for higher-resolution encoder */
 | 
				
			||||||
typedef struct
 | 
					typedef struct
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    MB_PREDICTION_MODE mode;
 | 
					    MB_PREDICTION_MODE mode;
 | 
				
			||||||
    MV_REFERENCE_FRAME ref_frame;
 | 
					    MV_REFERENCE_FRAME ref_frame;
 | 
				
			||||||
    int_mv mv;
 | 
					    int_mv mv;
 | 
				
			||||||
    //union b_mode_info bmi[16];
 | 
					    int dissim;    /* dissimilarity level of the macroblock */
 | 
				
			||||||
    int dissim;    // dissimilarity level of the macroblock
 | 
					} LOWER_RES_MB_INFO;
 | 
				
			||||||
} LOWER_RES_INFO;
 | 
					
 | 
				
			||||||
 | 
					/* The frame-level information needed to be stored for higher-resolution
 | 
				
			||||||
 | 
					 *  encoder */
 | 
				
			||||||
 | 
					typedef struct
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    FRAME_TYPE frame_type;
 | 
				
			||||||
 | 
					    int is_frame_dropped;
 | 
				
			||||||
 | 
					    /* The frame number of each reference frames */
 | 
				
			||||||
 | 
					    unsigned int low_res_ref_frames[MAX_REF_FRAMES];
 | 
				
			||||||
 | 
					    LOWER_RES_MB_INFO *mb_info;
 | 
				
			||||||
 | 
					} LOWER_RES_FRAME_INFO;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct blockd
 | 
					typedef struct blockd
 | 
				
			||||||
@@ -205,11 +216,6 @@ typedef struct macroblockd
 | 
				
			|||||||
    DECLARE_ALIGNED(16, short,  dequant_y2[16]);
 | 
					    DECLARE_ALIGNED(16, short,  dequant_y2[16]);
 | 
				
			||||||
    DECLARE_ALIGNED(16, short,  dequant_uv[16]);
 | 
					    DECLARE_ALIGNED(16, short,  dequant_uv[16]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* position of this macroblock */
 | 
					 | 
				
			||||||
    int mbr;
 | 
					 | 
				
			||||||
    int mbc;
 | 
					 | 
				
			||||||
    int mbrc;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
 | 
					    /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */
 | 
				
			||||||
    BLOCKD block[25];
 | 
					    BLOCKD block[25];
 | 
				
			||||||
    int fullpixel_mask;
 | 
					    int fullpixel_mask;
 | 
				
			||||||
@@ -225,6 +231,10 @@ typedef struct macroblockd
 | 
				
			|||||||
    int up_available;
 | 
					    int up_available;
 | 
				
			||||||
    int left_available;
 | 
					    int left_available;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unsigned char *recon_above[3];
 | 
				
			||||||
 | 
					    unsigned char *recon_left[3];
 | 
				
			||||||
 | 
					    int recon_left_stride[2];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Y,U,V,Y2 */
 | 
					    /* Y,U,V,Y2 */
 | 
				
			||||||
    ENTROPY_CONTEXT_PLANES *above_context;
 | 
					    ENTROPY_CONTEXT_PLANES *above_context;
 | 
				
			||||||
    ENTROPY_CONTEXT_PLANES *left_context;
 | 
					    ENTROPY_CONTEXT_PLANES *left_context;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,23 +8,11 @@
 | 
				
			|||||||
 *  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 <stdio.h>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "entropy.h"
 | 
					#include "entropy.h"
 | 
				
			||||||
#include "string.h"
 | 
					 | 
				
			||||||
#include "blockd.h"
 | 
					#include "blockd.h"
 | 
				
			||||||
#include "onyxc_int.h"
 | 
					#include "onyxc_int.h"
 | 
				
			||||||
#include "vpx_mem/vpx_mem.h"
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define uchar unsigned char     /* typedefs can clash */
 | 
					 | 
				
			||||||
#define uint  unsigned int
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef const uchar cuchar;
 | 
					 | 
				
			||||||
typedef const uint cuint;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef vp8_prob Prob;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#include "coefupdateprobs.h"
 | 
					#include "coefupdateprobs.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
 | 
					DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
 | 
				
			||||||
@@ -47,10 +35,11 @@ DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) =
 | 
				
			|||||||
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 | 
					    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) =
 | 
					DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]) =
 | 
				
			||||||
{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
 | 
					{ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
 | 
					DECLARE_ALIGNED(16, const unsigned char,
 | 
				
			||||||
 | 
					                vp8_prev_token_class[MAX_ENTROPY_TOKENS]) =
 | 
				
			||||||
{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
 | 
					{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
 | 
					DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
 | 
				
			||||||
@@ -69,7 +58,26 @@ DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) =
 | 
				
			|||||||
   10, 11, 15, 16
 | 
					   10, 11, 15, 16
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]);
 | 
					/* vp8_default_zig_zag_mask generated with:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    void vp8_init_scan_order_mask()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        for (i = 0; i < 16; i++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]) =
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					     1,    2,    32,     64,
 | 
				
			||||||
 | 
					     4,   16,   128,   4096,
 | 
				
			||||||
 | 
					     8,  256,  2048,   8192,
 | 
				
			||||||
 | 
					   512, 1024, 16384, -32768
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6};
 | 
					const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -90,56 +98,72 @@ const vp8_tree_index vp8_coef_tree[ 22] =     /* corresponding _CONTEXT_NODEs */
 | 
				
			|||||||
    -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6   /* 10 = CAT_FIVE */
 | 
					    -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6   /* 10 = CAT_FIVE */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
 | 
					/* vp8_coef_encodings generated with:
 | 
				
			||||||
 | 
					    vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					vp8_token vp8_coef_encodings[MAX_ENTROPY_TOKENS] =
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    {2, 2},
 | 
				
			||||||
 | 
					    {6, 3},
 | 
				
			||||||
 | 
					    {28, 5},
 | 
				
			||||||
 | 
					    {58, 6},
 | 
				
			||||||
 | 
					    {59, 6},
 | 
				
			||||||
 | 
					    {60, 6},
 | 
				
			||||||
 | 
					    {61, 6},
 | 
				
			||||||
 | 
					    {124, 7},
 | 
				
			||||||
 | 
					    {125, 7},
 | 
				
			||||||
 | 
					    {126, 7},
 | 
				
			||||||
 | 
					    {127, 7},
 | 
				
			||||||
 | 
					    {0, 1}
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Trees for extra bits.  Probabilities are constant and
 | 
					/* Trees for extra bits.  Probabilities are constant and
 | 
				
			||||||
   do not depend on previously encoded bits */
 | 
					   do not depend on previously encoded bits */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const Prob Pcat1[] = { 159};
 | 
					static const vp8_prob Pcat1[] = { 159};
 | 
				
			||||||
static const Prob Pcat2[] = { 165, 145};
 | 
					static const vp8_prob Pcat2[] = { 165, 145};
 | 
				
			||||||
static const Prob Pcat3[] = { 173, 148, 140};
 | 
					static const vp8_prob Pcat3[] = { 173, 148, 140};
 | 
				
			||||||
static const Prob Pcat4[] = { 176, 155, 140, 135};
 | 
					static const vp8_prob Pcat4[] = { 176, 155, 140, 135};
 | 
				
			||||||
static const Prob Pcat5[] = { 180, 157, 141, 134, 130};
 | 
					static const vp8_prob Pcat5[] = { 180, 157, 141, 134, 130};
 | 
				
			||||||
static const Prob Pcat6[] =
 | 
					static const vp8_prob Pcat6[] =
 | 
				
			||||||
{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129};
 | 
					{ 254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_init_scan_order_mask()
 | 
					/* tree index tables generated with:
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (i = 0; i < 16; i++)
 | 
					    void init_bit_tree(vp8_tree_index *p, int n)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
 | 
					        int i = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        while (++i < n)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            p[0] = p[1] = i << 1;
 | 
				
			||||||
 | 
					            p += 2;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        p[0] = p[1] = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					    void init_bit_trees()
 | 
				
			||||||
 | 
					 | 
				
			||||||
static void init_bit_tree(vp8_tree_index *p, int n)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int i = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    while (++i < n)
 | 
					 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        p[0] = p[1] = i << 1;
 | 
					        init_bit_tree(cat1, 1);
 | 
				
			||||||
        p += 2;
 | 
					        init_bit_tree(cat2, 2);
 | 
				
			||||||
 | 
					        init_bit_tree(cat3, 3);
 | 
				
			||||||
 | 
					        init_bit_tree(cat4, 4);
 | 
				
			||||||
 | 
					        init_bit_tree(cat5, 5);
 | 
				
			||||||
 | 
					        init_bit_tree(cat6, 11);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    p[0] = p[1] = 0;
 | 
					static const vp8_tree_index cat1[2] = { 0, 0 };
 | 
				
			||||||
}
 | 
					static const vp8_tree_index cat2[4] = { 2, 2, 0, 0 };
 | 
				
			||||||
 | 
					static const vp8_tree_index cat3[6] = { 2, 2, 4, 4, 0, 0 };
 | 
				
			||||||
 | 
					static const vp8_tree_index cat4[8] = { 2, 2, 4, 4, 6, 6, 0, 0 };
 | 
				
			||||||
 | 
					static const vp8_tree_index cat5[10] = { 2, 2, 4, 4, 6, 6, 8, 8, 0, 0 };
 | 
				
			||||||
 | 
					static const vp8_tree_index cat6[22] = { 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12,
 | 
				
			||||||
 | 
					                                        14, 14, 16, 16, 18, 18, 20, 20, 0, 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void init_bit_trees()
 | 
					const vp8_extra_bit_struct vp8_extra_bits[12] =
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    init_bit_tree(cat1, 1);
 | 
					 | 
				
			||||||
    init_bit_tree(cat2, 2);
 | 
					 | 
				
			||||||
    init_bit_tree(cat3, 3);
 | 
					 | 
				
			||||||
    init_bit_tree(cat4, 4);
 | 
					 | 
				
			||||||
    init_bit_tree(cat5, 5);
 | 
					 | 
				
			||||||
    init_bit_tree(cat6, 11);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
vp8_extra_bit_struct vp8_extra_bits[12] =
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    { 0, 0, 0, 0},
 | 
					    { 0, 0, 0, 0},
 | 
				
			||||||
    { 0, 0, 0, 1},
 | 
					    { 0, 0, 0, 1},
 | 
				
			||||||
@@ -163,8 +187,3 @@ void vp8_default_coef_probs(VP8_COMMON *pc)
 | 
				
			|||||||
                   sizeof(default_coef_probs));
 | 
					                   sizeof(default_coef_probs));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_coef_tree_initialize()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    init_bit_trees();
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -35,7 +35,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
extern const vp8_tree_index vp8_coef_tree[];
 | 
					extern const vp8_tree_index vp8_coef_tree[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
 | 
					extern const struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct
 | 
					typedef struct
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -45,7 +45,7 @@ typedef struct
 | 
				
			|||||||
    int base_val;
 | 
					    int base_val;
 | 
				
			||||||
} vp8_extra_bit_struct;
 | 
					} vp8_extra_bit_struct;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern vp8_extra_bit_struct vp8_extra_bits[12];    /* indexed by token value */
 | 
					extern const vp8_extra_bit_struct vp8_extra_bits[12];    /* indexed by token value */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define PROB_UPDATE_BASELINE_COST   7
 | 
					#define PROB_UPDATE_BASELINE_COST   7
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -94,7 +94,7 @@ void vp8_default_coef_probs(struct VP8Common *);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]);
 | 
					extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]);
 | 
				
			||||||
extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]);
 | 
					extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]);
 | 
				
			||||||
extern short vp8_default_zig_zag_mask[16];
 | 
					extern DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]);
 | 
				
			||||||
extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
 | 
					extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_coef_tree_initialize(void);
 | 
					void vp8_coef_tree_initialize(void);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,22 +8,13 @@
 | 
				
			|||||||
 *  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.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define USE_PREBUILT_TABLES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "entropymode.h"
 | 
					#include "entropymode.h"
 | 
				
			||||||
#include "entropy.h"
 | 
					#include "entropy.h"
 | 
				
			||||||
#include "vpx_mem/vpx_mem.h"
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 1607, 915, 812, 811, 5455};
 | 
					#include "vp8_entropymodedata.h"
 | 
				
			||||||
static const unsigned int y_mode_cts  [VP8_YMODES] = { 8080, 1908, 1582, 1007, 5874};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static const unsigned int uv_mode_cts  [VP8_UV_MODES] = { 59483, 13605, 16492, 4230};
 | 
					 | 
				
			||||||
static const unsigned int kf_uv_mode_cts[VP8_UV_MODES] = { 5319, 1904, 1703, 674};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static const unsigned int bmode_cts[VP8_BINTRAMODES] =
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
int vp8_mv_cont(const int_mv *l, const int_mv *a)
 | 
					int vp8_mv_cont(const int_mv *l, const int_mv *a)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -59,7 +50,7 @@ const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] =
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
 | 
					const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        0,  0,  0,  0,
 | 
					        0,  0,  0,  0,
 | 
				
			||||||
@@ -84,7 +75,7 @@ vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] =
 | 
				
			|||||||
        4,  5,  6,  7,
 | 
					        4,  5,  6,  7,
 | 
				
			||||||
        8,  9,  10, 11,
 | 
					        8,  9,  10, 11,
 | 
				
			||||||
        12, 13, 14, 15,
 | 
					        12, 13, 14, 15,
 | 
				
			||||||
    },
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16};
 | 
					const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16};
 | 
				
			||||||
@@ -155,17 +146,6 @@ const vp8_tree_index vp8_sub_mv_ref_tree[6] =
 | 
				
			|||||||
    -ZERO4X4, -NEW4X4
 | 
					    -ZERO4X4, -NEW4X4
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_bmode_encodings   [VP8_BINTRAMODES];
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_ymode_encodings   [VP8_YMODES];
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_uv_mode_encodings  [VP8_UV_MODES];
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_mbsplit_encodings [VP8_NUMMBSPLITS];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_mv_ref_encoding_array    [VP8_MVREFS];
 | 
					 | 
				
			||||||
struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const vp8_tree_index vp8_small_mvtree [14] =
 | 
					const vp8_tree_index vp8_small_mvtree [14] =
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    2, 8,
 | 
					    2, 8,
 | 
				
			||||||
@@ -177,89 +157,15 @@ const vp8_tree_index vp8_small_mvtree [14] =
 | 
				
			|||||||
    -6, -7
 | 
					    -6, -7
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct vp8_token_struct vp8_small_mvencodings [8];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_init_mbmode_probs(VP8_COMMON *x)
 | 
					void vp8_init_mbmode_probs(VP8_COMMON *x)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    unsigned int bct [VP8_YMODES] [2];      /* num Ymodes > num UV modes */
 | 
					    vpx_memcpy(x->fc.ymode_prob, vp8_ymode_prob, sizeof(vp8_ymode_prob));
 | 
				
			||||||
 | 
					    vpx_memcpy(x->fc.uv_mode_prob, vp8_uv_mode_prob, sizeof(vp8_uv_mode_prob));
 | 
				
			||||||
    vp8_tree_probs_from_distribution(
 | 
					 | 
				
			||||||
        VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree,
 | 
					 | 
				
			||||||
        x->fc.ymode_prob, bct, y_mode_cts,
 | 
					 | 
				
			||||||
        256, 1
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    vp8_tree_probs_from_distribution(
 | 
					 | 
				
			||||||
        VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree,
 | 
					 | 
				
			||||||
        x->kf_ymode_prob, bct, kf_y_mode_cts,
 | 
					 | 
				
			||||||
        256, 1
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    vp8_tree_probs_from_distribution(
 | 
					 | 
				
			||||||
        VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
 | 
					 | 
				
			||||||
        x->fc.uv_mode_prob, bct, uv_mode_cts,
 | 
					 | 
				
			||||||
        256, 1
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    vp8_tree_probs_from_distribution(
 | 
					 | 
				
			||||||
        VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
 | 
					 | 
				
			||||||
        x->kf_uv_mode_prob, bct, kf_uv_mode_cts,
 | 
					 | 
				
			||||||
        256, 1
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
    vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob));
 | 
					    vpx_memcpy(x->fc.sub_mv_ref_prob, sub_mv_ref_prob, sizeof(sub_mv_ref_prob));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
static void intra_bmode_probs_from_distribution(
 | 
					 | 
				
			||||||
    vp8_prob p [VP8_BINTRAMODES-1],
 | 
					 | 
				
			||||||
    unsigned int branch_ct [VP8_BINTRAMODES-1] [2],
 | 
					 | 
				
			||||||
    const unsigned int events [VP8_BINTRAMODES]
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    vp8_tree_probs_from_distribution(
 | 
					 | 
				
			||||||
        VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree,
 | 
					 | 
				
			||||||
        p, branch_ct, events,
 | 
					 | 
				
			||||||
        256, 1
 | 
					 | 
				
			||||||
    );
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1])
 | 
					void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
 | 
					    vpx_memcpy(p, vp8_bmode_prob, sizeof(vp8_bmode_prob));
 | 
				
			||||||
    intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1])
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    unsigned int branch_ct [VP8_BINTRAMODES-1] [2];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int i = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    do
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        int j = 0;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        do
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            intra_bmode_probs_from_distribution(
 | 
					 | 
				
			||||||
                p[i][j], branch_ct, vp8_kf_default_bmode_counts[i][j]);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        while (++j < VP8_BINTRAMODES);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    while (++i < VP8_BINTRAMODES);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_entropy_mode_init()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_bmode_encodings,   vp8_bmode_tree);
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_ymode_encodings,   vp8_ymode_tree);
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree);
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_uv_mode_encodings,  vp8_uv_mode_tree);
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array,
 | 
					 | 
				
			||||||
                                vp8_mv_ref_tree, NEARESTMV);
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array,
 | 
					 | 
				
			||||||
                                vp8_sub_mv_ref_tree, LEFT4X4);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -24,11 +24,11 @@ typedef enum
 | 
				
			|||||||
    SUBMVREF_LEFT_ABOVE_ZED
 | 
					    SUBMVREF_LEFT_ABOVE_ZED
 | 
				
			||||||
} sumvfref_t;
 | 
					} sumvfref_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef const int vp8_mbsplit[16];
 | 
					typedef int vp8_mbsplit[16];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define VP8_NUMMBSPLITS 4
 | 
					#define VP8_NUMMBSPLITS 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
 | 
					extern const vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS];    /* # of subsets */
 | 
					extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS];    /* # of subsets */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -52,26 +52,29 @@ extern const vp8_tree_index  vp8_mbsplit_tree[];
 | 
				
			|||||||
extern const vp8_tree_index  vp8_mv_ref_tree[];
 | 
					extern const vp8_tree_index  vp8_mv_ref_tree[];
 | 
				
			||||||
extern const vp8_tree_index  vp8_sub_mv_ref_tree[];
 | 
					extern const vp8_tree_index  vp8_sub_mv_ref_tree[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct vp8_token_struct vp8_bmode_encodings   [VP8_BINTRAMODES];
 | 
					extern const struct vp8_token_struct vp8_bmode_encodings[VP8_BINTRAMODES];
 | 
				
			||||||
extern struct vp8_token_struct vp8_ymode_encodings   [VP8_YMODES];
 | 
					extern const struct vp8_token_struct vp8_ymode_encodings[VP8_YMODES];
 | 
				
			||||||
extern struct vp8_token_struct vp8_kf_ymode_encodings [VP8_YMODES];
 | 
					extern const struct vp8_token_struct vp8_kf_ymode_encodings[VP8_YMODES];
 | 
				
			||||||
extern struct vp8_token_struct vp8_uv_mode_encodings  [VP8_UV_MODES];
 | 
					extern const struct vp8_token_struct vp8_uv_mode_encodings[VP8_UV_MODES];
 | 
				
			||||||
extern struct vp8_token_struct vp8_mbsplit_encodings  [VP8_NUMMBSPLITS];
 | 
					extern const struct vp8_token_struct vp8_mbsplit_encodings[VP8_NUMMBSPLITS];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Inter mode values do not start at zero */
 | 
					/* Inter mode values do not start at zero */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct vp8_token_struct vp8_mv_ref_encoding_array    [VP8_MVREFS];
 | 
					extern const struct vp8_token_struct vp8_mv_ref_encoding_array[VP8_MVREFS];
 | 
				
			||||||
extern struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS];
 | 
					extern const struct vp8_token_struct vp8_sub_mv_ref_encoding_array[VP8_SUBMVREFS];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern const vp8_tree_index vp8_small_mvtree[];
 | 
					extern const vp8_tree_index vp8_small_mvtree[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern struct vp8_token_struct vp8_small_mvencodings [8];
 | 
					extern const struct vp8_token_struct vp8_small_mvencodings[8];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_entropy_mode_init(void);
 | 
					/* Key frame default mode probs */
 | 
				
			||||||
 | 
					extern const vp8_prob vp8_kf_bmode_prob[VP8_BINTRAMODES][VP8_BINTRAMODES]
 | 
				
			||||||
 | 
					[VP8_BINTRAMODES-1];
 | 
				
			||||||
 | 
					extern const vp8_prob vp8_kf_uv_mode_prob[VP8_UV_MODES-1];
 | 
				
			||||||
 | 
					extern const vp8_prob vp8_kf_ymode_prob[VP8_YMODES-1];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_init_mbmode_probs(VP8_COMMON *x);
 | 
					void vp8_init_mbmode_probs(VP8_COMMON *x);
 | 
				
			||||||
 | 
					void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
 | 
				
			||||||
void   vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
 | 
					 | 
				
			||||||
void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
 | 
					void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -116,7 +116,7 @@ void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src,
 | 
				
			|||||||
    int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1);
 | 
					    int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1);
 | 
				
			||||||
    int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1);
 | 
					    int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // If the side is not touching the bounder then don't extend.
 | 
					    /* If the side is not touching the bounder then don't extend. */
 | 
				
			||||||
    if (srcy)
 | 
					    if (srcy)
 | 
				
			||||||
      et = 0;
 | 
					      et = 0;
 | 
				
			||||||
    if (srcx)
 | 
					    if (srcx)
 | 
				
			||||||
@@ -157,7 +157,10 @@ void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* note the extension is only for the last row, for intra prediction purpose */
 | 
					/* note the extension is only for the last row, for intra prediction purpose */
 | 
				
			||||||
void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr)
 | 
					void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf,
 | 
				
			||||||
 | 
					                       unsigned char *YPtr,
 | 
				
			||||||
 | 
					                       unsigned char *UPtr,
 | 
				
			||||||
 | 
					                       unsigned char *VPtr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,4 +19,4 @@
 | 
				
			|||||||
extern const short vp8_bilinear_filters[8][2];
 | 
					extern const short vp8_bilinear_filters[8][2];
 | 
				
			||||||
extern const short vp8_sub_pel_filters[8][6];
 | 
					extern const short vp8_sub_pel_filters[8][6];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif //FILTER_H
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -82,6 +82,7 @@ static int get_cpu_count()
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_machine_specific_config(VP8_COMMON *ctx)
 | 
					void vp8_machine_specific_config(VP8_COMMON *ctx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#if CONFIG_MULTITHREAD
 | 
					#if CONFIG_MULTITHREAD
 | 
				
			||||||
@@ -93,6 +94,4 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
 | 
				
			|||||||
#elif ARCH_X86 || ARCH_X86_64
 | 
					#elif ARCH_X86 || ARCH_X86_64
 | 
				
			||||||
    ctx->cpu_caps = x86_simd_caps();
 | 
					    ctx->cpu_caps = x86_simd_caps();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					 | 
				
			||||||
    vpx_rtcd();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -196,20 +196,126 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm,
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_loop_filter_frame
 | 
					
 | 
				
			||||||
(
 | 
					void vp8_loop_filter_row_normal(VP8_COMMON *cm, MODE_INFO *mode_info_context,
 | 
				
			||||||
    VP8_COMMON *cm,
 | 
					                         int mb_row, int post_ystride, int post_uvstride,
 | 
				
			||||||
    MACROBLOCKD *mbd
 | 
					                         unsigned char *y_ptr, unsigned char *u_ptr,
 | 
				
			||||||
)
 | 
					                         unsigned char *v_ptr)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int mb_col;
 | 
				
			||||||
 | 
					    int filter_level;
 | 
				
			||||||
 | 
					    loop_filter_info_n *lfi_n = &cm->lf_info;
 | 
				
			||||||
 | 
					    loop_filter_info lfi;
 | 
				
			||||||
 | 
					    FRAME_TYPE frame_type = cm->frame_type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
 | 
				
			||||||
 | 
					                        mode_info_context->mbmi.mode != SPLITMV &&
 | 
				
			||||||
 | 
					                        mode_info_context->mbmi.mb_skip_coeff);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
 | 
				
			||||||
 | 
					        const int seg = mode_info_context->mbmi.segment_id;
 | 
				
			||||||
 | 
					        const int ref_frame = mode_info_context->mbmi.ref_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (filter_level)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
 | 
				
			||||||
 | 
					            lfi.mblim = lfi_n->mblim[filter_level];
 | 
				
			||||||
 | 
					            lfi.blim = lfi_n->blim[filter_level];
 | 
				
			||||||
 | 
					            lfi.lim = lfi_n->lim[filter_level];
 | 
				
			||||||
 | 
					            lfi.hev_thr = lfi_n->hev_thr[hev_index];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (mb_col > 0)
 | 
				
			||||||
 | 
					                vp8_loop_filter_mbv
 | 
				
			||||||
 | 
					                (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!skip_lf)
 | 
				
			||||||
 | 
					                vp8_loop_filter_bv
 | 
				
			||||||
 | 
					                (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            /* don't apply across umv border */
 | 
				
			||||||
 | 
					            if (mb_row > 0)
 | 
				
			||||||
 | 
					                vp8_loop_filter_mbh
 | 
				
			||||||
 | 
					                (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!skip_lf)
 | 
				
			||||||
 | 
					                vp8_loop_filter_bh
 | 
				
			||||||
 | 
					                (y_ptr, u_ptr, v_ptr, post_ystride, post_uvstride, &lfi);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        y_ptr += 16;
 | 
				
			||||||
 | 
					        u_ptr += 8;
 | 
				
			||||||
 | 
					        v_ptr += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        mode_info_context++;     /* step to next MB */
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_loop_filter_row_simple(VP8_COMMON *cm, MODE_INFO *mode_info_context,
 | 
				
			||||||
 | 
					                         int mb_row, int post_ystride, int post_uvstride,
 | 
				
			||||||
 | 
					                         unsigned char *y_ptr, unsigned char *u_ptr,
 | 
				
			||||||
 | 
					                         unsigned char *v_ptr)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int mb_col;
 | 
				
			||||||
 | 
					    int filter_level;
 | 
				
			||||||
 | 
					    loop_filter_info_n *lfi_n = &cm->lf_info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
 | 
				
			||||||
 | 
					                        mode_info_context->mbmi.mode != SPLITMV &&
 | 
				
			||||||
 | 
					                        mode_info_context->mbmi.mb_skip_coeff);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
 | 
				
			||||||
 | 
					        const int seg = mode_info_context->mbmi.segment_id;
 | 
				
			||||||
 | 
					        const int ref_frame = mode_info_context->mbmi.ref_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (filter_level)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (mb_col > 0)
 | 
				
			||||||
 | 
					                vp8_loop_filter_simple_mbv
 | 
				
			||||||
 | 
					                (y_ptr, post_ystride, lfi_n->mblim[filter_level]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!skip_lf)
 | 
				
			||||||
 | 
					                vp8_loop_filter_simple_bv
 | 
				
			||||||
 | 
					                (y_ptr, post_ystride, lfi_n->blim[filter_level]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            /* don't apply across umv border */
 | 
				
			||||||
 | 
					            if (mb_row > 0)
 | 
				
			||||||
 | 
					                vp8_loop_filter_simple_mbh
 | 
				
			||||||
 | 
					                (y_ptr, post_ystride, lfi_n->mblim[filter_level]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (!skip_lf)
 | 
				
			||||||
 | 
					                vp8_loop_filter_simple_bh
 | 
				
			||||||
 | 
					                (y_ptr, post_ystride, lfi_n->blim[filter_level]);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        y_ptr += 16;
 | 
				
			||||||
 | 
					        u_ptr += 8;
 | 
				
			||||||
 | 
					        v_ptr += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        mode_info_context++;     /* step to next MB */
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					void vp8_loop_filter_frame(VP8_COMMON *cm,
 | 
				
			||||||
 | 
					                           MACROBLOCKD *mbd,
 | 
				
			||||||
 | 
					                           int frame_type)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    YV12_BUFFER_CONFIG *post = cm->frame_to_show;
 | 
					    YV12_BUFFER_CONFIG *post = cm->frame_to_show;
 | 
				
			||||||
    loop_filter_info_n *lfi_n = &cm->lf_info;
 | 
					    loop_filter_info_n *lfi_n = &cm->lf_info;
 | 
				
			||||||
    loop_filter_info lfi;
 | 
					    loop_filter_info lfi;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FRAME_TYPE frame_type = cm->frame_type;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    int mb_row;
 | 
					    int mb_row;
 | 
				
			||||||
    int mb_col;
 | 
					    int mb_col;
 | 
				
			||||||
 | 
					    int mb_rows = cm->mb_rows;
 | 
				
			||||||
 | 
					    int mb_cols = cm->mb_cols;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int filter_level;
 | 
					    int filter_level;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -217,6 +323,8 @@ void vp8_loop_filter_frame
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /* Point at base of Mb MODE_INFO list */
 | 
					    /* Point at base of Mb MODE_INFO list */
 | 
				
			||||||
    const MODE_INFO *mode_info_context = cm->mi;
 | 
					    const MODE_INFO *mode_info_context = cm->mi;
 | 
				
			||||||
 | 
					    int post_y_stride = post->y_stride;
 | 
				
			||||||
 | 
					    int post_uv_stride = post->uv_stride;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* Initialize the loop filter for this frame. */
 | 
					    /* Initialize the loop filter for this frame. */
 | 
				
			||||||
    vp8_loop_filter_frame_init(cm, mbd, cm->filter_level);
 | 
					    vp8_loop_filter_frame_init(cm, mbd, cm->filter_level);
 | 
				
			||||||
@@ -227,23 +335,23 @@ void vp8_loop_filter_frame
 | 
				
			|||||||
    v_ptr = post->v_buffer;
 | 
					    v_ptr = post->v_buffer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* vp8_filter each macro block */
 | 
					    /* vp8_filter each macro block */
 | 
				
			||||||
    for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
 | 
					    if (cm->filter_type == NORMAL_LOOPFILTER)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
 | 
					        for (mb_row = 0; mb_row < mb_rows; mb_row++)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
 | 
					            for (mb_col = 0; mb_col < mb_cols; mb_col++)
 | 
				
			||||||
                            mode_info_context->mbmi.mode != SPLITMV &&
 | 
					 | 
				
			||||||
                            mode_info_context->mbmi.mb_skip_coeff);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
 | 
					 | 
				
			||||||
            const int seg = mode_info_context->mbmi.segment_id;
 | 
					 | 
				
			||||||
            const int ref_frame = mode_info_context->mbmi.ref_frame;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (filter_level)
 | 
					 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (cm->filter_type == NORMAL_LOOPFILTER)
 | 
					                int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
 | 
				
			||||||
 | 
					                                mode_info_context->mbmi.mode != SPLITMV &&
 | 
				
			||||||
 | 
					                                mode_info_context->mbmi.mb_skip_coeff);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
 | 
				
			||||||
 | 
					                const int seg = mode_info_context->mbmi.segment_id;
 | 
				
			||||||
 | 
					                const int ref_frame = mode_info_context->mbmi.ref_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (filter_level)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
 | 
					                    const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level];
 | 
				
			||||||
                    lfi.mblim = lfi_n->mblim[filter_level];
 | 
					                    lfi.mblim = lfi_n->mblim[filter_level];
 | 
				
			||||||
@@ -253,54 +361,87 @@ void vp8_loop_filter_frame
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                    if (mb_col > 0)
 | 
					                    if (mb_col > 0)
 | 
				
			||||||
                        vp8_loop_filter_mbv
 | 
					                        vp8_loop_filter_mbv
 | 
				
			||||||
                        (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
 | 
					                        (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (!skip_lf)
 | 
					                    if (!skip_lf)
 | 
				
			||||||
                        vp8_loop_filter_bv
 | 
					                        vp8_loop_filter_bv
 | 
				
			||||||
                        (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
 | 
					                        (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    /* don't apply across umv border */
 | 
					                    /* don't apply across umv border */
 | 
				
			||||||
                    if (mb_row > 0)
 | 
					                    if (mb_row > 0)
 | 
				
			||||||
                        vp8_loop_filter_mbh
 | 
					                        vp8_loop_filter_mbh
 | 
				
			||||||
                        (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
 | 
					                        (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (!skip_lf)
 | 
					                    if (!skip_lf)
 | 
				
			||||||
                        vp8_loop_filter_bh
 | 
					                        vp8_loop_filter_bh
 | 
				
			||||||
                        (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi);
 | 
					                        (y_ptr, u_ptr, v_ptr, post_y_stride, post_uv_stride, &lfi);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					
 | 
				
			||||||
 | 
					                y_ptr += 16;
 | 
				
			||||||
 | 
					                u_ptr += 8;
 | 
				
			||||||
 | 
					                v_ptr += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                mode_info_context++;     /* step to next MB */
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            y_ptr += post_y_stride  * 16 - post->y_width;
 | 
				
			||||||
 | 
					            u_ptr += post_uv_stride *  8 - post->uv_width;
 | 
				
			||||||
 | 
					            v_ptr += post_uv_stride *  8 - post->uv_width;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            mode_info_context++;         /* Skip border mb */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else /* SIMPLE_LOOPFILTER */
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (mb_row = 0; mb_row < mb_rows; mb_row++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            for (mb_col = 0; mb_col < mb_cols; mb_col++)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                int skip_lf = (mode_info_context->mbmi.mode != B_PRED &&
 | 
				
			||||||
 | 
					                                mode_info_context->mbmi.mode != SPLITMV &&
 | 
				
			||||||
 | 
					                                mode_info_context->mbmi.mb_skip_coeff);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
 | 
				
			||||||
 | 
					                const int seg = mode_info_context->mbmi.segment_id;
 | 
				
			||||||
 | 
					                const int ref_frame = mode_info_context->mbmi.ref_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
 | 
				
			||||||
 | 
					                if (filter_level)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					                    const unsigned char * mblim = lfi_n->mblim[filter_level];
 | 
				
			||||||
 | 
					                    const unsigned char * blim = lfi_n->blim[filter_level];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (mb_col > 0)
 | 
					                    if (mb_col > 0)
 | 
				
			||||||
                        vp8_loop_filter_simple_mbv
 | 
					                        vp8_loop_filter_simple_mbv
 | 
				
			||||||
                        (y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
 | 
					                        (y_ptr, post_y_stride, mblim);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (!skip_lf)
 | 
					                    if (!skip_lf)
 | 
				
			||||||
                        vp8_loop_filter_simple_bv
 | 
					                        vp8_loop_filter_simple_bv
 | 
				
			||||||
                        (y_ptr, post->y_stride, lfi_n->blim[filter_level]);
 | 
					                        (y_ptr, post_y_stride, blim);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    /* don't apply across umv border */
 | 
					                    /* don't apply across umv border */
 | 
				
			||||||
                    if (mb_row > 0)
 | 
					                    if (mb_row > 0)
 | 
				
			||||||
                        vp8_loop_filter_simple_mbh
 | 
					                        vp8_loop_filter_simple_mbh
 | 
				
			||||||
                        (y_ptr, post->y_stride, lfi_n->mblim[filter_level]);
 | 
					                        (y_ptr, post_y_stride, mblim);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (!skip_lf)
 | 
					                    if (!skip_lf)
 | 
				
			||||||
                        vp8_loop_filter_simple_bh
 | 
					                        vp8_loop_filter_simple_bh
 | 
				
			||||||
                        (y_ptr, post->y_stride, lfi_n->blim[filter_level]);
 | 
					                        (y_ptr, post_y_stride, blim);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                y_ptr += 16;
 | 
				
			||||||
 | 
					                u_ptr += 8;
 | 
				
			||||||
 | 
					                v_ptr += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                mode_info_context++;     /* step to next MB */
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            y_ptr += post_y_stride  * 16 - post->y_width;
 | 
				
			||||||
 | 
					            u_ptr += post_uv_stride *  8 - post->uv_width;
 | 
				
			||||||
 | 
					            v_ptr += post_uv_stride *  8 - post->uv_width;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            y_ptr += 16;
 | 
					            mode_info_context++;         /* Skip border mb */
 | 
				
			||||||
            u_ptr += 8;
 | 
					 | 
				
			||||||
            v_ptr += 8;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            mode_info_context++;     /* step to next MB */
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        y_ptr += post->y_stride  * 16 - post->y_width;
 | 
					 | 
				
			||||||
        u_ptr += post->uv_stride *  8 - post->uv_width;
 | 
					 | 
				
			||||||
        v_ptr += post->uv_stride *  8 - post->uv_width;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        mode_info_context++;         /* Skip border mb */
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,6 +69,7 @@ typedef void loop_filter_uvfunction
 | 
				
			|||||||
/* assorted loopfilter functions which get used elsewhere */
 | 
					/* assorted loopfilter functions which get used elsewhere */
 | 
				
			||||||
struct VP8Common;
 | 
					struct VP8Common;
 | 
				
			||||||
struct macroblockd;
 | 
					struct macroblockd;
 | 
				
			||||||
 | 
					struct modeinfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_loop_filter_init(struct VP8Common *cm);
 | 
					void vp8_loop_filter_init(struct VP8Common *cm);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -76,7 +77,8 @@ void vp8_loop_filter_frame_init(struct VP8Common *cm,
 | 
				
			|||||||
                                struct macroblockd *mbd,
 | 
					                                struct macroblockd *mbd,
 | 
				
			||||||
                                int default_filt_lvl);
 | 
					                                int default_filt_lvl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd);
 | 
					void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd,
 | 
				
			||||||
 | 
					                           int frame_type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void vp8_loop_filter_partial_frame(struct VP8Common *cm,
 | 
					void vp8_loop_filter_partial_frame(struct VP8Common *cm,
 | 
				
			||||||
                                   struct macroblockd *mbd,
 | 
					                                   struct macroblockd *mbd,
 | 
				
			||||||
@@ -89,4 +91,15 @@ void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
 | 
				
			|||||||
void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
 | 
					void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
 | 
				
			||||||
                                      int sharpness_lvl);
 | 
					                                      int sharpness_lvl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_loop_filter_row_normal(struct VP8Common *cm,
 | 
				
			||||||
 | 
					                                struct modeinfo *mode_info_context,
 | 
				
			||||||
 | 
					                                int mb_row, int post_ystride, int post_uvstride,
 | 
				
			||||||
 | 
					                                unsigned char *y_ptr, unsigned char *u_ptr,
 | 
				
			||||||
 | 
					                                unsigned char *v_ptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_loop_filter_row_simple(struct VP8Common *cm,
 | 
				
			||||||
 | 
					                                struct modeinfo *mode_info_context,
 | 
				
			||||||
 | 
					                                int mb_row, int post_ystride, int post_uvstride,
 | 
				
			||||||
 | 
					                                unsigned char *y_ptr, unsigned char *u_ptr,
 | 
				
			||||||
 | 
					                                unsigned char *v_ptr);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -15,7 +15,7 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
typedef unsigned char uc;
 | 
					typedef unsigned char uc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static __inline signed char vp8_signed_char_clamp(int t)
 | 
					static signed char vp8_signed_char_clamp(int t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    t = (t < -128 ? -128 : t);
 | 
					    t = (t < -128 ? -128 : t);
 | 
				
			||||||
    t = (t > 127 ? 127 : t);
 | 
					    t = (t > 127 ? 127 : t);
 | 
				
			||||||
@@ -24,9 +24,9 @@ static __inline signed char vp8_signed_char_clamp(int t)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 | 
					/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 | 
				
			||||||
static __inline signed char vp8_filter_mask(uc limit, uc blimit,
 | 
					static signed char vp8_filter_mask(uc limit, uc blimit,
 | 
				
			||||||
                                     uc p3, uc p2, uc p1, uc p0,
 | 
					                            uc p3, uc p2, uc p1, uc p0,
 | 
				
			||||||
                                     uc q0, uc q1, uc q2, uc q3)
 | 
					                            uc q0, uc q1, uc q2, uc q3)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    signed char mask = 0;
 | 
					    signed char mask = 0;
 | 
				
			||||||
    mask |= (abs(p3 - p2) > limit);
 | 
					    mask |= (abs(p3 - p2) > limit);
 | 
				
			||||||
@@ -40,7 +40,7 @@ static __inline signed char vp8_filter_mask(uc limit, uc blimit,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* is there high variance internal edge ( 11111111 yes, 00000000 no) */
 | 
					/* is there high variance internal edge ( 11111111 yes, 00000000 no) */
 | 
				
			||||||
static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
 | 
					static signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    signed char hev = 0;
 | 
					    signed char hev = 0;
 | 
				
			||||||
    hev  |= (abs(p1 - p0) > thresh) * -1;
 | 
					    hev  |= (abs(p1 - p0) > thresh) * -1;
 | 
				
			||||||
@@ -48,7 +48,7 @@ static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1)
 | 
				
			|||||||
    return hev;
 | 
					    return hev;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static __inline void vp8_filter(signed char mask, uc hev, uc *op1,
 | 
					static void vp8_filter(signed char mask, uc hev, uc *op1,
 | 
				
			||||||
        uc *op0, uc *oq0, uc *oq1)
 | 
					        uc *op0, uc *oq0, uc *oq1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -158,7 +158,7 @@ void vp8_loop_filter_vertical_edge_c
 | 
				
			|||||||
    while (++i < count * 8);
 | 
					    while (++i < count * 8);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static __inline void vp8_mbfilter(signed char mask, uc hev,
 | 
					static void vp8_mbfilter(signed char mask, uc hev,
 | 
				
			||||||
                           uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
 | 
					                           uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    signed char s, u;
 | 
					    signed char s, u;
 | 
				
			||||||
@@ -279,7 +279,7 @@ void vp8_mbloop_filter_vertical_edge_c
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 | 
					/* should we apply any filter at all ( 11111111 yes, 00000000 no) */
 | 
				
			||||||
static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
 | 
					static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
/* Why does this cause problems for win32?
 | 
					/* Why does this cause problems for win32?
 | 
				
			||||||
 * error C2143: syntax error : missing ';' before 'type'
 | 
					 * error C2143: syntax error : missing ';' before 'type'
 | 
				
			||||||
@@ -289,7 +289,7 @@ static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q
 | 
				
			|||||||
    return mask;
 | 
					    return mask;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static __inline void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
 | 
					static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    signed char vp8_filter, Filter1, Filter2;
 | 
					    signed char vp8_filter, Filter1, Filter2;
 | 
				
			||||||
    signed char p1 = (signed char) * op1 ^ 0x80;
 | 
					    signed char p1 = (signed char) * op1 ^ 0x80;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,45 +11,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "blockd.h"
 | 
					#include "blockd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    PRED = 0,
 | 
					 | 
				
			||||||
    DEST = 1
 | 
					 | 
				
			||||||
} BLOCKSET;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    int block;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    unsigned char **y, **u, **v;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if (bs == DEST)
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        y = &x->dst.y_buffer;
 | 
					 | 
				
			||||||
        u = &x->dst.u_buffer;
 | 
					 | 
				
			||||||
        v = &x->dst.v_buffer;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        y = &x->pre.y_buffer;
 | 
					 | 
				
			||||||
        u = &x->pre.u_buffer;
 | 
					 | 
				
			||||||
        v = &x->pre.v_buffer;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (block = 0; block < 16; block++) /* y blocks */
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        x->block[block].offset =
 | 
					 | 
				
			||||||
            (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for (block = 16; block < 20; block++) /* U and V blocks */
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        x->block[block+4].offset =
 | 
					 | 
				
			||||||
        x->block[block].offset =
 | 
					 | 
				
			||||||
            ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_setup_block_dptrs(MACROBLOCKD *x)
 | 
					void vp8_setup_block_dptrs(MACROBLOCKD *x)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int r, c;
 | 
					    int r, c;
 | 
				
			||||||
@@ -90,8 +51,18 @@ void vp8_setup_block_dptrs(MACROBLOCKD *x)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void vp8_build_block_doffsets(MACROBLOCKD *x)
 | 
					void vp8_build_block_doffsets(MACROBLOCKD *x)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    int block;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* handle the destination pitch features */
 | 
					    for (block = 0; block < 16; block++) /* y blocks */
 | 
				
			||||||
    setup_macroblock(x, DEST);
 | 
					    {
 | 
				
			||||||
    setup_macroblock(x, PRED);
 | 
					        x->block[block].offset =
 | 
				
			||||||
 | 
					            (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (block = 16; block < 20; block++) /* U and V blocks */
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        x->block[block+4].offset =
 | 
				
			||||||
 | 
					        x->block[block].offset =
 | 
				
			||||||
 | 
					            ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										385
									
								
								vp8/common/mfqe.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										385
									
								
								vp8/common/mfqe.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,385 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* MFQE: Multiframe Quality Enhancement
 | 
				
			||||||
 | 
					 * In rate limited situations keyframes may cause significant visual artifacts
 | 
				
			||||||
 | 
					 * commonly referred to as "popping." This file implements a postproccesing
 | 
				
			||||||
 | 
					 * algorithm which blends data from the preceeding frame when there is no
 | 
				
			||||||
 | 
					 * motion and the q from the previous frame is lower which indicates that it is
 | 
				
			||||||
 | 
					 * higher quality.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "postproc.h"
 | 
				
			||||||
 | 
					#include "variance.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vpx_scale/yv12config.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <limits.h>
 | 
				
			||||||
 | 
					#include <stdlib.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void filter_by_weight(unsigned char *src, int src_stride,
 | 
				
			||||||
 | 
					                             unsigned char *dst, int dst_stride,
 | 
				
			||||||
 | 
					                             int block_size, int src_weight)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int dst_weight = (1 << MFQE_PRECISION) - src_weight;
 | 
				
			||||||
 | 
					    int rounding_bit = 1 << (MFQE_PRECISION - 1);
 | 
				
			||||||
 | 
					    int r, c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (r = 0; r < block_size; r++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (c = 0; c < block_size; c++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            dst[c] = (src[c] * src_weight +
 | 
				
			||||||
 | 
					                      dst[c] * dst_weight +
 | 
				
			||||||
 | 
					                      rounding_bit) >> MFQE_PRECISION;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        src += src_stride;
 | 
				
			||||||
 | 
					        dst += dst_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_filter_by_weight16x16_c(unsigned char *src, int src_stride,
 | 
				
			||||||
 | 
					                                 unsigned char *dst, int dst_stride,
 | 
				
			||||||
 | 
					                                 int src_weight)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_filter_by_weight8x8_c(unsigned char *src, int src_stride,
 | 
				
			||||||
 | 
					                               unsigned char *dst, int dst_stride,
 | 
				
			||||||
 | 
					                               int src_weight)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_filter_by_weight4x4_c(unsigned char *src, int src_stride,
 | 
				
			||||||
 | 
					                               unsigned char *dst, int dst_stride,
 | 
				
			||||||
 | 
					                               int src_weight)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    filter_by_weight(src, src_stride, dst, dst_stride, 4, src_weight);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void apply_ifactor(unsigned char *y_src,
 | 
				
			||||||
 | 
					                          int y_src_stride,
 | 
				
			||||||
 | 
					                          unsigned char *y_dst,
 | 
				
			||||||
 | 
					                          int y_dst_stride,
 | 
				
			||||||
 | 
					                          unsigned char *u_src,
 | 
				
			||||||
 | 
					                          unsigned char *v_src,
 | 
				
			||||||
 | 
					                          int uv_src_stride,
 | 
				
			||||||
 | 
					                          unsigned char *u_dst,
 | 
				
			||||||
 | 
					                          unsigned char *v_dst,
 | 
				
			||||||
 | 
					                          int uv_dst_stride,
 | 
				
			||||||
 | 
					                          int block_size,
 | 
				
			||||||
 | 
					                          int src_weight)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (block_size == 16)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        vp8_filter_by_weight16x16(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
 | 
				
			||||||
 | 
					        vp8_filter_by_weight8x8(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
 | 
				
			||||||
 | 
					        vp8_filter_by_weight8x8(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else /* if (block_size == 8) */
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        vp8_filter_by_weight8x8(y_src, y_src_stride, y_dst, y_dst_stride, src_weight);
 | 
				
			||||||
 | 
					        vp8_filter_by_weight4x4(u_src, uv_src_stride, u_dst, uv_dst_stride, src_weight);
 | 
				
			||||||
 | 
					        vp8_filter_by_weight4x4(v_src, uv_src_stride, v_dst, uv_dst_stride, src_weight);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static unsigned int int_sqrt(unsigned int x)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    unsigned int y = x;
 | 
				
			||||||
 | 
					    unsigned int guess;
 | 
				
			||||||
 | 
					    int p = 1;
 | 
				
			||||||
 | 
					    while (y>>=1) p++;
 | 
				
			||||||
 | 
					    p>>=1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    guess=0;
 | 
				
			||||||
 | 
					    while (p>=0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        guess |= (1<<p);
 | 
				
			||||||
 | 
					        if (x<guess*guess)
 | 
				
			||||||
 | 
					            guess -= (1<<p);
 | 
				
			||||||
 | 
					        p--;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    /* choose between guess or guess+1 */
 | 
				
			||||||
 | 
					    return guess+(guess*guess+guess+1<=x);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define USE_SSD
 | 
				
			||||||
 | 
					static void multiframe_quality_enhance_block
 | 
				
			||||||
 | 
					(
 | 
				
			||||||
 | 
					    int blksize, /* Currently only values supported are 16, 8 */
 | 
				
			||||||
 | 
					    int qcurr,
 | 
				
			||||||
 | 
					    int qprev,
 | 
				
			||||||
 | 
					    unsigned char *y,
 | 
				
			||||||
 | 
					    unsigned char *u,
 | 
				
			||||||
 | 
					    unsigned char *v,
 | 
				
			||||||
 | 
					    int y_stride,
 | 
				
			||||||
 | 
					    int uv_stride,
 | 
				
			||||||
 | 
					    unsigned char *yd,
 | 
				
			||||||
 | 
					    unsigned char *ud,
 | 
				
			||||||
 | 
					    unsigned char *vd,
 | 
				
			||||||
 | 
					    int yd_stride,
 | 
				
			||||||
 | 
					    int uvd_stride
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    static const unsigned char VP8_ZEROS[16]=
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    int uvblksize = blksize >> 1;
 | 
				
			||||||
 | 
					    int qdiff = qcurr - qprev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					    unsigned char *up;
 | 
				
			||||||
 | 
					    unsigned char *udp;
 | 
				
			||||||
 | 
					    unsigned char *vp;
 | 
				
			||||||
 | 
					    unsigned char *vdp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unsigned int act, actd, sad, usad, vsad, sse, thr, thrsq, actrisk;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (blksize == 16)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        actd = (vp8_variance16x16(yd, yd_stride, VP8_ZEROS, 0, &sse)+128)>>8;
 | 
				
			||||||
 | 
					        act = (vp8_variance16x16(y, y_stride, VP8_ZEROS, 0, &sse)+128)>>8;
 | 
				
			||||||
 | 
					#ifdef USE_SSD
 | 
				
			||||||
 | 
					        sad = (vp8_variance16x16(y, y_stride, yd, yd_stride, &sse));
 | 
				
			||||||
 | 
					        sad = (sse + 128)>>8;
 | 
				
			||||||
 | 
					        usad = (vp8_variance8x8(u, uv_stride, ud, uvd_stride, &sse));
 | 
				
			||||||
 | 
					        usad = (sse + 32)>>6;
 | 
				
			||||||
 | 
					        vsad = (vp8_variance8x8(v, uv_stride, vd, uvd_stride, &sse));
 | 
				
			||||||
 | 
					        vsad = (sse + 32)>>6;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					        sad = (vp8_sad16x16(y, y_stride, yd, yd_stride, UINT_MAX) + 128) >> 8;
 | 
				
			||||||
 | 
					        usad = (vp8_sad8x8(u, uv_stride, ud, uvd_stride, UINT_MAX) + 32) >> 6;
 | 
				
			||||||
 | 
					        vsad = (vp8_sad8x8(v, uv_stride, vd, uvd_stride, UINT_MAX)+ 32) >> 6;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else /* if (blksize == 8) */
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        actd = (vp8_variance8x8(yd, yd_stride, VP8_ZEROS, 0, &sse)+32)>>6;
 | 
				
			||||||
 | 
					        act = (vp8_variance8x8(y, y_stride, VP8_ZEROS, 0, &sse)+32)>>6;
 | 
				
			||||||
 | 
					#ifdef USE_SSD
 | 
				
			||||||
 | 
					        sad = (vp8_variance8x8(y, y_stride, yd, yd_stride, &sse));
 | 
				
			||||||
 | 
					        sad = (sse + 32)>>6;
 | 
				
			||||||
 | 
					        usad = (vp8_variance4x4(u, uv_stride, ud, uvd_stride, &sse));
 | 
				
			||||||
 | 
					        usad = (sse + 8)>>4;
 | 
				
			||||||
 | 
					        vsad = (vp8_variance4x4(v, uv_stride, vd, uvd_stride, &sse));
 | 
				
			||||||
 | 
					        vsad = (sse + 8)>>4;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					        sad = (vp8_sad8x8(y, y_stride, yd, yd_stride, UINT_MAX) + 32) >> 6;
 | 
				
			||||||
 | 
					        usad = (vp8_sad4x4(u, uv_stride, ud, uvd_stride, UINT_MAX) + 8) >> 4;
 | 
				
			||||||
 | 
					        vsad = (vp8_sad4x4(v, uv_stride, vd, uvd_stride, UINT_MAX) + 8) >> 4;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    actrisk = (actd > act * 5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* thr = qdiff/16 + log2(act) + log4(qprev) */
 | 
				
			||||||
 | 
					    thr = (qdiff >> 4);
 | 
				
			||||||
 | 
					    while (actd >>= 1) thr++;
 | 
				
			||||||
 | 
					    while (qprev >>= 2) thr++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef USE_SSD
 | 
				
			||||||
 | 
					    thrsq = thr * thr;
 | 
				
			||||||
 | 
					    if (sad < thrsq &&
 | 
				
			||||||
 | 
					        /* additional checks for color mismatch and excessive addition of
 | 
				
			||||||
 | 
					         * high-frequencies */
 | 
				
			||||||
 | 
					        4 * usad < thrsq && 4 * vsad < thrsq && !actrisk)
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    if (sad < thr &&
 | 
				
			||||||
 | 
					        /* additional checks for color mismatch and excessive addition of
 | 
				
			||||||
 | 
					         * high-frequencies */
 | 
				
			||||||
 | 
					        2 * usad < thr && 2 * vsad < thr && !actrisk)
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        int ifactor;
 | 
				
			||||||
 | 
					#ifdef USE_SSD
 | 
				
			||||||
 | 
					        /* TODO: optimize this later to not need sqr root */
 | 
				
			||||||
 | 
					        sad = int_sqrt(sad);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					        ifactor = (sad << MFQE_PRECISION) / thr;
 | 
				
			||||||
 | 
					        ifactor >>= (qdiff >> 5);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (ifactor)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            apply_ifactor(y, y_stride, yd, yd_stride,
 | 
				
			||||||
 | 
					                          u, v, uv_stride,
 | 
				
			||||||
 | 
					                          ud, vd, uvd_stride,
 | 
				
			||||||
 | 
					                          blksize, ifactor);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else  /* else implicitly copy from previous frame */
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        if (blksize == 16)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            vp8_copy_mem16x16(y, y_stride, yd, yd_stride);
 | 
				
			||||||
 | 
					            vp8_copy_mem8x8(u, uv_stride, ud, uvd_stride);
 | 
				
			||||||
 | 
					            vp8_copy_mem8x8(v, uv_stride, vd, uvd_stride);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        else  /* if (blksize == 8) */
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            vp8_copy_mem8x8(y, y_stride, yd, yd_stride);
 | 
				
			||||||
 | 
					            for (up = u, udp = ud, i = 0; i < uvblksize; ++i, up += uv_stride, udp += uvd_stride)
 | 
				
			||||||
 | 
					                vpx_memcpy(udp, up, uvblksize);
 | 
				
			||||||
 | 
					            for (vp = v, vdp = vd, i = 0; i < uvblksize; ++i, vp += uv_stride, vdp += uvd_stride)
 | 
				
			||||||
 | 
					                vpx_memcpy(vdp, vp, uvblksize);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int qualify_inter_mb(const MODE_INFO *mode_info_context, int *map)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (mode_info_context->mbmi.mb_skip_coeff)
 | 
				
			||||||
 | 
					        map[0] = map[1] = map[2] = map[3] = 1;
 | 
				
			||||||
 | 
					    else if (mode_info_context->mbmi.mode==SPLITMV)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        static int ndx[4][4] =
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            {0, 1, 4, 5},
 | 
				
			||||||
 | 
					            {2, 3, 6, 7},
 | 
				
			||||||
 | 
					            {8, 9, 12, 13},
 | 
				
			||||||
 | 
					            {10, 11, 14, 15}
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					        int i, j;
 | 
				
			||||||
 | 
					        for (i=0; i<4; ++i)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            map[i] = 1;
 | 
				
			||||||
 | 
					            for (j=0; j<4 && map[j]; ++j)
 | 
				
			||||||
 | 
					                map[i] &= (mode_info_context->bmi[ndx[i][j]].mv.as_mv.row <= 2 &&
 | 
				
			||||||
 | 
					                           mode_info_context->bmi[ndx[i][j]].mv.as_mv.col <= 2);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        map[0] = map[1] = map[2] = map[3] =
 | 
				
			||||||
 | 
					            (mode_info_context->mbmi.mode > B_PRED &&
 | 
				
			||||||
 | 
					             abs(mode_info_context->mbmi.mv.as_mv.row) <= 2 &&
 | 
				
			||||||
 | 
					             abs(mode_info_context->mbmi.mv.as_mv.col) <= 2);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return (map[0]+map[1]+map[2]+map[3]);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_multiframe_quality_enhance
 | 
				
			||||||
 | 
					(
 | 
				
			||||||
 | 
					    VP8_COMMON *cm
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    YV12_BUFFER_CONFIG *show = cm->frame_to_show;
 | 
				
			||||||
 | 
					    YV12_BUFFER_CONFIG *dest = &cm->post_proc_buffer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    FRAME_TYPE frame_type = cm->frame_type;
 | 
				
			||||||
 | 
					    /* Point at base of Mb MODE_INFO list has motion vectors etc */
 | 
				
			||||||
 | 
					    const MODE_INFO *mode_info_context = cm->mi;
 | 
				
			||||||
 | 
					    int mb_row;
 | 
				
			||||||
 | 
					    int mb_col;
 | 
				
			||||||
 | 
					    int totmap, map[4];
 | 
				
			||||||
 | 
					    int qcurr = cm->base_qindex;
 | 
				
			||||||
 | 
					    int qprev = cm->postproc_state.last_base_qindex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unsigned char *y_ptr, *u_ptr, *v_ptr;
 | 
				
			||||||
 | 
					    unsigned char *yd_ptr, *ud_ptr, *vd_ptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Set up the buffer pointers */
 | 
				
			||||||
 | 
					    y_ptr = show->y_buffer;
 | 
				
			||||||
 | 
					    u_ptr = show->u_buffer;
 | 
				
			||||||
 | 
					    v_ptr = show->v_buffer;
 | 
				
			||||||
 | 
					    yd_ptr = dest->y_buffer;
 | 
				
			||||||
 | 
					    ud_ptr = dest->u_buffer;
 | 
				
			||||||
 | 
					    vd_ptr = dest->v_buffer;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* postprocess each macro block */
 | 
				
			||||||
 | 
					    for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (mb_col = 0; mb_col < cm->mb_cols; mb_col++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            /* if motion is high there will likely be no benefit */
 | 
				
			||||||
 | 
					            if (frame_type == INTER_FRAME) totmap = qualify_inter_mb(mode_info_context, map);
 | 
				
			||||||
 | 
					            else totmap = (frame_type == KEY_FRAME ? 4 : 0);
 | 
				
			||||||
 | 
					            if (totmap)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (totmap < 4)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    int i, j;
 | 
				
			||||||
 | 
					                    for (i=0; i<2; ++i)
 | 
				
			||||||
 | 
					                        for (j=0; j<2; ++j)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            if (map[i*2+j])
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                multiframe_quality_enhance_block(8, qcurr, qprev,
 | 
				
			||||||
 | 
					                                                                 y_ptr + 8*(i*show->y_stride+j),
 | 
				
			||||||
 | 
					                                                                 u_ptr + 4*(i*show->uv_stride+j),
 | 
				
			||||||
 | 
					                                                                 v_ptr + 4*(i*show->uv_stride+j),
 | 
				
			||||||
 | 
					                                                                 show->y_stride,
 | 
				
			||||||
 | 
					                                                                 show->uv_stride,
 | 
				
			||||||
 | 
					                                                                 yd_ptr + 8*(i*dest->y_stride+j),
 | 
				
			||||||
 | 
					                                                                 ud_ptr + 4*(i*dest->uv_stride+j),
 | 
				
			||||||
 | 
					                                                                 vd_ptr + 4*(i*dest->uv_stride+j),
 | 
				
			||||||
 | 
					                                                                 dest->y_stride,
 | 
				
			||||||
 | 
					                                                                 dest->uv_stride);
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                            else
 | 
				
			||||||
 | 
					                            {
 | 
				
			||||||
 | 
					                                /* copy a 8x8 block */
 | 
				
			||||||
 | 
					                                int k;
 | 
				
			||||||
 | 
					                                unsigned char *up = u_ptr + 4*(i*show->uv_stride+j);
 | 
				
			||||||
 | 
					                                unsigned char *udp = ud_ptr + 4*(i*dest->uv_stride+j);
 | 
				
			||||||
 | 
					                                unsigned char *vp = v_ptr + 4*(i*show->uv_stride+j);
 | 
				
			||||||
 | 
					                                unsigned char *vdp = vd_ptr + 4*(i*dest->uv_stride+j);
 | 
				
			||||||
 | 
					                                vp8_copy_mem8x8(y_ptr + 8*(i*show->y_stride+j), show->y_stride,
 | 
				
			||||||
 | 
					                                                yd_ptr + 8*(i*dest->y_stride+j), dest->y_stride);
 | 
				
			||||||
 | 
					                                for (k = 0; k < 4; ++k, up += show->uv_stride, udp += dest->uv_stride,
 | 
				
			||||||
 | 
					                                                        vp += show->uv_stride, vdp += dest->uv_stride)
 | 
				
			||||||
 | 
					                                {
 | 
				
			||||||
 | 
					                                    vpx_memcpy(udp, up, 4);
 | 
				
			||||||
 | 
					                                    vpx_memcpy(vdp, vp, 4);
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else /* totmap = 4 */
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    multiframe_quality_enhance_block(16, qcurr, qprev, y_ptr,
 | 
				
			||||||
 | 
					                                                     u_ptr, v_ptr,
 | 
				
			||||||
 | 
					                                                     show->y_stride,
 | 
				
			||||||
 | 
					                                                     show->uv_stride,
 | 
				
			||||||
 | 
					                                                     yd_ptr, ud_ptr, vd_ptr,
 | 
				
			||||||
 | 
					                                                     dest->y_stride,
 | 
				
			||||||
 | 
					                                                     dest->uv_stride);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                vp8_copy_mem16x16(y_ptr, show->y_stride, yd_ptr, dest->y_stride);
 | 
				
			||||||
 | 
					                vp8_copy_mem8x8(u_ptr, show->uv_stride, ud_ptr, dest->uv_stride);
 | 
				
			||||||
 | 
					                vp8_copy_mem8x8(v_ptr, show->uv_stride, vd_ptr, dest->uv_stride);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            y_ptr += 16;
 | 
				
			||||||
 | 
					            u_ptr += 8;
 | 
				
			||||||
 | 
					            v_ptr += 8;
 | 
				
			||||||
 | 
					            yd_ptr += 16;
 | 
				
			||||||
 | 
					            ud_ptr += 8;
 | 
				
			||||||
 | 
					            vd_ptr += 8;
 | 
				
			||||||
 | 
					            mode_info_context++;     /* step to next MB */
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        y_ptr += show->y_stride  * 16 - 16 * cm->mb_cols;
 | 
				
			||||||
 | 
					        u_ptr += show->uv_stride *  8 - 8 * cm->mb_cols;
 | 
				
			||||||
 | 
					        v_ptr += show->uv_stride *  8 - 8 * cm->mb_cols;
 | 
				
			||||||
 | 
					        yd_ptr += dest->y_stride  * 16 - 16 * cm->mb_cols;
 | 
				
			||||||
 | 
					        ud_ptr += dest->uv_stride *  8 - 8 * cm->mb_cols;
 | 
				
			||||||
 | 
					        vd_ptr += dest->uv_stride *  8 - 8 * cm->mb_cols;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        mode_info_context++;         /* Skip border mb */
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										33
									
								
								vp8/common/mips/dspr2/dequantize_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								vp8/common/mips/dspr2/dequantize_dspr2.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vpx_mem/vpx_mem.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_DSPR2
 | 
				
			||||||
 | 
					void vp8_dequant_idct_add_dspr2(short *input, short *dq,
 | 
				
			||||||
 | 
					                                unsigned char *dest, int stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < 16; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        input[i] = dq[i] * input[i];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vp8_short_idct4x4llm_dspr2(input, dest, stride, dest, stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vpx_memset(input, 0, 32);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
							
								
								
									
										2823
									
								
								vp8/common/mips/dspr2/filter_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2823
									
								
								vp8/common/mips/dspr2/filter_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										88
									
								
								vp8/common/mips/dspr2/idct_blk_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								vp8/common/mips/dspr2/idct_blk_dspr2.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_DSPR2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_dequant_idct_add_y_block_dspr2
 | 
				
			||||||
 | 
					(short *q, short *dq,
 | 
				
			||||||
 | 
					 unsigned char *dst, int stride, char *eobs)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i, j;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < 4; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (j = 0; j < 4; j++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (*eobs++ > 1)
 | 
				
			||||||
 | 
					                vp8_dequant_idct_add_dspr2(q, dq, dst, stride);
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dst, stride, dst, stride);
 | 
				
			||||||
 | 
					                ((int *)q)[0] = 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            q   += 16;
 | 
				
			||||||
 | 
					            dst += 4;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        dst += 4 * stride - 16;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_dequant_idct_add_uv_block_dspr2
 | 
				
			||||||
 | 
					(short *q, short *dq,
 | 
				
			||||||
 | 
					 unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int i, j;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < 2; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (j = 0; j < 2; j++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (*eobs++ > 1)
 | 
				
			||||||
 | 
					                vp8_dequant_idct_add_dspr2(q, dq, dstu, stride);
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dstu, stride, dstu, stride);
 | 
				
			||||||
 | 
					                ((int *)q)[0] = 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            q    += 16;
 | 
				
			||||||
 | 
					            dstu += 4;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        dstu += 4 * stride - 8;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < 2; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (j = 0; j < 2; j++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            if (*eobs++ > 1)
 | 
				
			||||||
 | 
					                vp8_dequant_idct_add_dspr2(q, dq, dstv, stride);
 | 
				
			||||||
 | 
					            else
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                vp8_dc_only_idct_add_dspr2(q[0]*dq[0], dstv, stride, dstv, stride);
 | 
				
			||||||
 | 
					                ((int *)q)[0] = 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            q    += 16;
 | 
				
			||||||
 | 
					            dstv += 4;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        dstv += 4 * stride - 8;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										369
									
								
								vp8/common/mips/dspr2/idctllm_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										369
									
								
								vp8/common/mips/dspr2/idctllm_dspr2.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,369 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_rtcd.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_DSPR2
 | 
				
			||||||
 | 
					#define CROP_WIDTH 256
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/******************************************************************************
 | 
				
			||||||
 | 
					 * Notes:
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This implementation makes use of 16 bit fixed point version of two multiply
 | 
				
			||||||
 | 
					 * constants:
 | 
				
			||||||
 | 
					 *         1.   sqrt(2) * cos (pi/8)
 | 
				
			||||||
 | 
					 *         2.   sqrt(2) * sin (pi/8)
 | 
				
			||||||
 | 
					 * Since the first constant is bigger than 1, to maintain the same 16 bit
 | 
				
			||||||
 | 
					 * fixed point precision as the second one, we use a trick of
 | 
				
			||||||
 | 
					 *         x * a = x + x*(a-1)
 | 
				
			||||||
 | 
					 * so
 | 
				
			||||||
 | 
					 *         x * sqrt(2) * cos (pi/8) = x + x * (sqrt(2) *cos(pi/8)-1).
 | 
				
			||||||
 | 
					 ****************************************************************************/
 | 
				
			||||||
 | 
					extern unsigned char ff_cropTbl[256 + 2 * CROP_WIDTH];
 | 
				
			||||||
 | 
					static const int cospi8sqrt2minus1 = 20091;
 | 
				
			||||||
 | 
					static const int sinpi8sqrt2      = 35468;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					inline void prefetch_load_short(short *src)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    __asm__ __volatile__ (
 | 
				
			||||||
 | 
					        "pref   0,  0(%[src])   \n\t"
 | 
				
			||||||
 | 
					        :
 | 
				
			||||||
 | 
					        : [src] "r" (src)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_short_idct4x4llm_dspr2(short *input, unsigned char *pred_ptr,
 | 
				
			||||||
 | 
					                                int pred_stride, unsigned char *dst_ptr,
 | 
				
			||||||
 | 
					                                int dst_stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int r, c;
 | 
				
			||||||
 | 
					    int a1, b1, c1, d1;
 | 
				
			||||||
 | 
					    short output[16];
 | 
				
			||||||
 | 
					    short *ip = input;
 | 
				
			||||||
 | 
					    short *op = output;
 | 
				
			||||||
 | 
					    int temp1, temp2;
 | 
				
			||||||
 | 
					    int shortpitch = 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    int c2, d2;
 | 
				
			||||||
 | 
					    int temp3, temp4;
 | 
				
			||||||
 | 
					    unsigned char *cm = ff_cropTbl + CROP_WIDTH;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* prepare data for load */
 | 
				
			||||||
 | 
					    prefetch_load_short(ip + 8);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* first loop is unrolled */
 | 
				
			||||||
 | 
					    a1 = ip[0] + ip[8];
 | 
				
			||||||
 | 
					    b1 = ip[0] - ip[8];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = (ip[4] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = ip[4] + ((ip[4] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp2 = (ip[12] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d1 = temp1 + temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = (ip[5] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp4 = ip[13] + ((ip[13] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c2 = temp3 - temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = ip[5] + ((ip[5] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp4 = (ip[13] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d2 = temp3 + temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[0] = a1 + d1;
 | 
				
			||||||
 | 
					    op[12] = a1 - d1;
 | 
				
			||||||
 | 
					    op[4] = b1 + c1;
 | 
				
			||||||
 | 
					    op[8] = b1 - c1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[1] + ip[9];
 | 
				
			||||||
 | 
					    b1 = ip[1] - ip[9];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[1] = a1 + d2;
 | 
				
			||||||
 | 
					    op[13] = a1 - d2;
 | 
				
			||||||
 | 
					    op[5] = b1 + c2;
 | 
				
			||||||
 | 
					    op[9] = b1 - c2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[2] + ip[10];
 | 
				
			||||||
 | 
					    b1 = ip[2] - ip[10];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = (ip[6] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp2 = ip[14] + ((ip[14] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = ip[6] + ((ip[6] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp2 = (ip[14] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d1 = temp1 + temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = (ip[7] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp4 = ip[15] + ((ip[15] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c2 = temp3 - temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = ip[7] + ((ip[7] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp4 = (ip[15] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d2 = temp3 + temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[2] = a1 + d1;
 | 
				
			||||||
 | 
					    op[14] = a1 - d1;
 | 
				
			||||||
 | 
					    op[6] = b1 + c1;
 | 
				
			||||||
 | 
					    op[10] = b1 - c1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[3] + ip[11];
 | 
				
			||||||
 | 
					    b1 = ip[3] - ip[11];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[3] = a1 + d2;
 | 
				
			||||||
 | 
					    op[15] = a1 - d2;
 | 
				
			||||||
 | 
					    op[7] = b1 + c2;
 | 
				
			||||||
 | 
					    op[11] = b1 - c2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ip = output;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* prepare data for load */
 | 
				
			||||||
 | 
					    prefetch_load_short(ip + shortpitch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* second loop is unrolled */
 | 
				
			||||||
 | 
					    a1 = ip[0] + ip[2];
 | 
				
			||||||
 | 
					    b1 = ip[0] - ip[2];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = (ip[1] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = ip[1] + ((ip[1] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp2 = (ip[3] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d1 = temp1 + temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = (ip[5] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp4 = ip[7] + ((ip[7] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c2 = temp3 - temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = ip[5] + ((ip[5] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp4 = (ip[7] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d2 = temp3 + temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[0] = (a1 + d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[3] = (a1 - d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[1] = (b1 + c1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[2] = (b1 - c1 + 4) >> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[4] + ip[6];
 | 
				
			||||||
 | 
					    b1 = ip[4] - ip[6];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[4] = (a1 + d2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[7] = (a1 - d2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[5] = (b1 + c2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[6] = (b1 - c2 + 4) >> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[8] + ip[10];
 | 
				
			||||||
 | 
					    b1 = ip[8] - ip[10];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = (ip[9] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp2 = ip[11] + ((ip[11] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c1 = temp1 - temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp1 = ip[9] + ((ip[9] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp2 = (ip[11] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d1 = temp1 + temp2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = (ip[13] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    temp4 = ip[15] + ((ip[15] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    c2 = temp3 - temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    temp3 = ip[13] + ((ip[13] * cospi8sqrt2minus1) >> 16);
 | 
				
			||||||
 | 
					    temp4 = (ip[15] * sinpi8sqrt2) >> 16;
 | 
				
			||||||
 | 
					    d2 = temp3 + temp4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[8] = (a1 + d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[11] = (a1 - d1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[9] = (b1 + c1 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[10] = (b1 - c1 + 4) >> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ip[12] + ip[14];
 | 
				
			||||||
 | 
					    b1 = ip[12] - ip[14];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    op[12] = (a1 + d2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[15] = (a1 - d2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[13] = (b1 + c2 + 4) >> 3;
 | 
				
			||||||
 | 
					    op[14] = (b1 - c2 + 4) >> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ip = output;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (r = 0; r < 4; r++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        for (c = 0; c < 4; c++)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            short a = ip[c] + pred_ptr[c] ;
 | 
				
			||||||
 | 
					            dst_ptr[c] = cm[a] ;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ip += 4;
 | 
				
			||||||
 | 
					        dst_ptr += dst_stride;
 | 
				
			||||||
 | 
					        pred_ptr += pred_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_dc_only_idct_add_dspr2(short input_dc, unsigned char *pred_ptr, int pred_stride, unsigned char *dst_ptr, int dst_stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int a1;
 | 
				
			||||||
 | 
					    int i, absa1;
 | 
				
			||||||
 | 
					    int t2, vector_a1, vector_a;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* a1 = ((input_dc + 4) >> 3); */
 | 
				
			||||||
 | 
					    __asm__ __volatile__ (
 | 
				
			||||||
 | 
					        "addi  %[a1], %[input_dc], 4   \n\t"
 | 
				
			||||||
 | 
					        "sra   %[a1], %[a1],       3   \n\t"
 | 
				
			||||||
 | 
					        : [a1] "=r" (a1)
 | 
				
			||||||
 | 
					        : [input_dc] "r" (input_dc)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (a1 < 0)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /* use quad-byte
 | 
				
			||||||
 | 
					         * input and output memory are four byte aligned
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        __asm__ __volatile__ (
 | 
				
			||||||
 | 
					            "abs        %[absa1],     %[a1]         \n\t"
 | 
				
			||||||
 | 
					            "replv.qb   %[vector_a1], %[absa1]      \n\t"
 | 
				
			||||||
 | 
					            : [absa1] "=r" (absa1), [vector_a1] "=r" (vector_a1)
 | 
				
			||||||
 | 
					            : [a1] "r" (a1)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* use (a1 - predptr[c]) instead a1 + predptr[c] */
 | 
				
			||||||
 | 
					        for (i = 4; i--;)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            __asm__ __volatile__ (
 | 
				
			||||||
 | 
					                "lw             %[t2],       0(%[pred_ptr])                     \n\t"
 | 
				
			||||||
 | 
					                "add            %[pred_ptr], %[pred_ptr],    %[pred_stride]     \n\t"
 | 
				
			||||||
 | 
					                "subu_s.qb      %[vector_a], %[t2],          %[vector_a1]       \n\t"
 | 
				
			||||||
 | 
					                "sw             %[vector_a], 0(%[dst_ptr])                      \n\t"
 | 
				
			||||||
 | 
					                "add            %[dst_ptr],  %[dst_ptr],     %[dst_stride]      \n\t"
 | 
				
			||||||
 | 
					                : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a),
 | 
				
			||||||
 | 
					                  [dst_ptr] "+&r" (dst_ptr), [pred_ptr] "+&r" (pred_ptr)
 | 
				
			||||||
 | 
					                : [dst_stride] "r" (dst_stride), [pred_stride] "r" (pred_stride), [vector_a1] "r" (vector_a1)
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /* use quad-byte
 | 
				
			||||||
 | 
					         * input and output memory are four byte aligned
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        __asm__ __volatile__ (
 | 
				
			||||||
 | 
					            "replv.qb       %[vector_a1], %[a1]     \n\t"
 | 
				
			||||||
 | 
					            : [vector_a1] "=r" (vector_a1)
 | 
				
			||||||
 | 
					            : [a1] "r" (a1)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        for (i = 4; i--;)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            __asm__ __volatile__ (
 | 
				
			||||||
 | 
					                "lw             %[t2],       0(%[pred_ptr])                 \n\t"
 | 
				
			||||||
 | 
					                "add            %[pred_ptr], %[pred_ptr],    %[pred_stride] \n\t"
 | 
				
			||||||
 | 
					                "addu_s.qb      %[vector_a], %[vector_a1],   %[t2]          \n\t"
 | 
				
			||||||
 | 
					                "sw             %[vector_a], 0(%[dst_ptr])                  \n\t"
 | 
				
			||||||
 | 
					                "add            %[dst_ptr],  %[dst_ptr],     %[dst_stride]  \n\t"
 | 
				
			||||||
 | 
					                : [t2] "=&r" (t2), [vector_a] "=&r" (vector_a),
 | 
				
			||||||
 | 
					                  [dst_ptr] "+&r" (dst_ptr), [pred_ptr] "+&r" (pred_ptr)
 | 
				
			||||||
 | 
					                : [dst_stride] "r" (dst_stride), [pred_stride] "r" (pred_stride), [vector_a1] "r" (vector_a1)
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_short_inv_walsh4x4_dspr2(short *input, short *mb_dqcoeff)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    short output[16];
 | 
				
			||||||
 | 
					    int i;
 | 
				
			||||||
 | 
					    int a1, b1, c1, d1;
 | 
				
			||||||
 | 
					    int a2, b2, c2, d2;
 | 
				
			||||||
 | 
					    short *ip = input;
 | 
				
			||||||
 | 
					    short *op = output;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    prefetch_load_short(ip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 4; i--;)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        a1 = ip[0] + ip[12];
 | 
				
			||||||
 | 
					        b1 = ip[4] + ip[8];
 | 
				
			||||||
 | 
					        c1 = ip[4] - ip[8];
 | 
				
			||||||
 | 
					        d1 = ip[0] - ip[12];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        op[0] = a1 + b1;
 | 
				
			||||||
 | 
					        op[4] = c1 + d1;
 | 
				
			||||||
 | 
					        op[8] = a1 - b1;
 | 
				
			||||||
 | 
					        op[12] = d1 - c1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ip++;
 | 
				
			||||||
 | 
					        op++;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ip = output;
 | 
				
			||||||
 | 
					    op = output;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    prefetch_load_short(ip);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 4; i--;)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        a1 = ip[0] + ip[3] + 3;
 | 
				
			||||||
 | 
					        b1 = ip[1] + ip[2];
 | 
				
			||||||
 | 
					        c1 = ip[1] - ip[2];
 | 
				
			||||||
 | 
					        d1 = ip[0] - ip[3] + 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        a2 = a1 + b1;
 | 
				
			||||||
 | 
					        b2 = d1 + c1;
 | 
				
			||||||
 | 
					        c2 = a1 - b1;
 | 
				
			||||||
 | 
					        d2 = d1 - c1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        op[0] = a2 >> 3;
 | 
				
			||||||
 | 
					        op[1] = b2 >> 3;
 | 
				
			||||||
 | 
					        op[2] = c2 >> 3;
 | 
				
			||||||
 | 
					        op[3] = d2 >> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ip += 4;
 | 
				
			||||||
 | 
					        op += 4;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (i = 0; i < 16; i++)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        mb_dqcoeff[i * 16] = output[i];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void vp8_short_inv_walsh4x4_1_dspr2(short *input, short *mb_dqcoeff)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int a1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    a1 = ((input[0] + 3) >> 3);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    __asm__ __volatile__ (
 | 
				
			||||||
 | 
					        "sh             %[a1], 0(%[mb_dqcoeff])                    \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 32(%[mb_dqcoeff])                   \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 64(%[mb_dqcoeff])                   \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 96(%[mb_dqcoeff])                   \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 128(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 160(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 192(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 224(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 256(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 288(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 320(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 352(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 384(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 416(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 448(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					        "sh             %[a1], 480(%[mb_dqcoeff])                  \n\t"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        :
 | 
				
			||||||
 | 
					        : [a1] "r" (a1), [mb_dqcoeff] "r" (mb_dqcoeff)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
							
								
								
									
										2622
									
								
								vp8/common/mips/dspr2/loopfilter_filters_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2622
									
								
								vp8/common/mips/dspr2/loopfilter_filters_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										121
									
								
								vp8/common/mips/dspr2/reconinter_dspr2.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								vp8/common/mips/dspr2/reconinter_dspr2.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,121 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 *  Copyright (c) 2012 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 "vpx_config.h"
 | 
				
			||||||
 | 
					#include "vpx_rtcd.h"
 | 
				
			||||||
 | 
					#include "vpx/vpx_integer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if HAVE_DSPR2
 | 
				
			||||||
 | 
					inline void prefetch_load_int(unsigned char *src)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    __asm__ __volatile__ (
 | 
				
			||||||
 | 
					        "pref   0,  0(%[src])   \n\t"
 | 
				
			||||||
 | 
					        :
 | 
				
			||||||
 | 
					        : [src] "r" (src)
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__inline void vp8_copy_mem16x16_dspr2(
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT src,
 | 
				
			||||||
 | 
					    int src_stride,
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT dst,
 | 
				
			||||||
 | 
					    int dst_stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int r;
 | 
				
			||||||
 | 
					    unsigned int a0, a1, a2, a3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (r = 16; r--;)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /* load src data in cache memory */
 | 
				
			||||||
 | 
					        prefetch_load_int(src + src_stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* use unaligned memory load and store */
 | 
				
			||||||
 | 
					        __asm__ __volatile__ (
 | 
				
			||||||
 | 
					            "ulw    %[a0], 0(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "ulw    %[a1], 4(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "ulw    %[a2], 8(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "ulw    %[a3], 12(%[src])           \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a0], 0(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a1], 4(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a2], 8(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a3], 12(%[dst])           \n\t"
 | 
				
			||||||
 | 
					            : [a0] "=&r" (a0), [a1] "=&r" (a1),
 | 
				
			||||||
 | 
					              [a2] "=&r" (a2), [a3] "=&r" (a3)
 | 
				
			||||||
 | 
					            : [src] "r" (src), [dst] "r" (dst)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        src += src_stride;
 | 
				
			||||||
 | 
					        dst += dst_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__inline void vp8_copy_mem8x8_dspr2(
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT src,
 | 
				
			||||||
 | 
					    int src_stride,
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT dst,
 | 
				
			||||||
 | 
					    int dst_stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int r;
 | 
				
			||||||
 | 
					    unsigned int a0, a1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* load src data in cache memory */
 | 
				
			||||||
 | 
					    prefetch_load_int(src + src_stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (r = 8; r--;)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /* use unaligned memory load and store */
 | 
				
			||||||
 | 
					        __asm__ __volatile__ (
 | 
				
			||||||
 | 
					            "ulw    %[a0], 0(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "ulw    %[a1], 4(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a0], 0(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a1], 4(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            : [a0] "=&r" (a0), [a1] "=&r" (a1)
 | 
				
			||||||
 | 
					            : [src] "r" (src), [dst] "r" (dst)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        src += src_stride;
 | 
				
			||||||
 | 
					        dst += dst_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					__inline void vp8_copy_mem8x4_dspr2(
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT src,
 | 
				
			||||||
 | 
					    int src_stride,
 | 
				
			||||||
 | 
					    unsigned char *RESTRICT dst,
 | 
				
			||||||
 | 
					    int dst_stride)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    int r;
 | 
				
			||||||
 | 
					    unsigned int a0, a1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* load src data in cache memory */
 | 
				
			||||||
 | 
					    prefetch_load_int(src + src_stride);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for (r = 4; r--;)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        /* use unaligned memory load and store */
 | 
				
			||||||
 | 
					        __asm__ __volatile__ (
 | 
				
			||||||
 | 
					            "ulw    %[a0], 0(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "ulw    %[a1], 4(%[src])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a0], 0(%[dst])            \n\t"
 | 
				
			||||||
 | 
					            "sw     %[a1], 4(%[dst])            \n\t"
 | 
				
			||||||
 | 
					           : [a0] "=&r" (a0), [a1] "=&r" (a1)
 | 
				
			||||||
 | 
					           : [src] "r" (src), [dst] "r" (dst)
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        src += src_stride;
 | 
				
			||||||
 | 
					        dst += dst_stride;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
@@ -1,146 +0,0 @@
 | 
				
			|||||||
/*
 | 
					 | 
				
			||||||
 *  Copyright (c) 2010 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 "entropymode.h"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] =
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  0*/
 | 
					 | 
				
			||||||
        { 43438,   2195,    470,    316,    615,    171,    217,    412,    124,    160, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {  5722,   2751,    296,    291,     81,     68,     80,    101,    100,    170, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {  1629,    201,    307,     25,     47,     16,     34,     72,     19,     28, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {   332,    266,     36,    500,     20,     65,     23,     14,    154,    106, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {   450,     97,     10,     24,    117,     10,      2,     12,      8,     71, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {   384,     49,     29,     44,     12,    162,     51,      5,     87,     42, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {   495,     53,    157,     27,     14,     57,    180,     17,     17,     34, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {   695,     64,     62,      9,     27,      5,      3,    147,     10,     26, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {   230,     54,     20,    124,     16,    125,     29,     12,    283,     37, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {   260,     87,     21,    120,     32,     16,     33,     16,     33,    203, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  1*/
 | 
					 | 
				
			||||||
        {  3934,   2573,    355,    137,    128,     87,    133,    117,     37,     27, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {  1036,   1929,    278,    135,     27,     37,     48,     55,     41,     91, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {   223,    256,    253,     15,     13,      9,     28,     64,      3,      3, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {   120,    129,     17,    316,     15,     11,      9,      4,     53,     74, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {   129,     58,      6,     11,     38,      2,      0,      5,      2,     67, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    53,     22,     11,     16,      8,     26,     14,      3,     19,     12, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    59,     26,     61,     11,      4,      9,     35,     13,      8,      8, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {   101,     52,     40,      8,      5,      2,      8,     59,      2,     20, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    48,     34,     10,     52,      8,     15,      6,      6,     63,     20, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    96,     48,     22,     63,     11,     14,      5,      8,      9,     96, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  2*/
 | 
					 | 
				
			||||||
        {   709,    461,    506,     36,     27,     33,    151,     98,     24,      6, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {   201,    375,    442,     27,     13,      8,     46,     58,      6,     19, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {   122,    140,    417,      4,     13,      3,     33,     59,      4,      2, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    36,     17,     22,     16,      6,      8,     12,     17,      9,     21, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    51,     15,      7,      1,     14,      0,      4,      5,      3,     22, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    18,     11,     30,      9,      7,     20,     11,      5,      2,      6, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    38,     21,    103,      9,      4,     12,     79,     13,      2,      5, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    64,     17,     66,      2,     12,      4,      2,     65,      4,      5, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    14,      7,      7,     16,      3,     11,      4,     13,     15,     16, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    36,      8,     32,      9,      9,      4,     14,      7,      6,     24, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  3*/
 | 
					 | 
				
			||||||
        {  1340,    173,     36,    119,     30,     10,     13,     10,     20,     26, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {   156,    293,     26,    108,      5,     16,      2,      4,     23,     30, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    60,     34,     13,      7,      3,      3,      0,      8,      4,      5, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    72,     64,      1,    235,      3,      9,      2,      7,     28,     38, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    29,     14,      1,      3,      5,      0,      2,      2,      5,     13, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    22,      7,      4,     11,      2,      5,      1,      2,      6,      4, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    18,     14,      5,      6,      4,      3,     14,      0,      9,      2, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    41,     10,      7,      1,      2,      0,      0,     10,      2,      1, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    23,     19,      2,     33,      1,      5,      2,      0,     51,      8, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    33,     26,      7,     53,      3,      9,      3,      3,      9,     19, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  4*/
 | 
					 | 
				
			||||||
        {   410,    165,     43,     31,     66,     15,     30,     54,      8,     17, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {   115,     64,     27,     18,     30,      7,     11,     15,      4,     19, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    31,     23,     25,      1,      7,      2,      2,     10,      0,      5, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    17,      4,      1,      6,      8,      2,      7,      5,      5,     21, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {   120,     12,      1,      2,     83,      3,      0,      4,      1,     40, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {     4,      3,      1,      2,      1,      2,      5,      0,      3,      6, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    10,      2,     13,      6,      6,      6,      8,      2,      4,      5, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    58,     10,      5,      1,     28,      1,      1,     33,      1,      9, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {     8,      2,      1,      4,      2,      5,      1,      1,      2,     10, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    76,      7,      5,      7,     18,      2,      2,      0,      5,     45, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  5*/
 | 
					 | 
				
			||||||
        {   444,     46,     47,     20,     14,    110,     60,     14,     60,      7, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {    59,     57,     25,     18,      3,     17,     21,      6,     14,      6, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    24,     17,     20,      6,      4,     13,      7,      2,      3,      2, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    13,     11,      5,     14,      4,      9,      2,      4,     15,      7, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {     8,      5,      2,      1,      4,      0,      1,      1,      2,     12, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    19,      5,      5,      7,      4,     40,      6,      3,     10,      4, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    16,      5,      9,      1,      1,     16,     26,      2,     10,      4, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    11,      4,      8,      1,      1,      4,      4,      5,      4,      1, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    15,      1,      3,      7,      3,     21,      7,      1,     34,      5, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    18,      5,      1,      3,      4,      3,      7,      1,      2,      9, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  6*/
 | 
					 | 
				
			||||||
        {   476,    149,     94,     13,     14,     77,    291,     27,     23,      3, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {    79,     83,     42,     14,      2,     12,     63,      2,      4,     14, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    43,     36,     55,      1,      3,      8,     42,     11,      5,      1, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {     9,      9,      6,     16,      1,      5,      6,      3,     11,     10, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    10,      3,      1,      3,     10,      1,      0,      1,      1,      4, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    14,      6,     15,      5,      1,     20,     25,      2,      5,      0, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    28,      7,     51,      1,      0,      8,    127,      6,      2,      5, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    13,      3,      3,      2,      3,      1,      2,      8,      1,      2, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    10,      3,      3,      3,      3,      8,      2,      2,      9,      3, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    13,      7,     11,      4,      0,      4,      6,      2,      5,      8, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  7*/
 | 
					 | 
				
			||||||
        {   376,    135,    119,      6,     32,      8,     31,    224,      9,      3, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {    93,     60,     54,      6,     13,      7,      8,     92,      2,     12, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    74,     36,     84,      0,      3,      2,      9,     67,      2,      1, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    19,      4,      4,      8,      8,      2,      4,      7,      6,     16, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    51,      7,      4,      1,     77,      3,      0,     14,      1,     15, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {     7,      7,      5,      7,      4,      7,      4,      5,      0,      3, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    18,      2,     19,      2,      2,      4,     12,     11,      1,      2, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {   129,      6,     27,      1,     21,      3,      0,    189,      0,      6, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {     9,      1,      2,      8,      3,      7,      0,      5,      3,      3, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    20,      4,      5,     10,      4,      2,      7,     17,      3,     16, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  8*/
 | 
					 | 
				
			||||||
        {   617,     68,     34,     79,     11,     27,     25,     14,     75,     13, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {    51,     82,     21,     26,      6,     12,     13,      1,     26,     16, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    29,      9,     12,     11,      3,      7,      1,     10,      2,      2, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    17,     19,     11,     74,      4,      3,      2,      0,     58,     13, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    10,      1,      1,      3,      4,      1,      0,      2,      1,      8, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    14,      4,      5,      5,      1,     13,      2,      0,     27,      8, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    10,      3,      5,      4,      1,      7,      6,      4,      5,      1, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    10,      2,      6,      2,      1,      1,      1,      4,      2,      1, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {    14,      8,      5,     23,      2,     12,      6,      2,    117,      5, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {     9,      6,      2,     19,      1,      6,      3,      2,      9,      9, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        /*Above Mode :  9*/
 | 
					 | 
				
			||||||
        {   680,     73,     22,     38,     42,      5,     11,      9,      6,     28, }, /* left_mode 0 */
 | 
					 | 
				
			||||||
        {   113,    112,     21,     22,     10,      2,      8,      4,      6,     42, }, /* left_mode 1 */
 | 
					 | 
				
			||||||
        {    44,     20,     24,      6,      5,      4,      3,      3,      1,      2, }, /* left_mode 2 */
 | 
					 | 
				
			||||||
        {    40,     23,      7,     71,      5,      2,      4,      1,      7,     22, }, /* left_mode 3 */
 | 
					 | 
				
			||||||
        {    85,      9,      4,      4,     17,      2,      0,      3,      2,     23, }, /* left_mode 4 */
 | 
					 | 
				
			||||||
        {    13,      4,      2,      6,      1,      7,      0,      1,      7,      6, }, /* left_mode 5 */
 | 
					 | 
				
			||||||
        {    26,      6,      8,      3,      2,      3,      8,      1,      5,      4, }, /* left_mode 6 */
 | 
					 | 
				
			||||||
        {    54,      8,      9,      6,      7,      0,      1,     11,      1,      3, }, /* left_mode 7 */
 | 
					 | 
				
			||||||
        {     9,     10,      4,     13,      2,      5,      4,      2,     14,      8, }, /* left_mode 8 */
 | 
					 | 
				
			||||||
        {    92,      9,      5,     19,     15,      3,      3,      1,      6,     58, }, /* left_mode 9 */
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
@@ -37,14 +37,6 @@ extern "C"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    } VPX_SCALING;
 | 
					    } VPX_SCALING;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    typedef enum
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        VP8_LAST_FLAG = 1,
 | 
					 | 
				
			||||||
        VP8_GOLD_FLAG = 2,
 | 
					 | 
				
			||||||
        VP8_ALT_FLAG = 4
 | 
					 | 
				
			||||||
    } VP8_REFFRAME;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    typedef enum
 | 
					    typedef enum
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        USAGE_STREAM_FROM_SERVER    = 0x0,
 | 
					        USAGE_STREAM_FROM_SERVER    = 0x0,
 | 
				
			||||||
@@ -60,19 +52,19 @@ extern "C"
 | 
				
			|||||||
        MODE_BESTQUALITY    = 0x2,
 | 
					        MODE_BESTQUALITY    = 0x2,
 | 
				
			||||||
        MODE_FIRSTPASS      = 0x3,
 | 
					        MODE_FIRSTPASS      = 0x3,
 | 
				
			||||||
        MODE_SECONDPASS     = 0x4,
 | 
					        MODE_SECONDPASS     = 0x4,
 | 
				
			||||||
        MODE_SECONDPASS_BEST = 0x5,
 | 
					        MODE_SECONDPASS_BEST = 0x5
 | 
				
			||||||
    } MODE;
 | 
					    } MODE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    typedef enum
 | 
					    typedef enum
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        FRAMEFLAGS_KEY    = 1,
 | 
					        FRAMEFLAGS_KEY    = 1,
 | 
				
			||||||
        FRAMEFLAGS_GOLDEN = 2,
 | 
					        FRAMEFLAGS_GOLDEN = 2,
 | 
				
			||||||
        FRAMEFLAGS_ALTREF = 4,
 | 
					        FRAMEFLAGS_ALTREF = 4
 | 
				
			||||||
    } FRAMETYPE_FLAGS;
 | 
					    } FRAMETYPE_FLAGS;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <assert.h>
 | 
					#include <assert.h>
 | 
				
			||||||
    static __inline void Scale2Ratio(int mode, int *hr, int *hs)
 | 
					    static void Scale2Ratio(int mode, int *hr, int *hs)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        switch (mode)
 | 
					        switch (mode)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
@@ -102,83 +94,101 @@ extern "C"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    typedef struct
 | 
					    typedef struct
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        int Version;            // 4 versions of bitstream defined 0 best quality/slowest decode, 3 lowest quality/fastest decode
 | 
					        /* 4 versions of bitstream defined:
 | 
				
			||||||
        int Width;              // width of data passed to the compressor
 | 
					         *   0 best quality/slowest decode, 3 lowest quality/fastest decode
 | 
				
			||||||
        int Height;             // height of data passed to the compressor
 | 
					         */
 | 
				
			||||||
 | 
					        int Version;
 | 
				
			||||||
 | 
					        int Width;
 | 
				
			||||||
 | 
					        int Height;
 | 
				
			||||||
        struct vpx_rational  timebase;
 | 
					        struct vpx_rational  timebase;
 | 
				
			||||||
        int target_bandwidth;    // bandwidth to be used in kilobits per second
 | 
					        unsigned int target_bandwidth;    /* kilobits per second */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int noise_sensitivity;   // parameter used for applying pre processing blur: recommendation 0
 | 
					        /* parameter used for applying pre processing blur: recommendation 0 */
 | 
				
			||||||
        int Sharpness;          // parameter used for sharpening output: recommendation 0:
 | 
					        int noise_sensitivity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* parameter used for sharpening output: recommendation 0: */
 | 
				
			||||||
 | 
					        int Sharpness;
 | 
				
			||||||
        int cpu_used;
 | 
					        int cpu_used;
 | 
				
			||||||
        unsigned int rc_max_intra_bitrate_pct;
 | 
					        unsigned int rc_max_intra_bitrate_pct;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // mode ->
 | 
					        /* mode ->
 | 
				
			||||||
        //(0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing
 | 
					         *(0)=Realtime/Live Encoding. This mode is optimized for realtim
 | 
				
			||||||
        //    a television signal or feed from a live camera). ( speed setting controls how fast )
 | 
					         *    encoding (for example, capturing a television signal or feed
 | 
				
			||||||
        //(1)=Good Quality Fast Encoding. The encoder balances quality with the amount of time it takes to
 | 
					         *    from a live camera). ( speed setting controls how fast )
 | 
				
			||||||
        //    encode the output. ( speed setting controls how fast )
 | 
					         *(1)=Good Quality Fast Encoding. The encoder balances quality with
 | 
				
			||||||
        //(2)=One Pass - Best Quality. The encoder places priority on the quality of the output over encoding
 | 
					         *    the amount of time it takes to encode the output. ( speed
 | 
				
			||||||
        //    speed. The output is compressed at the highest possible quality. This option takes the longest
 | 
					         *    setting controls how fast )
 | 
				
			||||||
        //    amount of time to encode. ( speed setting ignored )
 | 
					         *(2)=One Pass - Best Quality. The encoder places priority on the
 | 
				
			||||||
        //(3)=Two Pass - First Pass. The encoder generates a file of statistics for use in the second encoding
 | 
					         *    quality of the output over encoding speed. The output is
 | 
				
			||||||
        //    pass. ( speed setting controls how fast )
 | 
					         *    compressed at the highest possible quality. This option takes
 | 
				
			||||||
        //(4)=Two Pass - Second Pass. The encoder uses the statistics that were generated in the first encoding
 | 
					         *    the longest amount of time to encode. ( speed setting ignored
 | 
				
			||||||
        //    pass to create the compressed output. ( speed setting controls how fast )
 | 
					         *    )
 | 
				
			||||||
        //(5)=Two Pass - Second Pass Best.  The encoder uses the statistics that were generated in the first
 | 
					         *(3)=Two Pass - First Pass. The encoder generates a file of
 | 
				
			||||||
        //    encoding pass to create the compressed output using the highest possible quality, and taking a
 | 
					         *    statistics for use in the second encoding pass. ( speed
 | 
				
			||||||
        //    longer amount of time to encode.. ( speed setting ignored )
 | 
					         *    setting controls how fast )
 | 
				
			||||||
        int Mode;               //
 | 
					         *(4)=Two Pass - Second Pass. The encoder uses the statistics that
 | 
				
			||||||
 | 
					         *    were generated in the first encoding pass to create the
 | 
				
			||||||
 | 
					         *    compressed output. ( speed setting controls how fast )
 | 
				
			||||||
 | 
					         *(5)=Two Pass - Second Pass Best.  The encoder uses the statistics
 | 
				
			||||||
 | 
					         *    that were generated in the first encoding pass to create the
 | 
				
			||||||
 | 
					         *    compressed output using the highest possible quality, and
 | 
				
			||||||
 | 
					         *    taking a longer amount of time to encode.. ( speed setting
 | 
				
			||||||
 | 
					         *    ignored )
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        int Mode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Key Framing Operations
 | 
					        /* Key Framing Operations */
 | 
				
			||||||
        int auto_key;            // automatically detect cut scenes and set the keyframes
 | 
					        int auto_key;       /* automatically detect cut scenes */
 | 
				
			||||||
        int key_freq;            // maximum distance to key frame.
 | 
					        int key_freq;       /* maximum distance to key frame. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int allow_lag;           // allow lagged compression (if 0 lagin frames is ignored)
 | 
					        /* lagged compression (if allow_lag == 0 lag_in_frames is ignored) */
 | 
				
			||||||
        int lag_in_frames;        // how many frames lag before we start encoding
 | 
					        int allow_lag;
 | 
				
			||||||
 | 
					        int lag_in_frames; /* how many frames lag before we start encoding */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //----------------------------------------------------------------
 | 
					        /*
 | 
				
			||||||
        // DATARATE CONTROL OPTIONS
 | 
					         * DATARATE CONTROL OPTIONS
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int end_usage; // vbr or cbr
 | 
					        int end_usage; /* vbr or cbr */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // buffer targeting aggressiveness
 | 
					        /* buffer targeting aggressiveness */
 | 
				
			||||||
        int under_shoot_pct;
 | 
					        int under_shoot_pct;
 | 
				
			||||||
        int over_shoot_pct;
 | 
					        int over_shoot_pct;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // buffering parameters
 | 
					        /* buffering parameters */
 | 
				
			||||||
        int64_t starting_buffer_level;  // in bytes
 | 
					        int64_t starting_buffer_level;
 | 
				
			||||||
        int64_t optimal_buffer_level;
 | 
					        int64_t optimal_buffer_level;
 | 
				
			||||||
        int64_t maximum_buffer_size;
 | 
					        int64_t maximum_buffer_size;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int64_t starting_buffer_level_in_ms;  // in milli-seconds
 | 
					        int64_t starting_buffer_level_in_ms;
 | 
				
			||||||
        int64_t optimal_buffer_level_in_ms;
 | 
					        int64_t optimal_buffer_level_in_ms;
 | 
				
			||||||
        int64_t maximum_buffer_size_in_ms;
 | 
					        int64_t maximum_buffer_size_in_ms;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // controlling quality
 | 
					        /* controlling quality */
 | 
				
			||||||
        int fixed_q;
 | 
					        int fixed_q;
 | 
				
			||||||
        int worst_allowed_q;
 | 
					        int worst_allowed_q;
 | 
				
			||||||
        int best_allowed_q;
 | 
					        int best_allowed_q;
 | 
				
			||||||
        int cq_level;
 | 
					        int cq_level;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // allow internal resizing ( currently disabled in the build !!!!!)
 | 
					        /* allow internal resizing */
 | 
				
			||||||
        int allow_spatial_resampling;
 | 
					        int allow_spatial_resampling;
 | 
				
			||||||
        int resample_down_water_mark;
 | 
					        int resample_down_water_mark;
 | 
				
			||||||
        int resample_up_water_mark;
 | 
					        int resample_up_water_mark;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // allow internal frame rate alterations
 | 
					        /* allow internal frame rate alterations */
 | 
				
			||||||
        int allow_df;
 | 
					        int allow_df;
 | 
				
			||||||
        int drop_frames_water_mark;
 | 
					        int drop_frames_water_mark;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // two pass datarate control
 | 
					        /* two pass datarate control */
 | 
				
			||||||
        int two_pass_vbrbias;        // two pass datarate control tweaks
 | 
					        int two_pass_vbrbias;
 | 
				
			||||||
        int two_pass_vbrmin_section;
 | 
					        int two_pass_vbrmin_section;
 | 
				
			||||||
        int two_pass_vbrmax_section;
 | 
					        int two_pass_vbrmax_section;
 | 
				
			||||||
        // END DATARATE CONTROL OPTIONS
 | 
					 | 
				
			||||||
        //----------------------------------------------------------------
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /*
 | 
				
			||||||
 | 
					         * END DATARATE CONTROL OPTIONS
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // these parameters aren't to be used in final build don't use!!!
 | 
					        /* these parameters aren't to be used in final build don't use!!! */
 | 
				
			||||||
        int play_alternate;
 | 
					        int play_alternate;
 | 
				
			||||||
        int alt_freq;
 | 
					        int alt_freq;
 | 
				
			||||||
        int alt_q;
 | 
					        int alt_q;
 | 
				
			||||||
@@ -186,31 +196,33 @@ extern "C"
 | 
				
			|||||||
        int gold_q;
 | 
					        int gold_q;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int multi_threaded;   // how many threads to run the encoder on
 | 
					        int multi_threaded;   /* how many threads to run the encoder on */
 | 
				
			||||||
        int token_partitions; // how many token partitions to create for multi core decoding
 | 
					        int token_partitions; /* how many token partitions to create */
 | 
				
			||||||
        int encode_breakout;  // early breakout encode threshold : for video conf recommend 800
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        unsigned int error_resilient_mode; // Bitfield defining the error
 | 
					        /* early breakout threshold: for video conf recommend 800 */
 | 
				
			||||||
                                   // resiliency features to enable. Can provide
 | 
					        int encode_breakout;
 | 
				
			||||||
                                   // decodable frames after losses in previous
 | 
					
 | 
				
			||||||
                                   // frames and decodable partitions after
 | 
					        /* Bitfield defining the error resiliency features to enable.
 | 
				
			||||||
                                   // losses in the same frame.
 | 
					         * Can provide decodable frames after losses in previous
 | 
				
			||||||
 | 
					         * frames and decodable partitions after losses in the same frame.
 | 
				
			||||||
 | 
					         */
 | 
				
			||||||
 | 
					        unsigned int error_resilient_mode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int arnr_max_frames;
 | 
					        int arnr_max_frames;
 | 
				
			||||||
        int arnr_strength ;
 | 
					        int arnr_strength;
 | 
				
			||||||
        int arnr_type     ;
 | 
					        int arnr_type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        struct vpx_fixed_buf         two_pass_stats_in;
 | 
					        struct vpx_fixed_buf        two_pass_stats_in;
 | 
				
			||||||
        struct vpx_codec_pkt_list  *output_pkt_list;
 | 
					        struct vpx_codec_pkt_list  *output_pkt_list;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        vp8e_tuning tuning;
 | 
					        vp8e_tuning tuning;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Temporal scaling parameters
 | 
					        /* Temporal scaling parameters */
 | 
				
			||||||
        unsigned int number_of_layers;
 | 
					        unsigned int number_of_layers;
 | 
				
			||||||
        unsigned int target_bitrate[MAX_PERIODICITY];
 | 
					        unsigned int target_bitrate[VPX_TS_MAX_PERIODICITY];
 | 
				
			||||||
        unsigned int rate_decimator[MAX_PERIODICITY];
 | 
					        unsigned int rate_decimator[VPX_TS_MAX_PERIODICITY];
 | 
				
			||||||
        unsigned int periodicity;
 | 
					        unsigned int periodicity;
 | 
				
			||||||
        unsigned int layer_id[MAX_PERIODICITY];
 | 
					        unsigned int layer_id[VPX_TS_MAX_PERIODICITY];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if CONFIG_MULTI_RES_ENCODING
 | 
					#if CONFIG_MULTI_RES_ENCODING
 | 
				
			||||||
        /* Number of total resolutions encoded */
 | 
					        /* Number of total resolutions encoded */
 | 
				
			||||||
@@ -236,16 +248,14 @@ extern "C"
 | 
				
			|||||||
    void vp8_init_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
 | 
					    void vp8_init_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
 | 
				
			||||||
    void vp8_change_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
 | 
					    void vp8_change_config(struct VP8_COMP* onyx, VP8_CONFIG *oxcf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// receive a frames worth of data caller can assume that a copy of this frame is made
 | 
					 | 
				
			||||||
// and not just a copy of the pointer..
 | 
					 | 
				
			||||||
    int vp8_receive_raw_frame(struct VP8_COMP* comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp);
 | 
					    int vp8_receive_raw_frame(struct VP8_COMP* comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp);
 | 
				
			||||||
    int vp8_get_compressed_data(struct VP8_COMP* comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, unsigned char *dest_end, int64_t *time_stamp, int64_t *time_end, int flush);
 | 
					    int vp8_get_compressed_data(struct VP8_COMP* comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, unsigned char *dest_end, int64_t *time_stamp, int64_t *time_end, int flush);
 | 
				
			||||||
    int vp8_get_preview_raw_frame(struct VP8_COMP* comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
 | 
					    int vp8_get_preview_raw_frame(struct VP8_COMP* comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int vp8_use_as_reference(struct VP8_COMP* comp, int ref_frame_flags);
 | 
					    int vp8_use_as_reference(struct VP8_COMP* comp, int ref_frame_flags);
 | 
				
			||||||
    int vp8_update_reference(struct VP8_COMP* comp, int ref_frame_flags);
 | 
					    int vp8_update_reference(struct VP8_COMP* comp, int ref_frame_flags);
 | 
				
			||||||
    int vp8_get_reference(struct VP8_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
 | 
					    int vp8_get_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
 | 
				
			||||||
    int vp8_set_reference(struct VP8_COMP* comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
 | 
					    int vp8_set_reference(struct VP8_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
 | 
				
			||||||
    int vp8_update_entropy(struct VP8_COMP* comp, int update);
 | 
					    int vp8_update_entropy(struct VP8_COMP* comp, int update);
 | 
				
			||||||
    int vp8_set_roimap(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]);
 | 
					    int vp8_set_roimap(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]);
 | 
				
			||||||
    int vp8_set_active_map(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols);
 | 
					    int vp8_set_active_map(struct VP8_COMP* comp, unsigned char *map, unsigned int rows, unsigned int cols);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,10 +26,6 @@
 | 
				
			|||||||
#include "header.h"
 | 
					#include "header.h"
 | 
				
			||||||
/*#endif*/
 | 
					/*#endif*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Create/destroy static data structures. */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void vp8_initialize_common(void);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define MINQ 0
 | 
					#define MINQ 0
 | 
				
			||||||
#define MAXQ 127
 | 
					#define MAXQ 127
 | 
				
			||||||
#define QINDEX_RANGE (MAXQ + 1)
 | 
					#define QINDEX_RANGE (MAXQ + 1)
 | 
				
			||||||
@@ -46,7 +42,6 @@ typedef struct frame_contexts
 | 
				
			|||||||
    vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1];
 | 
					    vp8_prob sub_mv_ref_prob [VP8_SUBMVREFS-1];
 | 
				
			||||||
    vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
 | 
					    vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
 | 
				
			||||||
    MV_CONTEXT mvc[2];
 | 
					    MV_CONTEXT mvc[2];
 | 
				
			||||||
    MV_CONTEXT pre_mvc[2];  /* not to caculate the mvcost for the frame if mvc doesn't change. */
 | 
					 | 
				
			||||||
} FRAME_CONTEXT;
 | 
					} FRAME_CONTEXT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum
 | 
					typedef enum
 | 
				
			||||||
@@ -63,12 +58,6 @@ typedef enum
 | 
				
			|||||||
    RECON_CLAMP_NOTREQUIRED     = 1
 | 
					    RECON_CLAMP_NOTREQUIRED     = 1
 | 
				
			||||||
} CLAMP_TYPE;
 | 
					} CLAMP_TYPE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef enum
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
    SIXTAP   = 0,
 | 
					 | 
				
			||||||
    BILINEAR = 1
 | 
					 | 
				
			||||||
} INTERPOLATIONFILTERTYPE;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct VP8Common
 | 
					typedef struct VP8Common
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -92,11 +81,14 @@ typedef struct VP8Common
 | 
				
			|||||||
    int fb_idx_ref_cnt[NUM_YV12_BUFFERS];
 | 
					    int fb_idx_ref_cnt[NUM_YV12_BUFFERS];
 | 
				
			||||||
    int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx;
 | 
					    int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    YV12_BUFFER_CONFIG post_proc_buffer;
 | 
					 | 
				
			||||||
    YV12_BUFFER_CONFIG temp_scale_frame;
 | 
					    YV12_BUFFER_CONFIG temp_scale_frame;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if CONFIG_POSTPROC
 | 
				
			||||||
 | 
					    YV12_BUFFER_CONFIG post_proc_buffer;
 | 
				
			||||||
    YV12_BUFFER_CONFIG post_proc_buffer_int;
 | 
					    YV12_BUFFER_CONFIG post_proc_buffer_int;
 | 
				
			||||||
    int post_proc_buffer_int_used;
 | 
					    int post_proc_buffer_int_used;
 | 
				
			||||||
 | 
					    unsigned char *pp_limits_buffer;   /* post-processing filter coefficients */
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    FRAME_TYPE last_frame_type;  /* Save last frame's frame type for motion search. */
 | 
					    FRAME_TYPE last_frame_type;  /* Save last frame's frame type for motion search. */
 | 
				
			||||||
    FRAME_TYPE frame_type;
 | 
					    FRAME_TYPE frame_type;
 | 
				
			||||||
@@ -116,7 +108,6 @@ typedef struct VP8Common
 | 
				
			|||||||
    int full_pixel;
 | 
					    int full_pixel;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int base_qindex;
 | 
					    int base_qindex;
 | 
				
			||||||
    int last_kf_gf_q;  /* Q used on the last GF or KF */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    int y1dc_delta_q;
 | 
					    int y1dc_delta_q;
 | 
				
			||||||
    int y2dc_delta_q;
 | 
					    int y2dc_delta_q;
 | 
				
			||||||
@@ -132,11 +123,11 @@ typedef struct VP8Common
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    MODE_INFO *mip; /* Base of allocated array */
 | 
					    MODE_INFO *mip; /* Base of allocated array */
 | 
				
			||||||
    MODE_INFO *mi;  /* Corresponds to upper left visible macroblock */
 | 
					    MODE_INFO *mi;  /* Corresponds to upper left visible macroblock */
 | 
				
			||||||
 | 
					#if CONFIG_ERROR_CONCEALMENT
 | 
				
			||||||
    MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
 | 
					    MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
 | 
				
			||||||
    MODE_INFO *prev_mi;  /* 'mi' from last frame (points into prev_mip) */
 | 
					    MODE_INFO *prev_mi;  /* 'mi' from last frame (points into prev_mip) */
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    INTERPOLATIONFILTERTYPE mcomp_filter_type;
 | 
					 | 
				
			||||||
    LOOPFILTERTYPE filter_type;
 | 
					    LOOPFILTERTYPE filter_type;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    loop_filter_info_n lf_info;
 | 
					    loop_filter_info_n lf_info;
 | 
				
			||||||
@@ -160,14 +151,6 @@ typedef struct VP8Common
 | 
				
			|||||||
    ENTROPY_CONTEXT_PLANES *above_context;   /* row of context for each plane */
 | 
					    ENTROPY_CONTEXT_PLANES *above_context;   /* row of context for each plane */
 | 
				
			||||||
    ENTROPY_CONTEXT_PLANES left_context;  /* (up to) 4 contexts "" */
 | 
					    ENTROPY_CONTEXT_PLANES left_context;  /* (up to) 4 contexts "" */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    /* keyframe block modes are predicted by their above, left neighbors */
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    vp8_prob kf_bmode_prob [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1];
 | 
					 | 
				
			||||||
    vp8_prob kf_ymode_prob [VP8_YMODES-1];  /* keyframe "" */
 | 
					 | 
				
			||||||
    vp8_prob kf_uv_mode_prob [VP8_UV_MODES-1];
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    FRAME_CONTEXT lfc; /* last frame entropy */
 | 
					    FRAME_CONTEXT lfc; /* last frame entropy */
 | 
				
			||||||
    FRAME_CONTEXT fc;  /* this frame entropy */
 | 
					    FRAME_CONTEXT fc;  /* this frame entropy */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user