changeset 4246:a579dae361e2 libavcodec

1 step diamond search around the median MV predictor +0.01 PSNR idea from x264
author michael
date Thu, 30 Nov 2006 22:44:22 +0000
parents 4397b7436222
children c2224aefb923
files motion_est_template.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/motion_est_template.c	Wed Nov 29 05:40:37 2006 +0000
+++ b/motion_est_template.c	Thu Nov 30 22:44:22 2006 +0000
@@ -907,7 +907,11 @@
             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)