2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef LIBVPX_TEST_ACM_RANDOM_H_
12 #define LIBVPX_TEST_ACM_RANDOM_H_
16 #include "vpx/vpx_integer.h"
18 namespace libvpx_test {
23 Reset(DeterministicSeed());
26 explicit ACMRandom(int seed) {
30 void Reset(int seed) {
35 return (rand() >> 8) & 0xff;
38 int PseudoUniform(int range) {
39 return (rand() >> 8) % range;
42 int operator()(int n) {
43 return PseudoUniform(n);
46 static int DeterministicSeed(void) {
51 } // namespace libvpx_test
53 #endif // LIBVPX_TEST_ACM_RANDOM_H_