shithub: libvpx

Download patch

ref: 927693a991e59e1fe1135a7585722c8af2626d6e
parent: 6de407b63897d950d43681ba8e633fcd3e8dc8c2
parent: 9922e4344a40a147abab06f16c7a9d9403d1a33b
author: Jingning Han <[email protected]>
date: Tue Apr 7 08:51:27 EDT 2015

Merge "Enable Hadamard transform based cost estimate for all block sizes"

--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -678,8 +678,10 @@
     }
   }
 
-  *rate <<= 10;
-  *rate += (eob_cost << 8);
+  if (*skippable == 0) {
+    *rate <<= 10;
+    *rate += (eob_cost << 8);
+  }
 }
 #endif
 
@@ -908,18 +910,10 @@
                           i, j, 0);
 
   // TODO(jingning): This needs further refactoring.
-  if (plane_bsize <= BLOCK_32X32) {
-    block_yrd(cpi, x, &rate, &dist, &is_skippable, &this_sse, 0,
-              bsize_tx, MIN(tx_size, TX_16X16));
-    x->skip_txfm[0] = is_skippable;
-    if (is_skippable)
-      rate = vp9_cost_bit(vp9_get_skip_prob(&cpi->common, xd), 1);
-    else
-      rate += vp9_cost_bit(vp9_get_skip_prob(&cpi->common, xd), 0);
-  } else {
-    unsigned int var_y, sse_y;
-    model_rd_for_sb_y(cpi, bsize_tx, x, xd, &rate, &dist, &var_y, &sse_y);
-  }
+  block_yrd(cpi, x, &rate, &dist, &is_skippable, &this_sse, 0,
+            bsize_tx, MIN(tx_size, TX_16X16));
+  x->skip_txfm[0] = is_skippable;
+  rate += vp9_cost_bit(vp9_get_skip_prob(&cpi->common, xd), is_skippable);
 
   p->src.buf = src_buf_base;
   pd->dst.buf = dst_buf_base;
@@ -1345,13 +1339,12 @@
         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 (bsize <= BLOCK_32X32) {
+    if (!this_early_term) {
       this_sse = (int64_t)sse_y;
       block_yrd(cpi, x, &this_rdc.rate, &this_rdc.dist, &is_skippable,
                 &this_sse, 0, bsize, MIN(mbmi->tx_size, TX_16X16));
@@ -1373,6 +1366,8 @@
         if ((mbmi->mv[0].as_mv.row | mbmi->mv[0].as_mv.col) & 0x07)
           this_rdc.rate += vp9_get_switchable_rate(cpi, xd);
       }
+    } else {
+      this_rdc.rate += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
     }
 
     if (x->color_sensitivity[0] || x->color_sensitivity[1]) {