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
Showing with 21 additions and 12 deletions
...@@ -569,23 +569,32 @@ void vp9_update_nmv_count(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -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) { int_mv *best_ref_mv, int_mv *second_best_ref_mv) {
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
MV mv; 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) { if (mbmi->mode == SPLITMV) {
int i; int i;
PARTITION_INFO *pi = x->partition_info; PARTITION_INFO *pi = x->partition_info;
for (i = 0; i < pi->count; i++) { #if !CONFIG_AB4X4
if (pi->bmi[i].mode == NEW4X4) { bw = 1, bh = 1;
mv.row = (pi->bmi[i].mv.as_mv.row - best_ref_mv->as_mv.row); #endif
mv.col = (pi->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col); for (idy = 0; idy < 2; idy += bh) {
vp9_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount, for (idx = 0; idx < 2; idx += bw) {
x->e_mbd.allow_high_precision_mv); i = idy * 2 + idx;
if (x->e_mbd.mode_info_context->mbmi.second_ref_frame > 0) { if (pi->bmi[i].mode == NEW4X4) {
mv.row = pi->bmi[i].second_mv.as_mv.row - mv.row = (pi->bmi[i].mv.as_mv.row - best_ref_mv->as_mv.row);
second_best_ref_mv->as_mv.row; mv.col = (pi->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col);
mv.col = pi->bmi[i].second_mv.as_mv.col - vp9_increment_nmv(&mv, &best_ref_mv->as_mv, &cpi->NMVcount,
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); 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);
}
} }
} }
} }
......
Supports Markdown
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