Commit ee364ff9 authored by Jingning Han's avatar Jingning Han

Store predicted mv in the collocated reference block

This commit makes the codec to store the predicted motion vector
at 8x8 block level and assign them when the reference motion vector
is obtained from collocated blocks in the previous frame.

Change-Id: I7e0403dad1df012f3994846939bb799e2445736c
parent e9630de8
......@@ -374,6 +374,7 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
if (idx == *refmv_count &&
*refmv_count < MAX_REF_MV_STACK_SIZE) {
ref_mv_stack[idx].this_mv.as_int = this_refmv.as_int;
ref_mv_stack[idx].pred_mv = prev_frame_mvs->pred_mv[ref];
ref_mv_stack[idx].weight = 2;
++(*refmv_count);
}
......
......@@ -78,6 +78,9 @@ typedef enum {
typedef struct {
int_mv mv[2];
#if CONFIG_REF_MV
int_mv pred_mv[2];
#endif
MV_REFERENCE_FRAME ref_frame[2];
} MV_REF;
......
......@@ -902,6 +902,10 @@ void av1_read_mode_info(AV1Decoder *const pbi, MACROBLOCKD *xd, int mi_row,
mv->ref_frame[1] = mi->mbmi.ref_frame[1];
mv->mv[0].as_int = mi->mbmi.mv[0].as_int;
mv->mv[1].as_int = mi->mbmi.mv[1].as_int;
#if CONFIG_REF_MV
mv->pred_mv[0].as_int = mi->mbmi.pred_mv[0].as_int;
mv->pred_mv[1].as_int = mi->mbmi.pred_mv[1].as_int;
#endif
}
}
}
......
......@@ -938,6 +938,7 @@ static void update_state(AV1_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx,
lower_mv_precision(&this_mv.as_mv, cm->allow_high_precision_mv);
x->mbmi_ext->ref_mvs[mbmi->ref_frame[i]][0] = this_mv;
mbmi->pred_mv[i] = this_mv;
mi->mbmi.pred_mv[i] = this_mv;
}
}
#endif
......@@ -1038,6 +1039,10 @@ static void update_state(AV1_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx,
mv->ref_frame[1] = mi->mbmi.ref_frame[1];
mv->mv[0].as_int = mi->mbmi.mv[0].as_int;
mv->mv[1].as_int = mi->mbmi.mv[1].as_int;
#if CONFIG_REF_MV
mv->pred_mv[0].as_int = mi->mbmi.pred_mv[0].as_int;
mv->pred_mv[1].as_int = mi->mbmi.pred_mv[1].as_int;
#endif
}
}
}
......
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