changeset 11925:c5e03082fd94 libavcodec

Use right-shift instead of division by two. Patch by Dark Shikari
author cehoyos
date Tue, 22 Jun 2010 21:12:42 +0000
parents b3b2fd53617b
children 43e39953f4f9
files mpegvideo_common.h
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo_common.h	Tue Jun 22 20:57:37 2010 +0000
+++ b/mpegvideo_common.h	Tue Jun 22 21:12:42 2010 +0000
@@ -580,11 +580,11 @@
 
     src_x = s->mb_x * 8 + mx;
     src_y = s->mb_y * 8 + my;
-    src_x = av_clip(src_x, -8, s->width/2);
-    if (src_x == s->width/2)
+    src_x = av_clip(src_x, -8, (s->width >> 1));
+    if (src_x == (s->width >> 1))
         dxy &= ~1;
-    src_y = av_clip(src_y, -8, s->height/2);
-    if (src_y == s->height/2)
+    src_y = av_clip(src_y, -8, (s->height >> 1));
+    if (src_y == (s->height >> 1))
         dxy &= ~2;
 
     offset = (src_y * (s->uvlinesize)) + src_x;