Commit fab16037 authored by Jingning Han's avatar Jingning Han

Scale reference motion vector search step size

This commit allows the dynamic motion vector referencing system to
scale its search range according to the coding block size. This
provides higher search resolution for smaller size coding unit.

The cb4x4 mode improves the compression performance across all the
test sets:

         avg     low    mid    high
lowres   2.8%    2.4%   3.1%   3.0%
midres   1.3%    0.3%   1.8%   2.7%
hdres    0.9%    0.5%   1.4%   1.5%

Change-Id: I1bc501506a9f2f06071c5274391f6bd053b235a7
parent ed8f3964
......@@ -171,10 +171,14 @@ static uint8_t scan_row_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile = &xd->tile;
int i;
uint8_t newmv_count = 0;
const int mi_offset = mi_size_wide[BLOCK_8X8];
#if CONFIG_CB4X4
const int bsize = xd->mi[0]->mbmi.sb_type;
const int mi_offset =
bsize < BLOCK_8X8 ? mi_size_wide[BLOCK_4X4] : mi_size_wide[BLOCK_8X8];
// TODO(jingning): Revisit this part after cb4x4 is stable.
row_offset *= 2;
if (bsize >= BLOCK_8X8) row_offset *= 2;
#else
const int mi_offset = mi_size_wide[BLOCK_8X8];
#endif
for (i = 0; i < xd->n8_w && *refmv_count < MAX_REF_MV_STACK_SIZE;) {
......@@ -215,9 +219,13 @@ static uint8_t scan_col_mbmi(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const TileInfo *const tile = &xd->tile;
int i;
uint8_t newmv_count = 0;
const int mi_offset = mi_size_wide[BLOCK_8X8];
#if CONFIG_CB4X4
col_offset *= 2;
const BLOCK_SIZE bsize = xd->mi[0]->mbmi.sb_type;
const int mi_offset =
(bsize < BLOCK_8X8) ? mi_size_high[BLOCK_4X4] : mi_size_high[BLOCK_8X8];
if (bsize >= BLOCK_8X8) col_offset *= 2;
#else
const int mi_offset = mi_size_wide[BLOCK_8X8];
#endif
for (i = 0; i < xd->n8_h && *refmv_count < MAX_REF_MV_STACK_SIZE;) {
......@@ -414,8 +422,13 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
rf[1] == NONE) {
int blk_row, blk_col;
int coll_blk_count = 0;
#if CONFIG_CB4X4
const int mi_step = (xd->n8_w == 1 || xd->n8_h == 1)
? mi_size_wide[BLOCK_8X8]
: mi_size_wide[BLOCK_16X16];
#else
const int mi_step = mi_size_wide[BLOCK_16X16];
#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(
......
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