X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fmotion_est.c;h=316d16a77b84deaaa2eab383b0a10a8f94860c10;hb=3f17751eeb7e3348576e2597884d5e5155aadcfb;hp=25b606f81957c1e126e6309ac119541baa0df40c;hpb=a308324ef7e5d4dbdb2ae95b526ac3bb8294f7cc;p=ffmpeg diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c index 25b606f8195..316d16a77b8 100644 --- a/libavcodec/motion_est.c +++ b/libavcodec/motion_est.c @@ -956,10 +956,10 @@ void ff_estimate_p_frame_motion(MpegEncContext * s, P_TOPRIGHT[1] = s->current_picture.motion_val[0][mot_xy - mot_stride + 2][1]; if (P_TOP[1] > (c->ymax << shift)) P_TOP[1] = c->ymax << shift; - if (P_TOPRIGHT[0] < (c->xmin << shift)) - P_TOPRIGHT[0] = c->xmin << shift; - if (P_TOPRIGHT[1] > (c->ymax << shift)) - P_TOPRIGHT[1] = c->ymax << shift; + if (P_TOPRIGHT[0] < (c->xmin * (1 << shift))) + P_TOPRIGHT[0] = c->xmin * (1 << shift); + if (P_TOPRIGHT[1] > (c->ymax * (1 << shift))) + P_TOPRIGHT[1] = c->ymax * (1 << shift); P_MEDIAN[0] = mid_pred(P_LEFT[0], P_TOP[0], P_TOPRIGHT[0]); P_MEDIAN[1] = mid_pred(P_LEFT[1], P_TOP[1], P_TOPRIGHT[1]);