Commit 40cedd67 authored by Jingning Han's avatar Jingning Han

Refactor sub8x8 ref motion vector search

Take out an unnecessary use of the mode context array.

Change-Id: I4032ed18464e5ec49a2160bea964bad9b716ee54
parent 63def292
......@@ -384,8 +384,9 @@ static void find_mv_refs_idx(const VP10_COMMON *cm, const MACROBLOCKD *xd,
}
}
Done:
mode_context[ref_frame] = counter_to_context[context_counter];
Done:
if (mode_context)
mode_context[ref_frame] = counter_to_context[context_counter];
for (i = refmv_count; i < MAX_MV_REF_CANDIDATES; ++i)
mv_ref_list[i].as_int = 0;
}
......@@ -432,9 +433,8 @@ void vp10_find_best_ref_mvs(int allow_hp,
}
void vp10_append_sub8x8_mvs_for_idx(VP10_COMMON *cm, MACROBLOCKD *xd,
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context) {
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv) {
int_mv mv_list[MAX_MV_REF_CANDIDATES];
MODE_INFO *const mi = xd->mi[0];
b_mode_info *bmi = mi->bmi;
......@@ -449,7 +449,7 @@ void vp10_append_sub8x8_mvs_for_idx(VP10_COMMON *cm, MACROBLOCKD *xd,
assert(MAX_MV_REF_CANDIDATES == 2);
find_mv_refs_idx(cm, xd, mi, mi->mbmi.ref_frame[ref], mv_list, block,
mi_row, mi_col, NULL, NULL, mode_context);
mi_row, mi_col, NULL, NULL, NULL);
#if CONFIG_REF_MV
......
......@@ -213,9 +213,8 @@ void vp10_find_best_ref_mvs(int allow_hp,
int_mv *mvlist, int_mv *nearest_mv, int_mv *near_mv);
void vp10_append_sub8x8_mvs_for_idx(VP10_COMMON *cm, MACROBLOCKD *xd,
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv,
uint8_t *mode_context);
int block, int ref, int mi_row, int mi_col,
int_mv *nearest_mv, int_mv *near_mv);
#ifdef __cplusplus
} // extern "C"
......
......@@ -834,12 +834,10 @@ static void read_inter_block_mode_info(VP10Decoder *const pbi,
b_mode = read_inter_mode(cm, xd, r, inter_mode_ctx[mbmi->ref_frame[0]]);
if (b_mode == NEARESTMV || b_mode == NEARMV) {
uint8_t dummy_mode_ctx[MAX_REF_FRAMES];
for (ref = 0; ref < 1 + is_compound; ++ref)
vp10_append_sub8x8_mvs_for_idx(cm, xd, j, ref, mi_row, mi_col,
&nearest_sub8x8[ref],
&near_sub8x8[ref],
dummy_mode_ctx);
&near_sub8x8[ref]);
}
if (!assign_mv(cm, xd, b_mode, block, nearestmv,
......
......@@ -3410,8 +3410,7 @@ static int64_t rd_pick_best_sub8x8_mode(VP10_COMP *cpi, MACROBLOCK *x,
frame_mv[ZEROMV][frame].as_int = 0;
vp10_append_sub8x8_mvs_for_idx(cm, xd, i, ref, mi_row, mi_col,
&frame_mv[NEARESTMV][frame],
&frame_mv[NEARMV][frame],
mbmi_ext->mode_context);
&frame_mv[NEARMV][frame]);
}
// search for the best motion vector on this segment
......
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