]> granicus.if.org Git - libx264/commitdiff
subpel search: always check mvp.
authorLoren Merritt <pengvado@videolan.org>
Tue, 22 Nov 2005 02:43:11 +0000 (02:43 +0000)
committerLoren Merritt <pengvado@videolan.org>
Tue, 22 Nov 2005 02:43:11 +0000 (02:43 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@370 df754926-b1dd-0310-bc7b-ec298dee348c

encoder/me.c

index 325da19a47c7b84495dc543440f4732b7d35678b..765457dd7441f43085aadcd9cdd2572a3a6b6e23 100644 (file)
@@ -366,8 +366,8 @@ static void refine_subpel( x264_t *h, x264_me_t *m, int hpel_iters, int qpel_ite
      * the result of the fullpel search */
     if( hpel_iters )
     {
-        int mx = abs(bmx - m->mvp[0]) < 4 ? m->mvp[0] : bmx;
-        int my = abs(bmy - m->mvp[1]) < 4 ? m->mvp[1] : bmy;
+        int mx = x264_clip3( m->mvp[0], h->mb.mv_min[0], h->mb.mv_max[0] );
+        int my = x264_clip3( m->mvp[1], h->mb.mv_min[1], h->mb.mv_max[1] );
         if( mx != bmx || my != bmy )
             COST_MV_SAD( mx, my );
     }