Use bottom and right blocks' mv for referencing
This commit enables the motion vector referencing system to use
the motion information of blocks to the bottom and right of the
collocated block. This improves the compression performance by
0.3% for lowres, midres, and hdres sets.
Change-Id: I03b3fb21f3a8698880ca9ceb945fa3e32531acdb
diff --git a/av1/common/mvref_common.c b/av1/common/mvref_common.c
index defeb96..b9f191d 100644
--- a/av1/common/mvref_common.c
+++ b/av1/common/mvref_common.c
@@ -454,6 +454,16 @@
#else
const int mi_step = mi_size_wide[BLOCK_16X16];
#endif
+
+#if CONFIG_TPL_MV
+ int tpl_sample_pos[5][2] = { { -1, xd->n8_w },
+ { 0, xd->n8_w },
+ { xd->n8_h, xd->n8_w },
+ { xd->n8_h, 0 },
+ { xd->n8_h, -1 } };
+ int i;
+#endif
+
for (blk_row = 0; blk_row < xd->n8_h; blk_row += mi_step) {
for (blk_col = 0; blk_col < xd->n8_w; blk_col += mi_step) {
coll_blk_count += add_col_ref_mv(
@@ -461,6 +471,17 @@
blk_col, refmv_count, ref_mv_stack, mode_context);
}
}
+
+#if CONFIG_TPL_MV
+ for (i = 0; i < 5; ++i) {
+ blk_row = tpl_sample_pos[i][0];
+ blk_col = tpl_sample_pos[i][1];
+ coll_blk_count += add_col_ref_mv(cm, prev_frame_mvs_base, xd, mi_row,
+ mi_col, ref_frame, blk_row, blk_col,
+ refmv_count, ref_mv_stack, mode_context);
+ }
+#endif
+
if (coll_blk_count == 0) mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);
} else {
mode_context[ref_frame] |= (1 << ZEROMV_OFFSET);