]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: Fix to compute some metrics on top spatiail layer.
authorMarco Paniconi <marpan@google.com>
Wed, 30 May 2018 23:01:53 +0000 (16:01 -0700)
committerMarco Paniconi <marpan@google.com>
Thu, 31 May 2018 03:15:03 +0000 (20:15 -0700)
The avg_frame_low_motion and consec_zeromv are frame-level
metrics that are updated on every frame. For SVC these should be
updated on top spatial layer (full resolution).

Small/negligible change in metrics.

Change-Id: Ibe14f05be3b82daa9dd60378097ff11a27f1b95e

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_ratectrl.c

index c7e9f9b2a0254cb6140f7c80498e09db56f07b62..90906cc46ffb075b24b6b0ccbfbf3267e126724f 100644 (file)
@@ -5235,7 +5235,11 @@ static void encode_superblock(VP9_COMP *cpi, ThreadData *td, TOKENEXTRA **t,
     ++td->counts->tx.tx_totals[get_uv_tx_size(mi, &xd->plane[1])];
     if (cm->seg.enabled && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
       vp9_cyclic_refresh_update_sb_postencode(cpi, mi, mi_row, mi_col, bsize);
-    if (cpi->oxcf.pass == 0 && cpi->svc.temporal_layer_id == 0)
+    if (cpi->oxcf.pass == 0 && cpi->svc.temporal_layer_id == 0 &&
+        (!cpi->use_svc ||
+         (cpi->use_svc &&
+          !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
+          cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)))
       update_zeromv_cnt(cpi, mi, mi_row, mi_col, bsize);
   }
 }
index 70b3a7ab6fbd863b67022480f3b3faab076c9b68..11547fb2eeb8aa9485ea8c89b169eb92f6fc3a33 100644 (file)
@@ -1610,7 +1610,11 @@ void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
   }
 
   if (oxcf->pass == 0) {
-    if (cm->frame_type != KEY_FRAME) {
+    if (cm->frame_type != KEY_FRAME &&
+        (!cpi->use_svc ||
+         (cpi->use_svc &&
+          !cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
+          cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1))) {
       compute_frame_low_motion(cpi);
       if (cpi->sf.use_altref_onepass) update_altref_usage(cpi);
     }