Commit fc5176f8 authored by Yaowu Xu's avatar Yaowu Xu

sync avg_test.cc with aom/master

Change-Id: I651db25bee8f83a9fc6dcd35db5007a002f171c0
parent e28d92be
......@@ -54,14 +54,14 @@ class AverageTestBase : public ::testing::Test {
}
// Sum Pixels
unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
static unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
unsigned int average = 0;
for (int h = 0; h < 8; ++h)
for (int w = 0; w < 8; ++w) average += source[h * pitch + w];
return ((average + 32) >> 6);
}
unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
static unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
unsigned int average = 0;
for (int h = 0; h < 4; ++h)
for (int w = 0; w < 4; ++w) average += source[h * pitch + w];
......@@ -97,11 +97,12 @@ class AverageTest : public AverageTestBase,
protected:
void CheckAverages() {
const int block_size = GET_PARAM(3);
unsigned int expected = 0;
if (GET_PARAM(3) == 8) {
if (block_size == 8) {
expected =
ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_);
} else if (GET_PARAM(3) == 4) {
} else if (block_size == 4) {
expected =
ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_);
}
......
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