Re-design motion compensated prediction mode entropy coding system

This commit re-works the entropy coding scheme of the motion
compensated prediction modes. It allows more flexible hyperplane
partition for precise classification.

Change-Id: Iba5035c76691946cf1386b6c495e399c3d9c8fc5
This commit is contained in:
Jingning Han
2015-12-02 10:59:01 -08:00
parent 9fbc394036
commit 1dc18077b8
13 changed files with 357 additions and 53 deletions

View File

@@ -3025,9 +3025,33 @@ static void choose_intra_uv_mode(VP10_COMP *cpi, MACROBLOCK *const x,
}
static int cost_mv_ref(const VP10_COMP *cpi, PREDICTION_MODE mode,
int mode_context) {
uint8_t mode_context) {
#if CONFIG_REF_MV
int mode_cost = 0;
uint8_t mode_ctx = mode_context & NEWMV_CTX_MASK;
assert(is_inter_mode(mode));
if (mode == NEWMV) {
mode_cost = cpi->newmv_mode_cost[mode_ctx][0];
return mode_cost;
} else {
mode_cost = cpi->newmv_mode_cost[mode_ctx][1];
mode_ctx = (mode_context >> ZEROMV_OFFSET) & ZEROMV_CTX_MASK;
if (mode == ZEROMV) {
mode_cost += cpi->zeromv_mode_cost[mode_ctx][0];
return mode_cost;
} else {
mode_cost += cpi->zeromv_mode_cost[mode_ctx][1];
mode_ctx = (mode_context >> REFMV_OFFSET);
mode_cost += cpi->refmv_mode_cost[mode_ctx][mode != NEARESTMV];
return mode_cost;
}
}
#else
assert(is_inter_mode(mode));
return cpi->inter_mode_cost[mode_context][INTER_OFFSET(mode)];
#endif
}
static int set_and_cost_bmi_mvs(VP10_COMP *cpi, MACROBLOCK *x, MACROBLOCKD *xd,