Update InitInput() in test/partial_idct_test.cc

Make it work in high bit depth.

BUG=webm:1412

Change-Id: Ic5cfd410a69709f01e2924774356a108a349d273
This commit is contained in:
Linfeng Zhang 2017-05-22 15:46:28 -07:00
parent bcfd9c9750
commit 36f1b183e4

View File

@ -128,8 +128,8 @@ class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> {
}
void InitInput() {
const int max_coeff = (32766 << (bit_depth_ - 8)) / 4;
int max_energy_leftover = max_coeff * max_coeff;
const int64_t max_coeff = (32766 << (bit_depth_ - 8)) / 4;
int64_t max_energy_leftover = max_coeff * max_coeff;
for (int j = 0; j < last_nonzero_; ++j) {
tran_low_t coeff = static_cast<tran_low_t>(
sqrt(1.0 * max_energy_leftover) * (rnd_.Rand16() - 32768) / 65536);
@ -161,6 +161,14 @@ class PartialIDctTest : public ::testing::TestWithParam<PartialInvTxfmParam> {
}
}
}
printf("\ninput_block_:\n");
for (int y = 0; y < size_; y++) {
for (int x = 0; x < size_; x++) {
printf("%6d,", input_block_[y * size_ + x]);
}
printf("\n");
}
}
}