ref: 272adbbec48eb6e16eaa8ee5addb34733419a397
parent: 6d3db91d3bbb3e4e341198e2826e8938cf0f9699
author: Dmitry Kovalev <[email protected]>
date: Mon Oct 7 09:18:46 EDT 2013
Using inter_mode_offset_function instead of duplicated code. Change-Id: I8de865cd1deca07b5c92c225782f0867367e9a11
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -341,7 +341,7 @@
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)]);
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -249,10 +249,10 @@
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 @@
// 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;
}