shithub: libvpx

Download patch

ref: adb9b4eddf15ce0852e3a891d16ebeced6eadfe7
parent: 6bff6cb5a9efe88c2cbe2c5f967560f68ee3ce29
author: Marco <marpan@google.com>
date: Thu Apr 13 13:45:55 EDT 2017

vp9: SVC: fix to allow use_base_mv to be used for 3 layers.

Allow use_base_mv to be used for 3 spatial layers where
base is 4x4 scale from the top layer.

Change-Id: If6641baf8b8e4d0fd5dc67619d873c6d75065f43

--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -651,7 +651,8 @@
                        &height);
 
   // The usage of use_base_mv assumes down-scale of 2x2. For now, turn off use
-  // of base motion vectors if spatial scale factors for any layers are not 2.
+  // of base motion vectors if spatial scale factors for any layers are not 2,
+  // keep the case of 3 spatial layers with scale factor of 4x4 for base layer.
   // TODO(marpan): Fix this to allow for use_base_mv for scale factors != 2.
   if (cpi->svc.number_spatial_layers > 1) {
     int sl;
@@ -658,7 +659,9 @@
     for (sl = 0; sl < cpi->svc.number_spatial_layers - 1; ++sl) {
       lc = &cpi->svc.layer_context[sl * cpi->svc.number_temporal_layers +
                                    cpi->svc.temporal_layer_id];
-      if (lc->scaling_factor_num != lc->scaling_factor_den >> 1) {
+      if ((lc->scaling_factor_num != lc->scaling_factor_den >> 1) &&
+          !(lc->scaling_factor_num == lc->scaling_factor_den >> 2 && sl == 0 &&
+            cpi->svc.number_spatial_layers == 3)) {
         cpi->svc.use_base_mv = 0;
         break;
       }