]> granicus.if.org Git - libvpx/commitdiff
vp9: Nonrd mode: use content_state_sb for high motion.
authorMarco <marpan@google.com>
Thu, 6 Jul 2017 20:06:39 +0000 (13:06 -0700)
committerMarco <marpan@google.com>
Thu, 6 Jul 2017 22:05:19 +0000 (15:05 -0700)
In the content_state for a superblock is set to HighSad,
use that to bias some decisions in variance partition and
nonrd pickmde: use int_pro_motion for sad computation in
choose_partitioning, and set large_block in pickmode based
on the content_state_sb.

Only affects speed >= 7.

Immprovement for high motion content.
Small gain (~1%) in RTC metrics.
Speedup of ~5 for high motion clip on android (speed 8, 1 thread).

Change-Id: I5774c4854f012b89c8e969f6129b60988c2ce11c

vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_pickmode.c

index 0601eacfa6e77acd6be147df0951d3622e3356db..1ca3ccc2bd1fd273beea7b00439bfc41bd56a2c8 100644 (file)
@@ -1166,7 +1166,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
     mi->mv[0].as_int = 0;
     mi->interp_filter = BILINEAR;
 
-    if (cpi->oxcf.speed >= 8 && !low_res)
+    if (cpi->oxcf.speed >= 8 && !low_res && x->content_state_sb != kVeryHighSad)
       y_sad = cpi->fn_ptr[bsize].sdf(
           x->plane[0].src.buf, x->plane[0].src.stride, xd->plane[0].pre[0].buf,
           xd->plane[0].pre[0].stride);
index 46b6b35616e630529e96f6da93707409dd1fe34b..f340ef2082726f9d3f3e0be303307e5b3ee6962b 100644 (file)
@@ -1928,9 +1928,14 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
         pd->dst.stride = this_mode_pred->stride;
       }
     } else {
-      const int large_block = (x->sb_is_skin || cpi->oxcf.speed < 7)
-                                  ? bsize > BLOCK_32X32
-                                  : bsize >= BLOCK_32X32;
+      // For low motion content use x->sb_is_skin in addition to VeryHighSad
+      // for setting large_block.
+      const int large_block =
+          (x->content_state_sb == kVeryHighSad ||
+           (x->sb_is_skin && cpi->rc.avg_frame_low_motion > 70) ||
+           cpi->oxcf.speed < 7)
+              ? bsize > BLOCK_32X32
+              : bsize >= BLOCK_32X32;
       mi->interp_filter = (filter_ref == SWITCHABLE) ? EIGHTTAP : filter_ref;
 
       if (cpi->use_svc && ref_frame == GOLDEN_FRAME &&