diff h264.c @ 11203:10c06a9bd3d9 libavcodec

H264: use alias-safe macros This eliminates all aliasing violation warnings in h264 code. No measurable speed difference with gcc-4.4.3 on i7.
author mru
date Thu, 18 Feb 2010 16:24:31 +0000
parents 778139a5e058
children 9df548187a80
line wrap: on
line diff
--- a/h264.c	Thu Feb 18 12:37:43 2010 +0000
+++ b/h264.c	Thu Feb 18 16:24:31 2010 +0000
@@ -156,11 +156,11 @@
 # if HAVE_FAST_64BIT
 #   define RS 7
     for(i=0; i+1<length; i+=9){
-        if(!((~*(const uint64_t*)(src+i) & (*(const uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL))
+        if(!((~AV_RN64A(src+i) & (AV_RN64A(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL))
 # else
 #   define RS 3
     for(i=0; i+1<length; i+=5){
-        if(!((~*(const uint32_t*)(src+i) & (*(const uint32_t*)(src+i) - 0x01000101U)) & 0x80008080U))
+        if(!((~AV_RN32A(src+i) & (AV_RN32A(src+i) - 0x01000101U)) & 0x80008080U))
 # endif
             continue;
         if(i>0 && !src[i]) i--;