]> granicus.if.org Git - libvpx/commitdiff
Removing redundant struct from union b_mode_info.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 2 Jul 2013 23:51:57 +0000 (16:51 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 2 Jul 2013 23:51:57 +0000 (16:51 -0700)
Change-Id: I08fc6e474ff2c12cfa065bae4989c724276e2c83

vp9/common/vp9_blockd.h
vp9/common/vp9_findnearmv.h
vp9/common/vp9_postproc.c
vp9/decoder/vp9_decodemv.c
vp9/decoder/vp9_decodframe.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_rdopt.c

index fb5a58a4c8288079c8a0b576e32c29604df72b95..55079421806a0b2180b0638bf7c029e75596e5f9 100644 (file)
@@ -127,9 +127,7 @@ typedef enum {
    is a single probability table. */
 
 union b_mode_info {
-  struct {
-    MB_PREDICTION_MODE first;
-  } as_mode;
+  MB_PREDICTION_MODE as_mode;
   int_mv as_mv[2];  // first, second inter predictor motion vectors
 };
 
@@ -491,7 +489,7 @@ static INLINE TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
     return DCT_DCT;
 
   return mode2txfm_map[mbmi->sb_type < BLOCK_SIZE_SB8X8 ?
-                       mi->bmi[ib].as_mode.first : mbmi->mode];
+                       mi->bmi[ib].as_mode : mbmi->mode];
 }
 
 static INLINE TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd) {
index d4ae2102dcce6426d2d21144a6ced703b4470c7c..d68572b7bd867de8d5d1cd0c8e78278463a8e83c 100644 (file)
@@ -86,13 +86,13 @@ static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) {
     if (cur_mb->mbmi.ref_frame[0] != INTRA_FRAME) {
       return DC_PRED;
     } else if (cur_mb->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
-      return ((cur_mb->bmi + 1 + b)->as_mode.first);
+      return ((cur_mb->bmi + 1 + b)->as_mode);
     } else {
       return cur_mb->mbmi.mode;
     }
   }
   assert(b == 1 || b == 3);
-  return (cur_mb->bmi + b - 1)->as_mode.first;
+  return (cur_mb->bmi + b - 1)->as_mode;
 }
 
 static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
@@ -104,13 +104,13 @@ static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb,
     if (cur_mb->mbmi.ref_frame[0] != INTRA_FRAME) {
       return DC_PRED;
     } else if (cur_mb->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
-      return ((cur_mb->bmi + 2 + b)->as_mode.first);
+      return ((cur_mb->bmi + 2 + b)->as_mode);
     } else {
       return cur_mb->mbmi.mode;
     }
   }
 
-  return (cur_mb->bmi + b - 2)->as_mode.first;
+  return (cur_mb->bmi + b - 2)->as_mode;
 }
 
 #endif  // VP9_COMMON_VP9_FINDNEARMV_H_
index 4282ddd1c39debb2d5064dc7ed2b016be639aa9a..728a641aabbac35a5480d0cf262ca4f8efbea1a7 100644 (file)
@@ -936,9 +936,9 @@ int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest,
             for (bx = 0; bx < 16; bx += 4) {
               if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode))
                   || (ppflags->display_mb_modes_flag & I4X4_PRED)) {
-                Y = B_PREDICTION_MODE_colors[bmi->as_mode.first][0];
-                U = B_PREDICTION_MODE_colors[bmi->as_mode.first][1];
-                V = B_PREDICTION_MODE_colors[bmi->as_mode.first][2];
+                Y = B_PREDICTION_MODE_colors[bmi->as_mode][0];
+                U = B_PREDICTION_MODE_colors[bmi->as_mode][1];
+                V = B_PREDICTION_MODE_colors[bmi->as_mode][2];
 
                 vp9_blend_b(yl + bx, ul + (bx >> 1), vl + (bx >> 1), Y, U, V,
                     0xc000, y_stride);
index 1e21d7b2f1051538848e76b23eb93b9c306c634b..875561b46e4b112e72cfecc40139dcc0e460e6b6 100644 (file)
@@ -162,15 +162,15 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
                                       left_block_mode(m, ib) : DC_PRED;
         const MB_PREDICTION_MODE b_mode = read_intra_mode(r,
                                               cm->kf_y_mode_prob[A][L]);
-        m->bmi[ib].as_mode.first = b_mode;
+        m->bmi[ib].as_mode = b_mode;
         if (bh == 2)
-          m->bmi[ib + 2].as_mode.first = b_mode;
+          m->bmi[ib + 2].as_mode = b_mode;
         if (bw == 2)
-          m->bmi[ib + 1].as_mode.first = b_mode;
+          m->bmi[ib + 1].as_mode = b_mode;
       }
     }
 
-    mbmi->mode = m->bmi[3].as_mode.first;
+    mbmi->mode = m->bmi[3].as_mode;
   }
 
   mbmi->uv_mode = read_intra_mode(r, cm->kf_uv_mode_prob[mbmi->mode]);
@@ -432,16 +432,16 @@ static void read_intra_block_modes(VP9D_COMP *pbi, MODE_INFO *mi,
        for (idx = 0; idx < 2; idx += bw) {
          const int ib = idy * 2 + idx;
          const int b_mode = read_intra_mode(r, cm->fc.y_mode_prob[0]);
-         mi->bmi[ib].as_mode.first = b_mode;
+         mi->bmi[ib].as_mode = b_mode;
          cm->fc.y_mode_counts[0][b_mode]++;
 
          if (bh == 2)
-           mi->bmi[ib + 2].as_mode.first = b_mode;
+           mi->bmi[ib + 2].as_mode = b_mode;
          if (bw == 2)
-           mi->bmi[ib + 1].as_mode.first = b_mode;
+           mi->bmi[ib + 1].as_mode = b_mode;
       }
     }
-    mbmi->mode = mi->bmi[3].as_mode.first;
+    mbmi->mode = mi->bmi[3].as_mode;
   }
 
   mbmi->uv_mode = read_intra_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);
index 76180e7750a958147a41119de475f791c9c422f3..87253a9996e8364bdaca5d36d9cb6dc5af5e4a4a 100644 (file)
@@ -149,7 +149,7 @@ static void decode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
 
   if (plane == 0 && mi->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
     assert(bsize == BLOCK_SIZE_SB8X8);
-    b_mode = mi->bmi[raster_block].as_mode.first;
+    b_mode = mi->bmi[raster_block].as_mode;
   } else {
     b_mode = mode;
   }
index ec54dc51d348ccf10898288246303a33374b16a3..fd8945fe804daba98a5970b4213300e8373faa73 100644 (file)
@@ -457,7 +457,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
       int bh = 1 << b_height_log2(mi->sb_type);
       for (idy = 0; idy < 2; idy += bh)
         for (idx = 0; idx < 2; idx += bw) {
-          MB_PREDICTION_MODE bm = m->bmi[idy * 2 + idx].as_mode.first;
+          const MB_PREDICTION_MODE bm = m->bmi[idy * 2 + idx].as_mode;
           write_intra_mode(bc, bm, pc->fc.y_mode_prob[0]);
         }
     }
@@ -583,7 +583,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
         const MB_PREDICTION_MODE A = above_block_mode(m, i, mis);
         const MB_PREDICTION_MODE L = (xd->left_available || idx) ?
                                      left_block_mode(m, i) : DC_PRED;
-        const int bm = m->bmi[i].as_mode.first;
+        const int bm = m->bmi[i].as_mode;
 #ifdef ENTROPY_STATS
         ++intra_mode_stats[A][L][bm];
 #endif
index 2c833ab536e085881daf734437fcc3dda778f35b..f86e4f23f7b852517b42efcc9a1768e78f8767fa 100644 (file)
@@ -2141,7 +2141,7 @@ static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
     int bh = 1 << b_height_log2(xd->mode_info_context->mbmi.sb_type);
     for (idy = 0; idy < 2; idy += bh) {
       for (idx = 0; idx < 2; idx += bw) {
-        int m = xd->mode_info_context->bmi[idy * 2 + idx].as_mode.first;
+        int m = xd->mode_info_context->bmi[idy * 2 + idx].as_mode;
         ++cpi->y_mode_count[0][m];
       }
     }
index d424f47f4f218d42eb5288ed0e04c7dde7757342..16d2fe955f3b848ab1462b20fc0e6bdaf602ad5e 100644 (file)
@@ -616,7 +616,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
   if (plane == 0 &&
       mbmi->sb_type < BLOCK_SIZE_SB8X8 &&
       mbmi->ref_frame[0] == INTRA_FRAME)
-    b_mode = xd->mode_info_context->bmi[ib].as_mode.first;
+    b_mode = xd->mode_info_context->bmi[ib].as_mode;
   else
     b_mode = mode;
 
index 62516231a0b5e3133ddad20b72cc63e450244d86..06f90d6cb958847d933b411e183f6127fcc5a0b2 100644 (file)
@@ -1198,7 +1198,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
         int64_t ssz;
 
         block = ib + idy * 2 + idx;
-        xd->mode_info_context->bmi[block].as_mode.first = mode;
+        xd->mode_info_context->bmi[block].as_mode = mode;
         src = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
                                         p->src.buf, src_stride);
         src_diff = raster_block_offset_int16(xd, BLOCK_SIZE_SB8X8, 0, block,
@@ -1265,7 +1265,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
   for (idy = 0; idy < bh; ++idy) {
     for (idx = 0; idx < bw; ++idx) {
       block = ib + idy * 2 + idx;
-      xd->mode_info_context->bmi[block].as_mode.first = *best_mode;
+      xd->mode_info_context->bmi[block].as_mode = *best_mode;
       dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
                                       pd->dst.buf,
                                       pd->dst.stride);
@@ -1331,11 +1331,11 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
       distortion += d;
       tot_rate_y += ry;
 
-      mic->bmi[i].as_mode.first = best_mode;
+      mic->bmi[i].as_mode = best_mode;
       for (j = 1; j < bh; ++j)
-        mic->bmi[i + j * 2].as_mode.first = best_mode;
+        mic->bmi[i + j * 2].as_mode = best_mode;
       for (j = 1; j < bw; ++j)
-        mic->bmi[i + j].as_mode.first = best_mode;
+        mic->bmi[i + j].as_mode = best_mode;
 
       if (total_rd >= best_rd)
         break;
@@ -1348,7 +1348,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
   *Rate = cost;
   *rate_y = tot_rate_y;
   *Distortion = distortion;
-  xd->mode_info_context->mbmi.mode = mic->bmi[3].as_mode.first;
+  xd->mode_info_context->mbmi.mode = mic->bmi[3].as_mode;
 
   return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
 }