Commit 05102b52 authored by Jingning Han's avatar Jingning Han
Browse files

Drop mvs with magnitude above 4096 from mvs reference frame

When either component of a motion vector is above 4096, drop this
motion vector from the motion vector reference frame for later
motion field projection use. The coding performance change is close
to 0 for lowres and midres. This ensures that the motion vector
and reference frame tuple can be efficiently stored within 32 bits.

Change-Id: I9ae60a5caab2d3f49200abb5415532d82986839f
parent ff86395f
......@@ -45,6 +45,9 @@ void av1_copy_frame_mvs(const AV1_COMMON *const cm, MODE_INFO *mi, int mi_row,
if (ref_frame > INTRA_FRAME) {
int8_t ref_idx = cm->ref_frame_side[ref_frame];
if (ref_idx < 0) continue;
if ((abs(mi->[idx].as_mv.row) > REFMVS_LIMIT) ||
(abs(mi->[idx].as_mv.col) > REFMVS_LIMIT))
mv->ref_frame[ref_idx] = ref_frame;
mv->mv[ref_idx].as_int = mi->[idx].as_int;
......@@ -22,6 +22,12 @@ extern "C" {
#define MVREF_ROWS 3
#define MVREF_COLS 4
// Set the upper limit of the motion vector component magnitude.
// This would make a motion vector fit in 26 bits. Plus 3 bits for the
// reference frame index. A tuple of motion vector can hence be stored within
// 32 bit range for efficient load/store operations.
#define REFMVS_LIMIT (1 << 12)
typedef struct position {
int row;
int col;
Supports Markdown
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