Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: source/libvpx/test/vp8_boolcoder_test.cc

Issue 12982023: libvpx: Pull from upstream (Closed) Base URL: https://src.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/test/encode_test_driver.cc ('k') | source/libvpx/test/vp8_decrypt_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/vp8_boolcoder_test.cc
===================================================================
--- source/libvpx/test/vp8_boolcoder_test.cc (revision 191054)
+++ source/libvpx/test/vp8_boolcoder_test.cc (working copy)
@@ -26,6 +26,20 @@
namespace {
const int num_tests = 10;
+
+void encrypt_buffer(uint8_t *buffer, int size, const uint8_t *key) {
+ for (int i = 0; i < size; ++i) {
+ buffer[i] ^= key[i % 32];
+ }
+}
+
+const uint8_t secret_key[32] = {
+ 234, 32, 2, 3, 4, 230, 6, 11,
+ 0, 132, 22, 23, 45, 21, 124, 255,
+ 0, 43, 52, 3, 23, 63, 99, 7,
+ 120, 8, 252, 84, 4, 83, 6, 13
+};
+
} // namespace
using libvpx_test::ACMRandom;
@@ -71,7 +85,12 @@
vp8_stop_encode(&bw);
BOOL_DECODER br;
- vp8dx_start_decode(&br, bw_buffer, buffer_size);
+
+#if CONFIG_DECRYPT
+ encrypt_buffer(bw_buffer, buffer_size, secret_key);
+#endif
+
+ vp8dx_start_decode(&br, bw_buffer, buffer_size, bw_buffer, secret_key);
bit_rnd.Reset(random_seed);
for (int i = 0; i < bits_to_test; ++i) {
if (bit_method == 2) {
« no previous file with comments | « source/libvpx/test/encode_test_driver.cc ('k') | source/libvpx/test/vp8_decrypt_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698