shithub: libvpx

Download patch

ref: 5724e8c4c755c913df99216836a31640ea1baefb
parent: 7042137e603e7bc98783fa4704f8d0460d66c44b
parent: 7994dba6c0f20f47a990a09e05a71bd73df74c69
author: Johann Koenig <johannkoenig@google.com>
date: Fri Oct 28 20:34:16 EDT 2016

Merge "partial_idct_test: add _add_ test"

--- a/test/partial_idct_test.cc
+++ b/test/partial_idct_test.cc
@@ -162,6 +162,30 @@
         << "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(