]> granicus.if.org Git - libvpx/commitdiff
Use extreme values for input in convovle tests
authorYaowu Xu <yaowu@google.com>
Fri, 23 May 2014 19:23:29 +0000 (12:23 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 23 May 2014 20:32:54 +0000 (13:32 -0700)
The intepolation filter functions can be better tested withe extreme
values, especially given the optimization functions are prone to
overflow signed 16 bit intermediate value when operation order is
wrong.

Change-Id: I712142b0bc1e5969c692c0486a57ffa37c9742b5

test/convolve_test.cc

index a6dcc98759afe36acc0eb5e1dd92059235c2427c..2d89429a12a121c92f61f91a758ee5d908b8cedb 100644 (file)
@@ -221,8 +221,12 @@ class ConvolveTest : public ::testing::TestWithParam<convolve_param_t> {
     }
 
     ::libvpx_test::ACMRandom prng;
-    for (int i = 0; i < kInputBufferSize; ++i)
-      input_[i] = prng.Rand8Extremes();
+    for (int i = 0; i < kInputBufferSize; ++i) {
+      if (i & 1)
+        input_[i] = 255;
+      else
+        input_[i] = prng.Rand8Extremes();
+    }
   }
 
   void SetConstantInput(int value) {