[FFmpeg-cvslog] r23894 - trunk/libavcodec/mpegvideo_common.h

cehoyos subversion
Wed Jun 30 03:47:42 CEST 2010


Author: cehoyos
Date: Wed Jun 30 03:47:42 2010
New Revision: 23894

Log:
Fix strict-aliasing violations in MPV_motion_internal.

Patch by Eli Friedman, eli D friedman A gmail

Modified:
   trunk/libavcodec/mpegvideo_common.h

Modified: trunk/libavcodec/mpegvideo_common.h
==============================================================================
--- trunk/libavcodec/mpegvideo_common.h	Wed Jun 30 00:41:22 2010	(r23893)
+++ trunk/libavcodec/mpegvideo_common.h	Wed Jun 30 03:47:42 2010	(r23894)
@@ -670,19 +670,19 @@ static av_always_inline void MPV_motion_
         }
 
         if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){
-            *(int32_t*)mv_cache[1][0]= *(int32_t*)mv_cache[1][1];
-            *(int32_t*)mv_cache[2][0]= *(int32_t*)mv_cache[2][1];
+            AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
+            AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
         }else{
-            *(int32_t*)mv_cache[1][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1];
-            *(int32_t*)mv_cache[2][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1+mot_stride];
+            AV_COPY32(mv_cache[1][0], s->current_picture.motion_val[0][mot_xy-1]);
+            AV_COPY32(mv_cache[2][0], s->current_picture.motion_val[0][mot_xy-1+mot_stride]);
         }
 
         if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){
-            *(int32_t*)mv_cache[1][3]= *(int32_t*)mv_cache[1][2];
-            *(int32_t*)mv_cache[2][3]= *(int32_t*)mv_cache[2][2];
+            AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
+            AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
         }else{
-            *(int32_t*)mv_cache[1][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2];
-            *(int32_t*)mv_cache[2][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2+mot_stride];
+            AV_COPY32(mv_cache[1][3], s->current_picture.motion_val[0][mot_xy+2]);
+            AV_COPY32(mv_cache[2][3], s->current_picture.motion_val[0][mot_xy+2+mot_stride]);
         }
 
         mx = 0;



More information about the ffmpeg-cvslog mailing list