Preparation for project restructuring.
Added vp9_ prefix on some function names that have global scope.
Added static declaration on some that dont.
Change-Id: If072f78b4300e8c17cfeed82c5d17b59946dcc5e
mv->as_mv.row = xd->mb_to_bottom_edge + MV_BORDER;
}
-// Code for selecting / building and entropy coding a motion vector reference
-// Returns a seperation value for two vectors.
-// This is taken as the sum of the abs x and y difference.
-unsigned int mv_distance(int_mv *mv1, int_mv *mv2) {
- return (abs(mv1->as_mv.row - mv2->as_mv.row) +
- abs(mv1->as_mv.col - mv2->as_mv.col));
-}
// Gets a best matching candidate refenence motion vector
// from the given mode info structure (if available)
-int get_candidate_mvref(
+static int get_candidate_mvref(
const MODE_INFO *candidate_mi,
MV_REFERENCE_FRAME ref_frame,
MV_REFERENCE_FRAME *c_ref_frame,
// Performs mv adjustment based on reference frame and clamps the MV
// if it goes off the edge of the buffer.
-void scale_mv(
+static void scale_mv(
MACROBLOCKD *xd,
MV_REFERENCE_FRAME this_ref_frame,
MV_REFERENCE_FRAME candidate_ref_frame,
// Adds a new candidate reference vector to the list if indeed it is new.
// If it is not new then the score of the existing candidate that it matches
// is increased and the list is resorted.
-void addmv_and_shuffle(
+static void addmv_and_shuffle(
int_mv *mv_list,
int *mv_scores,
int *index,
// This function searches the neighbourhood of a given MB/SB and populates a
// list of candidate reference vectors.
//
-void find_mv_refs(
+void vp9_find_mv_refs(
MACROBLOCKD *xd,
MODE_INFO *here,
MODE_INFO *lf_here,
#ifndef __INC_MVREF_COMMON_H
#define __INC_MVREF_COMMON_H
-unsigned int mv_distance(int_mv *mv1, int_mv *mv2);
-
-void find_mv_refs(
+void vp9_find_mv_refs(
MACROBLOCKD *xd,
MODE_INFO *here,
MODE_INFO *lf_here,
// TBD prediction functions for various bitstream signals
// Returns a context number for the given MB prediction signal
-unsigned char get_pred_context(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id) {
+unsigned char vp9_get_pred_context(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id) {
int pred_context;
MODE_INFO *m = xd->mode_info_context;
// This function returns a context probability for coding a given
// prediction signal
-vp8_prob get_pred_prob(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id) {
+vp8_prob vp9_get_pred_prob(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id) {
vp8_prob pred_probability;
int pred_context;
// Get the appropriate prediction context
- pred_context = get_pred_context(cm, xd, pred_id);
+ pred_context = vp9_get_pred_context(cm, xd, pred_id);
switch (pred_id) {
case PRED_SEG_ID:
// This function returns a context probability ptr for coding a given
// prediction signal
-const vp8_prob *get_pred_probs(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id) {
+const vp8_prob *vp9_get_pred_probs(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id) {
const vp8_prob *pred_probability;
int pred_context;
// Get the appropriate prediction context
- pred_context = get_pred_context(cm, xd, pred_id);
+ pred_context = vp9_get_pred_context(cm, xd, pred_id);
switch (pred_id) {
case PRED_SEG_ID:
// This function returns the status of the given prediction signal.
// I.e. is the predicted value for the given signal correct.
-unsigned char get_pred_flag(const MACROBLOCKD *const xd,
- PRED_ID pred_id) {
+unsigned char vp9_get_pred_flag(const MACROBLOCKD *const xd,
+ PRED_ID pred_id) {
unsigned char pred_flag = 0;
switch (pred_id) {
// This function sets the status of the given prediction signal.
// I.e. is the predicted value for the given signal correct.
-void set_pred_flag(MACROBLOCKD *const xd,
- PRED_ID pred_id,
- unsigned char pred_flag) {
+void vp9_set_pred_flag(MACROBLOCKD *const xd,
+ PRED_ID pred_id,
+ unsigned char pred_flag) {
switch (pred_id) {
case PRED_SEG_ID:
xd->mode_info_context->mbmi.seg_id_predicted = pred_flag;
// peredict various bitstream signals.
// Macroblock segment id prediction function
-unsigned char get_pred_mb_segid(const VP8_COMMON *const cm, int MbIndex) {
+unsigned char vp9_get_pred_mb_segid(const VP8_COMMON *const cm, int MbIndex) {
// Currently the prediction for the macroblock segment ID is
// the value stored for this macroblock in the previous frame.
return cm->last_frame_seg_map[MbIndex];
}
-MV_REFERENCE_FRAME get_pred_ref(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd) {
+MV_REFERENCE_FRAME vp9_get_pred_ref(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd) {
MODE_INFO *m = xd->mode_info_context;
MV_REFERENCE_FRAME left;
// Functions to computes a set of modified reference frame probabilities
// to use when the prediction of the reference frame value fails
-void calc_ref_probs(int *count, vp8_prob *probs) {
+void vp9_calc_ref_probs(int *count, vp8_prob *probs) {
int tot_count;
tot_count = count[0] + count[1] + count[2] + count[3];
// Values willbe set to 0 for reference frame options that are not possible
// because wither they were predicted and prediction has failed or because
// they are not allowed for a given segment.
-void compute_mod_refprobs(VP8_COMMON *const cm) {
+void vp9_compute_mod_refprobs(VP8_COMMON *const cm) {
int norm_cnt[MAX_REF_FRAMES];
int intra_count;
int inter_count;
norm_cnt[1] = last_count;
norm_cnt[2] = gf_count;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, cm->mod_refprobs[INTRA_FRAME]);
+ vp9_calc_ref_probs(norm_cnt, cm->mod_refprobs[INTRA_FRAME]);
cm->mod_refprobs[INTRA_FRAME][0] = 0; // This branch implicit
norm_cnt[0] = intra_count;
norm_cnt[1] = 0;
norm_cnt[2] = gf_count;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, cm->mod_refprobs[LAST_FRAME]);
+ vp9_calc_ref_probs(norm_cnt, cm->mod_refprobs[LAST_FRAME]);
cm->mod_refprobs[LAST_FRAME][1] = 0; // This branch implicit
norm_cnt[0] = intra_count;
norm_cnt[1] = last_count;
norm_cnt[2] = 0;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, cm->mod_refprobs[GOLDEN_FRAME]);
+ vp9_calc_ref_probs(norm_cnt, cm->mod_refprobs[GOLDEN_FRAME]);
cm->mod_refprobs[GOLDEN_FRAME][2] = 0; // This branch implicit
norm_cnt[0] = intra_count;
norm_cnt[1] = last_count;
norm_cnt[2] = gf_count;
norm_cnt[3] = 0;
- calc_ref_probs(norm_cnt, cm->mod_refprobs[ALTREF_FRAME]);
+ vp9_calc_ref_probs(norm_cnt, cm->mod_refprobs[ALTREF_FRAME]);
cm->mod_refprobs[ALTREF_FRAME][2] = 0; // This branch implicit
// Score the reference frames based on overal frequency.
PRED_SWITCHABLE_INTERP = 4
} PRED_ID;
-extern unsigned char get_pred_context(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id);
+extern unsigned char vp9_get_pred_context(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id);
-extern vp8_prob get_pred_prob(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id);
+extern vp8_prob vp9_get_pred_prob(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id);
-extern const vp8_prob *get_pred_probs(const VP8_COMMON *const cm,
- const MACROBLOCKD *const xd,
- PRED_ID pred_id);
+extern const vp8_prob *vp9_get_pred_probs(const VP8_COMMON *const cm,
+ const MACROBLOCKD *const xd,
+ PRED_ID pred_id);
-extern unsigned char get_pred_flag(const MACROBLOCKD *const xd,
- PRED_ID pred_id);
+extern unsigned char vp9_get_pred_flag(const MACROBLOCKD *const xd,
+ PRED_ID pred_id);
-extern void set_pred_flag(MACROBLOCKD *const xd,
- PRED_ID pred_id,
- unsigned char pred_flag);
+extern void vp9_set_pred_flag(MACROBLOCKD *const xd,
+ PRED_ID pred_id,
+ unsigned char pred_flag);
-extern unsigned char get_pred_mb_segid(const VP8_COMMON *const cm, int MbIndex);
+extern unsigned char vp9_get_pred_mb_segid(const VP8_COMMON *const cm,
+ int MbIndex);
-extern MV_REFERENCE_FRAME get_pred_ref(const VP8_COMMON *const cm,
+extern MV_REFERENCE_FRAME vp9_get_pred_ref(const VP8_COMMON *const cm,
const MACROBLOCKD *const xd);
-extern void compute_mod_refprobs(VP8_COMMON *const cm);
+extern void vp9_compute_mod_refprobs(VP8_COMMON *const cm);
#endif /* __INC_PRED_COMMON_H__ */
(get_segdata(&pbi->mb,
m->mbmi.segment_id, SEG_LVL_EOB) != 0))) {
MACROBLOCKD *const xd = &pbi->mb;
- m->mbmi.mb_skip_coeff = vp8_read(bc, get_pred_prob(cm, xd, PRED_MBSKIP));
+ m->mbmi.mb_skip_coeff =
+ vp8_read(bc, vp9_get_pred_prob(cm, xd, PRED_MBSKIP));
} else {
if (segfeature_active(&pbi->mb,
m->mbmi.segment_id, SEG_LVL_EOB) &&
MV_REFERENCE_FRAME pred_ref;
// Get the context probability the prediction flag
- pred_prob = get_pred_prob(cm, xd, PRED_REF);
+ pred_prob = vp9_get_pred_prob(cm, xd, PRED_REF);
// Read the prediction status flag
prediction_flag = (unsigned char)vp8_read(bc, pred_prob);
// Store the prediction flag.
- set_pred_flag(xd, PRED_REF, prediction_flag);
+ vp9_set_pred_flag(xd, PRED_REF, prediction_flag);
// Get the predicted reference frame.
- pred_ref = get_pred_ref(cm, xd);
+ pred_ref = vp9_get_pred_ref(cm, xd);
// If correctly predicted then use the predicted value
if (prediction_flag) {
// The reference frame for the mb is considered as correclty predicted
// if it is signaled at the segment level for the purposes of the
// common prediction model
- set_pred_flag(xd, PRED_REF, 1);
- ref_frame = get_pred_ref(cm, xd);
+ vp9_set_pred_flag(xd, PRED_REF, 1);
+ ref_frame = vp9_get_pred_ref(cm, xd);
}
return (MV_REFERENCE_FRAME)ref_frame;
// Computes a modified set of probabilities for use when reference
// frame prediction fails.
- compute_mod_refprobs(cm);
+ vp9_compute_mod_refprobs(cm);
pbi->common.comp_pred_mode = vp8_read(bc, 128);
if (cm->comp_pred_mode)
// Get the context based probability for reading the
// prediction status flag
vp8_prob pred_prob =
- get_pred_prob(cm, xd, PRED_SEG_ID);
+ vp9_get_pred_prob(cm, xd, PRED_SEG_ID);
// Read the prediction status flag
unsigned char seg_pred_flag =
(unsigned char)vp8_read(bc, pred_prob);
// Store the prediction flag.
- set_pred_flag(xd, PRED_SEG_ID, seg_pred_flag);
+ vp9_set_pred_flag(xd, PRED_SEG_ID, seg_pred_flag);
// If the value is flagged as correctly predicted
// then use the predicted value
if (seg_pred_flag) {
- mbmi->segment_id = get_pred_mb_segid(cm, index);
+ mbmi->segment_id = vp9_get_pred_mb_segid(cm, index);
}
// Else .... decode it explicitly
else {
(get_segdata(xd, mbmi->segment_id, SEG_LVL_EOB) != 0))) {
// Read the macroblock coeff skip flag if this feature is in use,
// else default to 0
- mbmi->mb_skip_coeff = vp8_read(bc, get_pred_prob(cm, xd, PRED_MBSKIP));
+ mbmi->mb_skip_coeff = vp8_read(bc, vp9_get_pred_prob(cm, xd, PRED_MBSKIP));
} else {
if (segfeature_active(xd,
mbmi->segment_id, SEG_LVL_EOB) &&
xd->pre.u_buffer = cm->yv12_fb[ref_fb_idx].u_buffer + recon_uvoffset;
xd->pre.v_buffer = cm->yv12_fb[ref_fb_idx].v_buffer + recon_uvoffset;
- find_mv_refs(xd, mi, prev_mi,
- ref_frame, mbmi->ref_mvs[ref_frame],
- cm->ref_frame_sign_bias);
+ vp9_find_mv_refs(xd, mi, prev_mi,
+ ref_frame, mbmi->ref_mvs[ref_frame],
+ cm->ref_frame_sign_bias);
vp8_find_best_ref_mvs(xd,
xd->pre.y_buffer,
if (cm->mcomp_filter_type == SWITCHABLE) {
mbmi->interp_filter = vp8_switchable_interp[
vp8_treed_read(bc, vp8_switchable_interp_tree,
- get_pred_probs(cm, xd, PRED_SWITCHABLE_INTERP))];
+ vp9_get_pred_probs(cm, xd, PRED_SWITCHABLE_INTERP))];
} else {
mbmi->interp_filter = cm->mcomp_filter_type;
}
if (cm->comp_pred_mode == COMP_PREDICTION_ONLY ||
(cm->comp_pred_mode == HYBRID_PREDICTION &&
- vp8_read(bc, get_pred_prob(cm, xd, PRED_COMP)))) {
+ vp8_read(bc, vp9_get_pred_prob(cm, xd, PRED_COMP)))) {
/* Since we have 3 reference frames, we can only have 3 unique
* combinations of combinations of 2 different reference frames
* (A-G, G-L or A-L). In the bitstream, we use this to simply
mbmi->second_ref_frame,
cm->ref_frame_sign_bias);
- find_mv_refs(xd, mi, prev_mi,
- mbmi->second_ref_frame,
- mbmi->ref_mvs[mbmi->second_ref_frame],
- cm->ref_frame_sign_bias);
+ vp9_find_mv_refs(xd, mi, prev_mi,
+ mbmi->second_ref_frame,
+ mbmi->ref_mvs[mbmi->second_ref_frame],
+ cm->ref_frame_sign_bias);
vp8_find_best_ref_mvs(xd,
xd->second_pre.y_buffer,
MV_REFERENCE_FRAME pred_rf;
// Get the context probability the prediction flag
- pred_prob = get_pred_prob(cm, xd, PRED_REF);
+ pred_prob = vp9_get_pred_prob(cm, xd, PRED_REF);
// Get the predicted value.
- pred_rf = get_pred_ref(cm, xd);
+ pred_rf = vp9_get_pred_ref(cm, xd);
// Did the chosen reference frame match its predicted value.
prediction_flag =
(xd->mode_info_context->mbmi.ref_frame == pred_rf);
- set_pred_flag(xd, PRED_REF, prediction_flag);
+ vp9_set_pred_flag(xd, PRED_REF, prediction_flag);
vp8_write(bc, prediction_flag, pred_prob);
// If not predicted correctly then code value explicitly
// Compute a modified set of probabilities to use when prediction of the
// reference frame fails
- compute_mod_refprobs(cm);
+ vp9_compute_mod_refprobs(cm);
}
static void pack_inter_mode_mvs(VP8_COMP *const cpi, vp8_writer *const bc) {
if (cpi->mb.e_mbd.update_mb_segmentation_map) {
// Is temporal coding of the segment map enabled
if (pc->temporal_update) {
- prediction_flag = get_pred_flag(xd, PRED_SEG_ID);
- pred_prob = get_pred_prob(pc, xd, PRED_SEG_ID);
+ prediction_flag = vp9_get_pred_flag(xd, PRED_SEG_ID);
+ pred_prob = vp9_get_pred_prob(pc, xd, PRED_SEG_ID);
// Code the segment id prediction flag for this mb
vp8_write(bc, prediction_flag, pred_prob);
}
#endif
vp8_encode_bool(bc, skip_coeff,
- get_pred_prob(pc, xd, PRED_MBSKIP));
+ vp9_get_pred_prob(pc, xd, PRED_MBSKIP));
}
// Encode the reference frame.
{
if (cpi->common.mcomp_filter_type == SWITCHABLE) {
vp8_write_token(bc, vp8_switchable_interp_tree,
- get_pred_probs(&cpi->common, xd,
- PRED_SWITCHABLE_INTERP),
+ vp9_get_pred_probs(&cpi->common, xd,
+ PRED_SWITCHABLE_INTERP),
vp8_switchable_interp_encodings +
vp8_switchable_interp_map[mi->interp_filter]);
} else {
// (if not specified at the frame/segment level)
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
vp8_write(bc, mi->second_ref_frame != INTRA_FRAME,
- get_pred_prob(pc, xd, PRED_COMP));
+ vp9_get_pred_prob(pc, xd, PRED_COMP));
}
{
}
#endif
vp8_encode_bool(bc, skip_coeff,
- get_pred_prob(c, xd, PRED_MBSKIP));
+ vp9_get_pred_prob(c, xd, PRED_MBSKIP));
}
#if CONFIG_SUPERBLOCKS
check_segref(xd, seg_id, GOLDEN_FRAME) +
check_segref(xd, seg_id, ALTREF_FRAME) > 1) {
// Get the prediction context and status
- int pred_flag = get_pred_flag(xd, PRED_REF);
- int pred_context = get_pred_context(cm, xd, PRED_REF);
+ int pred_flag = vp9_get_pred_flag(xd, PRED_REF);
+ int pred_context = vp9_get_pred_context(cm, xd, PRED_REF);
// Count prediction success
cpi->ref_pred_count[pred_context][pred_flag]++;
if (xd->mode_info_context->mbmi.ref_frame) {
unsigned char pred_context;
- pred_context = get_pred_context(cm, xd, PRED_COMP);
+ pred_context = vp9_get_pred_context(cm, xd, PRED_COMP);
if (xd->mode_info_context->mbmi.second_ref_frame == INTRA_FRAME)
cpi->single_pred_count[pred_context]++;
// Compute a modified set of reference frame probabilities to use when
// prediction fails. These are based on the current general estimates for
// this frame which may be updated with each iteration of the recode loop.
- compute_mod_refprobs(cm);
+ vp9_compute_mod_refprobs(cm);
#if CONFIG_NEW_MVREF
// temp stats reset
// SET VARIOUS PREDICTION FLAGS
// Did the chosen reference frame match its predicted value.
- ref_pred_flag = ((mbmi->ref_frame == get_pred_ref(cm, xd)));
- set_pred_flag(xd, PRED_REF, ref_pred_flag);
+ ref_pred_flag = ((mbmi->ref_frame == vp9_get_pred_ref(cm, xd)));
+ vp9_set_pred_flag(xd, PRED_REF, ref_pred_flag);
if (mbmi->ref_frame == INTRA_FRAME) {
if (mbmi->mode == B_PRED) {
// Did the chosen reference frame match its predicted value.
ref_pred_flag = ((xd->mode_info_context->mbmi.ref_frame ==
- get_pred_ref(cm, xd)));
- set_pred_flag(xd, PRED_REF, ref_pred_flag);
+ vp9_get_pred_ref(cm, xd)));
+ vp9_set_pred_flag(xd, PRED_REF, ref_pred_flag);
if (xd->mode_info_context->mbmi.ref_frame == INTRA_FRAME) {
vp8_build_intra_predictors_sby_s(&x->e_mbd);
MACROBLOCKD *xd = &x->e_mbd;
int can_skip = cm->mb_no_coeff_skip;
- vp8_prob skip_prob = can_skip ? get_pred_prob(cm, xd, PRED_MBSKIP) : 128;
+ vp8_prob skip_prob = can_skip ? vp9_get_pred_prob(cm, xd, PRED_MBSKIP) : 128;
int s0, s1;
int r4x4, r4x4s, r8x8, r8x8s, d4x4, d8x8, s4x4, s8x8;
int64_t rd4x4, rd8x8, rd4x4s, rd8x8s;
}
}
-extern void calc_ref_probs(int *count, vp8_prob *probs);
+extern void vp9_calc_ref_probs(int *count, vp8_prob *probs);
static void estimate_curframe_refprobs(VP8_COMP *cpi, vp8_prob mod_refprobs[3], int pred_ref) {
int norm_cnt[MAX_REF_FRAMES];
const int *const rfct = cpi->count_mb_ref_frame_usage;
norm_cnt[1] = last_count;
norm_cnt[2] = gf_count;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, mod_refprobs);
+ vp9_calc_ref_probs(norm_cnt, mod_refprobs);
mod_refprobs[0] = 0; // This branch implicit
} else if (pred_ref == LAST_FRAME) {
norm_cnt[0] = intra_count;
norm_cnt[1] = 0;
norm_cnt[2] = gf_count;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, mod_refprobs);
+ vp9_calc_ref_probs(norm_cnt, mod_refprobs);
mod_refprobs[1] = 0; // This branch implicit
} else if (pred_ref == GOLDEN_FRAME) {
norm_cnt[0] = intra_count;
norm_cnt[1] = last_count;
norm_cnt[2] = 0;
norm_cnt[3] = arf_count;
- calc_ref_probs(norm_cnt, mod_refprobs);
+ vp9_calc_ref_probs(norm_cnt, mod_refprobs);
mod_refprobs[2] = 0; // This branch implicit
} else {
norm_cnt[0] = intra_count;
norm_cnt[1] = last_count;
norm_cnt[2] = gf_count;
norm_cnt[3] = 0;
- calc_ref_probs(norm_cnt, mod_refprobs);
+ vp9_calc_ref_probs(norm_cnt, mod_refprobs);
mod_refprobs[2] = 0; // This branch implicit
}
}
}
// Get the predicted reference for this mb
- pred_ref = get_pred_ref(cm, xd);
+ pred_ref = vp9_get_pred_ref(cm, xd);
// Get the context probability for the prediction flag (based on last frame)
- pred_prob = get_pred_prob(cm, xd, PRED_REF);
+ pred_prob = vp9_get_pred_prob(cm, xd, PRED_REF);
// Predict probability for current frame based on stats so far
- pred_ctx = get_pred_context(cm, xd, PRED_REF);
+ pred_ctx = vp9_get_pred_context(cm, xd, PRED_REF);
tot_count = cpi->ref_pred_count[pred_ctx][0] + cpi->ref_pred_count[pred_ctx][1];
if (tot_count) {
new_pred_prob =
v_buffer[frame_type] = yv12->v_buffer + recon_uvoffset;
#if CONFIG_NEWBESTREFMV
- find_mv_refs(xd, xd->mode_info_context,
- xd->prev_mode_info_context,
- frame_type,
- mbmi->ref_mvs[frame_type],
- cpi->common.ref_frame_sign_bias);
+ vp9_find_mv_refs(xd, xd->mode_info_context,
+ xd->prev_mode_info_context,
+ frame_type,
+ mbmi->ref_mvs[frame_type],
+ cpi->common.ref_frame_sign_bias);
vp8_find_best_ref_mvs(xd, y_buffer[frame_type],
yv12->y_stride,
if (cpi->common.mcomp_filter_type == SWITCHABLE)
rate2 += SWITCHABLE_INTERP_RATE_FACTOR * x->switchable_interp_costs
- [get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
+ [vp9_get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
[vp8_switchable_interp_map[mbmi->interp_filter]];
// If even the 'Y' rd value of split is higher than best so far
// then dont bother looking at UV
mode_excluded = cpi->common.comp_pred_mode == COMP_PREDICTION_ONLY;
compmode_cost =
- vp8_cost_bit(get_pred_prob(cm, xd, PRED_COMP), is_comp_pred);
+ vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_COMP), is_comp_pred);
mbmi->mode = this_mode;
}
else {
#endif
if (cpi->common.mcomp_filter_type == SWITCHABLE)
rate2 += SWITCHABLE_INTERP_RATE_FACTOR * x->switchable_interp_costs
- [get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
+ [vp9_get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
[vp8_switchable_interp_map[
xd->mode_info_context->mbmi.interp_filter]];
/* We don't include the cost of the second reference here, because there are only
* three options: Last/Golden, ARF/Last or Golden/ARF, or in other words if you
* present them in that order, the second one is always known if the first is known */
- compmode_cost = vp8_cost_bit(get_pred_prob(cm, xd, PRED_COMP),
+ compmode_cost = vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_COMP),
is_comp_pred);
rate2 += vp8_cost_mv_ref(cpi, this_mode, mdcounts);
// Cost the skip mb case
vp8_prob skip_prob =
- get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP);
+ vp9_get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP);
if (skip_prob) {
prob_skip_cost = vp8_cost_bit(skip_prob, 1);
mbmi->mb_skip_coeff = 0;
if (mb_skip_allowed) {
int prob_skip_cost = vp8_cost_bit(
- get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP), 0);
+ vp9_get_pred_prob(cm, &x->e_mbd, PRED_MBSKIP), 0);
rate2 += prob_skip_cost;
other_cost += prob_skip_cost;
}
best_mbmode.mode >= NEARESTMV &&
best_mbmode.mode <= SPLITMV) {
++cpi->switchable_interp_count
- [get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
+ [vp9_get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
[vp8_switchable_interp_map[best_mbmode.interp_filter]];
}
if (cpi->common.mb_no_coeff_skip && y_skip && uv_skip) {
*returnrate = rate_y + rate_uv - rate_y_tokenonly - rate_uv_tokenonly +
- vp8_cost_bit(get_pred_prob(cm, xd, PRED_MBSKIP), 1);
+ vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 1);
*returndist = dist_y + (dist_uv >> 2);
} else {
*returnrate = rate_y + rate_uv;
if (cpi->common.mb_no_coeff_skip)
- *returnrate += vp8_cost_bit(get_pred_prob(cm, xd, PRED_MBSKIP), 0);
+ *returnrate += vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 0);
*returndist = dist_y + (dist_uv >> 2);
}
}
mbmi->mode = mode16x16;
mbmi->uv_mode = modeuv;
rate = rateuv8x8 + rate16x16 - rateuv8x8_tokenonly - rate16x16_tokenonly +
- vp8_cost_bit(get_pred_prob(cm, xd, PRED_MBSKIP), 1);
+ vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 1);
dist = dist16x16 + (distuv8x8 >> 2);
mbmi->txfm_size = txfm_size_16x16;
memset(x->mb_context[xd->mb_index].txfm_rd_diff, 0,
}
}
if (cpi->common.mb_no_coeff_skip)
- rate += vp8_cost_bit(get_pred_prob(cm, xd, PRED_MBSKIP), 0);
+ rate += vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 0);
} else {
if (error4x4 < error8x8) {
rate = rateuv;
sizeof(x->mb_context[xd->mb_index].txfm_rd_diff));
}
if (cpi->common.mb_no_coeff_skip)
- rate += vp8_cost_bit(get_pred_prob(cm, xd, PRED_MBSKIP), 0);
+ rate += vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_MBSKIP), 0);
}
*returnrate = rate;
xd->dst.uv_stride);
compmode_cost =
- vp8_cost_bit(get_pred_prob(cm, xd, PRED_COMP), 0);
+ vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_COMP), 0);
if (cpi->active_map_enabled && x->active_ptr[0] == 0) {
x->skip = 1;
* are only three options: Last/Golden, ARF/Last or Golden/ARF, or in
* other words if you present them in that order, the second one is
* always known if the first is known */
- compmode_cost = vp8_cost_bit(get_pred_prob(cm, xd, PRED_COMP), 1);
+ compmode_cost = vp8_cost_bit(vp9_get_pred_prob(cm, xd, PRED_COMP), 1);
}
if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
// Cost the skip mb case
vp8_prob skip_prob =
- get_pred_prob(cm, xd, PRED_MBSKIP);
+ vp9_get_pred_prob(cm, xd, PRED_MBSKIP);
if (skip_prob) {
prob_skip_cost = vp8_cost_bit(skip_prob, 1);
}
// Add in the cost of the no skip flag.
else if (mb_skip_allowed) {
- int prob_skip_cost = vp8_cost_bit(get_pred_prob(cm, xd,
+ int prob_skip_cost = vp8_cost_bit(vp9_get_pred_prob(cm, xd,
PRED_MBSKIP), 0);
rate2 += prob_skip_cost;
other_cost += prob_skip_cost;
if (cm->frame_type != KEY_FRAME) {
// Test to see if the segment id matches the predicted value.
int seg_predicted =
- (segment_id == get_pred_mb_segid(cm, segmap_index));
+ (segment_id == vp9_get_pred_mb_segid(cm, segmap_index));
// Get the segment id prediction context
pred_context =
- get_pred_context(cm, xd, PRED_SEG_ID);
+ vp9_get_pred_context(cm, xd, PRED_SEG_ID);
// Store the prediction status for this mb and update counts
// as appropriate
- set_pred_flag(xd, PRED_SEG_ID, seg_predicted);
+ vp9_set_pred_flag(xd, PRED_SEG_ID, seg_predicted);
temporal_predictor_count[pred_context][seg_predicted]++;
if (!seg_predicted)
int has_y2_block;
int b;
int tx_size = xd->mode_info_context->mbmi.txfm_size;
- int mb_skip_context = get_pred_context(&cpi->common, xd, PRED_MBSKIP);
+ int mb_skip_context = vp9_get_pred_context(&cpi->common, xd, PRED_MBSKIP);
TOKENEXTRA *t_backup = *t;
ENTROPY_CONTEXT * A = (ENTROPY_CONTEXT *) xd->above_context;
ENTROPY_CONTEXT * L = (ENTROPY_CONTEXT *) xd->left_context;