diff options
Diffstat (limited to 'third_party/aom/test/subtract_test.cc')
-rw-r--r-- | third_party/aom/test/subtract_test.cc | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/third_party/aom/test/subtract_test.cc b/third_party/aom/test/subtract_test.cc index ad39f56b3..725a6a2c6 100644 --- a/third_party/aom/test/subtract_test.cc +++ b/third_party/aom/test/subtract_test.cc @@ -130,7 +130,11 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> { rnd_.Reset(ACMRandom::DeterministicSeed()); +#if CONFIG_EXT_PARTITION const size_t max_width = 128; +#else + const size_t max_width = 64; +#endif const size_t max_block_size = max_width * max_width; src_ = CONVERT_TO_BYTEPTR(reinterpret_cast<uint16_t *>( aom_memalign(16, max_block_size * sizeof(uint16_t)))); @@ -147,8 +151,8 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> { } protected: - void RunForSpeed(); void CheckResult(); + void RunForSpeed(); private: ACMRandom rnd_; @@ -161,27 +165,13 @@ class AV1HBDSubtractBlockTest : public ::testing::TestWithParam<Params> { int16_t *diff_; }; -void AV1HBDSubtractBlockTest::RunForSpeed() { - const int test_num = 200000; - const int max_width = 128; - const int max_block_size = max_width * max_width; - const int mask = (1 << bit_depth_) - 1; - int i, j; - - for (j = 0; j < max_block_size; ++j) { - CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask; - CONVERT_TO_SHORTPTR(pred_)[j] = rnd_.Rand16() & mask; - } - - for (i = 0; i < test_num; ++i) { - func_(block_height_, block_width_, diff_, block_width_, src_, block_width_, - pred_, block_width_, bit_depth_); - } -} - void AV1HBDSubtractBlockTest::CheckResult() { const int test_num = 100; - const int max_width = 128; +#if CONFIG_EXT_PARTITION + const size_t max_width = 128; +#else + const size_t max_width = 64; +#endif const int max_block_size = max_width * max_width; const int mask = (1 << bit_depth_) - 1; int i, j; @@ -208,9 +198,29 @@ void AV1HBDSubtractBlockTest::CheckResult() { TEST_P(AV1HBDSubtractBlockTest, CheckResult) { CheckResult(); } -#if USE_SPEED_TEST -TEST_P(AV1HBDSubtractBlockTest, CheckSpeed) { RunForSpeed(); } -#endif // USE_SPEED_TEST +void AV1HBDSubtractBlockTest::RunForSpeed() { + const int test_num = 200000; +#if CONFIG_EXT_PARTITION + const size_t max_width = 128; +#else + const size_t max_width = 64; +#endif + const int max_block_size = max_width * max_width; + const int mask = (1 << bit_depth_) - 1; + int i, j; + + for (j = 0; j < max_block_size; ++j) { + CONVERT_TO_SHORTPTR(src_)[j] = rnd_.Rand16() & mask; + CONVERT_TO_SHORTPTR(pred_)[j] = rnd_.Rand16() & mask; + } + + for (i = 0; i < test_num; ++i) { + func_(block_height_, block_width_, diff_, block_width_, src_, block_width_, + pred_, block_width_, bit_depth_); + } +} + +TEST_P(AV1HBDSubtractBlockTest, DISABLED_Speed) { RunForSpeed(); } #if HAVE_SSE2 @@ -241,12 +251,14 @@ const Params kAV1HBDSubtractBlock_sse2[] = { make_tuple(64, 32, 12, &aom_highbd_subtract_block_c), make_tuple(64, 64, 12, &aom_highbd_subtract_block_sse2), make_tuple(64, 64, 12, &aom_highbd_subtract_block_c), +#if CONFIG_EXT_PARTITION make_tuple(64, 128, 12, &aom_highbd_subtract_block_sse2), make_tuple(64, 128, 12, &aom_highbd_subtract_block_c), make_tuple(128, 64, 12, &aom_highbd_subtract_block_sse2), make_tuple(128, 64, 12, &aom_highbd_subtract_block_c), make_tuple(128, 128, 12, &aom_highbd_subtract_block_sse2), make_tuple(128, 128, 12, &aom_highbd_subtract_block_c) +#endif // CONFIG_EXT_PARTITION }; INSTANTIATE_TEST_CASE_P(SSE2, AV1HBDSubtractBlockTest, |