Merge "Inlining and removing vp9_set_pred_flag_seg_id() function."
This commit is contained in:
commit
78d3adbb21
@ -396,10 +396,6 @@ unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) {
|
|||||||
return above_context + left_context > max_tx_size;
|
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,
|
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
|
||||||
BLOCK_SIZE bsize, int mi_row, int mi_col) {
|
BLOCK_SIZE bsize, int mi_row, int mi_col) {
|
||||||
const int mi_offset = mi_row * cm->mi_cols + mi_col;
|
const int mi_offset = mi_row * cm->mi_cols + mi_col;
|
||||||
|
@ -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)];
|
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) {
|
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 above_mi = get_above_mi(xd);
|
||||||
const MODE_INFO *const left_mi = get_left_mi(xd);
|
const MODE_INFO *const left_mi = get_left_mi(xd);
|
||||||
|
@ -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,
|
static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
|
||||||
int mi_row, int mi_col, vp9_reader *r) {
|
int mi_row, int mi_col, vp9_reader *r) {
|
||||||
struct segmentation *const seg = &cm->seg;
|
struct segmentation *const seg = &cm->seg;
|
||||||
const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
|
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
|
||||||
int pred_segment_id, segment_id;
|
const BLOCK_SIZE bsize = mbmi->sb_type;
|
||||||
|
int predicted_segment_id, segment_id;
|
||||||
|
|
||||||
if (!seg->enabled)
|
if (!seg->enabled)
|
||||||
return 0; // Default for disabled segmentation
|
return 0; // Default for disabled segmentation
|
||||||
|
|
||||||
pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
|
predicted_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
|
||||||
bsize, mi_row, mi_col);
|
bsize, mi_row, mi_col);
|
||||||
if (!seg->update_map)
|
if (!seg->update_map)
|
||||||
return pred_segment_id;
|
return predicted_segment_id;
|
||||||
|
|
||||||
if (seg->temporal_update) {
|
if (seg->temporal_update) {
|
||||||
const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
|
const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
|
||||||
const int pred_flag = vp9_read(r, pred_prob);
|
mbmi->seg_id_predicted = vp9_read(r, pred_prob);
|
||||||
vp9_set_pred_flag_seg_id(xd, pred_flag);
|
segment_id = mbmi->seg_id_predicted ? predicted_segment_id
|
||||||
segment_id = pred_flag ? pred_segment_id
|
: read_segment_id(r, seg);
|
||||||
: read_segment_id(r, seg);
|
|
||||||
} else {
|
} else {
|
||||||
segment_id = read_segment_id(r, seg);
|
segment_id = read_segment_id(r, seg);
|
||||||
}
|
}
|
||||||
|
@ -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
|
// Store the prediction status for this mb and update counts
|
||||||
// as appropriate
|
// 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]++;
|
temporal_predictor_count[pred_context][pred_flag]++;
|
||||||
|
|
||||||
if (!pred_flag)
|
if (!pred_flag)
|
||||||
|
Loading…
Reference in New Issue
Block a user