ref: 2d4929e340901cece322208f25bea3bc4ddaa440
parent: 9da67da04a1e150630196e5457133365bd9c8618
author: Ronald S. Bultje <rbultje@google.com>
date: Wed Jul 17 12:46:53 EDT 2013
Remove motion vectors from PARTITION_INFO. The same information already exists in union b_mode_info. Change-Id: Iac5086b99a3c3cc270380138062bb693e58f9e6d
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -505,7 +505,7 @@
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 @@
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);
}
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -24,11 +24,8 @@
} search_site;
typedef struct {
- int count;
struct {
MB_PREDICTION_MODE mode;
- int_mv mv;
- int_mv second_mv;
} bmi[4];
} PARTITION_INFO;
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -352,8 +352,8 @@
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;
--- a/vp9/encoder/vp9_encodemv.c
+++ b/vp9/encoder/vp9_encodemv.c
@@ -510,7 +510,8 @@
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 @@
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);
}
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1641,9 +1641,6 @@
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 @@
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 @@
// 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 @@
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 @@
*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) {
--
⑨