Generalize vp9 sse2 denoiser test for other platforms.

Renamed to vp9_denoiser_test.

Change-Id: I0d8f4c94bcb81a60949a13d9fe839cee95d03f77
This commit is contained in:
Jerome Jiang 2017-04-27 15:56:39 -07:00
parent ef15d38df0
commit 26aebd77b8
2 changed files with 32 additions and 11 deletions

View File

@ -171,7 +171,7 @@ LIBVPX_TEST_SRCS-$(CONFIG_INTERNAL_STATS) += consistency_test.cc
endif
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_TEMPORAL_DENOISING),yesyes)
LIBVPX_TEST_SRCS-$(HAVE_SSE2) += vp9_denoiser_sse2_test.cc
LIBVPX_TEST_SRCS-yes += vp9_denoiser_test.cc
endif
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_arf_freq_test.cc

View File

@ -29,11 +29,21 @@ using libvpx_test::ACMRandom;
namespace {
const int kNumPixels = 64 * 64;
class VP9DenoiserTest : public ::testing::TestWithParam<BLOCK_SIZE> {
typedef int (*Vp9DenoiserFilterFunc)(const uint8_t *sig, int sig_stride,
const uint8_t *mc_avg, int mc_avg_stride,
uint8_t *avg, int avg_stride,
int increase_denoising, BLOCK_SIZE bs,
int motion_magnitude);
typedef std::tr1::tuple<Vp9DenoiserFilterFunc, BLOCK_SIZE> VP9DenoiserTestParam;
class VP9DenoiserTest
: public ::testing::Test,
public ::testing::WithParamInterface<VP9DenoiserTestParam> {
public:
virtual ~VP9DenoiserTest() {}
virtual void SetUp() { bs_ = GetParam(); }
virtual void SetUp() { bs_ = GET_PARAM(1); }
virtual void TearDown() { libvpx_test::ClearSystemState(); }
@ -76,8 +86,8 @@ TEST_P(VP9DenoiserTest, BitexactCheck) {
64, avg_block_c, 64, 0, bs_,
motion_magnitude_random));
ASM_REGISTER_STATE_CHECK(vp9_denoiser_filter_sse2(
sig_block, 64, mc_avg_block, 64, avg_block_sse2, 64, 0, bs_,
ASM_REGISTER_STATE_CHECK(GET_PARAM(0)(sig_block, 64, mc_avg_block, 64,
avg_block_sse2, 64, 0, bs_,
motion_magnitude_random));
// Test bitexactness.
@ -89,10 +99,21 @@ TEST_P(VP9DenoiserTest, BitexactCheck) {
}
}
using std::tr1::make_tuple;
// Test for all block size.
INSTANTIATE_TEST_CASE_P(SSE2, VP9DenoiserTest,
::testing::Values(BLOCK_8X8, BLOCK_8X16, BLOCK_16X8,
BLOCK_16X16, BLOCK_16X32, BLOCK_32X16,
BLOCK_32X32, BLOCK_32X64, BLOCK_64X32,
BLOCK_64X64));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
SSE2, VP9DenoiserTest,
::testing::Values(make_tuple(&vp9_denoiser_filter_sse2, BLOCK_8X8),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_8X16),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_16X8),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_16X16),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_16X32),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_32X16),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_32X32),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_32X64),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_64X32),
make_tuple(&vp9_denoiser_filter_sse2, BLOCK_64X64)));
#endif // HAVE_SSE2
} // namespace