shithub: libvpx

Download patch

ref: 30ab37019c59b166c34199e1ce215d78a8c196b2
parent: 9d41313e4bd28d3c504c26079cbe4a499e7eceb7
author: Jingning Han <jingning@google.com>
date: Mon Jun 30 05:49:48 EDT 2014

Remove unused set_mode_info function

When the frame is intra coded only, the encoder takes the RD
coding flow. Hence the function set_mode_info is not practically
in use. This commit removes it and the associated conditional
branches.

Change-Id: I1e42659ceb55b771ba712d1cdecacb446aa6460d

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2391,20 +2391,6 @@
   }
 }
 
-static void set_mode_info(MB_MODE_INFO *mbmi, BLOCK_SIZE bsize,
-                          PREDICTION_MODE mode) {
-  mbmi->mode = mode;
-  mbmi->uv_mode = mode;
-  mbmi->mv[0].as_int = 0;
-  mbmi->mv[1].as_int = 0;
-  mbmi->ref_frame[0] = INTRA_FRAME;
-  mbmi->ref_frame[1] = NONE;
-  mbmi->tx_size = max_txsize_lookup[bsize];
-  mbmi->skip = 0;
-  mbmi->sb_type = bsize;
-  mbmi->segment_id = 0;
-}
-
 static void nonrd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
                                 int mi_row, int mi_col,
                                 int *rate, int64_t *dist,
@@ -2417,19 +2403,15 @@
   mbmi = &xd->mi[0]->mbmi;
   mbmi->sb_type = bsize;
 
-  if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled) {
+  if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled)
     if (mbmi->segment_id && x->in_static_area)
       x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh);
-  }
 
-  if (!frame_is_intra_only(cm)) {
-    if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP))
-      set_mode_info_seg_skip(x, cm->tx_mode, rate, dist, bsize);
-    else
-      vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col, rate, dist, bsize);
-  } else {
-    set_mode_info(&xd->mi[0]->mbmi, bsize, DC_PRED);
-  }
+  if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP))
+    set_mode_info_seg_skip(x, cm->tx_mode, rate, dist, bsize);
+  else
+    vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col, rate, dist, bsize);
+
   duplicate_mode_info_in_sb(cm, xd, mi_row, mi_col, bsize);
 }
 
@@ -3040,7 +3022,7 @@
       vp9_tile_init(&tile, cm, tile_row, tile_col);
       for (mi_row = tile.mi_row_start; mi_row < tile.mi_row_end;
            mi_row += MI_BLOCK_SIZE) {
-        if (cpi->sf.use_nonrd_pick_mode && cm->frame_type != KEY_FRAME)
+        if (cpi->sf.use_nonrd_pick_mode && !frame_is_intra_only(cm))
           encode_nonrd_sb_row(cpi, &tile, mi_row, &tok);
         else
           encode_rd_sb_row(cpi, &tile, mi_row, &tok);