Move ACMRandom to acm_random.h
Change-Id: I1d99c56d1e1f521507978737fc661ca90af72507
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "test/acm_random.h"
|
||||
#include "test/util.h"
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
extern "C" {
|
||||
@@ -22,21 +23,6 @@ extern "C" {
|
||||
|
||||
namespace {
|
||||
|
||||
class ACMRandom {
|
||||
public:
|
||||
explicit ACMRandom(int seed) { Reset(seed); }
|
||||
|
||||
void Reset(int seed) { srand(seed); }
|
||||
|
||||
uint8_t Rand8(void) { return (rand() >> 8) & 0xff; }
|
||||
|
||||
int PseudoUniform(int range) { return (rand() >> 8) % range; }
|
||||
|
||||
int operator()(int n) { return PseudoUniform(n); }
|
||||
|
||||
static int DeterministicSeed(void) { return 0xbaba; }
|
||||
};
|
||||
|
||||
typedef void (*sixtap_predict_fn_t)(uint8_t *src_ptr,
|
||||
int src_pixels_per_line,
|
||||
int xoffset,
|
||||
@@ -139,6 +125,8 @@ TEST_P(SixtapPredictTest, TestWithPresetData) {
|
||||
<< "i==" << (i * width_ + j);
|
||||
}
|
||||
|
||||
using libvpx_test::ACMRandom;
|
||||
|
||||
TEST_P(SixtapPredictTest, TestWithRandomData) {
|
||||
const size_t src_size = sizeof(src_) / sizeof(uint8_t);
|
||||
|
||||
|
Reference in New Issue
Block a user