return c;
}
-// TODO(jingning): This idle function is intentionally left as is for
-// experimental purpose.
-int av1_use_mv_hp(const MV *ref) {
- (void)ref;
- return 1;
-}
-
static void inc_mv_component(int v, nmv_component_counts *comp_counts, int incr,
int usehp) {
int s, z, c, o, d, e, f;
void av1_init_mv_probs(struct AV1Common *cm);
void av1_adapt_mv_probs(struct AV1Common *cm, int usehp);
-int av1_use_mv_hp(const MV *ref);
#define MV_UPDATE_PROB 252
}
static INLINE void lower_mv_precision(MV *mv, int allow_hp) {
- const int use_hp = allow_hp && av1_use_mv_hp(mv);
- if (!use_hp) {
+ if (!allow_hp) {
if (mv->row & 1) mv->row += (mv->row > 0 ? -1 : 1);
if (mv->col & 1) mv->col += (mv->col > 0 ? -1 : 1);
}
const nmv_context *ctx, nmv_context_counts *counts,
int allow_hp) {
MV_JOINT_TYPE joint_type;
- const int use_hp = allow_hp && av1_use_mv_hp(ref);
MV diff = { 0, 0 };
joint_type =
#if CONFIG_DAALA_EC || CONFIG_RANS
#endif
if (mv_joint_vertical(joint_type))
- diff.row = read_mv_component(r, &ctx->comps[0], use_hp);
+ diff.row = read_mv_component(r, &ctx->comps[0], allow_hp);
if (mv_joint_horizontal(joint_type))
- diff.col = read_mv_component(r, &ctx->comps[1], use_hp);
+ diff.col = read_mv_component(r, &ctx->comps[1], allow_hp);
- av1_inc_mv(&diff, counts, use_hp);
+ av1_inc_mv(&diff, counts, allow_hp);
mv->row = ref->row + diff.row;
mv->col = ref->col + diff.col;
const nmv_context *mvctx, int usehp) {
const MV diff = { mv->row - ref->row, mv->col - ref->col };
const MV_JOINT_TYPE j = av1_get_mv_joint(&diff);
- usehp = usehp && av1_use_mv_hp(ref);
#if CONFIG_REF_MV
(void)is_compound;
#endif
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
(void)pred_mvs;
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
}
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[1]][0].as_mv;
mbmi_ext->ref_mv_stack[rf_type], 1, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
} else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
const MV *ref = &mbmi_ext->ref_mvs[mbmi->ref_frame[0]][0].as_mv;
const MV diff = { mvs[0].as_mv.row - ref->row,
mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
}
}
mbmi_ext->ref_mv_stack[rf_type], i, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
}
} else if (mode == NEAREST_NEWMV || mode == NEAR_NEWMV) {
const MV *ref = &mi->bmi[block].ref_mv[1].as_mv;
mbmi_ext->ref_mv_stack[rf_type], 1, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
} else if (mode == NEW_NEARESTMV || mode == NEW_NEARMV) {
const MV *ref = &mi->bmi[block].ref_mv[0].as_mv;
const MV diff = { mvs[0].as_mv.row - ref->row,
mbmi_ext->ref_mv_stack[rf_type], 0, mbmi->ref_mv_idx);
nmv_context_counts *counts = &nmv_counts[nmv_ctx];
#endif
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
}
}
#else
#endif
const MV diff = { mvs[i].as_mv.row - ref->row,
mvs[i].as_mv.col - ref->col };
- av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
+ av1_inc_mv(&diff, counts, 1);
}
}
#endif // CONFIG_EXT_INTER
tr = br;
tc = bc;
- if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+ if (allow_hp && forced_stop == 0) {
hstep >>= 1;
FIRST_LEVEL_CHECKS;
if (eighthiters > 1) {
}
}
- if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+ if (allow_hp && forced_stop == 0) {
tr = br;
tc = bc;
hstep >>= 1;
tc = bc;
}
- if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+ if (allow_hp && forced_stop == 0) {
hstep >>= 1;
FIRST_LEVEL_CHECKS;
if (eighthiters > 1) {
unsigned int cost_array[5];
int kr, kc;
- if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+ if (!allow_hp)
if (round == 3) round = 2;
bestmv->row *= 8;
tc = bc;
}
- if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
+ if (allow_hp && forced_stop == 0) {
hstep >>= 1;
FIRST_LEVEL_CHECKS;
if (eighthiters > 1) {
y_stride = pd->pre[is_second].stride;
offset = bestmv->row * y_stride + bestmv->col;
- if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+ if (!allow_hp)
if (round == 3) round = 2;
bestmv->row *= 8;
y_stride = pd->pre[is_second].stride;
offset = bestmv->row * y_stride + bestmv->col;
- if (!(allow_hp && av1_use_mv_hp(ref_mv)))
+ if (!allow_hp)
if (round == 3) round = 2;
bestmv->row *= 8;
#endif // CONFIG_EXT_INTER
this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
#if CONFIG_EXT_INTER
- if (!cpi->common.allow_high_precision_mv ||
- !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+ if (!cpi->common.allow_high_precision_mv)
lower_mv_precision(&this_mv[0].as_mv, 0);
#endif // CONFIG_EXT_INTER
this_mv[0].as_int = compound_seg_newmvs[0].as_int;
this_mv[1].as_int = compound_seg_newmvs[1].as_int;
}
- if (!cpi->common.allow_high_precision_mv ||
- !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+ if (!cpi->common.allow_high_precision_mv)
lower_mv_precision(&this_mv[0].as_mv, 0);
- if (!cpi->common.allow_high_precision_mv ||
- !av1_use_mv_hp(&best_ref_mv[1]->as_mv))
+ if (!cpi->common.allow_high_precision_mv)
lower_mv_precision(&this_mv[1].as_mv, 0);
thismvcost += av1_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB);
case NEW_NEARMV:
case NEW_NEARESTMV:
this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
- if (!cpi->common.allow_high_precision_mv ||
- !av1_use_mv_hp(&best_ref_mv[0]->as_mv))
+ if (!cpi->common.allow_high_precision_mv)
lower_mv_precision(&this_mv[0].as_mv, 0);
thismvcost += av1_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB);
case NEAREST_NEWMV:
this_mv[0].as_int = frame_mv[mode][mbmi->ref_frame[0]].as_int;
this_mv[1].as_int = seg_mvs[mbmi->ref_frame[1]].as_int;
- if (!cpi->common.allow_high_precision_mv ||
- !av1_use_mv_hp(&best_ref_mv[1]->as_mv))
+ if (!cpi->common.allow_high_precision_mv)
lower_mv_precision(&this_mv[1].as_mv, 0);
thismvcost += av1_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB);
if (!has_second_rf &&
#if CONFIG_EXT_INTER
have_newmv_in_inter_mode(this_mode) &&
- (seg_mvs[index][mv_idx][mbmi->ref_frame[0]].as_int == INVALID_MV ||
- av1_use_mv_hp(&bsi->ref_mv[0]->as_mv) == 0)
+ (seg_mvs[index][mv_idx][mbmi->ref_frame[0]].as_int == INVALID_MV)
#else
this_mode == NEWMV &&
(seg_mvs[index][mbmi->ref_frame[0]].as_int == INVALID_MV ||