From: Daniel Kang Date: Thu, 16 Aug 2012 18:04:34 +0000 (-0700) Subject: Fix valgrind error which causes non-deterministic results. X-Git-Tag: v1.3.0~1217^2~297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5cc24cc2e097ab569fca493e490a8e059993d26;p=platform%2Fupstream%2Flibvpx.git Fix valgrind error which causes non-deterministic results. Error was introduced in bf474e170fefbed60cf20fa3d2e9e229776469f0 Change-Id: I55bf114a1938c3a8869d8ff49cbe076eb9e83ea0 --- diff --git a/vp8/common/reconinter.c b/vp8/common/reconinter.c index 0d82db7..d73d8fd 100644 --- a/vp8/common/reconinter.c +++ b/vp8/common/reconinter.c @@ -619,7 +619,8 @@ static void clamp_uvmv_to_umv_border(MV *mv, const MACROBLOCKD *xd) { /*encoder only*/ void vp8_build_1st_inter16x16_predictors_mby(MACROBLOCKD *xd, unsigned char *dst_y, - int dst_ystride) { + int dst_ystride, + int clamp_mvs) { unsigned char *ptr_base = xd->pre.y_buffer; unsigned char *ptr; int pre_stride = xd->block[0].pre_stride; @@ -627,7 +628,7 @@ void vp8_build_1st_inter16x16_predictors_mby(MACROBLOCKD *xd, ymv.as_int = xd->mode_info_context->mbmi.mv[0].as_int; - if (xd->mode_info_context->mbmi.need_to_clamp_mvs) + if (clamp_mvs) clamp_mv_to_umv_border(&ymv.as_mv, xd); ptr = ptr_base + (ymv.as_mv.row >> 3) * pre_stride + (ymv.as_mv.col >> 3); @@ -755,7 +756,8 @@ void vp8_build_1st_inter16x16_predictors_mb(MACROBLOCKD *xd, unsigned char *dst_u, unsigned char *dst_v, int dst_ystride, int dst_uvstride) { - vp8_build_1st_inter16x16_predictors_mby(xd, dst_y, dst_ystride); + vp8_build_1st_inter16x16_predictors_mby(xd, dst_y, dst_ystride, + xd->mode_info_context->mbmi.need_to_clamp_mvs); vp8_build_1st_inter16x16_predictors_mbuv(xd, dst_u, dst_v, dst_uvstride); } diff --git a/vp8/common/reconinter.h b/vp8/common/reconinter.h index 48d95ff..7ad0adb 100644 --- a/vp8/common/reconinter.h +++ b/vp8/common/reconinter.h @@ -18,7 +18,8 @@ extern void vp8_build_1st_inter16x16_predictors_mby(MACROBLOCKD *xd, unsigned char *dst_y, - int dst_ystride); + int dst_ystride, + int clamp_mvs); extern void vp8_build_1st_inter16x16_predictors_mbuv(MACROBLOCKD *xd, unsigned char *dst_u, unsigned char *dst_v, diff --git a/vp8/encoder/encodemb.c b/vp8/encoder/encodemb.c index e03b47e..4542444 100644 --- a/vp8/encoder/encodemb.c +++ b/vp8/encoder/encodemb.c @@ -1194,7 +1194,8 @@ void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) { x->e_mbd.mode_info_context->mbmi.pred_filter_enabled = 0; #endif - vp8_build_1st_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.predictor, 16); + vp8_build_1st_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.predictor, + 16, 0); ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), x->e_mbd.predictor, b->src_stride); diff --git a/vp8/encoder/mbgraph.c b/vp8/encoder/mbgraph.c index f3f7f84..dde000a 100644 --- a/vp8/encoder/mbgraph.c +++ b/vp8/encoder/mbgraph.c @@ -88,7 +88,7 @@ static unsigned int do_16x16_motion_iteration #endif vp8_set_mbmode_and_mvs(x, NEWMV, dst_mv); - vp8_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16); + vp8_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0); // VARIANCE_INVOKE(&cpi->rtcd.variance, satd16x16) best_err = VARIANCE_INVOKE(&cpi->rtcd.variance, sad16x16) (xd->dst.y_buffer, xd->dst.y_stride, diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index 720736f..a2c1a23 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -3213,7 +3213,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int rate2 += vp8_cost_mv_ref(cpi, this_mode, mdcounts); vp8_build_1st_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.predictor, - 16); + 16, 0); if (is_comp_pred) vp8_build_2nd_inter16x16_predictors_mby(&x->e_mbd, x->e_mbd.predictor, 16);