shithub: libvpx

Download patch

ref: a2d35b234f176316fb978d8c7099a003ddd4e8ab
parent: 4400b0137e4b1b54f3c2ff54dfb1163d69983ce6
author: Jingning Han <[email protected]>
date: Thu Jun 28 11:11:35 EDT 2018

Refactor to use unified multiplier for partition search

Change-Id: I26ced25ff2e20ec414d5ecaa7d26f4a69175896c

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3540,6 +3540,8 @@
   int rate_breakout_thr = cpi->sf.partition_search_breakout_thr.rate;
   int must_split = 0;
 
+  int partition_mul = cpi->rd.RDMULT;
+
   (void)*tp_orig;
 
   assert(num_8x8_blocks_wide_lookup[bsize] ==
@@ -3670,7 +3672,7 @@
                      best_rdc.rdcost);
     if (this_rdc.rate != INT_MAX) {
       if (bsize >= BLOCK_8X8) {
-        this_rdc.rdcost += RDCOST(x->rdmult, x->rddiv,
+        this_rdc.rdcost += RDCOST(partition_mul, x->rddiv,
                                   cpi->partition_cost[pl][PARTITION_NONE], 0);
         this_rdc.rate += cpi->partition_cost[pl][PARTITION_NONE];
       }
@@ -3830,7 +3832,7 @@
     }
 
     if (((sum_rdc.rdcost < best_rdc.rdcost) || must_split) && i == 4) {
-      sum_rdc.rdcost += RDCOST(x->rdmult, x->rddiv,
+      sum_rdc.rdcost += RDCOST(partition_mul, x->rddiv,
                                cpi->partition_cost[pl][PARTITION_SPLIT], 0);
       sum_rdc.rate += cpi->partition_cost[pl][PARTITION_SPLIT];
 
@@ -3893,7 +3895,7 @@
     }
 
     if (sum_rdc.rdcost < best_rdc.rdcost) {
-      sum_rdc.rdcost += RDCOST(x->rdmult, x->rddiv,
+      sum_rdc.rdcost += RDCOST(partition_mul, x->rddiv,
                                cpi->partition_cost[pl][PARTITION_HORZ], 0);
       sum_rdc.rate += cpi->partition_cost[pl][PARTITION_HORZ];
       if (sum_rdc.rdcost < best_rdc.rdcost) {
@@ -3942,7 +3944,7 @@
     }
 
     if (sum_rdc.rdcost < best_rdc.rdcost) {
-      sum_rdc.rdcost += RDCOST(x->rdmult, x->rddiv,
+      sum_rdc.rdcost += RDCOST(partition_mul, x->rddiv,
                                cpi->partition_cost[pl][PARTITION_VERT], 0);
       sum_rdc.rate += cpi->partition_cost[pl][PARTITION_VERT];
       if (sum_rdc.rdcost < best_rdc.rdcost) {