summaryrefslogtreecommitdiffstats
path: root/third_party/aom/test/convolve_round_test.cc
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
committertrav90 <travawine@palemoon.org>2018-10-18 21:53:44 -0500
commitec910d81405c736a4490383a250299a7837c2e64 (patch)
tree4f27cc226f93a863121aef6c56313e4153a69b3e /third_party/aom/test/convolve_round_test.cc
parent01eb57073ba97b2d6cbf20f745dfcc508197adc3 (diff)
downloadUXP-ec910d81405c736a4490383a250299a7837c2e64.tar
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.gz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.lz
UXP-ec910d81405c736a4490383a250299a7837c2e64.tar.xz
UXP-ec910d81405c736a4490383a250299a7837c2e64.zip
Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614
Diffstat (limited to 'third_party/aom/test/convolve_round_test.cc')
-rw-r--r--third_party/aom/test/convolve_round_test.cc45
1 files changed, 30 insertions, 15 deletions
diff --git a/third_party/aom/test/convolve_round_test.cc b/third_party/aom/test/convolve_round_test.cc
index 6f77dbb80..4976b03c8 100644
--- a/third_party/aom/test/convolve_round_test.cc
+++ b/third_party/aom/test/convolve_round_test.cc
@@ -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_);
@@ -109,14 +114,24 @@ class ConvolveRoundTest : public ::testing::TestWithParam<ConvolveRoundParam> {
GenerateBufferWithRandom(src_, src_stride, bits, w, h);
func_ref_(src_, src_stride, dst_ref, dst_stride, w, h, bits);
- 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 << " test: " << test_num;
+ ASM_REGISTER_STATE_CHECK(
+ func_(src_, src_stride, dst, dst_stride, w, h, bits));
+
+ 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;
+ }
}
}