From f7f8af46f7a0ae7754c5b20e55550a3554384162 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 30 Nov 2006 22:44:22 +0000 Subject: 1 step diamond search around the median MV predictor +0.01 PSNR idea from x264 Originally committed as revision 7189 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/motion_est_template.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libavcodec/motion_est_template.c') diff --git a/libavcodec/motion_est_template.c b/libavcodec/motion_est_template.c index bdcd48f..837d49a 100644 --- a/libavcodec/motion_est_template.c +++ b/libavcodec/motion_est_template.c @@ -907,7 +907,11 @@ static always_inline int epzs_motion_search_internal(MpegEncContext * s, int *mx c->skip=1; return dmin; } - CHECK_MV(P_MEDIAN[0]>>shift, P_MEDIAN[1]>>shift) + CHECK_MV( P_MEDIAN[0] >>shift , P_MEDIAN[1] >>shift) + CHECK_CLIPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)-1) + CHECK_CLIPED_MV((P_MEDIAN[0]>>shift) , (P_MEDIAN[1]>>shift)+1) + CHECK_CLIPED_MV((P_MEDIAN[0]>>shift)-1, (P_MEDIAN[1]>>shift) ) + CHECK_CLIPED_MV((P_MEDIAN[0]>>shift)+1, (P_MEDIAN[1]>>shift) ) if(dmin>h*h*2){ CHECK_CLIPED_MV((last_mv[ref_mv_xy][0]*ref_mv_scale + (1<<15))>>16, (last_mv[ref_mv_xy][1]*ref_mv_scale + (1<<15))>>16) -- cgit v1.1