Remove CONFIG_EXT_SKIP flag

Change-Id: Id84dd812ad3a31a1b7889e8cafe746b763314213
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 99a9e1f..ec8a7b7 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -232,7 +232,6 @@
   }
 }
 
-#if CONFIG_EXT_SKIP
 static int write_skip_mode(const AV1_COMMON *cm, const MACROBLOCKD *xd,
                            int segment_id, const MODE_INFO *mi, aom_writer *w) {
   if (!cm->skip_mode_flag) return 0;
@@ -248,7 +247,6 @@
   aom_write_symbol(w, skip_mode, xd->tile_ctx->skip_mode_cdfs[ctx], 2);
   return skip_mode;
 }
-#endif  // CONFIG_EXT_SKIP
 
 static void write_is_inter(const AV1_COMMON *cm, const MACROBLOCKD *xd,
                            int segment_id, aom_writer *w, const int is_inter) {
@@ -1049,18 +1047,14 @@
 
   write_inter_segment_id(cpi, w, seg, segp, mi_row, mi_col, 0, 1);
 
-#if CONFIG_EXT_SKIP
   write_skip_mode(cm, xd, segment_id, mi, w);
 
   if (mbmi->skip_mode) {
     skip = mbmi->skip;
     assert(skip);
   } else {
-#endif  // CONFIG_EXT_SKIP
     skip = write_skip(cm, xd, segment_id, mi, w);
-#if CONFIG_EXT_SKIP
   }
-#endif  // CONFIG_EXT_SKIP
 
 #if CONFIG_SPATIAL_SEGMENTATION
   write_inter_segment_id(cpi, w, seg, segp, mi_row, mi_col, skip, 0);
@@ -1103,14 +1097,9 @@
     }
   }
 
-#if CONFIG_EXT_SKIP
-  if (!mbmi->skip_mode)
-#endif  // CONFIG_EXT_SKIP
-    write_is_inter(cm, xd, mbmi->segment_id, w, is_inter);
+  if (!mbmi->skip_mode) write_is_inter(cm, xd, mbmi->segment_id, w, is_inter);
 
-#if CONFIG_EXT_SKIP
   if (mbmi->skip_mode) return;
-#endif  // CONFIG_EXT_SKIP
 
   if (!is_inter) {
     write_intra_mode(ec_ctx, bsize, mode, w);
@@ -1497,7 +1486,6 @@
           refmv_ctx = (mode_ctx >> REFMV_OFFSET) & REFMV_CTX_MASK;
       }
 
-#if CONFIG_EXT_SKIP
       printf(
           "=== ENCODER ===: "
           "Frame=%d, (mi_row,mi_col)=(%d,%d), skip_mode=%d, mode=%d, bsize=%d, "
@@ -1509,19 +1497,6 @@
           mv[1].as_mv.row, mv[1].as_mv.col, mbmi->ref_frame[0],
           mbmi->ref_frame[1], mbmi->motion_mode, mode_ctx, newmv_ctx,
           zeromv_ctx, refmv_ctx, mbmi->tx_size);
-#else
-      printf(
-          "=== ENCODER ===: "
-          "Frame=%d, (mi_row,mi_col)=(%d,%d), mode=%d, bsize=%d, "
-          "show_frame=%d, mv[0]=(%d,%d), mv[1]=(%d,%d), ref[0]=%d, "
-          "ref[1]=%d, motion_mode=%d, mode_ctx=%d, "
-          "newmv_ctx=%d, zeromv_ctx=%d, refmv_ctx=%d, tx_size=%d\n",
-          cm->current_video_frame, mi_row, mi_col, mbmi->mode, bsize,
-          cm->show_frame, mv[0].as_mv.row, mv[0].as_mv.col, mv[1].as_mv.row,
-          mv[1].as_mv.col, mbmi->ref_frame[0], mbmi->ref_frame[1],
-          mbmi->motion_mode, mode_ctx, newmv_ctx, zeromv_ctx, refmv_ctx,
-          mbmi->tx_size);
-#endif  // CONFIG_EXT_SKIP
     }
   }
 }
@@ -1708,9 +1683,7 @@
   for (int plane = 0; plane < AOMMIN(2, av1_num_planes(cm)); ++plane) {
     const uint8_t palette_size_plane =
         mbmi->palette_mode_info.palette_size[plane];
-#if CONFIG_EXT_SKIP
     assert(!mbmi->skip_mode || !palette_size_plane);
-#endif  // CONFIG_EXT_SKIP
     if (palette_size_plane > 0) {
       assert(mbmi->use_intrabc == 0);
       assert(av1_allow_palette(cm->allow_screen_content_tools, mbmi->sb_type));
@@ -3400,13 +3373,7 @@
     aom_wb_write_bit(wb, use_hybrid_pred);
   }
 
-#if CONFIG_EXT_SKIP
-#if 0
-  printf("\n[ENCODER] Frame=%d, is_skip_mode_allowed=%d, skip_mode_flag=%d\n\n",
-         (int)cm->frame_offset, cm->is_skip_mode_allowed, cm->skip_mode_flag);
-#endif  // 0
   if (cm->is_skip_mode_allowed) aom_wb_write_bit(wb, cm->skip_mode_flag);
-#endif  // CONFIG_EXT_SKIP
 
   write_compound_tools(cm, wb);
 
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index 6829529..62faef7 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -237,7 +237,6 @@
   int skip_chroma_rd;
   int skip_cost[SKIP_CONTEXTS][2];
 
-#if CONFIG_EXT_SKIP
   int skip_mode;  // 0: off; 1: on
   int skip_mode_cost[SKIP_CONTEXTS][2];
 
@@ -252,7 +251,6 @@
 #endif  // CONFIG_JNT_COMP
   int skip_mode_index_candidate;
   int skip_mode_index;
-#endif  // CONFIG_EXT_SKIP
 
   LV_MAP_COEFF_COST coeff_costs[TX_SIZES][PLANE_TYPES];
   LV_MAP_EOB_COST eob_costs[7][2];
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 53abe84..4c22337 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -657,10 +657,8 @@
     // Set to zero to make sure we do not use the previous encoded frame stats
     mbmi->skip = 0;
 
-#if CONFIG_EXT_SKIP
     // Reset skip mode flag.
     mbmi->skip_mode = 0;
-#endif
   }
 
   x->skip_chroma_rd =
@@ -899,7 +897,6 @@
   const int seg_ref_active =
       segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
 
-#if CONFIG_EXT_SKIP
   if (cm->skip_mode_flag && !seg_ref_active && is_comp_ref_allowed(bsize)) {
     const int skip_mode_ctx = av1_get_skip_mode_context(xd);
     td->counts->skip_mode[skip_mode_ctx][mbmi->skip_mode]++;
@@ -908,15 +905,12 @@
   }
 
   if (!mbmi->skip_mode) {
-#endif  // CONFIG_EXT_SKIP
     if (!seg_ref_active) {
       const int skip_ctx = av1_get_skip_context(xd);
       td->counts->skip[skip_ctx][mbmi->skip]++;
       if (allow_update_cdf) update_cdf(fc->skip_cdfs[skip_ctx], mbmi->skip, 2);
     }
-#if CONFIG_EXT_SKIP
   }
-#endif  // CONFIG_EXT_SKIP
 
   if (cm->delta_q_present_flag &&
       (bsize != cm->seq_params.sb_size || !mbmi->skip) &&
@@ -984,7 +978,6 @@
 
     FRAME_COUNTS *const counts = td->counts;
 
-#if CONFIG_EXT_SKIP
     if (mbmi->skip_mode) {
       rdc->skip_mode_used_flag = 1;
       if (cm->reference_mode == REFERENCE_MODE_SELECT) {
@@ -994,7 +987,6 @@
       set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
       return;
     }
-#endif  // CONFIG_EXT_SKIP
 
     const int inter_block = is_inter_block(mbmi);
 
@@ -4121,7 +4113,6 @@
   }
 }
 
-#if CONFIG_EXT_SKIP
 static INLINE void get_skip_mode_ref_offsets(const AV1_COMMON *cm,
                                              int ref_offset[2]) {
   ref_offset[0] = ref_offset[1] = 0;
@@ -4169,7 +4160,6 @@
 
   return 1;
 }
-#endif  // CONFIG_EXT_SKIP
 
 static void encode_frame_internal(AV1_COMP *cpi) {
   ThreadData *const td = &cpi->td;
@@ -4469,9 +4459,7 @@
   cpi->all_one_sided_refs =
       frame_is_intra_only(cm) ? 0 : av1_refs_are_one_sided(cm);
 
-#if CONFIG_EXT_SKIP
   cm->skip_mode_flag = check_skip_mode_enabled(cpi);
-#endif  // CONFIG_EXT_SKIP
 
   {
     struct aom_usec_timer emr_timer;
@@ -4579,9 +4567,7 @@
     make_consistent_compound_tools(cm);
 
     rdc->compound_ref_used_flag = 0;
-#if CONFIG_EXT_SKIP
     rdc->skip_mode_used_flag = 0;
-#endif  // CONFIG_EXT_SKIP
 
     encode_frame_internal(cpi);
 
@@ -4598,7 +4584,6 @@
       }
     }
     make_consistent_compound_tools(cm);
-#if CONFIG_EXT_SKIP
     // Re-check on the skip mode status as reference mode may have been changed.
     if (frame_is_intra_only(cm) || cm->reference_mode == SINGLE_REFERENCE) {
       cm->is_skip_mode_allowed = 0;
@@ -4606,7 +4591,6 @@
     }
     if (cm->skip_mode_flag && rdc->skip_mode_used_flag == 0)
       cm->skip_mode_flag = 0;
-#endif  // CONFIG_EXT_SKIP
 
 #if CONFIG_EXT_TILE
     if (!cm->large_scale_tile) {
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index fd9d04a..4c49fa2 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -343,9 +343,7 @@
   // Stores number of 4x4 blocks using global motion per reference frame.
   int global_motion_used[TOTAL_REFS_PER_FRAME];
   int compound_ref_used_flag;
-#if CONFIG_EXT_SKIP
   int skip_mode_used_flag;
-#endif  // CONFIG_EXT_SKIP
 } RD_COUNTS;
 
 typedef struct ThreadData {
diff --git a/av1/encoder/ethread.c b/av1/encoder/ethread.c
index a505b0d..3540c12 100644
--- a/av1/encoder/ethread.c
+++ b/av1/encoder/ethread.c
@@ -24,9 +24,7 @@
 
   td->rd_counts.compound_ref_used_flag |=
       td_t->rd_counts.compound_ref_used_flag;
-#if CONFIG_EXT_SKIP
   td->rd_counts.skip_mode_used_flag |= td_t->rd_counts.skip_mode_used_flag;
-#endif  // CONFIG_EXT_SKIP
 }
 
 static int enc_worker_hook(EncWorkerData *const thread_data, void *unused) {
diff --git a/av1/encoder/rd.c b/av1/encoder/rd.c
index 50d8b9f..28a4c59 100644
--- a/av1/encoder/rd.c
+++ b/av1/encoder/rd.c
@@ -104,14 +104,12 @@
                                NULL);
   }
 
-#if CONFIG_EXT_SKIP
   if (cm->skip_mode_flag) {
     for (i = 0; i < SKIP_CONTEXTS; ++i) {
       av1_cost_tokens_from_cdf(x->skip_mode_cost[i], fc->skip_mode_cdfs[i],
                                NULL);
     }
   }
-#endif  // CONFIG_EXT_SKIP
 
   for (i = 0; i < SKIP_CONTEXTS; ++i) {
     av1_cost_tokens_from_cdf(x->skip_cost[i], fc->skip_cdfs[i], NULL);
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 7a79d9e..557b633 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -7553,7 +7553,6 @@
   return 0;
 }
 
-#if CONFIG_EXT_SKIP
 static int64_t skip_mode_rd(const AV1_COMP *const cpi, MACROBLOCK *const x,
                             BLOCK_SIZE bsize, int mi_row, int mi_col,
                             BUFFER_SET *const orig_dst) {
@@ -7593,7 +7592,6 @@
   restore_dst_buf(xd, *orig_dst, num_planes);
   return 0;
 }
-#endif  // CONFIG_EXT_SKIP
 
 static int64_t handle_inter_mode(
     const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
@@ -8591,7 +8589,6 @@
                                       int left_stride);
 #endif
 
-#if CONFIG_EXT_SKIP
 static void estimate_skip_mode_rdcost(
     const AV1_COMP *const cpi, TileDataEnc *tile_data, MACROBLOCK *const x,
     BLOCK_SIZE bsize, int mi_row, int mi_col,
@@ -8712,7 +8709,6 @@
     break;
   }
 }
-#endif  // CONFIG_EXT_SKIP
 
 void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
                                MACROBLOCK *x, int mi_row, int mi_col,
@@ -9061,10 +9057,8 @@
     for (ref_frame = 0; ref_frame < TOTAL_REFS_PER_FRAME; ++ref_frame)
       modelled_rd[i][ref_frame] = INT64_MAX;
 
-#if CONFIG_EXT_SKIP
   x->skip_mode_rdcost = -1;
   x->skip_mode_index = -1;
-#endif  // CONFIG_EXT_SKIP
 
   for (midx = 0; midx < MAX_MODES; ++midx) {
     int mode_index;
@@ -9080,9 +9074,7 @@
     uint8_t ref_frame_type;
 
     mode_index = mode_map[midx];
-#if CONFIG_EXT_SKIP
     x->skip_mode_index_candidate = mode_index;
-#endif  // CONFIG_EXT_SKIP
     this_mode = av1_mode_order[mode_index].mode;
     ref_frame = av1_mode_order[mode_index].ref_frame[0];
     second_ref_frame = av1_mode_order[mode_index].ref_frame[1];
@@ -10033,7 +10025,6 @@
   }
 PALETTE_EXIT:
 
-#if CONFIG_EXT_SKIP
   best_mbmode.skip_mode = 0;
   if (cm->skip_mode_flag &&
       !segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
@@ -10124,7 +10115,6 @@
 #endif  // 0
     }
   }
-#endif  // CONFIG_EXT_SKIP
 
   // The inter modes' rate costs are not calculated precisely in some cases.
   // Therefore, sometimes, NEWMV is chosen instead of NEARESTMV, NEARMV, and