ref: cae3fb726793713ed08449bbad9322bea226638f
parent: dac5891a1aa6876f1155084b3d473726dfd0153e
parent: 8c05e59065f66d3fbd9d742eb63f5b78678e7e67
author: Dmitry Kovalev <[email protected]>
date: Thu Jul 11 11:20:14 EDT 2013
Merge "Calling is_inter_mode() instead of custom code."
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -348,11 +348,11 @@
*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) {
- assert(NEARESTMV <= m && m <= NEWMV);
+ assert(is_inter_mode(mode));
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]);
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1556,19 +1556,19 @@
return best_rd;
}
-static int cost_mv_ref(VP9_COMP *cpi,
- MB_PREDICTION_MODE m,
- const int mode_context) {
+static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
+ int mode_context) {
MACROBLOCK *const x = &cpi->mb;
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)) {
- assert(NEARESTMV <= m && m <= NEWMV);
- return x->inter_mode_cost[mode_context][m - NEARESTMV];
- } else
+ assert(is_inter_mode(mode));
+ return x->inter_mode_cost[mode_context][mode - NEARESTMV];
+ } else {
return 0;
+ }
}
void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) {