Commit 79bef030 authored by Jingning Han's avatar Jingning Han Committed by Gerrit Code Review
Browse files

Merge "Apply motion vector precision check to candidate mv" into nextgenv2

parents 03a468f9 525995a3
......@@ -61,6 +61,8 @@ static uint8_t add_ref_mv_candidate(const MODE_INFO *const candidate_mi,
int alt_block = 3 - block;
this_refmv =
get_sub_block_mv(candidate_mi, ref, col, alt_block);
lower_mv_precision(&this_refmv.as_mv, use_hp);
for (index = 0; index < *refmv_count; ++index)
if (ref_mv_stack[index].this_mv.as_int == this_refmv.as_int)
break;
......@@ -95,6 +97,9 @@ static uint8_t add_ref_mv_candidate(const MODE_INFO *const candidate_mi,
get_sub_block_mv(candidate_mi, 1, col, block)
};
for (ref = 0; ref < 2; ++ref)
lower_mv_precision(&this_refmv[ref].as_mv, use_hp);
for (index = 0; index < *refmv_count; ++index)
if ((ref_mv_stack[index].this_mv.as_int == this_refmv[0].as_int) &&
(ref_mv_stack[index].comp_mv.as_int == this_refmv[1].as_int))
......@@ -123,6 +128,9 @@ static uint8_t add_ref_mv_candidate(const MODE_INFO *const candidate_mi,
this_refmv[0] = get_sub_block_mv(candidate_mi, 0, col, alt_block);
this_refmv[1] = get_sub_block_mv(candidate_mi, 1, col, alt_block);
for (ref = 0; ref < 2; ++ref)
lower_mv_precision(&this_refmv[ref].as_mv, use_hp);
for (index = 0; index < *refmv_count; ++index)
if (ref_mv_stack[index].this_mv.as_int == this_refmv[0].as_int &&
ref_mv_stack[index].comp_mv.as_int == this_refmv[1].as_int)
......
......@@ -1293,7 +1293,6 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
if (mbmi->ref_mv_idx > 0) {
int_mv cur_mv =
xd->ref_mv_stack[mbmi->ref_frame[0]][1 + mbmi->ref_mv_idx].this_mv;
lower_mv_precision(&cur_mv.as_mv, cm->allow_high_precision_mv);
nearmv[0] = cur_mv;
}
......@@ -1310,15 +1309,11 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
#else
if (xd->ref_mv_count[ref_frame_type] == 1 && mbmi->mode == NEARESTMV) {
#endif // CONFIG_EXT_INTER
int i;
#if CONFIG_EXT_INTER
if (mbmi->mode == NEAREST_NEARESTMV) {
#endif // CONFIG_EXT_INTER
nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv;
nearestmv[1] = xd->ref_mv_stack[ref_frame_type][0].comp_mv;
for (i = 0; i < 1 + is_compound; ++i)
lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
#if CONFIG_EXT_INTER
} else if (mbmi->mode == NEAREST_NEWMV || mbmi->mode == NEAREST_NEARMV) {
nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv;
......@@ -1344,17 +1339,11 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
}
#else
if (xd->ref_mv_count[ref_frame_type] > 1) {
int i;
int ref_mv_idx = 1 + mbmi->ref_mv_idx;
nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv;
nearestmv[1] = xd->ref_mv_stack[ref_frame_type][0].comp_mv;
nearmv[0] = xd->ref_mv_stack[ref_frame_type][ref_mv_idx].this_mv;
nearmv[1] = xd->ref_mv_stack[ref_frame_type][ref_mv_idx].comp_mv;
for (i = 0; i < 1 + is_compound; ++i) {
lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
lower_mv_precision(&nearmv[i].as_mv, allow_hp);
}
}
#endif // CONFIG_EXT_INTER
}
......@@ -1495,7 +1484,6 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
xd->ref_mv_stack[ref_frame_type][mbmi->ref_mv_idx].this_mv :
xd->ref_mv_stack[ref_frame_type][mbmi->ref_mv_idx].comp_mv;
clamp_mv_ref(&ref_mv[ref].as_mv, xd->n8_w << 3, xd->n8_h << 3, xd);
lower_mv_precision(&ref_mv[ref].as_mv, allow_hp);
}
#endif
nearestmv[ref] = ref_mv[ref];
......
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