summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2015-07-07 20:42:18 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-07-07 20:42:19 +0000
commit9d251f9510765a4ff0ed01689dc5c9985c42ec10 (patch)
tree7acefa3e5e19cb480e6a2cbc52236bf946f4c3ad /test
parentea5450b2802178ed5b8298f89d7e760000058d59 (diff)
parent0ede9f52b796b6d8e02046b24f68a3db8b9f5920 (diff)
downloadlibvpx-9d251f9510765a4ff0ed01689dc5c9985c42ec10.tar
libvpx-9d251f9510765a4ff0ed01689dc5c9985c42ec10.tar.gz
libvpx-9d251f9510765a4ff0ed01689dc5c9985c42ec10.tar.bz2
libvpx-9d251f9510765a4ff0ed01689dc5c9985c42ec10.zip
Merge "Unify subtract function used in VP8/9"
Diffstat (limited to 'test')
-rw-r--r--test/subtract_test.cc123
-rw-r--r--test/test.mk1
2 files changed, 0 insertions, 124 deletions
diff --git a/test/subtract_test.cc b/test/subtract_test.cc
deleted file mode 100644
index ff42725f0..000000000
--- a/test/subtract_test.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "third_party/googletest/src/include/gtest/gtest.h"
-#include "test/acm_random.h"
-#include "test/clear_system_state.h"
-#include "test/register_state_check.h"
-#include "./vpx_config.h"
-#include "./vp8_rtcd.h"
-#include "vp8/common/blockd.h"
-#include "vp8/encoder/block.h"
-#include "vpx_mem/vpx_mem.h"
-
-typedef void (*SubtractBlockFunc)(BLOCK *be, BLOCKD *bd, int pitch);
-
-namespace {
-
-class SubtractBlockTest : public ::testing::TestWithParam<SubtractBlockFunc> {
- public:
- virtual void TearDown() {
- libvpx_test::ClearSystemState();
- }
-};
-
-using libvpx_test::ACMRandom;
-
-TEST_P(SubtractBlockTest, SimpleSubtract) {
- ACMRandom rnd(ACMRandom::DeterministicSeed());
- BLOCK be;
- BLOCKD bd;
- // in libvpx, this stride is always 16
- const int kDiffPredStride = 16;
- const int kSrcStride[] = {32, 16, 8, 4, 0};
- const int kBlockWidth = 4;
- const int kBlockHeight = 4;
-
- // Allocate... align to 16 for mmx/sse tests
- uint8_t *source = reinterpret_cast<uint8_t*>(
- vpx_memalign(16, kBlockHeight * kSrcStride[0] * sizeof(*source)));
- be.src_diff = reinterpret_cast<int16_t*>(
- vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*be.src_diff)));
- bd.predictor = reinterpret_cast<unsigned char*>(
- vpx_memalign(16, kBlockHeight * kDiffPredStride * sizeof(*bd.predictor)));
-
- for (int i = 0; kSrcStride[i] > 0; ++i) {
- // start at block0
- be.src = 0;
- be.base_src = &source;
- be.src_stride = kSrcStride[i];
-
- // set difference
- int16_t *src_diff = be.src_diff;
- for (int r = 0; r < kBlockHeight; ++r) {
- for (int c = 0; c < kBlockWidth; ++c) {
- src_diff[c] = static_cast<int16_t>(0xa5a5u);
- }
- src_diff += kDiffPredStride;
- }
-
- // set destination
- uint8_t *base_src = *be.base_src;
- for (int r = 0; r < kBlockHeight; ++r) {
- for (int c = 0; c < kBlockWidth; ++c) {
- base_src[c] = rnd.Rand8();
- }
- base_src += be.src_stride;
- }
-
- // set predictor
- uint8_t *predictor = bd.predictor;
- for (int r = 0; r < kBlockHeight; ++r) {
- for (int c = 0; c < kBlockWidth; ++c) {
- predictor[c] = rnd.Rand8();
- }
- predictor += kDiffPredStride;
- }
-
- ASM_REGISTER_STATE_CHECK(GetParam()(&be, &bd, kDiffPredStride));
-
- base_src = *be.base_src;
- src_diff = be.src_diff;
- predictor = bd.predictor;
- for (int r = 0; r < kBlockHeight; ++r) {
- for (int c = 0; c < kBlockWidth; ++c) {
- EXPECT_EQ(base_src[c], (src_diff[c] + predictor[c])) << "r = " << r
- << ", c = " << c;
- }
- src_diff += kDiffPredStride;
- predictor += kDiffPredStride;
- base_src += be.src_stride;
- }
- }
- vpx_free(be.src_diff);
- vpx_free(source);
- vpx_free(bd.predictor);
-}
-
-INSTANTIATE_TEST_CASE_P(C, SubtractBlockTest,
- ::testing::Values(vp8_subtract_b_c));
-
-#if HAVE_NEON
-INSTANTIATE_TEST_CASE_P(NEON, SubtractBlockTest,
- ::testing::Values(vp8_subtract_b_neon));
-#endif
-
-#if HAVE_MMX
-INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest,
- ::testing::Values(vp8_subtract_b_mmx));
-#endif
-
-#if HAVE_SSE2
-INSTANTIATE_TEST_CASE_P(SSE2, SubtractBlockTest,
- ::testing::Values(vp8_subtract_b_sse2));
-#endif
-
-} // namespace
diff --git a/test/test.mk b/test/test.mk
index 8415117ef..a8a365ec0 100644
--- a/test/test.mk
+++ b/test/test.mk
@@ -104,7 +104,6 @@ endif
LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += pp_filter_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += vp8_decrypt_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += set_roi.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += subtract_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += variance_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += vp8_fdct4x4_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += quantize_test.cc