]> granicus.if.org Git - libvpx/commitdiff
dct32x32_test: add PartialTrans32x32Test, Random
authorJames Zern <jzern@google.com>
Sat, 2 Apr 2016 02:44:23 +0000 (19:44 -0700)
committerJames Zern <jzern@google.com>
Sat, 2 Apr 2016 02:45:21 +0000 (19:45 -0700)
Change-Id: I644f35b0b0a540bf5b6ebb6dbc05b3c95736f42b

test/dct32x32_test.cc

index 407d9f0b08e0e2a95c2a95920c5de30865d4a804..bb263e0092352be47c5cfb807fe152461a274a46 100644 (file)
@@ -344,6 +344,28 @@ TEST_P(PartialTrans32x32Test, Extremes) {
   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