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

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

Issue 23530058: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 3 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/vp8_fdct4x4_test.cc ('k') | source/libvpx/vp8/common/onyx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/vp9_boolcoder_test.cc
===================================================================
--- source/libvpx/test/vp9_boolcoder_test.cc (revision 223100)
+++ source/libvpx/test/vp9_boolcoder_test.cc (working copy)
@@ -19,7 +19,7 @@
#include "vp9/decoder/vp9_dboolhuff.h"
}
-#include "acm_random.h"
+#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
@@ -32,10 +32,10 @@
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];
+ const int kBitsToTest = 1000;
+ uint8_t probas[kBitsToTest];
- for (int i = 0; i < bits_to_test; ++i) {
+ for (int i = 0; i < kBitsToTest; ++i) {
const int parity = i & 1;
probas[i] =
(method == 0) ? 0 : (method == 1) ? 255 :
@@ -50,14 +50,14 @@
}
for (int bit_method = 0; bit_method <= 3; ++bit_method) {
const int random_seed = 6432;
- const int buffer_size = 10000;
+ const int kBufferSize = 10000;
ACMRandom bit_rnd(random_seed);
vp9_writer bw;
- uint8_t bw_buffer[buffer_size];
+ uint8_t bw_buffer[kBufferSize];
vp9_start_encode(&bw, bw_buffer);
int bit = (bit_method == 0) ? 0 : (bit_method == 1) ? 1 : 0;
- for (int i = 0; i < bits_to_test; ++i) {
+ for (int i = 0; i < kBitsToTest; ++i) {
if (bit_method == 2) {
bit = (i & 1);
} else if (bit_method == 3) {
@@ -72,16 +72,16 @@
GTEST_ASSERT_EQ(bw_buffer[0] & 0x80, 0);
vp9_reader br;
- vp9_reader_init(&br, bw_buffer, buffer_size);
+ vp9_reader_init(&br, bw_buffer, kBufferSize);
bit_rnd.Reset(random_seed);
- for (int i = 0; i < bits_to_test; ++i) {
+ for (int i = 0; i < kBitsToTest; ++i) {
if (bit_method == 2) {
bit = (i & 1);
} else if (bit_method == 3) {
bit = bit_rnd(2);
}
GTEST_ASSERT_EQ(vp9_read(&br, probas[i]), bit)
- << "pos: " << i << " / " << bits_to_test
+ << "pos: " << i << " / " << kBitsToTest
<< " bit_method: " << bit_method
<< " method: " << method;
}
« no previous file with comments | « source/libvpx/test/vp8_fdct4x4_test.cc ('k') | source/libvpx/vp8/common/onyx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698