[FFmpeg-cvslog] r23745 - trunk/libavcodec/vp8.c

stefang subversion
Wed Jun 23 23:45:26 CEST 2010


Author: stefang
Date: Wed Jun 23 23:45:26 2010
New Revision: 23745

Log:
avoid conditional and division in chroma MV calculation

Modified:
   trunk/libavcodec/vp8.c

Modified: trunk/libavcodec/vp8.c
==============================================================================
--- trunk/libavcodec/vp8.c	Wed Jun 23 23:22:56 2010	(r23744)
+++ trunk/libavcodec/vp8.c	Wed Jun 23 23:45:26 2010	(r23745)
@@ -989,8 +989,8 @@ static void inter_predict(VP8Context *s,
                          mb->bmv[ 2*y    * 4 + 2*x+1].y +
                          mb->bmv[(2*y+1) * 4 + 2*x  ].y +
                          mb->bmv[(2*y+1) * 4 + 2*x+1].y;
-                uvmv.x = (uvmv.x + (uvmv.x < 0 ? -2 : 2)) / 4;
-                uvmv.y = (uvmv.y + (uvmv.y < 0 ? -2 : 2)) / 4;
+                uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2;
+                uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2;
                 if (s->profile == 3) {
                     uvmv.x &= ~7;
                     uvmv.y &= ~7;



More information about the ffmpeg-cvslog mailing list