From c98f8e04e573bdab8dbd2e9ab23354af58b2af68 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 1 Apr 2016 19:44:23 -0700 Subject: [PATCH] dct32x32_test: add PartialTrans32x32Test, Random Change-Id: I644f35b0b0a540bf5b6ebb6dbc05b3c95736f42b --- test/dct32x32_test.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/dct32x32_test.cc b/test/dct32x32_test.cc index 407d9f0b0..bb263e009 100644 --- a/test/dct32x32_test.cc +++ b/test/dct32x32_test.cc @@ -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(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