]> granicus.if.org Git - libvpx/commitdiff
Update Loop8Test{6,9}Param to test filter8() in mb_lpf_vertical_edge_w()
authorLinfeng Zhang <linfengz@google.com>
Wed, 3 Aug 2016 18:02:15 +0000 (11:02 -0700)
committerLinfeng Zhang <linfengz@google.com>
Thu, 4 Aug 2016 18:33:14 +0000 (11:33 -0700)
One branch of filter8() in mb_lpf_vertical_edge_w() was not tested.

Change-Id: I194202d771d9acd6b4e5e600ee2bae89986b49f3

test/lpf_8_test.cc

index 22952e4e6f06bc612c42f0ed868ae9684f6e0fdf..4d28f8cad9b86564f9eeaf8a6026d17744397c73 100644 (file)
@@ -95,7 +95,7 @@ TEST_P(Loop8Test6Param, OperationCheck) {
   ACMRandom rnd(ACMRandom::DeterministicSeed());
   const int count_test_block = number_of_iterations;
 #if CONFIG_VP9_HIGHBITDEPTH
-  int32_t bd = bit_depth_;
+  const int32_t bd = bit_depth_;
   DECLARE_ALIGNED(16, uint16_t, s[kNumCoeffs]);
   DECLARE_ALIGNED(16, uint16_t, ref_s[kNumCoeffs]);
 #else
@@ -119,7 +119,6 @@ TEST_P(Loop8Test6Param, OperationCheck) {
                     thresh[16]) = { tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp,
                                     tmp, tmp, tmp, tmp, tmp, tmp, tmp, tmp };
     int32_t p = kNumCoeffs / 32;
-
     uint16_t tmp_s[kNumCoeffs];
     int j = 0;
     while (j < kNumCoeffs) {
@@ -127,15 +126,30 @@ TEST_P(Loop8Test6Param, OperationCheck) {
       if (val & 0x80) {  // 50% chance to choose a new value.
         tmp_s[j] = rnd.Rand16();
         j++;
-      } else {  // 50% chance to repeat previous value in row X times
+      } else if (val & 0x40) {
+        // 25% chance to repeat previous value in row X times.
+        int k = 0;
+        while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
+          if (j < 1) {
+            tmp_s[j] = rnd.Rand16();
+          } else if (val & 0x20) {  // Increment by a value within the limit.
+            tmp_s[j] = tmp_s[j - 1] + (*limit - 1);
+          } else {  // Decrement by a value within the limit.
+            tmp_s[j] = tmp_s[j - 1] - (*limit - 1);
+          }
+          j++;
+        }
+      } else {  // 25% chance to repeat previous value in column X times.
         int k = 0;
         while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
           if (j < 1) {
             tmp_s[j] = rnd.Rand16();
-          } else if (val & 0x20) {  // Increment by an value within the limit
-            tmp_s[j] = (tmp_s[j - 1] + (*limit - 1));
-          } else {  // Decrement by an value within the limit
-            tmp_s[j] = (tmp_s[j - 1] - (*limit - 1));
+          } else if (val & 0x20) {  // Increment by a value within the limit.
+            tmp_s[(j % 32) * 32 + j / 32] =
+                tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (*limit - 1);
+          } else {  // Decrement by a value within the limit.
+            tmp_s[(j % 32) * 32 + j / 32] =
+                tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (*limit - 1);
           }
           j++;
         }
@@ -227,6 +241,7 @@ TEST_P(Loop8Test6Param, ValueCheck) {
     ASM_REGISTER_STATE_CHECK(
         loopfilter_op_(s + 8 + p * 8, p, blimit, limit, thresh));
 #endif  // CONFIG_VP9_HIGHBITDEPTH
+
     for (int j = 0; j < kNumCoeffs; ++j) {
       err_count += ref_s[j] != s[j];
     }
@@ -289,15 +304,30 @@ TEST_P(Loop8Test9Param, OperationCheck) {
       if (val & 0x80) {  // 50% chance to choose a new value.
         tmp_s[j] = rnd.Rand16();
         j++;
-      } else {  // 50% chance to repeat previous value in row X times.
+      } else if (val & 0x40) {
+        // 25% chance to repeat previous value in row X times.
+        int k = 0;
+        while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
+          if (j < 1) {
+            tmp_s[j] = rnd.Rand16();
+          } else if (val & 0x20) {  // Increment by a value within the limit.
+            tmp_s[j] = tmp_s[j - 1] + (limit - 1);
+          } else {  // Decrement by a value within the limit.
+            tmp_s[j] = tmp_s[j - 1] - (limit - 1);
+          }
+          j++;
+        }
+      } else {  // 25% chance to repeat previous value in column X times.
         int k = 0;
         while (k++ < ((val & 0x1f) + 1) && j < kNumCoeffs) {
           if (j < 1) {
             tmp_s[j] = rnd.Rand16();
           } else if (val & 0x20) {  // Increment by a value within the limit.
-            tmp_s[j] = (tmp_s[j - 1] + (limit - 1));
-          } else {  // Decrement by an value within the limit.
-            tmp_s[j] = (tmp_s[j - 1] - (limit - 1));
+            tmp_s[(j % 32) * 32 + j / 32] =
+                tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] + (limit - 1);
+          } else {  // Decrement by a value within the limit.
+            tmp_s[(j % 32) * 32 + j / 32] =
+                tmp_s[((j - 1) % 32) * 32 + (j - 1) / 32] - (limit - 1);
           }
           j++;
         }