]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Make constrained_layer_drop default for svc.
authorMarco Paniconi <marpan@google.com>
Mon, 9 Apr 2018 16:41:47 +0000 (09:41 -0700)
committerMarco Paniconi <marpan@google.com>
Mon, 9 Apr 2018 16:53:28 +0000 (09:53 -0700)
Switch the order of constrained and layer drop mode,
and keep constrained_layer_drop as the default.
Update the svc datarate tests.

Change-Id: I764270f7b4964b87b0cd3da6c2f96a628f212a30

test/svc_datarate_test.cc
vp9/encoder/vp9_svc_layercontext.c
vpx/vp8cx.h

index 2340fa49e8c5dc4e7f7bcaced777221f126d949e..5d70bda9710580acf3c74974b3134e77123cb501 100644 (file)
@@ -121,7 +121,7 @@ class DatarateOnePassCbrSvc
     superframe_count_ = -1;
     key_frame_spacing_ = 9999;
     num_nonref_frames_ = 0;
-    constrained_framedrop_ = 0;
+    layer_framedrop_ = 0;
   }
   virtual void BeginPassHook(unsigned int /*pass*/) {}
 
@@ -205,9 +205,9 @@ class DatarateOnePassCbrSvc
       encoder->Control(VP8E_SET_STATIC_THRESHOLD, 1);
       encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
 
-      if (constrained_framedrop_) {
+      if (layer_framedrop_) {
         vpx_svc_frame_drop_t svc_drop_frame;
-        svc_drop_frame.framedrop_mode = CONSTRAINED_LAYER_DROP;
+        svc_drop_frame.framedrop_mode = LAYER_DROP;
         for (i = 0; i < number_spatial_layers_; i++)
           svc_drop_frame.framedrop_thresh[i] = 30;
         encoder->Control(VP9E_SET_SVC_FRAME_DROP_LAYER, &svc_drop_frame);
@@ -372,7 +372,7 @@ 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_) {
+    if (!layer_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.
@@ -467,7 +467,7 @@ class DatarateOnePassCbrSvc
   int superframe_count_;
   int key_frame_spacing_;
   unsigned int num_nonref_frames_;
-  int constrained_framedrop_;
+  int layer_framedrop_;
 };
 
 // Check basic rate targeting for 1 pass CBR SVC: 2 spatial layers and 1
@@ -699,12 +699,12 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc2SL3TL4Threads) {
   ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 60);
   top_sl_width_ = 1280;
   top_sl_height_ = 720;
-  constrained_framedrop_ = 0;
+  layer_framedrop_ = 0;
   for (int k = 0; k < 2; k++) {
     for (int i = 200; i <= 600; i += 200) {
       cfg_.rc_target_bitrate = i;
       ResetModel();
-      constrained_framedrop_ = k;
+      layer_framedrop_ = k;
       AssignLayerBitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
                           cfg_.ts_number_layers, cfg_.temporal_layering_mode,
                           layer_target_avg_bandwidth_, bits_in_buffer_model_);
@@ -1000,12 +1000,12 @@ TEST_P(DatarateOnePassCbrSvc, OnePassCbrSvc3SL3TL4Threads) {
   ::libvpx_test::Y4mVideoSource video("niklas_1280_720_30.y4m", 0, 60);
   top_sl_width_ = 1280;
   top_sl_height_ = 720;
-  constrained_framedrop_ = 0;
+  layer_framedrop_ = 0;
   for (int k = 0; k < 2; k++) {
     for (int i = 200; i <= 600; i += 200) {
       cfg_.rc_target_bitrate = i;
       ResetModel();
-      constrained_framedrop_ = k;
+      layer_framedrop_ = k;
       AssignLayerBitrates(&cfg_, &svc_params_, cfg_.ss_number_layers,
                           cfg_.ts_number_layers, cfg_.temporal_layering_mode,
                           layer_target_avg_bandwidth_, bits_in_buffer_model_);
index 531a5d4bc8511e87b58ee98280aff6c41f0804e3..4dfdc65b72765d2e6edbc701ed75ebd35194d37f 100644 (file)
@@ -39,7 +39,7 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
   svc->non_reference_frame = 0;
   svc->skip_enhancement_layer = 0;
   svc->disable_inter_layer_pred = INTER_LAYER_PRED_ON;
-  svc->framedrop_mode = LAYER_DROP;
+  svc->framedrop_mode = CONSTRAINED_LAYER_DROP;
 
   for (i = 0; i < REF_FRAMES; ++i) svc->ref_frame_index[i] = -1;
   for (sl = 0; sl < oxcf->ss_number_layers; ++sl) {
index 860cce686bdd9135d59142ad25c5485ac34c4d85..f409844b5909a90b60cb5952c06beeecf1103321 100644 (file)
@@ -769,9 +769,9 @@ typedef struct vpx_svc_ref_frame_config {
  *
  */
 typedef enum {
-  LAYER_DROP, /**< Any spatial layer can drop. */
-  CONSTRAINED_LAYER_DROP
+  CONSTRAINED_LAYER_DROP,
   /**< Upper layers are constrained to drop if current layer drops. */
+  LAYER_DROP, /**< Any spatial layer can drop. */
 } SVC_LAYER_DROP_MODE;
 
 /*!\brief vp9 svc frame dropping parameters.