Commit 5f3612c3 authored by Jingning Han's avatar Jingning Han
Browse files

Make nmv_count update 4x8/8x4 aware

This commit modifies the vp9_update_nmv_count_ to support rectangular
partition of 8x8 block.

Change-Id: I3e742f80f18f95b031c1c785d756d9365503c24c
parent 481a7c59
......@@ -569,23 +569,32 @@ void vp9_update_nmv_count(VP9_COMP *cpi, MACROBLOCK *x,
int_mv *best_ref_mv, int_mv *second_best_ref_mv) {
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
MV mv;
int bwl = b_width_log2(mbmi->sb_type), bw = 1 << bwl;
int bhl = b_height_log2(mbmi->sb_type), bh = 1 << bhl;
int idx, idy;
if (mbmi->mode == SPLITMV) {
int i;
PARTITION_INFO *pi = x->partition_info;
for (i = 0; i < pi->count; i++) {
if (pi->bmi[i].mode == NEW4X4) {
mv.row = (pi->bmi[i].mv.as_mv.row - best_ref_mv->as_mv.row);
mv.col = (pi->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col);
vp9_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount,
x->e_mbd.allow_high_precision_mv);
if (x->e_mbd.mode_info_context->mbmi.second_ref_frame > 0) {
mv.row = pi->bmi[i].second_mv.as_mv.row -
second_best_ref_mv->as_mv.row;
mv.col = pi->bmi[i].second_mv.as_mv.col -
second_best_ref_mv->as_mv.col;
vp9_increment_nmv(&mv, &second_best_ref_mv->as_mv, &cpi->NMVcount,
#if !CONFIG_AB4X4
bw = 1, bh = 1;
#endif
for (idy = 0; idy < 2; idy += bh) {
for (idx = 0; idx < 2; idx += bw) {
i = idy * 2 + idx;
if (pi->bmi[i].mode == NEW4X4) {
mv.row = (pi->bmi[i].mv.as_mv.row - best_ref_mv->as_mv.row);
mv.col = (pi->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col);
vp9_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount,
x->e_mbd.allow_high_precision_mv);
if (x->e_mbd.mode_info_context->mbmi.second_ref_frame > 0) {
mv.row = pi->bmi[i].second_mv.as_mv.row -
second_best_ref_mv->as_mv.row;
mv.col = pi->bmi[i].second_mv.as_mv.col -
second_best_ref_mv->as_mv.col;
vp9_increment_nmv(&mv, &second_best_ref_mv->as_mv, &cpi->NMVcount,
x->e_mbd.allow_high_precision_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