summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2016-10-26 21:24:46 -0700
committerJohann <johannkoenig@google.com>2016-10-26 21:35:49 -0700
commit7994dba6c0f20f47a990a09e05a71bd73df74c69 (patch)
treeb44567a44cea9619057e8078eeb4239363c4d897
parented2c2405380eb5f418b47c02d786a0a21b8723ee (diff)
downloadlibvpx-7994dba6c0f20f47a990a09e05a71bd73df74c69.tar
libvpx-7994dba6c0f20f47a990a09e05a71bd73df74c69.tar.gz
libvpx-7994dba6c0f20f47a990a09e05a71bd73df74c69.tar.bz2
libvpx-7994dba6c0f20f47a990a09e05a71bd73df74c69.zip
partial_idct_test: add _add_ test
The result of the transform is added to the destination buffers. In the existing tests the destination buffer is always empty so that portion of the code was never exercised. Change-Id: I1858c4fed2274f1b9faf834d2ba4186a4510492a
-rw-r--r--test/partial_idct_test.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/partial_idct_test.cc b/test/partial_idct_test.cc
index c41813d26..0c704c5c8 100644
--- a/test/partial_idct_test.cc
+++ b/test/partial_idct_test.cc
@@ -162,6 +162,30 @@ TEST_P(PartialIDctTest, ResultsMatch) {
<< "Error: partial inverse transform produces different results";
}
}
+
+TEST_P(PartialIDctTest, AddOutputBlock) {
+ ACMRandom rnd(ACMRandom::DeterministicSeed());
+ const int count_test_block = 10;
+ for (int i = 0; i < count_test_block; ++i) {
+ memset(input_block_, 0, sizeof(*input_block_) * block_size_);
+ for (int j = 0; j < last_nonzero_; ++j) {
+ input_block_[vp9_default_scan_orders[tx_size_].scan[j]] = 10;
+ }
+
+ for (int j = 0; j < block_size_; ++j) {
+ output_block_[j] = output_block_ref_[j] = rnd.Rand8();
+ }
+
+ ASM_REGISTER_STATE_CHECK(
+ full_itxfm_(input_block_, output_block_ref_, size_));
+ ASM_REGISTER_STATE_CHECK(
+ partial_itxfm_(input_block_, output_block_, size_));
+
+ ASSERT_EQ(0, memcmp(output_block_ref_, output_block_,
+ sizeof(*output_block_) * block_size_))
+ << "Error: Transform results are not correctly added to output.";
+ }
+}
using std::tr1::make_tuple;
INSTANTIATE_TEST_CASE_P(