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

Side by Side Diff: source/libvpx/test/vp8_boolcoder_test.cc

Issue 168343002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: libvpx: Pull from upstream Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/test/test_vectors.cc ('k') | source/libvpx/third_party/libmkv/EbmlBufferWriter.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 25 matching lines...) Expand all
36 }; 36 };
37 37
38 void encrypt_buffer(uint8_t *buffer, int size) { 38 void encrypt_buffer(uint8_t *buffer, int size) {
39 for (int i = 0; i < size; ++i) { 39 for (int i = 0; i < size; ++i) {
40 buffer[i] ^= secret_key[i & 15]; 40 buffer[i] ^= secret_key[i & 15];
41 } 41 }
42 } 42 }
43 43
44 void test_decrypt_cb(void *decrypt_state, const uint8_t *input, 44 void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
45 uint8_t *output, int count) { 45 uint8_t *output, int count) {
46 int offset = input - reinterpret_cast<uint8_t *>(decrypt_state); 46 const size_t offset = input - reinterpret_cast<uint8_t*>(decrypt_state);
47 for (int i = 0; i < count; i++) { 47 for (int i = 0; i < count; i++) {
48 output[i] = input[i] ^ secret_key[(offset + i) & 15]; 48 output[i] = input[i] ^ secret_key[(offset + i) & 15];
49 } 49 }
50 } 50 }
51 51
52 } // namespace 52 } // namespace
53 53
54 using libvpx_test::ACMRandom; 54 using libvpx_test::ACMRandom;
55 55
56 TEST(VP8, TestBitIO) { 56 TEST(VP8, TestBitIO) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit) 112 GTEST_ASSERT_EQ(vp8dx_decode_bool(&br, probas[i]), bit)
113 << "pos: "<< i << " / " << kBitsToTest 113 << "pos: "<< i << " / " << kBitsToTest
114 << " bit_method: " << bit_method 114 << " bit_method: " << bit_method
115 << " method: " << method; 115 << " method: " << method;
116 } 116 }
117 } 117 }
118 } 118 }
119 } 119 }
120 } 120 }
OLDNEW
« no previous file with comments | « source/libvpx/test/test_vectors.cc ('k') | source/libvpx/third_party/libmkv/EbmlBufferWriter.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698