Commit 6fd71e1b authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

vp9_get_pred_context_intra_inter() clean up.

Renaming:
 vp9_get_pred_context_intra_inter => vp9_get_intra_inter_context
 vp9_get_pred_prob_intra_inter    => vp9_get_intra_inter_prob

Change-Id: I2c1affea2e84f4e616137c6df82adb11c7845781
parent da519166
......@@ -60,13 +60,11 @@ unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
return SWITCHABLE_FILTERS;
}
// Returns a context number for the given MB prediction signal
unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) {
const MODE_INFO *const above_mi = get_above_mi(xd);
const MODE_INFO *const left_mi = get_left_mi(xd);
const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
const int above_in_image = above_mi != NULL;
const int left_in_image = left_mi != NULL;
int vp9_get_intra_inter_context(const MACROBLOCKD *xd) {
const MB_MODE_INFO *const above_mbmi = get_above_mbmi(get_above_mi(xd));
const MB_MODE_INFO *const left_mbmi = get_left_mbmi(get_left_mi(xd));
const int above_in_image = above_mbmi != NULL;
const int left_in_image = left_mbmi != NULL;
const int above_intra = above_in_image ? !is_inter_block(above_mbmi) : 1;
const int left_intra = left_in_image ? !is_inter_block(left_mbmi) : 1;
......
......@@ -61,12 +61,11 @@ static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd);
int vp9_get_intra_inter_context(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_intra_inter(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = vp9_get_pred_context_intra_inter(xd);
return cm->fc.intra_inter_prob[pred_context];
static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
return cm->fc.intra_inter_prob[vp9_get_intra_inter_context(xd)];
}
unsigned char vp9_get_pred_context_comp_inter_inter(const VP9_COMMON *cm,
......
......@@ -408,8 +408,8 @@ static int read_is_inter_block(VP9_COMMON *const cm, MACROBLOCKD *const xd,
return vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) !=
INTRA_FRAME;
} else {
const int ctx = vp9_get_pred_context_intra_inter(xd);
const int is_inter = vp9_read(r, vp9_get_pred_prob_intra_inter(cm, xd));
const int ctx = vp9_get_intra_inter_context(xd);
const int is_inter = vp9_read(r, cm->fc.intra_inter_prob[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.intra_inter[ctx][is_inter];
return is_inter;
......
......@@ -292,8 +292,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
skip_coeff = write_skip_coeff(cpi, segment_id, m, bc);
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME))
vp9_write(bc, rf != INTRA_FRAME,
vp9_get_pred_prob_intra_inter(cm, xd));
vp9_write(bc, rf != INTRA_FRAME, vp9_get_intra_inter_prob(cm, xd));
if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT &&
!(rf != INTRA_FRAME &&
......
......@@ -751,7 +751,7 @@ static void update_stats(VP9_COMP *cpi) {
SEG_LVL_REF_FRAME);
if (!seg_ref_active)
cpi->intra_inter_count[vp9_get_pred_context_intra_inter(xd)]
cpi->intra_inter_count[vp9_get_intra_inter_context(xd)]
[is_inter_block(mbmi)]++;
// If the segment reference feature is enabled we have only a single
......
......@@ -2145,7 +2145,7 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id,
vpx_memset(ref_costs_comp, 0, MAX_REF_FRAMES * sizeof(*ref_costs_comp));
*comp_mode_p = 128;
} else {
vp9_prob intra_inter_p = vp9_get_pred_prob_intra_inter(cm, xd);
vp9_prob intra_inter_p = vp9_get_intra_inter_prob(cm, xd);
vp9_prob comp_inter_p = 128;
if (cm->comp_pred_mode == REFERENCE_MODE_SELECT) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment