diff options
author | Linfeng Zhang <linfengz@google.com> | 2016-12-07 11:34:00 -0800 |
---|---|---|
committer | Linfeng Zhang <linfengz@google.com> | 2016-12-07 11:34:00 -0800 |
commit | 834feffe08113a0528d9c919c846459f4975b962 (patch) | |
tree | 2a0226cd193aac1056ff78cd7ad18016f6020122 /test | |
parent | 018a2adcb1b14a8f12fae6342c627c41e8b28ef1 (diff) | |
download | libvpx-834feffe08113a0528d9c919c846459f4975b962.tar libvpx-834feffe08113a0528d9c919c846459f4975b962.tar.gz libvpx-834feffe08113a0528d9c919c846459f4975b962.tar.bz2 libvpx-834feffe08113a0528d9c919c846459f4975b962.zip |
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
Diffstat (limited to 'test')
-rw-r--r-- | test/partial_idct_test.cc | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc index cab93a3f6..509aeac88 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_)); |