From 17256ad763d34fff9cf1b2046572c31485298fc1 Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Wed, 12 Mar 2014 19:36:48 -0700 Subject: [PATCH] Revert "With on demand border extension, clamping the MV" This reverts commit b0fec6ab4a61ded1ab2ade188987631f53c4e9c1. Change-Id: I9acd8ee0423f22d92138f11579611ff959331013 --- vp9/common/vp9_reconinter.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c index 5b80cd2e2..86548750e 100644 --- a/vp9/common/vp9_reconinter.c +++ b/vp9/common/vp9_reconinter.c @@ -266,15 +266,21 @@ static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block, ? (plane == 0 ? mi->bmi[block].as_mv[ref].as_mv : mi_mv_pred_q4(mi, ref)) : mi->mbmi.mv[ref].as_mv; + + // TODO(jkoleszar): This clamping is done in the incorrect place for the + // scaling case. It needs to be done on the scaled MV, not the pre-scaling + // MV. Note however that it performs the subsampling aware scaling so + // that the result is always q4. + // mv_precision precision is MV_PRECISION_Q4. + const MV mv_q4 = clamp_mv_to_umv_border_sb(xd, &mv, bw, bh, + pd->subsampling_x, + pd->subsampling_y); + MV32 scaled_mv; int xs, ys, x0, y0, x0_16, y0_16, frame_width, frame_height, buf_stride, subpel_x, subpel_y; uint8_t *ref_frame, *buf_ptr; const YV12_BUFFER_CONFIG *ref_buf = xd->block_refs[ref]->buf; - const MV mv_q4 = { - mv.row * (1 << (1 - pd->subsampling_y)), - mv.col * (1 << (1 - pd->subsampling_x)) - }; // Get reference frame pointer, width and height. if (plane == 0) { -- 2.40.0