Commit b74a72bf authored by Jingning Han's avatar Jingning Han
Browse files

Constrain motion vector projection range

Constrain the maximum motion vector projection range to be within
+/-32 pixels in the vertical direction and +/-64 pixels in the
horizontal direction.

Such constraints allow a fixed amount of reference motion vector
load to SRAM for each 64x64 block size, independent of the frame
size. The wider range in the horizontal direction can be stored in
the SRAM and reused by next 64x64 block. The compression performance
loss is 0.03% for lowres and 0.04% for midres.

Change-Id: I7f1c136363b136b1f2fa9f7c962a791c8e91a976
parent 4eafefe0
......@@ -1218,8 +1218,15 @@ INLINE void get_mv_projection(MV *output, MV ref, int num, int den) {
output->col = (int16_t)(ref.col * (double)num / den);
}
#define MAX_OFFSET_WIDTH 64
#define MAX_OFFSET_HEIGHT 32
INLINE 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;
int row = (sign_bias == 1) ? blk_row - (mv.row >> (3 + MI_SIZE_LOG2))
: blk_row + (mv.row >> (3 + MI_SIZE_LOG2));
int col = (sign_bias == 1) ? blk_col - (mv.col >> (3 + MI_SIZE_LOG2))
......
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