ref: 1a3641d91b7179631113ece6c0f4bb25ad9b881f
parent: adfc54a464ff82c7c2a39ae2f3df9d09415699a8
parent: 26fead7ecf7d390c6a6d9e25a3ae578d1ff07036
author: Paul Wilkins <[email protected]>
date: Wed Aug 14 22:12:48 EDT 2013
Merge "Renaming in MB_MODE_INFO"
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -38,7 +38,7 @@
for (i = 0; i < cm->mi_rows; i++) {
MODE_INFO *ptr = mi;
for (j = 0; j < cm->mi_cols; j++) {
- ptr->mbmi.mb_in_image = 1;
+ ptr->mbmi.in_image = 1;
ptr++; // Next element in the row
}
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -130,26 +130,26 @@
return mi_height_log2_lookup[sb_type];
}
+// This structure now relates to 8x8 block regions.
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
MV_REFERENCE_FRAME ref_frame[2];
TX_SIZE txfm_size;
- int_mv mv[2]; // for each reference frame used
+ int_mv mv[2]; // for each reference frame used
int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES];
int_mv best_mv, best_second_mv;
- uint8_t mb_mode_context[MAX_REF_FRAMES];
+ uint8_t mode_context[MAX_REF_FRAMES];
- unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
- unsigned char segment_id; // Segment id for current frame
+ unsigned char skip_coeff; // 0=need to decode coeffs, 1=no coefficients
+ unsigned char segment_id; // Segment id for this block.
// Flags used for prediction status of various bit-stream signals
unsigned char seg_id_predicted;
- // Indicates if the mb is part of the image (1) vs border (0)
- // This can be useful in determining whether the MB provides
- // a valid predictor
- unsigned char mb_in_image;
+ // Indicates if the block is part of the image (1) vs border (0)
+ // This can be useful in determining whether it provides a valid predictor
+ unsigned char in_image;
INTERPOLATIONFILTERTYPE interp_filter;
--- a/vp9/common/vp9_debugmodes.c
+++ b/vp9/common/vp9_debugmodes.c
@@ -57,7 +57,7 @@
print_mi_data(cm, mvs, "Partitions:", offsetof(MB_MODE_INFO, sb_type));
print_mi_data(cm, mvs, "Modes:", offsetof(MB_MODE_INFO, mode));
- print_mi_data(cm, mvs, "Skips:", offsetof(MB_MODE_INFO, mb_skip_coeff));
+ print_mi_data(cm, mvs, "Skips:", offsetof(MB_MODE_INFO, skip_coeff));
print_mi_data(cm, mvs, "Ref frame:", offsetof(MB_MODE_INFO, ref_frame[0]));
print_mi_data(cm, mvs, "Transform:", offsetof(MB_MODE_INFO, txfm_size));
print_mi_data(cm, mvs, "UV Modes:", offsetof(MB_MODE_INFO, uv_mode));
--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -263,7 +263,7 @@
// Determine the vertical edges that need filtering
for (c = 0; c < MI_BLOCK_SIZE && mi_col + c < cm->mi_cols; c += col_step) {
- const int skip_this = mi[c].mbmi.mb_skip_coeff
+ const int skip_this = mi[c].mbmi.skip_coeff
&& is_inter_block(&mi[c].mbmi);
// left edge of current unit is block/partition edge -> no skip
const int block_edge_left = b_width_log2(mi[c].mbmi.sb_type) ?
--- a/vp9/common/vp9_mvref_common.c
+++ b/vp9/common/vp9_mvref_common.c
@@ -281,7 +281,7 @@
Done:
- mbmi->mb_mode_context[ref_frame] = counter_to_context[context_counter];
+ mbmi->mode_context[ref_frame] = counter_to_context[context_counter];
// Clamp vectors
for (idx = 0; idx < MAX_MV_REF_CANDIDATES; ++idx)
--- a/vp9/common/vp9_postproc.c
+++ b/vp9/common/vp9_postproc.c
@@ -737,7 +737,7 @@
char zz[4];
int dc_diff = !(mi[mb_index].mbmi.mode != I4X4_PRED &&
mi[mb_index].mbmi.mode != SPLITMV &&
- mi[mb_index].mbmi.mb_skip_coeff);
+ mi[mb_index].mbmi.skip_coeff);
if (oci->frame_type == KEY_FRAME)
sprintf(zz, "a");
--- a/vp9/common/vp9_pred_common.c
+++ b/vp9/common/vp9_pred_common.c
@@ -21,8 +21,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
@@ -56,8 +56,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
const int left_intra = !is_inter_block(left_mbmi);
const int above_intra = !is_inter_block(above_mbmi);
@@ -83,8 +83,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-cm->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
@@ -128,8 +128,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-cm->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
const int left_intra = !is_inter_block(left_mbmi);
const int above_intra = !is_inter_block(above_mbmi);
@@ -206,8 +206,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
const int left_intra = !is_inter_block(left_mbmi);
const int above_intra = !is_inter_block(above_mbmi);
@@ -271,8 +271,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
const int left_intra = !is_inter_block(left_mbmi);
const int above_intra = !is_inter_block(above_mbmi);
@@ -361,18 +361,18 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
const int max_tx_size = max_txsize_lookup[mi->mbmi.sb_type];
int above_context = max_tx_size;
int left_context = max_tx_size;
if (above_in_image)
- above_context = above_mbmi->mb_skip_coeff ? max_tx_size
+ above_context = above_mbmi->skip_coeff ? max_tx_size
: above_mbmi->txfm_size;
if (left_in_image)
- left_context = left_mbmi->mb_skip_coeff ? max_tx_size
+ left_context = left_mbmi->skip_coeff ? max_tx_size
: left_mbmi->txfm_size;
if (!left_in_image)
@@ -409,7 +409,7 @@
for (y = 0; y < ymis; y++)
for (x = 0; x < xmis; x++)
- mi[y * cm->mode_info_stride + x].mbmi.mb_skip_coeff = pred_flag;
+ mi[y * cm->mode_info_stride + x].mbmi.skip_coeff = pred_flag;
}
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
--- a/vp9/common/vp9_pred_common.h
+++ b/vp9/common/vp9_pred_common.h
@@ -39,8 +39,8 @@
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- return above_mbmi->mb_skip_coeff +
- (xd->left_available ? left_mbmi->mb_skip_coeff : 0);
+ return above_mbmi->skip_coeff +
+ (xd->left_available ? left_mbmi->skip_coeff : 0);
}
static INLINE vp9_prob vp9_get_pred_prob_mbskip(const VP9_COMMON *cm,
@@ -49,7 +49,7 @@
}
static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
- return xd->mode_info_context->mbmi.mb_skip_coeff;
+ return xd->mode_info_context->mbmi.skip_coeff;
}
void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize,
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -159,7 +159,7 @@
const int mis = cm->mode_info_stride;
mbmi->segment_id = read_intra_segment_id(pbi, mi_row, mi_col, r);
- mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
+ mbmi->skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
mbmi->txfm_size = read_tx_size(pbi, cm->tx_mode, bsize, 1, r);
mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE;
@@ -457,7 +457,7 @@
ref0, mbmi->ref_mvs[ref0], cm->ref_frame_sign_bias,
mi_row, mi_col);
- inter_mode_ctx = mbmi->mb_mode_context[ref0];
+ inter_mode_ctx = mbmi->mode_context[ref0];
if (vp9_segfeature_active(&xd->seg, mbmi->segment_id, SEG_LVL_SKIP))
mbmi->mode = ZEROMV;
@@ -598,10 +598,10 @@
mbmi->mv[0].as_int = 0;
mbmi->mv[1].as_int = 0;
mbmi->segment_id = read_inter_segment_id(pbi, mi_row, mi_col, r);
- mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
+ mbmi->skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
inter_block = read_is_inter_block(pbi, mbmi->segment_id, r);
mbmi->txfm_size = read_tx_size(pbi, cm->tx_mode, mbmi->sb_type,
- !mbmi->mb_skip_coeff || !inter_block, r);
+ !mbmi->skip_coeff || !inter_block, r);
if (inter_block)
read_inter_block_mode_info(pbi, mi, mi_row, mi_col, r);
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -160,7 +160,7 @@
dst, pd->dst.stride);
// Early exit if there are no coefficients
- if (mi->mbmi.mb_skip_coeff)
+ if (mi->mbmi.skip_coeff)
return;
decode_block(plane, block, bsize, ss_txfrm_size, arg);
@@ -169,7 +169,7 @@
static int decode_tokens(VP9D_COMP *pbi, BLOCK_SIZE_TYPE bsize, vp9_reader *r) {
MACROBLOCKD *const xd = &pbi->mb;
- if (xd->mode_info_context->mbmi.mb_skip_coeff) {
+ if (xd->mode_info_context->mbmi.skip_coeff) {
reset_skip_context(xd, bsize);
return -1;
} else {
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -216,7 +216,7 @@
if (vp9_segfeature_active(&xd->seg, segment_id, SEG_LVL_SKIP)) {
return 1;
} else {
- const int skip_coeff = m->mbmi.mb_skip_coeff;
+ const int skip_coeff = m->mbmi.skip_coeff;
vp9_write(w, skip_coeff, vp9_get_pred_prob_mbskip(&cpi->common, xd));
return skip_coeff;
}
@@ -462,7 +462,7 @@
} else {
vp9_prob *mv_ref_p;
encode_ref_frame(cpi, bc);
- mv_ref_p = cpi->common.fc.inter_mode_probs[mi->mb_mode_context[rf]];
+ mv_ref_p = cpi->common.fc.inter_mode_probs[mi->mode_context[rf]];
#ifdef ENTROPY_STATS
active_section = 3;
@@ -472,7 +472,7 @@
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
if (bsize >= BLOCK_8X8) {
write_sb_mv_ref(bc, mode, mv_ref_p);
- ++pc->counts.inter_mode[mi->mb_mode_context[rf]]
+ ++pc->counts.inter_mode[mi->mode_context[rf]]
[inter_mode_offset(mode)];
}
}
@@ -499,7 +499,7 @@
blockmode = x->partition_info->bmi[j].mode;
blockmv = m->bmi[j].as_mv[0];
write_sb_mv_ref(bc, blockmode, mv_ref_p);
- ++pc->counts.inter_mode[mi->mb_mode_context[rf]]
+ ++pc->counts.inter_mode[mi->mode_context[rf]]
[inter_mode_offset(blockmode)];
if (blockmode == NEWMV) {
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1467,8 +1467,8 @@
const MODE_INFO *const mi = xd->mode_info_context;
const MB_MODE_INFO *const above_mbmi = &mi[-xd->mode_info_stride].mbmi;
const MB_MODE_INFO *const left_mbmi = &mi[-1].mbmi;
- const int left_in_image = xd->left_available && left_mbmi->mb_in_image;
- const int above_in_image = xd->up_available && above_mbmi->mb_in_image;
+ const int left_in_image = xd->left_available && left_mbmi->in_image;
+ const int above_in_image = xd->up_available && above_mbmi->in_image;
// Frequency check
if (cpi->sf.auto_min_max_partition_count <= 0) {
@@ -2180,7 +2180,7 @@
for (y = 0; y < ymbs; y++) {
for (x = 0; x < xmbs; x++) {
- if (!mi[y * mis + x].mbmi.mb_skip_coeff)
+ if (!mi[y * mis + x].mbmi.skip_coeff)
return 0;
}
}
@@ -2624,10 +2624,10 @@
vp9_encode_sb(cm, x, MAX(bsize, BLOCK_8X8));
vp9_tokenize_sb(cpi, t, !output_enabled, MAX(bsize, BLOCK_8X8));
} else {
- int mb_skip_context = xd->left_available ? (mi - 1)->mbmi.mb_skip_coeff : 0;
- mb_skip_context += (mi - mis)->mbmi.mb_skip_coeff;
+ int mb_skip_context = xd->left_available ? (mi - 1)->mbmi.skip_coeff : 0;
+ mb_skip_context += (mi - mis)->mbmi.skip_coeff;
- mbmi->mb_skip_coeff = 1;
+ mbmi->skip_coeff = 1;
if (output_enabled)
cm->counts.mbskip[mb_skip_context][1]++;
reset_skip_context(xd, MAX(bsize, BLOCK_8X8));
@@ -2635,13 +2635,13 @@
// copy skip flag on all mb_mode_info contexts in this SB
// if this was a skip at this txfm size
- vp9_set_pred_flag_mbskip(cm, bsize, mi_row, mi_col, mi->mbmi.mb_skip_coeff);
+ vp9_set_pred_flag_mbskip(cm, bsize, mi_row, mi_col, mi->mbmi.skip_coeff);
if (output_enabled) {
if (cm->tx_mode == TX_MODE_SELECT &&
mbmi->sb_type >= BLOCK_8X8 &&
!(is_inter_block(mbmi) &&
- (mbmi->mb_skip_coeff ||
+ (mbmi->skip_coeff ||
vp9_segfeature_active(&xd->seg, segment_id, SEG_LVL_SKIP)))) {
const uint8_t context = vp9_get_pred_context_tx_size(xd);
update_tx_counts(bsize, context, mbmi->txfm_size, &cm->counts.tx);
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1558,7 +1558,7 @@
}
cost = cost_mv_ref(cpi, this_mode,
- mbmi->mb_mode_context[mbmi->ref_frame[0]]);
+ mbmi->mode_context[mbmi->ref_frame[0]]);
mic->bmi[i].as_mv[0].as_int = this_mv->as_int;
if (mbmi->ref_frame[1] > 0)
@@ -1791,7 +1791,7 @@
frame_mv[this_mode][mbmi->ref_frame[0]].as_int == 0 &&
(mbmi->ref_frame[1] <= 0 ||
frame_mv[this_mode][mbmi->ref_frame[1]].as_int == 0)) {
- int rfc = mbmi->mb_mode_context[mbmi->ref_frame[0]];
+ int rfc = mbmi->mode_context[mbmi->ref_frame[0]];
int c1 = cost_mv_ref(cpi, NEARMV, rfc);
int c2 = cost_mv_ref(cpi, NEARESTMV, rfc);
int c3 = cost_mv_ref(cpi, ZEROMV, rfc);
@@ -2747,7 +2747,7 @@
frame_mv[refs[0]].as_int == 0 &&
!vp9_segfeature_active(&xd->seg, mbmi->segment_id, SEG_LVL_SKIP) &&
(num_refs == 1 || frame_mv[refs[1]].as_int == 0)) {
- int rfc = mbmi->mb_mode_context[mbmi->ref_frame[0]];
+ int rfc = mbmi->mode_context[mbmi->ref_frame[0]];
int c1 = cost_mv_ref(cpi, NEARMV, rfc);
int c2 = cost_mv_ref(cpi, NEARESTMV, rfc);
int c3 = cost_mv_ref(cpi, ZEROMV, rfc);
@@ -2804,7 +2804,7 @@
* words if you present them in that order, the second one is always known
* if the first is known */
*rate2 += cost_mv_ref(cpi, this_mode,
- mbmi->mb_mode_context[mbmi->ref_frame[0]]);
+ mbmi->mode_context[mbmi->ref_frame[0]]);
if (!(*mode_excluded)) {
if (is_comp_pred) {
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -278,8 +278,8 @@
SEG_LVL_SKIP);
struct tokenize_b_args arg = {cpi, xd, t, mbmi->txfm_size};
- mbmi->mb_skip_coeff = vp9_sb_is_skippable(xd, bsize);
- if (mbmi->mb_skip_coeff) {
+ mbmi->skip_coeff = vp9_sb_is_skippable(xd, bsize);
+ if (mbmi->skip_coeff) {
if (!dry_run)
cm->counts.mbskip[mb_skip_context][1] += skip_inc;
reset_skip_context(xd, bsize);