Commit de97a9ea authored by Alex Converse's avatar Alex Converse
Browse files

Remove av1_use_hp_mv()

It always returns true since the related misc_fix[1] was merged.

[1] 23e83574

Change-Id: Ie3af685572a2f0a42d2b9fb9903c1abeea225dfd
parent bf98c213
......@@ -139,11 +139,6 @@ MV_CLASS_TYPE av1_get_mv_class(int z, int *offset) {
return c;
}
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;
......
......@@ -27,7 +27,6 @@ struct AV1Common;
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
......
......@@ -294,8 +294,7 @@ static INLINE int is_inside(const TileInfo *const tile, int mi_col, int mi_row,
}
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);
}
......
......@@ -619,16 +619,15 @@ static INLINE void read_mv(aom_reader *r, MV *mv, const MV *ref,
#else
(MV_JOINT_TYPE)aom_read_tree(r, av1_mv_joint_tree, ctx->joints, ACCT_STR);
#endif
const int use_hp = allow_hp && av1_use_mv_hp(ref);
MV diff = { 0, 0 };
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;
......
......@@ -273,7 +273,6 @@ void av1_encode_mv(AV1_COMP *cpi, aom_writer *w, const MV *mv, const MV *ref,
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_DAALA_EC
aom_write_symbol(w, j, mvctx->joint_cdf, MV_JOINTS);
......@@ -318,7 +317,7 @@ static void inc_mvs(const MB_MODE_INFO *mbmi, const MB_MODE_INFO_EXT *mbmi_ext,
#else
nmv_context_counts *counts = nmv_counts;
#endif
av1_inc_mv(&diff, counts, av1_use_mv_hp(ref));
av1_inc_mv(&diff, counts, 1);
}
}
......
......@@ -436,7 +436,7 @@ int av1_find_best_sub_pixel_tree_pruned_evenmore(
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) {
......@@ -496,7 +496,7 @@ int av1_find_best_sub_pixel_tree_pruned_more(
}
}
if (allow_hp && av1_use_mv_hp(ref_mv) && forced_stop == 0) {
if (allow_hp && forced_stop == 0) {
tr = br;
tc = bc;
hstep >>= 1;
......@@ -584,7 +584,7 @@ int av1_find_best_sub_pixel_tree_pruned(
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) {
......@@ -696,7 +696,7 @@ int av1_find_best_sub_pixel_tree(
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;
......@@ -2787,7 +2787,7 @@ int av1_find_best_obmc_sub_pixel_tree_up(
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;
......
......@@ -3452,15 +3452,6 @@ static int64_t handle_inter_mode(
joint_motion_search(cpi, x, bsize, frame_mv, mi_row, mi_col,
single_newmv, &rate_mv, 0);
} else {
#if CONFIG_REF_MV
for (i = 0; i < 2; ++i) {
if (!av1_use_mv_hp(&x->mbmi_ext->ref_mvs[refs[i]][0].as_mv)) {
MV *this_mv = &frame_mv[refs[i]].as_mv;
if (this_mv->row & 1) this_mv->row += (this_mv->row > 0 ? -1 : 1);
if (this_mv->col & 1) this_mv->col += (this_mv->col > 0 ? -1 : 1);
}
}
#endif
rate_mv = av1_mv_bit_cost(&frame_mv[refs[0]].as_mv,
&x->mbmi_ext->ref_mvs[refs[0]][0].as_mv,
x->nmvjointcost, x->mvcost, MV_COST_WEIGHT);
......
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