From: Jingning Han Date: Fri, 7 Jun 2013 22:43:08 +0000 (-0700) Subject: Fix mv range border in pixels X-Git-Tag: v1.3.0~1104^2~35^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0167cbbc217a86af6cc85cdb1e8afa70b51a00d;p=libvpx Fix mv range border in pixels WIP: trying to resolve the mismatch issue in extending frame dimension into multiples of 8. Change-Id: I24e7638ab3c50e21e6969c1eeed4f607d6f11f65 --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 001129d02..473a09e33 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -501,9 +501,9 @@ void vp9_first_pass(VP9_COMP *cpi) { recon_uvoffset = (mb_row * recon_uv_stride * 8); // Set up limit values for motion vectors to prevent them extending outside the UMV borders - x->mv_row_min = -((mb_row * 16) + (VP9BORDERINPIXELS - 16)); + x->mv_row_min = -((mb_row * 16) + (VP9BORDERINPIXELS - 8)); x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16) - + (VP9BORDERINPIXELS - 16); + + (VP9BORDERINPIXELS - 8); // for each macroblock col in image for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { @@ -538,9 +538,9 @@ void vp9_first_pass(VP9_COMP *cpi) { intra_error += (int64_t)this_error; // Set up limit values for motion vectors to prevent them extending outside the UMV borders - x->mv_col_min = -((mb_col * 16) + (VP9BORDERINPIXELS - 16)); + x->mv_col_min = -((mb_col * 16) + (VP9BORDERINPIXELS - 8)); x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) - + (VP9BORDERINPIXELS - 16); + + (VP9BORDERINPIXELS - 8); // Other than for the first frame do a motion search if (cm->current_video_frame > 0) { diff --git a/vp9/encoder/vp9_mbgraph.c b/vp9/encoder/vp9_mbgraph.c index 80614f5ca..65fdcbe50 100644 --- a/vp9/encoder/vp9_mbgraph.c +++ b/vp9/encoder/vp9_mbgraph.c @@ -257,9 +257,9 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi, // Set up limit values for motion vectors to prevent them extending outside the UMV borders arf_top_mv.as_int = 0; gld_top_mv.as_int = 0; - x->mv_row_min = -(VP9BORDERINPIXELS - 16 - VP9_INTERP_EXTEND); - x->mv_row_max = (cm->mb_rows - 1) * 16 + VP9BORDERINPIXELS - - 16 - VP9_INTERP_EXTEND; + x->mv_row_min = -(VP9BORDERINPIXELS - 8 - VP9_INTERP_EXTEND); + x->mv_row_max = (cm->mb_rows - 1) * 8 + VP9BORDERINPIXELS + - 8 - VP9_INTERP_EXTEND; xd->up_available = 0; xd->plane[0].dst.stride = buf->y_stride; xd->plane[0].pre[0].stride = buf->y_stride; @@ -278,9 +278,9 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi, // Set up limit values for motion vectors to prevent them extending outside the UMV borders arf_left_mv.as_int = arf_top_mv.as_int; gld_left_mv.as_int = gld_top_mv.as_int; - x->mv_col_min = -(VP9BORDERINPIXELS - 16 - VP9_INTERP_EXTEND); - x->mv_col_max = (cm->mb_cols - 1) * 16 + VP9BORDERINPIXELS - - 16 - VP9_INTERP_EXTEND; + x->mv_col_min = -(VP9BORDERINPIXELS - 8 - VP9_INTERP_EXTEND); + x->mv_col_max = (cm->mb_cols - 1) * 8 + VP9BORDERINPIXELS + - 8 - VP9_INTERP_EXTEND; xd->left_available = 0; for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {