[FFmpeg-cvslog] r18599 - trunk/libavcodec/xan.c

reimar subversion
Fri Apr 17 22:05:27 CEST 2009


Author: reimar
Date: Fri Apr 17 22:05:27 2009
New Revision: 18599

Log:
Use sign_extend function instead of reimplementing it.

Modified:
   trunk/libavcodec/xan.c

Modified: trunk/libavcodec/xan.c
==============================================================================
--- trunk/libavcodec/xan.c	Fri Apr 17 22:01:45 2009	(r18598)
+++ trunk/libavcodec/xan.c	Fri Apr 17 22:05:27 2009	(r18599)
@@ -333,16 +333,10 @@ static void xan_wc3_decode_frame(XanCont
             }
         } else {
             /* run-based motion compensation from last frame */
-            motion_x = *vector_segment >> 4;
-            motion_y = *vector_segment & 0xF;
+            motion_x = sign_extend(*vector_segment >> 4,  4);
+            motion_y = sign_extend(*vector_segment & 0xF, 4);
             vector_segment++;
 
-            /* sign extension */
-            if (motion_x & 0x8)
-                motion_x |= 0xFFFFFFF0;
-            if (motion_y & 0x8)
-                motion_y |= 0xFFFFFFF0;
-
             /* copy a run of pixels from the previous frame */
             xan_wc3_copy_pixel_run(s, x, y, size, motion_x, motion_y);
 



More information about the ffmpeg-cvslog mailing list