Commit e47125e6 authored by Angie Chiang's avatar Angie Chiang Committed by James Zern

Fix ConvolveRoundTest

In the original code, when LOWBITDEPTH_TEST is on,
the convolve round functions will write result into
first 128*128 8 bit buffer

But the process is checking different part of the buffer

Change-Id: If5a689fc523ee5cca67ef2614b6442fa3475cd23
parent 773e8dc8
......@@ -12,13 +12,13 @@
#include <assert.h>
#include "./av1_rtcd.h"
#include "aom/aom_integer.h"
#include "aom_ports/aom_timer.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "third_party/googletest/src/googletest/include/gtest/gtest.h"
#include "aom/aom_integer.h"
#include "aom_ports/aom_timer.h"
using libaom_test::ACMRandom;
......@@ -68,12 +68,18 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
virtual void SetUp() {
const size_t block_size = 128 * 128;
src_ = reinterpret_cast<int32_t *>(
aom_memalign(16, 3 * block_size * sizeof(int32_t)));
dst_ref_ = reinterpret_cast<uint16_t *>(src_ + block_size);
dst_ = dst_ref_ + block_size;
aom_memalign(16, block_size * sizeof(*src_)));
dst_ref_ = reinterpret_cast<uint16_t *>(
aom_memalign(16, block_size * sizeof(*dst_ref_)));
dst_ = reinterpret_cast<uint16_t *>(
aom_memalign(16, block_size * sizeof(*dst_)));
}
virtual void TearDown() { aom_free(src_); }
virtual void TearDown() {
aom_free(src_);
aom_free(dst_ref_);
aom_free(dst_);
}
void ConvolveRoundingRun() {
int test_num = 0;
......@@ -82,7 +88,6 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
int bits = 13;
uint8_t *dst = 0;
uint8_t *dst_ref = 0;
int diff_wide;
if (data_path_ == LOWBITDEPTH_TEST) {
dst = reinterpret_cast<uint8_t *>(dst_);
......@@ -112,13 +117,21 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
ASM_REGISTER_STATE_CHECK(
func_(src_, src_stride, dst, dst_stride, w, h, bits));
diff_wide = w;
if (data_path_ == LOWBITDEPTH_TEST) diff_wide >>= 1;
for (int r = 0; r < h; ++r) {
for (int c = 0; c < diff_wide; ++c) {
ASSERT_EQ(dst_ref_[r * dst_stride + c], dst_[r * dst_stride + c])
<< "Mismatch at r: " << r << " c: " << c << " w: " << w
<< " h: " << h << " test: " << test_num;
if (data_path_ == LOWBITDEPTH_TEST) {
for (int r = 0; r < h; ++r) {
for (int c = 0; c < w; ++c) {
ASSERT_EQ(dst_ref[r * dst_stride + c], dst[r * dst_stride + c])
<< "Mismatch at r: " << r << " c: " << c << " w: " << w
<< " h: " << h << " test: " << test_num;
}
}
} else {
for (int r = 0; r < h; ++r) {
for (int c = 0; c < w; ++c) {
ASSERT_EQ(dst_ref_[r * dst_stride + c], dst_[r * dst_stride + c])
<< "Mismatch at r: " << r << " c: " << c << " w: " << w
<< " h: " << h << " test: " << test_num;
}
}
}
......
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