diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index b56193e..2882974 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -837,7 +837,7 @@
       block += step;
     }
   }
-  this_rdc->skip = *skippable;
+  this_rdc->skip_txfm = *skippable;
   this_rdc->rate = 0;
   if (*sse < INT64_MAX) {
     *sse = (*sse << 6) >> 2;
@@ -920,16 +920,16 @@
 
   // Take a snapshot of the coding context so it can be
   // restored if we decide to encode this way
-  ctx->rd_stats.skip = x->force_skip;
+  ctx->rd_stats.skip_txfm = x->skip_txfm;
   memset(ctx->blk_skip, 0, sizeof(ctx->blk_skip[0]) * ctx->num_4x4_blk);
   memset(ctx->tx_type_map, DCT_DCT,
          sizeof(ctx->tx_type_map[0]) * ctx->num_4x4_blk);
-  ctx->skippable = x->force_skip;
+  ctx->skippable = x->skip_txfm;
 #if CONFIG_INTERNAL_STATS
   ctx->best_mode_index = mode_index;
 #endif  // CONFIG_INTERNAL_STATS
   ctx->mic = *xd->mi[0];
-  ctx->skippable = x->force_skip;
+  ctx->skippable = x->skip_txfm;
   av1_copy_mbmi_ext_to_mbmi_ext_frame(&ctx->mbmi_ext_best, x->mbmi_ext,
                                       av1_ref_frame_type(xd->mi[0]->ref_frame));
   ctx->comp_pred_diff = 0;
@@ -1052,7 +1052,7 @@
 
   this_rdc->rate = 0;
   this_rdc->dist = 0;
-  this_rdc->skip = 0;
+  this_rdc->skip_txfm = 0;
 
   for (i = start_plane; i <= stop_plane; ++i) {
     struct macroblock_plane *const p = &x->plane[i];
@@ -1083,14 +1083,14 @@
   }
 
   if (this_rdc->rate == 0) {
-    this_rdc->skip = 1;
+    this_rdc->skip_txfm = 1;
   }
 
   if (RDCOST(x->rdmult, this_rdc->rate, this_rdc->dist) >=
       RDCOST(x->rdmult, 0, ((int64_t)tot_sse) << 4)) {
     this_rdc->rate = 0;
     this_rdc->dist = tot_sse << 4;
-    this_rdc->skip = 1;
+    this_rdc->skip_txfm = 1;
   }
 
   *var_y = tot_var;
@@ -1353,7 +1353,7 @@
   *var_y = pf_var[best_filter_index];
   *sse_y = pf_sse[best_filter_index];
   *sse_block_yrd = pf_sse_block_yrd[best_filter_index];
-  this_rdc->skip = (best_skip || best_early_term);
+  this_rdc->skip_txfm = (best_skip || best_early_term);
   *this_early_term = best_early_term;
   if (reuse_inter_pred) {
     pd->dst.buf = (*this_mode_pred)->data;
@@ -1452,9 +1452,9 @@
     av1_foreach_transformed_block_in_plane(xd, bsize, 0, estimate_block_intra,
                                            &args);
     if (args.skippable) {
-      this_rdc.rate = av1_cost_symbol(av1_get_skip_cdf(xd)[1]);
+      this_rdc.rate = av1_cost_symbol(av1_get_skip_txfm_cdf(xd)[1]);
     } else {
-      this_rdc.rate += av1_cost_symbol(av1_get_skip_cdf(xd)[0]);
+      this_rdc.rate += av1_cost_symbol(av1_get_skip_txfm_cdf(xd)[0]);
     }
     this_rdc.rate += bmode_costs[this_mode];
     this_rdc.rdcost = RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist);
@@ -1576,7 +1576,7 @@
     tmp[3].in_use = 0;
   }
 
-  x->force_skip = 0;
+  x->skip_txfm = 0;
 
   // Instead of using av1_get_pred_context_switchable_interp(xd) to assign
   // filter_ref, we use a less strict condition on assigning filter_ref.
@@ -1848,7 +1848,7 @@
                                   use_modeled_non_rd_cost);
       } else {
         model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist,
-                          &this_rdc.skip, NULL, &var_y, &sse_y,
+                          &this_rdc.skip_txfm, NULL, &var_y, &sse_y,
                           use_modeled_non_rd_cost);
       }
     }
@@ -1858,38 +1858,38 @@
           sse_y >> (b_width_log2_lookup[bsize] + b_height_log2_lookup[bsize]);
     }
 
-    const int skip_ctx = av1_get_skip_context(xd);
-    const int skip_cost = x->skip_cost[skip_ctx][1];
-    const int no_skip_cost = x->skip_cost[skip_ctx][0];
+    const int skip_ctx = av1_get_skip_txfm_context(xd);
+    const int skip_txfm_cost = x->skip_txfm_cost[skip_ctx][1];
+    const int no_skip_txfm_cost = x->skip_txfm_cost[skip_ctx][0];
     if (!this_early_term) {
       if (use_modeled_non_rd_cost) {
-        if (this_rdc.skip) {
-          this_rdc.rate = skip_cost;
+        if (this_rdc.skip_txfm) {
+          this_rdc.rate = skip_txfm_cost;
         } else {
-          this_rdc.rate += no_skip_cost;
+          this_rdc.rate += no_skip_txfm_cost;
         }
       } else {
         this_sse = (int64_t)sse_y;
         block_yrd(cpi, x, mi_row, mi_col, &this_rdc, &is_skippable, &this_sse,
                   bsize, mi->tx_size);
-        if (this_rdc.skip) {
-          this_rdc.rate = skip_cost;
+        if (this_rdc.skip_txfm) {
+          this_rdc.rate = skip_txfm_cost;
         } else {
           if (RDCOST(x->rdmult, this_rdc.rate, this_rdc.dist) >=
               RDCOST(x->rdmult, 0,
                      this_sse)) {  // this_sse already multiplied by 16 in
                                    // block_yrd
-            this_rdc.skip = 1;
-            this_rdc.rate = skip_cost;
+            this_rdc.skip_txfm = 1;
+            this_rdc.rate = skip_txfm_cost;
             this_rdc.dist = this_sse;
           } else {
-            this_rdc.rate += no_skip_cost;
+            this_rdc.rate += no_skip_txfm_cost;
           }
         }
       }
     } else {
-      this_rdc.skip = 1;
-      this_rdc.rate = skip_cost;
+      this_rdc.skip_txfm = 1;
+      this_rdc.rate = skip_txfm_cost;
       this_rdc.dist = sse_y << 4;
     }
 
@@ -1909,7 +1909,7 @@
       model_rd_for_sb_uv(cpi, uv_bsize, x, xd, &rdc_uv, &var_y, &sse_y, 1, 2);
       this_rdc.rate += rdc_uv.rate;
       this_rdc.dist += rdc_uv.dist;
-      this_rdc.skip = this_rdc.skip && rdc_uv.skip;
+      this_rdc.skip_txfm = this_rdc.skip_txfm && rdc_uv.skip_txfm;
     }
 
     // TODO(kyslov) account for UV prediction cost
@@ -1941,7 +1941,7 @@
       best_pickmode.best_pred_filter = mi->interp_filters;
       best_pickmode.best_tx_size = mi->tx_size;
       best_pickmode.best_ref_frame = ref_frame;
-      best_pickmode.best_mode_skip_txfm = this_rdc.skip;
+      best_pickmode.best_mode_skip_txfm = this_rdc.skip_txfm;
       best_pickmode.best_second_ref_frame = second_ref_frame;
       if (reuse_inter_pred) {
         free_pred_buffer(best_pickmode.best_pred);
@@ -1951,7 +1951,7 @@
       if (reuse_inter_pred) free_pred_buffer(this_mode_pred);
     }
     if (best_early_term && idx > 0) {
-      x->force_skip = 1;
+      x->skip_txfm = 1;
       break;
     }
   }
@@ -1964,7 +1964,7 @@
   mi->mv[0].as_int =
       frame_mv[best_pickmode.best_mode][best_pickmode.best_ref_frame].as_int;
   mi->ref_frame[1] = best_pickmode.best_second_ref_frame;
-  x->force_skip = best_rdc.skip;
+  x->skip_txfm = best_rdc.skip_txfm;
 
   // Perform intra prediction search, if the best SAD is above a certain
   // threshold.
@@ -2053,7 +2053,7 @@
       // Look into selecting tx_size here, based on prediction residual.
       if (use_modeled_non_rd_cost)
         model_rd_for_sb_y(cpi, bsize, x, xd, &this_rdc.rate, &this_rdc.dist,
-                          &this_rdc.skip, NULL, &var_y, &sse_y, 1);
+                          &this_rdc.skip_txfm, NULL, &var_y, &sse_y, 1);
       else
         block_yrd(cpi, x, mi_row, mi_col, &this_rdc, &args.skippable, &this_sse,
                   bsize, mi->tx_size);
