summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp9/common/vp9_pred_common.c20
-rw-r--r--vp9/common/vp9_pred_common.h20
-rw-r--r--vp9/decoder/vp9_decodemv.c8
-rw-r--r--vp9/encoder/vp9_encodeframe.c8
-rw-r--r--vp9/encoder/vp9_rdopt.c2
5 files changed, 25 insertions, 33 deletions
diff --git a/vp9/common/vp9_pred_common.c b/vp9/common/vp9_pred_common.c
index 3d33dbdc2..ea2b0f418 100644
--- a/vp9/common/vp9_pred_common.c
+++ b/vp9/common/vp9_pred_common.c
@@ -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;
diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h
index cb4c1d32a..9c83a63da 100644
--- a/vp9/common/vp9_pred_common.h
+++ b/vp9/common/vp9_pred_common.h
@@ -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];
}
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index c6d23f0b9..f58896494 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -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]++;
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 70c64eeda..f2cb478be 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -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]++;
}
}
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index a0c64beb5..4f5b90870 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -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];
}