Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
11202:778139a5e058 | 11203:10c06a9bd3d9 |
---|---|
154 | 154 |
155 #if HAVE_FAST_UNALIGNED | 155 #if HAVE_FAST_UNALIGNED |
156 # if HAVE_FAST_64BIT | 156 # if HAVE_FAST_64BIT |
157 # define RS 7 | 157 # define RS 7 |
158 for(i=0; i+1<length; i+=9){ | 158 for(i=0; i+1<length; i+=9){ |
159 if(!((~*(const uint64_t*)(src+i) & (*(const uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL)) | 159 if(!((~AV_RN64A(src+i) & (AV_RN64A(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL)) |
160 # else | 160 # else |
161 # define RS 3 | 161 # define RS 3 |
162 for(i=0; i+1<length; i+=5){ | 162 for(i=0; i+1<length; i+=5){ |
163 if(!((~*(const uint32_t*)(src+i) & (*(const uint32_t*)(src+i) - 0x01000101U)) & 0x80008080U)) | 163 if(!((~AV_RN32A(src+i) & (AV_RN32A(src+i) - 0x01000101U)) & 0x80008080U)) |
164 # endif | 164 # endif |
165 continue; | 165 continue; |
166 if(i>0 && !src[i]) i--; | 166 if(i>0 && !src[i]) i--; |
167 while(src[i]) i++; | 167 while(src[i]) i++; |
168 #else | 168 #else |