Commit 5946d365 authored by Jingning Han's avatar Jingning Han
Browse files

Fix out of bound tpl mv access

Resolve an enc/dec mismatch issue when mv-compress is on.


Change-Id: Iaa79129076e6bd7215cb0448c4933a58c6241eaf
parent a0ba9f2c
......@@ -345,9 +345,6 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm,
MV_REFERENCE_FRAME ref_frame, int blk_row,
int blk_col, uint8_t *refmv_count,
CANDIDATE_MV *ref_mv_stack, int16_t *mode_context) {
const TPL_MV_REF *prev_frame_mvs = cm->cur_frame->tpl_mvs +
(mi_row + blk_row) * cm->mi_stride +
(mi_col + blk_col);
POSITION mi_pos;
int idx;
......@@ -365,6 +362,10 @@ static int add_tpl_ref_mv(const AV1_COMMON *cm,
if (!is_inside(&xd->tile, mi_col, mi_row, cm->mi_rows, cm, &mi_pos))
return coll_blk_count;
const TPL_MV_REF *prev_frame_mvs = cm->cur_frame->tpl_mvs +
(mi_row + mi_pos.row) * cm->mi_stride +
(mi_col + mi_pos.col);
av1_set_ref_frame(rf, ref_frame);
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