summaryrefslogtreecommitdiff
path: root/libavcodec/h264_direct.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-02-18 16:24:31 +0000
committerMåns Rullgård <mans@mansr.com>2010-02-18 16:24:31 +0000
commit19769ece3bd99b7570f39c9c605bee1bbada2b57 (patch)
treedb19c1e9e60ff41d57dfd1a76a4eb08509f924f6 /libavcodec/h264_direct.c
parentf4a7434f16afc4616a34a7cd1bd8e592ed04e89f (diff)
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. Originally committed as revision 21881 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r--libavcodec/h264_direct.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index e461fea06f..8977be114f 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -183,11 +183,11 @@ static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){
}else {
assert(match_count==1);
if(left_ref==ref[list]){
- mv[list]= *(uint32_t*)A;
+ mv[list]= AV_RN32A(A);
}else if(top_ref==ref[list]){
- mv[list]= *(uint32_t*)B;
+ mv[list]= AV_RN32A(B);
}else{
- mv[list]= *(uint32_t*)C;
+ mv[list]= AV_RN32A(C);
}
}
}else{
@@ -362,9 +362,9 @@ single_col:
const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride];
if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){
if(ref[0] == 0)
- *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0;
+ AV_ZERO32(h->mv_cache[0][scan8[i8*4+i4]]);
if(ref[1] == 0)
- *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0;
+ AV_ZERO32(h->mv_cache[1][scan8[i8*4+i4]]);
m++;
}
}
@@ -571,8 +571,8 @@ single_col:
int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]];
mv_l0[0] = (scale * mv_col[0] + 128) >> 8;
mv_l0[1] = (scale * mv_col[1] + 128) >> 8;
- *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] =
- pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]);
+ AV_WN32A(h->mv_cache[1][scan8[i8*4+i4]],
+ pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]));
}
}
}