shithub: libvpx

Download patch

ref: 74c890b98ba0ee3b7bcb77ce2656cd5d17f6a80b
parent: 4fc3dadb3223d6d68878502b4e80d0a0e1dd3f5a
parent: 3edef86c5f5651f4a89004012ec3efe3232351df
author: Marco Paniconi <[email protected]>
date: Mon Jun 25 14:19:41 EDT 2018

Merge "vp9-svc: Fix to frame dropping when layer is skipped."

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -414,9 +414,12 @@
                                          svc->number_temporal_layers);
       LAYER_CONTEXT *lc = &svc->layer_context[layer];
       RATE_CONTROL *lrc = &lc->rc;
-      const int drop_mark_layer =
-          (int)(cpi->svc.framedrop_thresh[i] * lrc->optimal_buffer_level / 100);
-      if (!(lrc->buffer_level > drop_mark_layer)) return 0;
+      // Exclude check for layer whose bitrate is 0.
+      if (lc->target_bandwidth > 0) {
+        const int drop_mark_layer = (int)(cpi->svc.framedrop_thresh[i] *
+                                          lrc->optimal_buffer_level / 100);
+        if (!(lrc->buffer_level > drop_mark_layer)) return 0;
+      }
     }
     return 1;
   }
@@ -439,12 +442,15 @@
                                          svc->number_temporal_layers);
       LAYER_CONTEXT *lc = &svc->layer_context[layer];
       RATE_CONTROL *lrc = &lc->rc;
-      const int drop_mark_layer =
-          (int)(cpi->svc.framedrop_thresh[i] * lrc->optimal_buffer_level / 100);
-      if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP) {
-        if (lrc->buffer_level <= drop_mark_layer) return 1;
-      } else {
-        if (!(lrc->buffer_level <= drop_mark_layer)) return 0;
+      // Exclude check for layer whose bitrate is 0.
+      if (lc->target_bandwidth > 0) {
+        const int drop_mark_layer = (int)(cpi->svc.framedrop_thresh[i] *
+                                          lrc->optimal_buffer_level / 100);
+        if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP) {
+          if (lrc->buffer_level <= drop_mark_layer) return 1;
+        } else {
+          if (!(lrc->buffer_level <= drop_mark_layer)) return 0;
+        }
       }
     }
     if (cpi->svc.framedrop_mode == FULL_SUPERFRAME_DROP)