From 31a7f65cd6d2fae6e3413defe62da59c52fdcce4 Mon Sep 17 00:00:00 2001 From: Luc Trudeau Date: Wed, 20 Jun 2018 21:42:19 -0400 Subject: [PATCH] Add Speed Tests to Trans32x32Test Speed tests are disabled by default. Change-Id: I49f8da3d3e1e4d9c72b17fc47c098284e7d84236 --- test/dct32x32_test.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc index 204ff9a5f..dd902f584 100644 --- a/test/dct32x32_test.cc +++ b/test/dct32x32_test.cc @@ -18,6 +18,7 @@ #include "./vpx_config.h" #include "./vpx_dsp_rtcd.h" #include "test/acm_random.h" +#include "test/bench.h" #include "test/clear_system_state.h" #include "test/register_state_check.h" #include "test/util.h" @@ -79,7 +80,8 @@ void idct32x32_12(const tran_low_t *in, uint8_t *out, int stride) { } #endif // CONFIG_VP9_HIGHBITDEPTH -class Trans32x32Test : public ::testing::TestWithParam { +class Trans32x32Test : public AbstractBench, + public ::testing::TestWithParam { public: virtual ~Trans32x32Test() {} virtual void SetUp() { @@ -99,8 +101,14 @@ class Trans32x32Test : public ::testing::TestWithParam { int mask_; FwdTxfmFunc fwd_txfm_; InvTxfmFunc inv_txfm_; + + int16_t *bench_in_; + tran_low_t *bench_out_; + virtual void Run(); }; +void Trans32x32Test::Run() { fwd_txfm_(bench_in_, bench_out_, 32); } + TEST_P(Trans32x32Test, AccuracyCheck) { ACMRandom rnd(ACMRandom::DeterministicSeed()); uint32_t max_error = 0; @@ -237,6 +245,19 @@ TEST_P(Trans32x32Test, MemCheck) { } } +TEST_P(Trans32x32Test, DISABLED_Speed) { + ACMRandom rnd(ACMRandom::DeterministicSeed()); + + DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]); + DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]); + + bench_in_ = input_extreme_block; + bench_out_ = output_block; + + RunNTimes(INT16_MAX); + PrintMedian("32x32"); +} + TEST_P(Trans32x32Test, InverseAccuracy) { ACMRandom rnd(ACMRandom::DeterministicSeed()); const int count_test_block = 1000; -- 2.40.0