]> granicus.if.org Git - libvpx/commitdiff
Compute prediction filter type cost only when needed
authorJingning Han <jingning@google.com>
Tue, 7 Apr 2015 19:39:54 +0000 (12:39 -0700)
committerJingning Han <jingning@google.com>
Tue, 7 Apr 2015 19:41:46 +0000 (12:41 -0700)
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

vp9/encoder/vp9_pickmode.c

index d754fd2b15c9f82ef308989e252a600e20a051aa..aab346edd52a6b94532f193a0441f0845211671c 100644 (file)
@@ -1336,9 +1336,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
         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 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
           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);
     }