]> granicus.if.org Git - libvpx/commitdiff
Fix a bug in vp8_clamp_mv function
authorYunqing Wang <yunqingwang@google.com>
Wed, 18 May 2011 13:52:56 +0000 (09:52 -0400)
committerYunqing Wang <yunqingwang@google.com>
Wed, 18 May 2011 13:52:56 +0000 (09:52 -0400)
Scott fixed the bug in MV clamping function in encoder, which
could cause artifacts.

Change-Id: Id05f2794c43c31cdd45e66179c8811f3ee452cb9

vp8/encoder/pickinter.c
vp8/encoder/rdopt.c

index 61d6612cd2cd7f7c84c47076d191375028996a8a..9b2d3d231451df834e1901b5bb2a0c9530b933bb 100644 (file)
@@ -637,10 +637,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
 
             /* adjust mvp to make sure it is within MV range */
             vp8_clamp_mv(&mvp,
-                         best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL,
-                         best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL,
                          best_ref_mv.as_mv.col - MAX_FULL_PEL_VAL,
-                         best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL);
+                         best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL,
+                         best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL,
+                         best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL);
         }
 
         switch (this_mode)
index 7bd2dfbbebc8f6f9bd073c0690e25ffec79ee778..d18bae3fe42cecb9b377ddebc3e38bbcdc800613 100644 (file)
@@ -1878,10 +1878,10 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
 
             /* adjust mvp to make sure it is within MV range */
             vp8_clamp_mv(&mvp,
-                         best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL,
-                         best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL,
                          best_ref_mv.as_mv.col - MAX_FULL_PEL_VAL,
-                         best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL);
+                         best_ref_mv.as_mv.col + MAX_FULL_PEL_VAL,
+                         best_ref_mv.as_mv.row - MAX_FULL_PEL_VAL,
+                         best_ref_mv.as_mv.row + MAX_FULL_PEL_VAL);
         }
 
         // Check to see if the testing frequency for this mode is at its max