shithub: libvpx

Download patch

ref: d9c417cb49a155f8403254aa23c403af81ccbcf8
parent: b3933e2d3ccf0de83441eac9d22a145c20ac6803
author: Angie Chiang <[email protected]>
date: Tue Jun 21 08:16:03 EDT 2016

set interp_filter to SWITCHABLE_FILTER for intra block

In vp9_pick_inter_mode(), instead of using
vp9_get_pred_context_switchable_interp(xd) to assign filter_ref,
we use a less strict condition on assigning filter_ref.
This is to reduce the probabily of entering the flow of not
assigning filter_ref and then skipping filter search.

Overall PSNR gain 0.074% for rtc dataset

Details:
Low    Mid     High
0.185% -0.008% -0.082%

Change-Id: Id5c5ab38d3766c213d5681e17b4d1afd1529e676

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1299,11 +1299,8 @@
   MODE_INFO *const mi = xd->mi[0];
   INTERP_FILTER filter_ref;
 
-  if (xd->above_mi)
-    filter_ref = xd->above_mi->interp_filter;
-  else if (xd->left_mi)
-    filter_ref = xd->left_mi->interp_filter;
-  else
+  filter_ref = vp9_get_pred_context_switchable_interp(xd);
+  if (filter_ref == SWITCHABLE_FILTERS)
     filter_ref = EIGHTTAP;
 
   mi->sb_type = bsize;
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1410,9 +1410,13 @@
   x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
   x->skip = 0;
 
-  if (xd->above_mi)
+  // Instead of using vp9_get_pred_context_switchable_interp(xd) to assign
+  // filter_ref, we use a less strict condition on assigning filter_ref.
+  // This is to reduce the probabily of entering the flow of not assigning
+  // filter_ref and then skip filter search.
+  if (xd->above_mi && is_inter_block(xd->above_mi))
     filter_ref = xd->above_mi->interp_filter;
-  else if (xd->left_mi)
+  else if (xd->left_mi && is_inter_block(xd->left_mi))
     filter_ref = xd->left_mi->interp_filter;
   else
     filter_ref = cm->interp_filter;
@@ -1976,6 +1980,10 @@
   mi->mode = best_mode;
   mi->ref_frame[0] = best_ref_frame;
   x->skip_txfm[0] = best_mode_skip_txfm;
+
+  if (!is_inter_block(mi)) {
+    mi->interp_filter = SWITCHABLE_FILTERS;
+  }
 
   if (reuse_inter_pred && best_pred != NULL) {
     if (best_pred->data != orig_dst.buf && is_inter_mode(mi->mode)) {