shithub: libvpx

Download patch

ref: c98f8e04e573bdab8dbd2e9ab23354af58b2af68
parent: a0359b8c900cf2cf7e15148d14b0ee8d56236c86
author: James Zern <jzern@google.com>
date: Fri Apr 1 15:44:23 EDT 2016

dct32x32_test: add PartialTrans32x32Test, Random

Change-Id: I644f35b0b0a540bf5b6ebb6dbc05b3c95736f42b

--- a/test/dct32x32_test.cc
+++ b/test/dct32x32_test.cc
@@ -344,6 +344,28 @@
   EXPECT_EQ((minval * kNumCoeffs) >> 3, output[0]);
 }
 
+TEST_P(PartialTrans32x32Test, Random) {
+#if CONFIG_VP9_HIGHBITDEPTH
+  const int16_t maxval =
+      static_cast<int16_t>(clip_pixel_highbd(1 << 30, bit_depth_));
+#else
+  const int16_t maxval = 255;
+#endif
+  DECLARE_ALIGNED(16, int16_t, input[kNumCoeffs]);
+  DECLARE_ALIGNED(16, tran_low_t, output[kNumCoeffs]);
+  ACMRandom rnd(ACMRandom::DeterministicSeed());
+
+  int sum = 0;
+  for (int i = 0; i < kNumCoeffs; ++i) {
+    const int val = (i & 1) ? -rnd(maxval + 1) : rnd(maxval + 1);
+    input[i] = val;
+    sum += val;
+  }
+  output[0] = 0;
+  ASM_REGISTER_STATE_CHECK(fwd_txfm_(input, output, 32));
+  EXPECT_EQ(sum >> 3, output[0]);
+}
+
 using std::tr1::make_tuple;
 
 #if CONFIG_VP9_HIGHBITDEPTH
--