Commit d689f2ad authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Cleaning up vp9_mvref_common.c.

different_ref_found is always equal to one (if calculated) because
ref_frame[0] != ref_frame[1] for each mi-block.

Change-Id: Ibd7625b7b29dec2fd3c40edbc3de1169abb78585
Showing with 10 additions and 20 deletions
...@@ -191,7 +191,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, ...@@ -191,7 +191,7 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
MODE_INFO *mi, const MODE_INFO *prev_mi, MODE_INFO *mi, const MODE_INFO *prev_mi,
MV_REFERENCE_FRAME ref_frame, MV_REFERENCE_FRAME ref_frame,
int_mv *mv_ref_list, int_mv *mv_ref_list,
int block_idx, int mi_row, int mi_col) { int block, int mi_row, int mi_col) {
const int *ref_sign_bias = cm->ref_frame_sign_bias; const int *ref_sign_bias = cm->ref_frame_sign_bias;
int i, refmv_count = 0; int i, refmv_count = 0;
const POSITION *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type]; const POSITION *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type];
...@@ -214,19 +214,12 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, ...@@ -214,19 +214,12 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
const MB_MODE_INFO *const candidate = &candidate_mi->mbmi; const MB_MODE_INFO *const candidate = &candidate_mi->mbmi;
// Keep counts for entropy encoding. // Keep counts for entropy encoding.
context_counter += mode_2_counter[candidate->mode]; context_counter += mode_2_counter[candidate->mode];
different_ref_found = 1;
// Check if the candidate comes from the same reference frame. if (candidate->ref_frame[0] == ref_frame)
if (candidate->ref_frame[0] == ref_frame) { ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block));
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, else if (candidate->ref_frame[1] == ref_frame)
mv_ref->col, block_idx)); ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block));
different_ref_found = candidate->ref_frame[1] != ref_frame;
} else {
if (candidate->ref_frame[1] == ref_frame)
// Add second motion vector if it has the same ref_frame.
ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1,
mv_ref->col, block_idx));
different_ref_found = 1;
}
} }
} }
...@@ -239,15 +232,12 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd, ...@@ -239,15 +232,12 @@ static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col + const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col +
mv_ref->row mv_ref->row
* xd->mode_info_stride]->mbmi; * xd->mode_info_stride]->mbmi;
different_ref_found = 1;
if (candidate->ref_frame[0] == ref_frame) { if (candidate->ref_frame[0] == ref_frame)
ADD_MV_REF_LIST(candidate->mv[0]); ADD_MV_REF_LIST(candidate->mv[0]);
different_ref_found = candidate->ref_frame[1] != ref_frame; else if (candidate->ref_frame[1] == ref_frame)
} else { ADD_MV_REF_LIST(candidate->mv[1]);
if (candidate->ref_frame[1] == ref_frame)
ADD_MV_REF_LIST(candidate->mv[1]);
different_ref_found = 1;
}
} }
} }
......
Supports Markdown
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