Merge "Remove motion vectors from PARTITION_INFO."
This commit is contained in:
commit
cf8988bda8
@ -505,7 +505,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
for (idx = 0; idx < 2; idx += bw) {
|
||||
j = idy * 2 + idx;
|
||||
blockmode = cpi->mb.partition_info->bmi[j].mode;
|
||||
blockmv = cpi->mb.partition_info->bmi[j].mv;
|
||||
blockmv = m->bmi[j].as_mv[0];
|
||||
write_sb_mv_ref(bc, blockmode, mv_ref_p);
|
||||
vp9_accum_mv_refs(&cpi->common, blockmode, mi->mb_mode_context[rf]);
|
||||
if (blockmode == NEWMV) {
|
||||
@ -517,7 +517,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
|
||||
if (mi->ref_frame[1] > INTRA_FRAME)
|
||||
vp9_encode_mv(cpi, bc,
|
||||
&cpi->mb.partition_info->bmi[j].second_mv.as_mv,
|
||||
&m->bmi[j].as_mv[1].as_mv,
|
||||
&mi->best_second_mv.as_mv,
|
||||
nmvc, xd->allow_high_precision_mv);
|
||||
}
|
||||
|
@ -24,11 +24,8 @@ typedef struct {
|
||||
} search_site;
|
||||
|
||||
typedef struct {
|
||||
int count;
|
||||
struct {
|
||||
MB_PREDICTION_MODE mode;
|
||||
int_mv mv;
|
||||
int_mv second_mv;
|
||||
} bmi[4];
|
||||
} PARTITION_INFO;
|
||||
|
||||
|
@ -352,8 +352,8 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
|
||||
|
||||
if (mbmi->ref_frame[0] != INTRA_FRAME && mbmi->sb_type < BLOCK_SIZE_SB8X8) {
|
||||
*x->partition_info = ctx->partition_info;
|
||||
mbmi->mv[0].as_int = x->partition_info->bmi[3].mv.as_int;
|
||||
mbmi->mv[1].as_int = x->partition_info->bmi[3].second_mv.as_int;
|
||||
mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int;
|
||||
mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int;
|
||||
}
|
||||
|
||||
x->skip = ctx->skip;
|
||||
|
@ -510,7 +510,8 @@ void vp9_build_nmv_cost_table(int *mvjoint,
|
||||
|
||||
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;
|
||||
MODE_INFO *mi = x->e_mbd.mode_info_context;
|
||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||
MV diff;
|
||||
const int bw = 1 << b_width_log2(mbmi->sb_type);
|
||||
const int bh = 1 << b_height_log2(mbmi->sb_type);
|
||||
@ -522,14 +523,14 @@ void vp9_update_nmv_count(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
for (idx = 0; idx < 2; idx += bw) {
|
||||
const int i = idy * 2 + idx;
|
||||
if (pi->bmi[i].mode == NEWMV) {
|
||||
diff.row = pi->bmi[i].mv.as_mv.row - best_ref_mv->as_mv.row;
|
||||
diff.col = pi->bmi[i].mv.as_mv.col - best_ref_mv->as_mv.col;
|
||||
diff.row = mi->bmi[i].as_mv[0].as_mv.row - best_ref_mv->as_mv.row;
|
||||
diff.col = mi->bmi[i].as_mv[0].as_mv.col - best_ref_mv->as_mv.col;
|
||||
vp9_inc_mv(&diff, &cpi->NMVcount);
|
||||
|
||||
if (x->e_mbd.mode_info_context->mbmi.ref_frame[1] > INTRA_FRAME) {
|
||||
diff.row = pi->bmi[i].second_mv.as_mv.row -
|
||||
diff.row = mi->bmi[i].as_mv[1].as_mv.row -
|
||||
second_best_ref_mv->as_mv.row;
|
||||
diff.col = pi->bmi[i].second_mv.as_mv.col -
|
||||
diff.col = mi->bmi[i].as_mv[1].as_mv.col -
|
||||
second_best_ref_mv->as_mv.col;
|
||||
vp9_inc_mv(&diff, &cpi->NMVcount);
|
||||
}
|
||||
|
@ -1641,9 +1641,6 @@ static int labels2mode(MACROBLOCK *x, int i,
|
||||
mic->bmi[i].as_mv[1].as_int = this_second_mv->as_int;
|
||||
|
||||
x->partition_info->bmi[i].mode = m;
|
||||
x->partition_info->bmi[i].mv.as_int = this_mv->as_int;
|
||||
if (mbmi->ref_frame[1] > 0)
|
||||
x->partition_info->bmi[i].second_mv.as_int = this_second_mv->as_int;
|
||||
for (idy = 0; idy < bh; ++idy) {
|
||||
for (idx = 0; idx < bw; ++idx) {
|
||||
vpx_memcpy(&mic->bmi[i + idy * 2 + idx],
|
||||
@ -1806,7 +1803,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
int i, j, br = 0, rate = 0, sbr = 0, idx, idy;
|
||||
int64_t bd = 0, sbd = 0, subblock_sse = 0, block_sse = 0;
|
||||
MB_PREDICTION_MODE this_mode;
|
||||
MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi;
|
||||
MODE_INFO *mi = x->e_mbd.mode_info_context;
|
||||
MB_MODE_INFO *const mbmi = &mi->mbmi;
|
||||
const int label_count = 4;
|
||||
int64_t this_segment_rd = 0;
|
||||
int label_mv_thresh;
|
||||
@ -2080,9 +2078,9 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
// store everything needed to come back to this!!
|
||||
for (i = 0; i < 4; i++) {
|
||||
bsi->mvs[i].as_mv = x->partition_info->bmi[i].mv.as_mv;
|
||||
bsi->mvs[i].as_mv = mi->bmi[i].as_mv[0].as_mv;
|
||||
if (mbmi->ref_frame[1] > 0)
|
||||
bsi->second_mvs[i].as_mv = x->partition_info->bmi[i].second_mv.as_mv;
|
||||
bsi->second_mvs[i].as_mv = mi->bmi[i].as_mv[1].as_mv;
|
||||
bsi->modes[i] = x->partition_info->bmi[i].mode;
|
||||
bsi->eobs[i] = best_eobs[i];
|
||||
}
|
||||
@ -2123,24 +2121,12 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
x->e_mbd.mode_info_context->bmi[i].as_mv[1].as_int =
|
||||
bsi.second_mvs[i].as_int;
|
||||
x->e_mbd.plane[0].eobs[i] = bsi.eobs[i];
|
||||
}
|
||||
|
||||
/* save partitions */
|
||||
x->partition_info->count = 4;
|
||||
|
||||
for (i = 0; i < x->partition_info->count; i++) {
|
||||
x->partition_info->bmi[i].mode = bsi.modes[i];
|
||||
x->partition_info->bmi[i].mv.as_mv = bsi.mvs[i].as_mv;
|
||||
if (mbmi->ref_frame[1] > 0)
|
||||
x->partition_info->bmi[i].second_mv.as_mv = bsi.second_mvs[i].as_mv;
|
||||
}
|
||||
|
||||
/*
|
||||
* used to set mbmi->mv.as_int
|
||||
*/
|
||||
x->partition_info->bmi[3].mv.as_int = bsi.mvs[3].as_int;
|
||||
if (mbmi->ref_frame[1] > 0)
|
||||
x->partition_info->bmi[3].second_mv.as_int = bsi.second_mvs[3].as_int;
|
||||
|
||||
*returntotrate = bsi.r;
|
||||
*returndistortion = bsi.d;
|
||||
*returnyrate = bsi.segment_yrate;
|
||||
@ -4041,8 +4027,8 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
|
||||
*x->partition_info = best_partition;
|
||||
|
||||
mbmi->mv[0].as_int = x->partition_info->bmi[3].mv.as_int;
|
||||
mbmi->mv[1].as_int = x->partition_info->bmi[3].second_mv.as_int;
|
||||
mbmi->mv[0].as_int = xd->mode_info_context->bmi[3].as_mv[0].as_int;
|
||||
mbmi->mv[1].as_int = xd->mode_info_context->bmi[3].as_mv[1].as_int;
|
||||
}
|
||||
|
||||
for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user