Removing redundant struct from union b_mode_info.

Change-Id: I08fc6e474ff2c12cfa065bae4989c724276e2c83
This commit is contained in:
Dmitry Kovalev
2013-07-02 16:51:57 -07:00
parent b0520b61ed
commit be77f6bbbf
9 changed files with 28 additions and 30 deletions

View File

@@ -127,9 +127,7 @@ typedef enum {
is a single probability table. */ is a single probability table. */
union b_mode_info { union b_mode_info {
struct { MB_PREDICTION_MODE as_mode;
MB_PREDICTION_MODE first;
} as_mode;
int_mv as_mv[2]; // first, second inter predictor motion vectors 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 DCT_DCT;
return mode2txfm_map[mbmi->sb_type < BLOCK_SIZE_SB8X8 ? 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) { static INLINE TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd) {

View 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) { if (cur_mb->mbmi.ref_frame[0] != INTRA_FRAME) {
return DC_PRED; return DC_PRED;
} else if (cur_mb->mbmi.sb_type < BLOCK_SIZE_SB8X8) { } 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 { } else {
return cur_mb->mbmi.mode; return cur_mb->mbmi.mode;
} }
} }
assert(b == 1 || b == 3); 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, 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) { if (cur_mb->mbmi.ref_frame[0] != INTRA_FRAME) {
return DC_PRED; return DC_PRED;
} else if (cur_mb->mbmi.sb_type < BLOCK_SIZE_SB8X8) { } 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 { } else {
return cur_mb->mbmi.mode; 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_ #endif // VP9_COMMON_VP9_FINDNEARMV_H_

View File

@@ -936,9 +936,9 @@ int vp9_post_proc_frame(VP9_COMMON *oci, YV12_BUFFER_CONFIG *dest,
for (bx = 0; bx < 16; bx += 4) { for (bx = 0; bx < 16; bx += 4) {
if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode)) if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode))
|| (ppflags->display_mb_modes_flag & I4X4_PRED)) { || (ppflags->display_mb_modes_flag & I4X4_PRED)) {
Y = B_PREDICTION_MODE_colors[bmi->as_mode.first][0]; Y = B_PREDICTION_MODE_colors[bmi->as_mode][0];
U = B_PREDICTION_MODE_colors[bmi->as_mode.first][1]; U = B_PREDICTION_MODE_colors[bmi->as_mode][1];
V = B_PREDICTION_MODE_colors[bmi->as_mode.first][2]; V = B_PREDICTION_MODE_colors[bmi->as_mode][2];
vp9_blend_b(yl + bx, ul + (bx >> 1), vl + (bx >> 1), Y, U, V, vp9_blend_b(yl + bx, ul + (bx >> 1), vl + (bx >> 1), Y, U, V,
0xc000, y_stride); 0xc000, y_stride);

View File

@@ -162,15 +162,15 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
left_block_mode(m, ib) : DC_PRED; left_block_mode(m, ib) : DC_PRED;
const MB_PREDICTION_MODE b_mode = read_intra_mode(r, const MB_PREDICTION_MODE b_mode = read_intra_mode(r,
cm->kf_y_mode_prob[A][L]); 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) if (bh == 2)
m->bmi[ib + 2].as_mode.first = b_mode; m->bmi[ib + 2].as_mode = b_mode;
if (bw == 2) 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]); 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) { for (idx = 0; idx < 2; idx += bw) {
const int ib = idy * 2 + idx; const int ib = idy * 2 + idx;
const int b_mode = read_intra_mode(r, cm->fc.y_mode_prob[0]); 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]++; cm->fc.y_mode_counts[0][b_mode]++;
if (bh == 2) if (bh == 2)
mi->bmi[ib + 2].as_mode.first = b_mode; mi->bmi[ib + 2].as_mode = b_mode;
if (bw == 2) 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]); mbmi->uv_mode = read_intra_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);

View 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) { if (plane == 0 && mi->mbmi.sb_type < BLOCK_SIZE_SB8X8) {
assert(bsize == 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 { } else {
b_mode = mode; b_mode = mode;
} }

View 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); int bh = 1 << b_height_log2(mi->sb_type);
for (idy = 0; idy < 2; idy += bh) for (idy = 0; idy < 2; idy += bh)
for (idx = 0; idx < 2; idx += bw) { 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]); 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 A = above_block_mode(m, i, mis);
const MB_PREDICTION_MODE L = (xd->left_available || idx) ? const MB_PREDICTION_MODE L = (xd->left_available || idx) ?
left_block_mode(m, i) : DC_PRED; 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 #ifdef ENTROPY_STATS
++intra_mode_stats[A][L][bm]; ++intra_mode_stats[A][L][bm];
#endif #endif

View 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); int bh = 1 << b_height_log2(xd->mode_info_context->mbmi.sb_type);
for (idy = 0; idy < 2; idy += bh) { for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) { 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]; ++cpi->y_mode_count[0][m];
} }
} }

View File

@@ -616,7 +616,7 @@ void encode_block_intra(int plane, int block, BLOCK_SIZE_TYPE bsize,
if (plane == 0 && if (plane == 0 &&
mbmi->sb_type < BLOCK_SIZE_SB8X8 && mbmi->sb_type < BLOCK_SIZE_SB8X8 &&
mbmi->ref_frame[0] == INTRA_FRAME) 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 else
b_mode = mode; b_mode = mode;

View File

@@ -1198,7 +1198,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
int64_t ssz; int64_t ssz;
block = ib + idy * 2 + idx; 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, src = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
p->src.buf, src_stride); p->src.buf, src_stride);
src_diff = raster_block_offset_int16(xd, BLOCK_SIZE_SB8X8, 0, block, 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 (idy = 0; idy < bh; ++idy) {
for (idx = 0; idx < bw; ++idx) { for (idx = 0; idx < bw; ++idx) {
block = ib + idy * 2 + 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, dst = raster_block_offset_uint8(xd, BLOCK_SIZE_SB8X8, 0, block,
pd->dst.buf, pd->dst.buf,
pd->dst.stride); pd->dst.stride);
@@ -1331,11 +1331,11 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
distortion += d; distortion += d;
tot_rate_y += ry; 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) 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) 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) if (total_rd >= best_rd)
break; break;
@@ -1348,7 +1348,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb,
*Rate = cost; *Rate = cost;
*rate_y = tot_rate_y; *rate_y = tot_rate_y;
*Distortion = distortion; *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); return RDCOST(mb->rdmult, mb->rddiv, cost, distortion);
} }