Using inter_mode_offset_function instead of duplicated code.

Change-Id: I8de865cd1deca07b5c92c225782f0867367e9a11
This commit is contained in:
Dmitry Kovalev 2013-10-07 13:18:46 -07:00
Родитель 6d3db91d3b
Коммит 272adbbec4
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -341,7 +341,7 @@ static void write_sb_mv_ref(vp9_writer *w, MB_PREDICTION_MODE mode,
const vp9_prob *p) {
assert(is_inter_mode(mode));
write_token(w, vp9_inter_mode_tree, p,
&vp9_inter_mode_encodings[mode - NEARESTMV]);
&vp9_inter_mode_encodings[inter_mode_offset(mode)]);
}

Просмотреть файл

@ -249,10 +249,10 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi, int qindex) {
MB_PREDICTION_MODE m;
for (m = NEARESTMV; m < MB_MODE_COUNT; m++)
cpi->mb.inter_mode_cost[i][m - NEARESTMV] =
cpi->mb.inter_mode_cost[i][inter_mode_offset(m)] =
cost_token(vp9_inter_mode_tree,
cpi->common.fc.inter_mode_probs[i],
vp9_inter_mode_encodings + (m - NEARESTMV));
vp9_inter_mode_encodings + inter_mode_offset(m));
}
}
}
@ -1416,7 +1416,7 @@ static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
// Don't account for mode here if segment skip is enabled.
if (!vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
assert(is_inter_mode(mode));
return x->inter_mode_cost[mode_context][mode - NEARESTMV];
return x->inter_mode_cost[mode_context][inter_mode_offset(mode)];
} else {
return 0;
}