Commit f33a0a82 authored by Jingning Han's avatar Jingning Han
Browse files

Fix a few mis-use cases of MAX_MV_REF_CANDIDATES

Fix several use cases where MAX_MV_REF_CANDIDATES is mixed up with
is_compound flag to avoid potential coding interruption.

Change-Id: Ifdee1ef8a81ef6d1c155315c6c6a3074aa7a8b5e
parent 1d043d56
......@@ -1317,7 +1317,7 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
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 < MAX_MV_REF_CANDIDATES; ++i)
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) {
......@@ -1351,7 +1351,7 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
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 < MAX_MV_REF_CANDIDATES; ++i) {
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);
}
......
......@@ -8832,7 +8832,7 @@ void vp10_rd_pick_inter_mode_sb(VP10_COMP *cpi,
nearestmv[1] = mbmi_ext->ref_mv_stack[rf_type][0].comp_mv;
}
for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
for (i = 0; i < 2; ++i) {
lower_mv_precision(&nearestmv[i].as_mv, allow_hp);
lower_mv_precision(&nearmv[i].as_mv, allow_hp);
}
......
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