shithub: libvpx

Download patch

ref: 36f1b183e4efb9efe1390ae210f51b3b209c7e70
parent: bcfd9c97508531a81cc2f5d393edb9eb1b00ce79
author: Linfeng Zhang <[email protected]>
date: Mon May 22 11:46:28 EDT 2017

Update InitInput() in test/partial_idct_test.cc

Make it work in high bit depth.

BUG=webm:1412

Change-Id: Ic5cfd410a69709f01e2924774356a108a349d273

--- a/test/partial_idct_test.cc
+++ b/test/partial_idct_test.cc
@@ -128,8 +128,8 @@
   }
 
   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);
@@ -160,6 +160,14 @@
             printf("dest[%d][%d] diff:%6d (ref),%6d (opt)\n", y, x, ref, opt);
           }
         }
+      }
+
+      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");
       }
     }
   }