From 52b43a287679f195b9bfefcd7d68b2b2f3f1f07d Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Fri, 22 Nov 2013 17:32:11 -0800 Subject: [PATCH] Inlining and removing vp9_set_pred_flag_seg_id() function. Change-Id: I0fd76937e847f78378a7ab3fa0af00a7c2c52b42 --- vp9/common/vp9_pred_common.c | 4 ---- vp9/common/vp9_pred_common.h | 2 -- vp9/decoder/vp9_decodemv.c | 18 +++++++++--------- vp9/encoder/vp9_segmentation.c | 2 +- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/vp9/common/vp9_pred_common.c b/vp9/common/vp9_pred_common.c index 6018e1775..22b66b57a 100644 --- a/vp9/common/vp9_pred_common.c +++ b/vp9/common/vp9_pred_common.c @@ -396,10 +396,6 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) { return above_context + left_context > max_tx_size; } -void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag) { - xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag; -} - int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids, BLOCK_SIZE bsize, int mi_row, int mi_col) { const int mi_offset = mi_row * cm->mi_cols + mi_col; diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h index 919093080..b6f18e323 100644 --- a/vp9/common/vp9_pred_common.h +++ b/vp9/common/vp9_pred_common.h @@ -40,8 +40,6 @@ static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg, return seg->pred_probs[vp9_get_pred_context_seg_id(xd)]; } -void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag); - static INLINE int vp9_get_pred_context_mbskip(const MACROBLOCKD *xd) { const MODE_INFO *const above_mi = get_above_mi(xd); const MODE_INFO *const left_mi = get_left_mi(xd); diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c index 9c1f61000..75f0ae865 100644 --- a/vp9/decoder/vp9_decodemv.c +++ b/vp9/decoder/vp9_decodemv.c @@ -123,23 +123,23 @@ static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd, int mi_row, int mi_col, vp9_reader *r) { struct segmentation *const seg = &cm->seg; - const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type; - int pred_segment_id, segment_id; + MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi; + const BLOCK_SIZE bsize = mbmi->sb_type; + int predicted_segment_id, segment_id; if (!seg->enabled) return 0; // Default for disabled segmentation - pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map, - bsize, mi_row, mi_col); + predicted_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map, + bsize, mi_row, mi_col); if (!seg->update_map) - return pred_segment_id; + return predicted_segment_id; if (seg->temporal_update) { const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd); - const int pred_flag = vp9_read(r, pred_prob); - vp9_set_pred_flag_seg_id(xd, pred_flag); - segment_id = pred_flag ? pred_segment_id - : read_segment_id(r, seg); + mbmi->seg_id_predicted = vp9_read(r, pred_prob); + segment_id = mbmi->seg_id_predicted ? predicted_segment_id + : read_segment_id(r, seg); } else { segment_id = read_segment_id(r, seg); } diff --git a/vp9/encoder/vp9_segmentation.c b/vp9/encoder/vp9_segmentation.c index 24f011f83..a9cdc9a67 100644 --- a/vp9/encoder/vp9_segmentation.c +++ b/vp9/encoder/vp9_segmentation.c @@ -149,7 +149,7 @@ static void count_segs(VP9_COMP *cpi, const TileInfo *const tile, // Store the prediction status for this mb and update counts // as appropriate - vp9_set_pred_flag_seg_id(xd, pred_flag); + xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag; temporal_predictor_count[pred_context][pred_flag]++; if (!pred_flag)