shithub: libvpx

Download patch

ref: a0b6b8a7d434373220a78f9b3a3e1e5b2802c64f
parent: 14a5c7285bdc612bdef75d929e7ed0e83f278ca9
parent: cba0a5db2b52ae814a56faaa6da4142d39daa55f
author: Dmitry Kovalev <dkovalev@google.com>
date: Wed May 8 07:23:14 EDT 2013

Merge "Removing unused code + little cleanup." into experimental

--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -313,11 +313,6 @@
 
 #define BLOCK_OFFSET(x, i, n) ((x) + (i) * (n))
 
-#define MB_SUBBLOCK_FIELD(x, field, i) (\
-  ((i) < 16) ? BLOCK_OFFSET((x)->plane[0].field, (i), 16) : \
-  ((i) < 20) ? BLOCK_OFFSET((x)->plane[1].field, ((i) - 16), 16) : \
-  BLOCK_OFFSET((x)->plane[2].field, ((i) - 20), 16))
-
 typedef struct macroblockd {
   struct macroblockd_plane plane[MAX_MB_PLANE];
 
--- a/vp9/common/vp9_entropy.c
+++ b/vp9/common/vp9_entropy.c
@@ -8,9 +8,6 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-
-#include <stdio.h>
-
 #include "vp9/common/vp9_entropy.h"
 #include "vp9/common/vp9_blockd.h"
 #include "vp9/common/vp9_onyxc_int.h"
@@ -18,8 +15,6 @@
 #include "vpx_mem/vpx_mem.h"
 #include "vpx/vpx_integer.h"
 #include "vp9/common/vp9_coefupdateprobs.h"
-
-const int vp9_i8x8_block[4] = {0, 2, 8, 10};
 
 DECLARE_ALIGNED(16, const uint8_t, vp9_norm[256]) = {
   0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -16,8 +16,6 @@
 #include "vp9/common/vp9_blockd.h"
 #include "vp9/common/vp9_common.h"
 
-extern const int vp9_i8x8_block[4];
-
 /* Coefficient token alphabet */
 
 #define ZERO_TOKEN              0       /* 0         Extra Bits 0+0 */
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -97,7 +97,7 @@
   return txfm_size;
 }
 
-extern const int vp9_i8x8_block[4];
+
 static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
                          int mi_row, int mi_col,
                          vp9_reader *r) {
@@ -403,14 +403,6 @@
 };
 #endif
 
-static const unsigned char mbsplit_fill_count[4] = { 8, 8, 4, 1 };
-static const unsigned char mbsplit_fill_offset[4][16] = {
-  { 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15 },
-  { 0,  1,  4,  5,  8,  9, 12, 13,  2,  3,   6,  7, 10, 11, 14, 15 },
-  { 0,  1,  4,  5,  2,  3,  6,  7,  8,  9,  12, 13, 10, 11, 14, 15 },
-  { 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15 }
-};
-
 static void read_switchable_interp_probs(VP9D_COMP* const pbi, vp9_reader *r) {
   VP9_COMMON *const cm = &pbi->common;
   int i, j;
@@ -849,10 +841,6 @@
     mbmi->uv_mode = read_uv_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);
     cm->fc.uv_mode_counts[mbmi->mode][mbmi->uv_mode]++;
   }
-  /*
-  if (cm->current_video_frame == 1)
-    printf("mode: %d skip: %d\n", mbmi->mode, mbmi->mb_skip_coeff);
-    */
 
   if (cm->txfm_mode == TX_MODE_SELECT && mbmi->mb_skip_coeff == 0 &&
       ((mbmi->ref_frame == INTRA_FRAME && mbmi->mode != I4X4_PRED) ||
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -9,7 +9,6 @@
  */
 
 #include <assert.h>
-#include <stdio.h>
 
 #include "vp9/decoder/vp9_onyxd_int.h"
 #include "vp9/common/vp9_common.h"
@@ -250,11 +249,11 @@
 
   for (i = 0; i < bc; i++) {
     int b_mode = xd->mode_info_context->bmi[i].as_mode.first;
-    uint8_t* dst;
-    dst = raster_block_offset_uint8(xd, bsize, 0, i,
-                                    xd->plane[0].dst.buf,
-                                    xd->plane[0].dst.stride);
 
+    uint8_t* dst = raster_block_offset_uint8(xd, bsize, 0, i,
+                                             xd->plane[0].dst.buf,
+                                             xd->plane[0].dst.stride);
+
     vp9_intra4x4_predict(xd, i, bsize, b_mode, dst, xd->plane[0].dst.stride);
     // TODO(jingning): refactor to use foreach_transformed_block_in_plane_
     tx_type = get_tx_type_4x4(xd, i);
@@ -459,12 +458,12 @@
       break;
     case PARTITION_HORZ:
       decode_modes_b(pbi, mi_row, mi_col, r, subsize);
-      if ((mi_row + bs) < pc->mi_rows)
+      if (mi_row + bs < pc->mi_rows)
         decode_modes_b(pbi, mi_row + bs, mi_col, r, subsize);
       break;
     case PARTITION_VERT:
       decode_modes_b(pbi, mi_row, mi_col, r, subsize);
-      if ((mi_col + bs) < pc->mi_cols)
+      if (mi_col + bs < pc->mi_cols)
         decode_modes_b(pbi, mi_row, mi_col + bs, r, subsize);
       break;
     case PARTITION_SPLIT:
@@ -819,9 +818,8 @@
     vpx_memset(&pc->left_context, 0, sizeof(pc->left_context));
     vpx_memset(pc->left_seg_context, 0, sizeof(pc->left_seg_context));
     for (mi_col = pc->cur_tile_mi_col_start;
-         mi_col < pc->cur_tile_mi_col_end; mi_col += 8) {
+         mi_col < pc->cur_tile_mi_col_end; mi_col += 8)
       decode_modes_sb(pbi, mi_row, mi_col, r, BLOCK_SIZE_SB64X64);
-    }
   }
 }