Commit b0e5775e authored by James Zern's avatar James Zern

convolve_test: remove unnecessary memset

input_ is filled with random values just afterward.
the size was wrong anyway as input_ is allocated with memalign so
sizeof(input_)==sizeof(uint8_t*)

Change-Id: I014b832ac60960cd22b6f369dbc9fd648d4055b5
parent 519d9f3e
......@@ -173,10 +173,9 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
static void SetUpTestCase() {
// Force input_ to be unaligned, output to be 16 byte aligned.
input_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kOuterBlockSize * kOuterBlockSize + 1))
+ 1;
vpx_memalign(kDataAlignment, kInputBufferSize + 1)) + 1;
output_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kOuterBlockSize * kOuterBlockSize));
vpx_memalign(kDataAlignment, kOutputBufferSize));
}
static void TearDownTestCase() {
......@@ -192,6 +191,8 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
static const int kInputStride = kOuterBlockSize;
static const int kOutputStride = kOuterBlockSize;
static const int kMaxDimension = 64;
static const int kInputBufferSize = kOuterBlockSize * kOuterBlockSize;
static const int kOutputBufferSize = kOuterBlockSize * kOuterBlockSize;
int Width() const { return GET_PARAM(0); }
int Height() const { return GET_PARAM(1); }
......@@ -210,9 +211,8 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
virtual void SetUp() {
UUT_ = GET_PARAM(2);
memset(input_, 0, sizeof(input_));
/* Set up guard blocks for an inner block cetered in the outer block */
for (int i = 0; i < kOuterBlockSize * kOuterBlockSize; ++i) {
for (int i = 0; i < kOutputBufferSize; ++i) {
if (IsIndexInBorder(i))
output_[i] = 255;
else
......@@ -220,12 +220,12 @@ class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
}
::libvpx_test::ACMRandom prng;
for (int i = 0; i < kOuterBlockSize * kOuterBlockSize; ++i)
for (int i = 0; i < kInputBufferSize; ++i)
input_[i] = prng.Rand8Extremes();
}
void CheckGuardBlocks() {
for (int i = 0; i < kOuterBlockSize * kOuterBlockSize; ++i) {
for (int i = 0; i < kOutputBufferSize; ++i) {
if (IsIndexInBorder(i))
EXPECT_EQ(255, output_[i]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment