From 834feffe08113a0528d9c919c846459f4975b962 Mon Sep 17 00:00:00 2001 From: Linfeng Zhang Date: Wed, 7 Dec 2016 11:34:00 -0800 Subject: [PATCH] Update TEST_P(PartialIDctTest, RunQuantCheck) 1. Use correct projections when copying real dct/quant outputs. 2. Remove local random number generator and combine loops. 3. Quantization with minimum allowed step sizes instead of maximum. This may generate larger inputs. Change-Id: I154afc26230c894d564671cff4b8fd5485b69598 --- test/partial_idct_test.cc | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc index cab93a3..509aeac 100644 --- a/test/partial_idct_test.cc +++ b/test/partial_idct_test.cc @@ -178,35 +178,30 @@ TEST_P(PartialIDctTest, RunQuantCheck) { DECLARE_ALIGNED(16, int16_t, input_extreme_block[kMaxNumCoeffs]); DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kMaxNumCoeffs]); - for (int i = 0; i < kCountTestBlock; ++i) { - InitMem(); - - ACMRandom rnd(ACMRandom::DeterministicSeed()); - - for (int j = 0; j < kCountTestBlock; ++j) { - // Initialize a test block with input range [-mask_, mask_]. - if (j == 0) { - for (int k = 0; k < input_block_size_; ++k) { - input_extreme_block[k] = mask_; - } - } else if (j == 1) { - for (int k = 0; k < input_block_size_; ++k) { - input_extreme_block[k] = -mask_; - } - } else { - for (int k = 0; k < input_block_size_; ++k) { - input_extreme_block[k] = rnd.Rand8() % 2 ? mask_ : -mask_; - } + InitMem(); + for (int i = 0; i < kCountTestBlock * kCountTestBlock; ++i) { + // Initialize a test block with input range [-mask_, mask_]. + if (i == 0) { + for (int k = 0; k < input_block_size_; ++k) { + input_extreme_block[k] = mask_; } + } else if (i == 1) { + for (int k = 0; k < input_block_size_; ++k) { + input_extreme_block[k] = -mask_; + } + } else { + for (int k = 0; k < input_block_size_; ++k) { + input_extreme_block[k] = rnd_.Rand8() % 2 ? mask_ : -mask_; + } + } - ftxfm_(input_extreme_block, output_ref_block, size_); + ftxfm_(input_extreme_block, output_ref_block, size_); - // quantization with maximum allowed step sizes - input_block_[0] = (output_ref_block[0] / 1336) * 1336; - for (int k = 1; k < last_nonzero_; ++k) { - input_block_[vp9_default_scan_orders[tx_size_].scan[k]] = - (output_ref_block[k] / 1828) * 1828; - } + // quantization with minimum allowed step sizes + input_block_[0] = (output_ref_block[0] / 4) * 4; + for (int k = 1; k < last_nonzero_; ++k) { + const int pos = vp9_default_scan_orders[tx_size_].scan[k]; + input_block_[pos] = (output_ref_block[pos] / 4) * 4; } ASM_REGISTER_STATE_CHECK(Exec(full_itxfm_, output_block_ref_)); -- 2.7.4