Commit 7f537b85 authored by Jingning Han's avatar Jingning Han

mfmv projection constraint

Apply constraint of 64x(64 + 2 x 64) referencing region on the
reference frames.

Change-Id: I4aa2b47082b85fc9e03ca6f5f489cd80a337c218
parent 69ac7bf7
......@@ -1570,9 +1570,8 @@ static void get_mv_projection(MV *output, MV ref, int num, int den) {
static int get_block_position(AV1_COMMON *cm, int *mi_r, int *mi_c, int blk_row,
int blk_col, MV mv, int sign_bias) {
if ((abs(mv.row) >> 3) > MAX_OFFSET_HEIGHT ||
(abs(mv.col) >> 3) > MAX_OFFSET_WIDTH)
return 0;
const int base_blk_row = (blk_row >> 3) << 3;
const int base_blk_col = (blk_col >> 3) << 3;
int row = (sign_bias == 1) ? blk_row - (mv.row >> (4 + MI_SIZE_LOG2))
: blk_row + (mv.row >> (4 + MI_SIZE_LOG2));
......@@ -1583,6 +1582,11 @@ static int get_block_position(AV1_COMMON *cm, int *mi_r, int *mi_c, int blk_row,
col >= (cm->mi_cols >> 1))
return 0;
if (row < base_blk_row || row > base_blk_row + 7 ||
col <= base_blk_col - (MAX_OFFSET_WIDTH >> 3) ||
col >= base_blk_col + (MAX_OFFSET_WIDTH >> 3))
return 0;
*mi_r = row;
*mi_c = col;
......
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