Merge "Removing redundant struct from union b_mode_info."

This commit is contained in:
Dmitry Kovalev 2013-07-02 18:09:31 -07:00 committed by Gerrit Code Review
commit 1f6e95e76a
9 changed files with 28 additions and 30 deletions

View 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) {

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) {
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_

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) {
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);

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;
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]);

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) {
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;
}

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);
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

View File

@ -2142,7 +2142,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];
}
}

View 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;

View 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);
}