shithub: libvpx

Download patch

ref: e93571601ac181376bb84b0b926c5e3ae8b9f496
parent: 5f3e99166c84c76075f0faf64fb12746c856d8cb
author: Marco Paniconi <marpan@google.com>
date: Wed May 9 16:37:48 EDT 2018

vp9-svc: Fix inter-layer early exit threshold.

If the scale factors are 1 (no scaling), set the threshold
for skipping the inter-layer prediction to 0, so we will
more often test this mode.

Improves quality for upper layers for quality layers
in svc mode.

Change-Id: Iaf848d44f6cc153780db861b76517a4cf9672c45

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1502,8 +1502,17 @@
   int flag_svc_subpel = 0;
   int svc_mv_col = 0;
   int svc_mv_row = 0;
+  int no_scaling = 0;
   unsigned int thresh_svc_skip_golden = 500;
-  if (cpi->svc.spatial_layer_id > 0 && cpi->svc.high_source_sad_superframe)
+  if (cpi->use_svc && cpi->svc.spatial_layer_id > 0) {
+    int layer = LAYER_IDS_TO_IDX(cpi->svc.spatial_layer_id - 1,
+                                 cpi->svc.temporal_layer_id,
+                                 cpi->svc.number_temporal_layers);
+    LAYER_CONTEXT *lc = &cpi->svc.layer_context[layer];
+    if (lc->scaling_factor_num == lc->scaling_factor_den) no_scaling = 1;
+  }
+  if (cpi->svc.spatial_layer_id > 0 &&
+      (cpi->svc.high_source_sad_superframe || no_scaling))
     thresh_svc_skip_golden = 0;
   // Lower the skip threshold if lower spatial layer is better quality relative
   // to current layer.
@@ -1517,7 +1526,6 @@
     thresh_svc_skip_golden = 1000;
 
   init_ref_frame_cost(cm, xd, ref_frame_cost);
-
   memset(&mode_checked[0][0], 0, MB_MODE_COUNT * MAX_REF_FRAMES);
 
   if (reuse_inter_pred) {