MB_MODE_COUNT
} MB_PREDICTION_MODE;
+static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) {
+ return mode >= NEARESTMV && mode <= SPLITMV;
+}
+
+
// Segment level features.
typedef enum {
SEG_LVL_ALT_Q = 0, // Use alternate Quantizer ....
case PRED_SWITCHABLE_INTERP: {
// left
const int left_in_image = xd->left_available && left_mi->mbmi.mb_in_image;
- const int left_mv_pred = left_mi->mbmi.mode >= NEARESTMV &&
- left_mi->mbmi.mode <= SPLITMV;
+ const int left_mv_pred = is_inter_mode(left_mi->mbmi.mode);
const int left_interp = left_in_image && left_mv_pred ?
vp9_switchable_interp_map[left_mi->mbmi.interp_filter] :
VP9_SWITCHABLE_FILTERS;
// above
const int above_in_image = xd->up_available && above_mi->mbmi.mb_in_image;
- const int above_mv_pred = above_mi->mbmi.mode >= NEARESTMV &&
- above_mi->mbmi.mode <= SPLITMV;
+ const int above_mv_pred = is_inter_mode(above_mi->mbmi.mode);
const int above_interp = above_in_image && above_mv_pred ?
vp9_switchable_interp_map[above_mi->mbmi.interp_filter] :
VP9_SWITCHABLE_FILTERS;
#endif
}
- if (mbmi->mode >= NEARESTMV && mbmi->mode <= SPLITMV) {
+ if (is_inter_mode(mbmi->mode)) {
mbmi->interp_filter = cm->mcomp_filter_type == SWITCHABLE
? read_switchable_filter_type(pbi, r)
: cm->mcomp_filter_type;
vp9_accum_mv_refs(&cpi->common, mode, mi->mb_mode_context[rf]);
}
- if (mode >= NEARESTMV && mode <= SPLITMV) {
+ if (is_inter_mode(mode)) {
if (cpi->common.mcomp_filter_type == SWITCHABLE) {
write_token(bc, vp9_switchable_interp_tree,
vp9_get_pred_probs(&cpi->common, xd,
}
#endif
if (cpi->common.mcomp_filter_type == SWITCHABLE &&
- mbmi->mode >= NEARESTMV &&
- mbmi->mode <= SPLITMV) {
+ is_inter_mode(mbmi->mode)) {
++cpi->switchable_interp_count
[vp9_get_pred_context(&cpi->common, xd, PRED_SWITCHABLE_INTERP)]
[vp9_switchable_interp_map[mbmi->interp_filter]];
// Accumulate filter usage stats
// TODO(agrange): Use RD criteria to select interpolation filter mode.
- if ((best_mode >= NEARESTMV) && (best_mode <= SPLITMV))
+ if (is_inter_mode(best_mode))
++cpi->best_switchable_interp_count[vp9_switchable_interp_map[best_filter]];
// Reduce the activation RD thresholds for the best choice mode
// Accumulate filter usage stats
// TODO(agrange): Use RD criteria to select interpolation filter mode.
- if ((best_mode >= NEARESTMV) && (best_mode <= SPLITMV))
+ if (is_inter_mode(best_mode))
++cpi->best_switchable_interp_count[vp9_switchable_interp_map[best_filter]];
// TODO(rbultje) integrate with RD thresholding