vp9-svc: Add check in datarate unittests for frame-dropping.
authorMarco Paniconi <marpan@google.com>
Wed, 28 Mar 2018 17:28:14 +0000 (10:28 -0700)
committerMarco Paniconi <marpan@google.com>
Wed, 28 Mar 2018 17:30:59 +0000 (10:30 -0700)
Add verfication for constrained svc framedrop mode: check that
if a given spatial is dropped, all uppper layers must be dropped.

Change-Id: I9b4821b23c95d1d9d0c031a41af19984647ec5dc

test/datarate_test.cc

index ba3c536..c5e6f9b 100644 (file)
@@ -1618,6 +1618,17 @@ class DatarateOnePassCbrSvc
       }
     }
     ASSERT_EQ(count, num_layers_encoded);
+    // In the constrained frame drop mode, if a given spatial is dropped all
+    // upper layers must be dropped too.
+    if (constrained_framedrop_) {
+      for (int sl = 0; sl < number_spatial_layers_; ++sl) {
+        if (!pkt->data.frame.spatial_layer_encoded[sl]) {
+          // Check that all upper layers are dropped.
+          for (int sl2 = sl + 1; sl2 < number_spatial_layers_; ++sl2)
+            ASSERT_EQ(pkt->data.frame.spatial_layer_encoded[sl2], 0);
+        }
+      }
+    }
     // Keep track of number of non-reference frames, needed for mismatch check.
     // Non-reference frames are top spatial and temporal layer frames,
     // for TL > 0.