shithub: libvpx

Download patch

ref: 25206e7b7fd9e342ed2af0aeb404ec0aecc3040c
parent: 9922e4344a40a147abab06f16c7a9d9403d1a33b
author: Jingning Han <jingning@google.com>
date: Tue Apr 7 08:39:54 EDT 2015

Compute prediction filter type cost only when needed

Skip redundant prediction filter type cost in filter search loop,
if the rate value will be reset in Hadamard transform based rate
distortion estimate.

Change-Id: Ie5221f4bc8da9461c449df367251aeeac52c6e5d

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1336,9 +1336,6 @@
         model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist,
                           &var_y, &sse_y);
       }
-      this_rdc.rate +=
-          cm->interp_filter == SWITCHABLE ?
-              vp9_get_switchable_rate(cpi, xd) : 0;
     }
 
     if (!this_early_term) {
@@ -1364,6 +1361,8 @@
           this_rdc.rate += vp9_get_switchable_rate(cpi, xd);
       }
     } else {
+      this_rdc.rate += cm->interp_filter == SWITCHABLE ?
+          vp9_get_switchable_rate(cpi, xd) : 0;
       this_rdc.rate += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
     }