Commit cc774c8b authored by James Zern's avatar James Zern

variance_test: use REGISTER_STATE_CHECK

Change-Id: Id54ad9a781634f075e990d5bade5be8490959975
parent ba42c026
......@@ -13,6 +13,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "vpx/vpx_integer.h"
#include "vpx_config.h"
......@@ -151,7 +152,8 @@ void VarianceTest<VarianceFunctionType>::ZeroTest() {
for (int j = 0; j <= 255; ++j) {
memset(ref_, j, block_size_);
unsigned int sse;
const unsigned int var = variance_(src_, width_, ref_, width_, &sse);
unsigned int var;
REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse));
EXPECT_EQ(0u, var) << "src values: " << i << "ref values: " << j;
}
}
......@@ -165,7 +167,8 @@ void VarianceTest<VarianceFunctionType>::RefTest() {
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
const unsigned int var1 = variance_(src_, width_, ref_, width_, &sse1);
unsigned int var1;
REGISTER_STATE_CHECK(var1 = variance_(src_, width_, ref_, width_, &sse1));
const unsigned int var2 = variance_ref(src_, ref_, log2width_,
log2height_, &sse2);
EXPECT_EQ(sse1, sse2);
......@@ -180,7 +183,8 @@ void VarianceTest<VarianceFunctionType>::OneQuarterTest() {
memset(ref_, 255, half);
memset(ref_ + half, 0, half);
unsigned int sse;
const unsigned int var = variance_(src_, width_, ref_, width_, &sse);
unsigned int var;
REGISTER_STATE_CHECK(var = variance_(src_, width_, ref_, width_, &sse));
const unsigned int expected = block_size_ * 255 * 255 / 4;
EXPECT_EQ(expected, var);
}
......@@ -238,8 +242,9 @@ void SubpelVarianceTest<SubpelVarianceFunctionType>::RefTest() {
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
const unsigned int var1 = subpel_variance_(ref_, width_ + 1, x, y,
src_, width_, &sse1);
unsigned int var1;
REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
src_, width_, &sse1));
const unsigned int var2 = subpel_variance_ref(ref_, src_, log2width_,
log2height_, x, y, &sse2);
EXPECT_EQ(sse1, sse2) << "at position " << x << ", " << y;
......@@ -260,8 +265,9 @@ void SubpelVarianceTest<vp9_subp_avg_variance_fn_t>::RefTest() {
ref_[j] = rnd.Rand8();
}
unsigned int sse1, sse2;
const unsigned int var1 = subpel_variance_(ref_, width_ + 1, x, y,
src_, width_, &sse1, sec_);
unsigned int var1;
REGISTER_STATE_CHECK(var1 = subpel_variance_(ref_, width_ + 1, x, y,
src_, width_, &sse1, sec_));
const unsigned int var2 = subpel_avg_variance_ref(ref_, src_, sec_,
log2width_, log2height_,
x, y, &sse2);
......
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