Commit afe43d40 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Removing redundant VP9_COMMON* from function signatures.

Functions: vp9_get_pred_context_switchable_interp,
           vp9_get_pred_context_intra_inter,
           vp9_get_pred_context_single_ref_p1,
           vp9_get_pred_context_single_ref_p2.

Change-Id: I3d6fb8aee23c9062270768e1e6da416dd9bb8f96
parent 561fb31d
......@@ -17,10 +17,9 @@
#include "vp9/common/vp9_treecoder.h"
// Returns a context number for the given MB prediction signal
unsigned char vp9_get_pred_context_switchable_interp(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
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 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;
......@@ -55,11 +54,10 @@ unsigned char vp9_get_pred_context_switchable_interp(const VP9_COMMON *cm,
return VP9_SWITCHABLE_FILTERS;
}
// Returns a context number for the given MB prediction signal
unsigned char vp9_get_pred_context_intra_inter(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) {
int pred_context;
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 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;
......@@ -211,11 +209,10 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
return pred_context;
}
unsigned char vp9_get_pred_context_single_ref_p1(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
int pred_context;
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 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;
......@@ -277,11 +274,10 @@ unsigned char vp9_get_pred_context_single_ref_p1(const VP9_COMMON *cm,
return pred_context;
}
unsigned char vp9_get_pred_context_single_ref_p2(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
int pred_context;
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 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;
......
......@@ -55,21 +55,19 @@ static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
void vp9_set_pred_flag_mbskip(VP9_COMMON *cm, BLOCK_SIZE_TYPE bsize,
int mi_row, int mi_col, uint8_t pred_flag);
unsigned char vp9_get_pred_context_switchable_interp(const VP9_COMMON *cm,
const MACROBLOCKD *xd);
unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
static INLINE const vp9_prob *vp9_get_pred_probs_switchable_interp(
const VP9_COMMON *cm, const MACROBLOCKD *xd) {
const int pred_context = vp9_get_pred_context_switchable_interp(cm, xd);
const int pred_context = vp9_get_pred_context_switchable_interp(xd);
return &cm->fc.switchable_interp_prob[pred_context][0];
}
unsigned char vp9_get_pred_context_intra_inter(const VP9_COMMON *cm,
const MACROBLOCKD *xd);
unsigned char vp9_get_pred_context_intra_inter(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(cm, xd);
const int pred_context = vp9_get_pred_context_intra_inter(xd);
return cm->fc.intra_inter_prob[pred_context];
}
......@@ -92,21 +90,19 @@ static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
return cm->fc.comp_ref_prob[pred_context];
}
unsigned char vp9_get_pred_context_single_ref_p1(const VP9_COMMON *cm,
const MACROBLOCKD *xd);
unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = vp9_get_pred_context_single_ref_p1(cm, xd);
const int pred_context = vp9_get_pred_context_single_ref_p1(xd);
return cm->fc.single_ref_prob[pred_context][0];
}
unsigned char vp9_get_pred_context_single_ref_p2(const VP9_COMMON *cm,
const MACROBLOCKD *xd);
unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
const int pred_context = vp9_get_pred_context_single_ref_p2(cm, xd);
const int pred_context = vp9_get_pred_context_single_ref_p2(xd);
return cm->fc.single_ref_prob[pred_context][1];
}
......
......@@ -330,10 +330,10 @@ static void read_ref_frame(VP9D_COMP *pbi, vp9_reader *r,
ref_frame[fix_ref_idx] = cm->comp_fixed_ref;
ref_frame[!fix_ref_idx] = cm->comp_var_ref[b];
} else {
const int ref1_ctx = vp9_get_pred_context_single_ref_p1(cm, xd);
const int ref1_ctx = vp9_get_pred_context_single_ref_p1(xd);
ref_frame[1] = NONE;
if (vp9_read(r, fc->single_ref_prob[ref1_ctx][0])) {
const int ref2_ctx = vp9_get_pred_context_single_ref_p2(cm, xd);
const int ref2_ctx = vp9_get_pred_context_single_ref_p2(xd);
const int b = vp9_read(r, fc->single_ref_prob[ref2_ctx][1]);
ref_frame[0] = b ? ALTREF_FRAME : GOLDEN_FRAME;
fc->single_ref_count[ref1_ctx][0][1]++;
......@@ -385,7 +385,7 @@ static INLINE INTERPOLATIONFILTERTYPE read_switchable_filter_type(
MACROBLOCKD *const xd = &pbi->mb;
const vp9_prob *probs = vp9_get_pred_probs_switchable_interp(cm, xd);
const int index = treed_read(r, vp9_switchable_interp_tree, probs);
const int ctx = vp9_get_pred_context_switchable_interp(cm, xd);
const int ctx = vp9_get_pred_context_switchable_interp(xd);
++cm->fc.switchable_interp_count[ctx][index];
return vp9_switchable_interp[index];
}
......@@ -433,7 +433,7 @@ static MV_REFERENCE_FRAME read_reference_frame(VP9D_COMP *pbi, int segment_id,
MV_REFERENCE_FRAME ref;
if (!vp9_segfeature_active(&xd->seg, segment_id, SEG_LVL_REF_FRAME)) {
const int ctx = vp9_get_pred_context_intra_inter(cm, xd);
const int ctx = vp9_get_pred_context_intra_inter(xd);
ref = (MV_REFERENCE_FRAME)
vp9_read(r, vp9_get_pred_prob_intra_inter(cm, xd));
cm->fc.intra_inter_count[ctx][ref != INTRA_FRAME]++;
......
......@@ -422,7 +422,7 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
if (cpi->common.mcomp_filter_type == SWITCHABLE
&& is_inter_mode(mbmi->mode)) {
++cpi->common.fc.switchable_interp_count[
vp9_get_pred_context_switchable_interp(&cpi->common, xd)]
vp9_get_pred_context_switchable_interp(xd)]
[vp9_switchable_interp_map[mbmi->interp_filter]];
}
......@@ -581,7 +581,7 @@ static void update_stats(VP9_COMP *cpi, int mi_row, int mi_col) {
SEG_LVL_REF_FRAME);
if (!seg_ref_active)
cpi->intra_inter_count[vp9_get_pred_context_intra_inter(cm, xd)][mbmi
cpi->intra_inter_count[vp9_get_pred_context_intra_inter(xd)][mbmi
->ref_frame[0] > INTRA_FRAME]++;
// If the segment reference feature is enabled we have only a single
......@@ -596,10 +596,10 @@ static void update_stats(VP9_COMP *cpi, int mi_row, int mi_col) {
cpi->comp_ref_count[vp9_get_pred_context_comp_ref_p(cm, xd)][mbmi
->ref_frame[0] == GOLDEN_FRAME]++;
} else {
cpi->single_ref_count[vp9_get_pred_context_single_ref_p1(cm, xd)]
cpi->single_ref_count[vp9_get_pred_context_single_ref_p1(xd)]
[0][mbmi->ref_frame[0] != LAST_FRAME]++;
if (mbmi->ref_frame[0] != LAST_FRAME)
cpi->single_ref_count[vp9_get_pred_context_single_ref_p2(cm, xd)][1]
cpi->single_ref_count[vp9_get_pred_context_single_ref_p2(xd)][1]
[mbmi->ref_frame[0] != GOLDEN_FRAME]++;
}
}
......
......@@ -2379,7 +2379,7 @@ static INLINE int get_switchable_rate(VP9_COMMON *cm, MACROBLOCK *x) {
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
const int c = vp9_get_pred_context_switchable_interp(cm, xd);
const int c = vp9_get_pred_context_switchable_interp(xd);
const int m = vp9_switchable_interp_map[mbmi->interp_filter];
return SWITCHABLE_INTERP_RATE_FACTOR * x->switchable_interp_costs[c][m];
}
......
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