Commit 83c27ecd authored by Jingning Han's avatar Jingning Han
Browse files

Constrain motion field referencing region

Limit the motion field referencing region to be within a 64x64
coding block region to reduce line buffer requirement. The coding
performance loss numbers are 0.028% for lowres and 0.064% for
midres.

Change-Id: I4fe1a915c5710b763591b7046c45459b02543377
parent 00d5868d
...@@ -381,6 +381,18 @@ static int has_top_right(const MACROBLOCKD *xd, int mi_row, int mi_col, ...@@ -381,6 +381,18 @@ static int has_top_right(const MACROBLOCKD *xd, int mi_row, int mi_col,
} }
#if CONFIG_MFMV #if CONFIG_MFMV
static int check_sb_border(const int mi_row, const int mi_col,
const int row_offset, const int col_offset) {
const int row = mi_row & MAX_MIB_MASK;
const int col = mi_col & MAX_MIB_MASK;
if (row + row_offset < 0 || row + row_offset >= MAX_MIB_SIZE ||
col + col_offset < 0 || col + col_offset >= MAX_MIB_SIZE)
return 0;
return 1;
}
static int add_tpl_ref_mv(const AV1_COMMON *cm, static int add_tpl_ref_mv(const AV1_COMMON *cm,
const MV_REF *prev_frame_mvs_base, const MV_REF *prev_frame_mvs_base,
const MACROBLOCKD *xd, int mi_row, int mi_col, const MACROBLOCKD *xd, int mi_row, int mi_col,
...@@ -648,6 +660,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd, ...@@ -648,6 +660,9 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
for (i = 0; i < 9; ++i) { for (i = 0; i < 9; ++i) {
blk_row = tpl_sample_pos[i][0]; blk_row = tpl_sample_pos[i][0];
blk_col = tpl_sample_pos[i][1]; blk_col = tpl_sample_pos[i][1];
if (!check_sb_border(mi_row, mi_col, blk_row, blk_col)) continue;
coll_blk_count += add_tpl_ref_mv(cm, prev_frame_mvs_base, xd, mi_row, coll_blk_count += add_tpl_ref_mv(cm, prev_frame_mvs_base, xd, mi_row,
mi_col, ref_frame, blk_row, blk_col, mi_col, ref_frame, blk_row, blk_col,
refmv_count, ref_mv_stack, mode_context); refmv_count, ref_mv_stack, mode_context);
......
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