Merge "Take out skip_recode speed feature" into nextgenv2
diff --git a/vp10/encoder/block.h b/vp10/encoder/block.h
index 4b5831d..d4adf0d 100644
--- a/vp10/encoder/block.h
+++ b/vp10/encoder/block.h
@@ -77,7 +77,6 @@
   MB_MODE_INFO_EXT *mbmi_ext;
   int skip_block;
   int select_tx_size;
-  int skip_recode;
   int skip_optimize;
   int q_index;
 
diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c
index 51141d6..39b0d8e 100644
--- a/vp10/encoder/encodeframe.c
+++ b/vp10/encoder/encodeframe.c
@@ -1707,7 +1707,6 @@
   ctx->is_coded = 0;
   ctx->skippable = 0;
   ctx->pred_pixel_ready = 0;
-  x->skip_recode = 0;
 
   // Set to zero to make sure we do not use the previous encoded frame stats
   mbmi->skip = 0;
@@ -2263,8 +2262,6 @@
 
       set_offsets(cpi, tile, x, mi_row, mi_col, bsize);
       if (!x->skip) {
-        // TODO(geza.lore): Investigate if this can be relaxed
-        x->skip_recode = 0;
         memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
 
         x->skip_optimize = 0;
@@ -4970,10 +4967,7 @@
   const int mi_width = num_8x8_blocks_wide_lookup[bsize];
   const int mi_height = num_8x8_blocks_high_lookup[bsize];
 
-  x->skip_recode = 0;
-
-  if (!x->skip_recode)
-    memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
+  memset(x->skip_txfm, 0, sizeof(x->skip_txfm));
 
   x->skip_optimize = ctx->is_coded;
   ctx->is_coded = 1;
diff --git a/vp10/encoder/encodemb.c b/vp10/encoder/encodemb.c
index 966a133..b9412cc 100644
--- a/vp10/encoder/encodemb.c
+++ b/vp10/encoder/encodemb.c
@@ -436,10 +436,9 @@
   // Assert not magic number (uninitialised).
   assert(x->blk_skip[plane][(blk_row << bwl) + blk_col] != 234);
 
-  if (!x->skip_recode &&
-      x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) {
+  if (x->blk_skip[plane][(blk_row << bwl) + blk_col] == 0) {
 #else
-  if (!x->skip_recode) {
+  {
 #endif
     if (x->quant_fp) {
       // Encoding process for rtc mode
@@ -479,12 +478,11 @@
   }
 #if CONFIG_VAR_TX
   else {
-    if (!x->skip_recode)
-      p->eobs[block] = 0;
+    p->eobs[block] = 0;
   }
 #endif
 
-  if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
+  if (x->optimize) {
     int ctx;
 #if CONFIG_VAR_TX
     switch (tx_size) {
@@ -661,10 +659,9 @@
     int block = 0;
     int step = 1 << (max_tx_size * 2);
 #endif
-    if (!x->skip_recode)
-      vp10_subtract_plane(x, bsize, plane);
+    vp10_subtract_plane(x, bsize, plane);
 
-    if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
+    if (x->optimize) {
 #if CONFIG_VAR_TX
       vp10_get_entropy_contexts(bsize, TX_4X4, pd,
                                 ctx.ta[plane], ctx.tl[plane]);
@@ -761,24 +758,15 @@
                      src_stride, dst, dst_stride);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
-#if CONFIG_EXT_INTRA
   vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
                    VP10_XFORM_QUANT_B);
-#else
-  if (!x->skip_recode)
-    vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
-                     VP10_XFORM_QUANT_B);
-  else
-    vp10_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, tx_size,
-                     VP10_XFORM_QUANT_SKIP_QUANT);
-#endif  // CONFIG_EXT_INTRA
 
   if (args->ctx != NULL) {
     struct optimize_ctx *const ctx = args->ctx;
     ENTROPY_CONTEXT *a, *l;
     a = &ctx->ta[plane][blk_col];
     l = &ctx->tl[plane][blk_row];
-    if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
+    if (x->optimize) {
       int ctx;
       ctx = combine_entropy_contexts(*a, *l);
       *a = *l = optimize_b(x, plane, block, tx_size, ctx) > 0;
@@ -814,8 +802,7 @@
   struct optimize_ctx ctx;
   struct encode_b_args arg = {x, &ctx, &xd->mi[0]->mbmi.skip};
 
-  if (enable_optimize_b && x->optimize &&
-      (!x->skip_recode || !x->skip_optimize)) {
+  if (enable_optimize_b && x->optimize) {
     const struct macroblockd_plane* const pd = &xd->plane[plane];
     const TX_SIZE tx_size = plane ? get_uv_tx_size(&xd->mi[0]->mbmi, pd) :
         xd->mi[0]->mbmi.tx_size;
diff --git a/vp10/encoder/firstpass.c b/vp10/encoder/firstpass.c
index 9ebb5a8..1504462 100644
--- a/vp10/encoder/firstpass.c
+++ b/vp10/encoder/firstpass.c
@@ -563,7 +563,6 @@
     pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
     p[i].eobs = ctx->eobs_pbuf[i][1];
   }
-  x->skip_recode = 0;
 
   vp10_init_mv_probs(cm);
   vp10_initialize_rd_consts(cpi);
diff --git a/vp10/encoder/speed_features.c b/vp10/encoder/speed_features.c
index 92b071e..3f411b7 100644
--- a/vp10/encoder/speed_features.c
+++ b/vp10/encoder/speed_features.c
@@ -131,7 +131,6 @@
   const int boosted = frame_is_boosted(cpi);
 
   sf->adaptive_rd_thresh = 1;
-  sf->allow_skip_recode = 1;
 
   if (speed >= 1) {
     if ((cpi->twopass.fr_content_type == FC_GRAPHICS_ANIMATION) ||
@@ -335,7 +334,6 @@
     sf->mv.subpel_iters_per_step = 1;
     sf->adaptive_rd_thresh = 4;
     sf->mode_skip_start = 6;
-    sf->allow_skip_recode = 0;
     sf->optimize_coefficients = 0;
     sf->disable_split_mask = DISABLE_ALL_SPLIT;
     sf->lpf_pick = LPF_PICK_FROM_Q;
@@ -369,7 +367,6 @@
     sf->inter_mode_mask[BLOCK_128X128] = INTER_NEAREST;
 #endif  // CONFIG_EXT_PARTITION
     sf->max_intra_bsize = BLOCK_32X32;
-    sf->allow_skip_recode = 1;
   }
 
   if (speed >= 5) {
@@ -382,7 +379,6 @@
         (frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
     sf->max_delta_qindex = is_keyframe ? 20 : 15;
     sf->partition_search_type = REFERENCE_PARTITION;
-    sf->allow_skip_recode = 0;
     sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO;
     sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
     sf->inter_mode_mask[BLOCK_64X32] = INTER_NEAREST_NEW_ZERO;
@@ -532,7 +528,6 @@
   }
   sf->use_rd_breakout = 0;
   sf->use_uv_intra_rd_estimate = 0;
-  sf->allow_skip_recode = 0;
   sf->lpf_pick = LPF_PICK_FROM_FULL_IMAGE;
   sf->use_fast_coef_updates = TWO_LOOP;
   sf->use_fast_coef_costing = 0;
@@ -567,12 +562,6 @@
   else if (oxcf->mode == GOOD)
     set_good_speed_feature(cpi, cm, sf, oxcf->speed);
 
-#if CONFIG_REF_MV
-  // TODO(geza): Temporarily turn this off for ref-mv to fix tests.
-  //             Investigate/reimplement skip_recode better to enable this.
-  sf->allow_skip_recode = 0;
-#endif  // CONFIG_REF_MV
-
   // sf->partition_search_breakout_dist_thr is set assuming max 64x64
   // blocks. Normalise this if the blocks are bigger.
   if (MAX_SB_SIZE_LOG2 > 6) {
diff --git a/vp10/encoder/speed_features.h b/vp10/encoder/speed_features.h
index dc966e9..2ddf4be 100644
--- a/vp10/encoder/speed_features.h
+++ b/vp10/encoder/speed_features.h
@@ -288,10 +288,6 @@
   // mode to be evaluated. A high value means we will be faster.
   int adaptive_rd_thresh;
 
-  // Speed feature to allow or disallow skipping of recode at block
-  // level within a frame.
-  int allow_skip_recode;
-
   // Coefficient probability model approximation step size
   int coeff_prob_appx_step;