Mercurial > libavcodec.hg
diff h264_mvpred.h @ 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 | 3a7fa91fa168 |
children | 411ab09ada91 |
line wrap: on
line diff
--- a/h264_mvpred.h Thu Feb 18 12:37:43 2010 +0000 +++ b/h264_mvpred.h Thu Feb 18 16:24:31 2010 +0000 @@ -58,7 +58,7 @@ && h->ref_cache[list][scan8[0]-1] != PART_NOT_AVAILABLE){ const uint32_t *mb_types = s->current_picture_ptr->mb_type; const int16_t *mv; - *(uint32_t*)h->mv_cache[list][scan8[0]-2] = 0; + AV_ZERO32(h->mv_cache[list][scan8[0]-2]); *C = h->mv_cache[list][scan8[0]-2]; if(!MB_FIELD @@ -220,8 +220,8 @@ tprintf(h->s.avctx, "pred_pskip: (%d) (%d) at %2d %2d\n", top_ref, left_ref, h->s.mb_x, h->s.mb_y); if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE - || !( top_ref | *(uint32_t*)h->mv_cache[0][ scan8[0] - 8 ]) - || !(left_ref | *(uint32_t*)h->mv_cache[0][ scan8[0] - 1 ])){ + || !( top_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 8 ])) + || !(left_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 1 ]))){ *mx = *my = 0; return;