shithub: libvpx

Download patch

ref: 31a7f65cd6d2fae6e3413defe62da59c52fdcce4
parent: 3c20815a40557e5fce62d49bd4109eb1c8900778
author: Luc Trudeau <[email protected]>
date: Wed Jun 20 17:42:19 EDT 2018

Add Speed Tests to Trans32x32Test

Speed tests are disabled by default.

Change-Id: I49f8da3d3e1e4d9c72b17fc47c098284e7d84236

--- 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 @@
 }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-class Trans32x32Test : public ::testing::TestWithParam<Trans32x32Param> {
+class Trans32x32Test : public AbstractBench,
+                       public ::testing::TestWithParam<Trans32x32Param> {
  public:
   virtual ~Trans32x32Test() {}
   virtual void SetUp() {
@@ -99,8 +101,14 @@
   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;
@@ -235,6 +243,19 @@
           << "4*DCT_MAX_VALUE";
     }
   }
+}
+
+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) {