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

Unified Diff: source/libvpx/test/set_roi.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/sad_test.cc ('k') | source/libvpx/test/subtract_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/test/set_roi.cc
===================================================================
--- source/libvpx/test/set_roi.cc (revision 223100)
+++ source/libvpx/test/set_roi.cc (working copy)
@@ -17,15 +17,19 @@
#include <sys/types.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
extern "C" {
#include "vp8/encoder/onyx_int.h"
}
+using libvpx_test::ACMRandom;
+
namespace {
TEST(Vp8RoiMapTest, ParameterCheck) {
+ ACMRandom rnd(ACMRandom::DeterministicSeed());
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 };
@@ -121,10 +125,10 @@
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;
+ rand_deltas[0] = rnd(160) - 80;
+ rand_deltas[1] = rnd(160) - 80;
+ rand_deltas[2] = rnd(160) - 80;
+ rand_deltas[3] = rnd(160) - 80;
deltas_valid = ((abs(rand_deltas[0]) <= 63) &&
(abs(rand_deltas[1]) <= 63) &&
« no previous file with comments | « source/libvpx/test/sad_test.cc ('k') | source/libvpx/test/subtract_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698