Commit cae3fb72 authored by Dmitry Kovalev's avatar Dmitry Kovalev Committed by Gerrit Code Review
Browse files

Merge "Calling is_inter_mode() instead of custom code."

parents dac5891a 8c05e590
...@@ -348,11 +348,11 @@ static void pack_mb_tokens(vp9_writer* const bc, ...@@ -348,11 +348,11 @@ static void pack_mb_tokens(vp9_writer* const bc,
*tp = p; *tp = p;
} }
static void write_sb_mv_ref(vp9_writer *w, MB_PREDICTION_MODE m, static void write_sb_mv_ref(vp9_writer *w, MB_PREDICTION_MODE mode,
const vp9_prob *p) { const vp9_prob *p) {
assert(NEARESTMV <= m && m <= NEWMV); assert(is_inter_mode(mode));
write_token(w, vp9_sb_mv_ref_tree, p, write_token(w, vp9_sb_mv_ref_tree, p,
vp9_sb_mv_ref_encoding_array - NEARESTMV + m); &vp9_sb_mv_ref_encoding_array[mode - NEARESTMV]);
} }
......
...@@ -1556,19 +1556,19 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -1556,19 +1556,19 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
return best_rd; return best_rd;
} }
static int cost_mv_ref(VP9_COMP *cpi, static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
MB_PREDICTION_MODE m, int mode_context) {
const int mode_context) {
MACROBLOCK *const x = &cpi->mb; MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd; MACROBLOCKD *const xd = &x->e_mbd;
int segment_id = xd->mode_info_context->mbmi.segment_id; const int segment_id = xd->mode_info_context->mbmi.segment_id;
// Dont account for mode here if segment skip is enabled. // Don't account for mode here if segment skip is enabled.
if (!vp9_segfeature_active(&xd->seg, segment_id, SEG_LVL_SKIP)) { if (!vp9_segfeature_active(&xd->seg, segment_id, SEG_LVL_SKIP)) {
assert(NEARESTMV <= m && m <= NEWMV); assert(is_inter_mode(mode));
return x->inter_mode_cost[mode_context][m - NEARESTMV]; return x->inter_mode_cost[mode_context][mode - NEARESTMV];
} else } else {
return 0; return 0;
}
} }
void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) { void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) {
......
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