Commit 5433fa49 authored by Debargha Mukherjee's avatar Debargha Mukherjee

Fix mv clamping when superres is used

BUG=aomedia:862

Change-Id: Ide71432cb85858362360e3c4ae8404f75ff9ba03
parent 97d6a37e
......@@ -31,7 +31,11 @@ extern "C" {
// TODO(jingning): Use unified inter predictor for encoder and
// decoder during the development process. Revisit the frame border
// to improve the decoder performance.
#if CONFIG_EXT_PARTITION && CONFIG_FRAME_SUPERRES
#define AOM_BORDER_IN_PIXELS 288
#else
#define AOM_BORDER_IN_PIXELS 160
#endif // CONFIG_EXT_PARTITION
typedef struct yv12_buffer_config {
union {
......
......@@ -1336,10 +1336,10 @@ static INLINE void build_inter_predictors(
pos_x += SCALE_EXTRA_OFF;
pos_y += SCALE_EXTRA_OFF;
const int top = -((AOM_INTERP_EXTEND + bh) << SCALE_SUBPEL_BITS);
const int top = -AOM_LEFT_TOP_MARGIN_SCALED;
const int left = -AOM_LEFT_TOP_MARGIN_SCALED;
const int bottom = (pre_buf->height + AOM_INTERP_EXTEND)
<< SCALE_SUBPEL_BITS;
const int left = -((AOM_INTERP_EXTEND + bw) << SCALE_SUBPEL_BITS);
const int right = (pre_buf->width + AOM_INTERP_EXTEND)
<< SCALE_SUBPEL_BITS;
pos_y = clamp(pos_y, top, bottom);
......@@ -1494,10 +1494,10 @@ static INLINE void build_inter_predictors(
// Clamp against the reference frame borders, with enough extension
// that we don't force the reference block to be partially onscreen.
const int top = -((AOM_INTERP_EXTEND + bh) << SCALE_SUBPEL_BITS);
const int top = -AOM_LEFT_TOP_MARGIN_SCALED;
const int left = -AOM_LEFT_TOP_MARGIN_SCALED;
const int bottom = (pre_buf->height + AOM_INTERP_EXTEND)
<< SCALE_SUBPEL_BITS;
const int left = -((AOM_INTERP_EXTEND + bw) << SCALE_SUBPEL_BITS);
const int right = (pre_buf->width + AOM_INTERP_EXTEND)
<< SCALE_SUBPEL_BITS;
pos_y = clamp(pos_y, top, bottom);
......@@ -3227,10 +3227,10 @@ static void build_inter_predictors_single_buf(MACROBLOCKD *xd, int plane,
pos_x += SCALE_EXTRA_OFF;
pos_y += SCALE_EXTRA_OFF;
const int top = -((AOM_INTERP_EXTEND + bh) << SCALE_SUBPEL_BITS);
const int top = -AOM_LEFT_TOP_MARGIN_SCALED;
const int left = -AOM_LEFT_TOP_MARGIN_SCALED;
const int bottom = (pre_buf->height + AOM_INTERP_EXTEND)
<< SCALE_SUBPEL_BITS;
const int left = -((AOM_INTERP_EXTEND + bw) << SCALE_SUBPEL_BITS);
const int right = (pre_buf->width + AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS;
pos_y = clamp(pos_y, top, bottom);
pos_x = clamp(pos_x, left, right);
......
......@@ -28,6 +28,9 @@
#define WARP_GM_NEIGHBORS_WITH_OBMC 0
#endif // CONFIG_MOTION_VAR && CONFIG_WARPED_MOTION
#define AOM_LEFT_TOP_MARGIN_SCALED \
((AOM_BORDER_IN_PIXELS - AOM_INTERP_EXTEND) << SCALE_SUBPEL_BITS)
#ifdef __cplusplus
extern "C" {
#endif
......
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