From 15f0bf47e7e244c506f8ce4b34a76997dfaa5f76 Mon Sep 17 00:00:00 2001 From: hui su Date: Fri, 24 Jun 2016 11:47:56 -0700 Subject: [PATCH] Fix a bug in vp10_pattern_search() Should use sub-pel MV instead of full-pixel MV as input parameter to calc_int_cost_list(). Change-Id: I054d94220a090ca54c8d24df265193ee345cd439 --- vp10/encoder/mcomp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vp10/encoder/mcomp.c b/vp10/encoder/mcomp.c index 14a11c32a..e604d1e6f 100644 --- a/vp10/encoder/mcomp.c +++ b/vp10/encoder/mcomp.c @@ -937,7 +937,7 @@ static INLINE int is_mv_in(const MACROBLOCK *x, const MV *mv) { // Calculate and return a sad+mvcost list around an integer best pel. static INLINE void calc_int_cost_list(const MACROBLOCK *x, - const MV *ref_mv, + const MV *const ref_mv, int sadpb, const vp10_variance_fn_ptr_t *fn_ptr, const MV *best_mv, @@ -946,8 +946,8 @@ static INLINE void calc_int_cost_list(const MACROBLOCK *x, const struct buf_2d *const what = &x->plane[0].src; const struct buf_2d *const in_what = &x->e_mbd.plane[0].pre[0]; const MV fcenter_mv = {ref_mv->row >> 3, ref_mv->col >> 3}; - int br = best_mv->row; - int bc = best_mv->col; + const int br = best_mv->row; + const int bc = best_mv->col; MV this_mv; int i; unsigned int sse; @@ -1155,7 +1155,7 @@ static int vp10_pattern_search(const MACROBLOCK *x, // cost_list[4]: cost at delta {-1, 0} (top) from the best integer pel if (cost_list) { const MV best_mv = { br, bc }; - calc_int_cost_list(x, &fcenter_mv, sad_per_bit, vfp, &best_mv, cost_list); + calc_int_cost_list(x, center_mv, sad_per_bit, vfp, &best_mv, cost_list); } best_mv->row = br; best_mv->col = bc;