comparison 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
comparison
equal deleted inserted replaced
11202:778139a5e058 11203:10c06a9bd3d9
56 if(topright_ref == PART_NOT_AVAILABLE 56 if(topright_ref == PART_NOT_AVAILABLE
57 && i >= scan8[0]+8 && (i&7)==4 57 && i >= scan8[0]+8 && (i&7)==4
58 && h->ref_cache[list][scan8[0]-1] != PART_NOT_AVAILABLE){ 58 && h->ref_cache[list][scan8[0]-1] != PART_NOT_AVAILABLE){
59 const uint32_t *mb_types = s->current_picture_ptr->mb_type; 59 const uint32_t *mb_types = s->current_picture_ptr->mb_type;
60 const int16_t *mv; 60 const int16_t *mv;
61 *(uint32_t*)h->mv_cache[list][scan8[0]-2] = 0; 61 AV_ZERO32(h->mv_cache[list][scan8[0]-2]);
62 *C = h->mv_cache[list][scan8[0]-2]; 62 *C = h->mv_cache[list][scan8[0]-2];
63 63
64 if(!MB_FIELD 64 if(!MB_FIELD
65 && IS_INTERLACED(mb_types[h->left_mb_xy[0]])){ 65 && IS_INTERLACED(mb_types[h->left_mb_xy[0]])){
66 SET_DIAG_MV(*2, >>1, s->mb_x*4-1, (s->mb_y|1)*4+(s->mb_y&1)*2+(i>>4)-1); 66 SET_DIAG_MV(*2, >>1, s->mb_x*4-1, (s->mb_y|1)*4+(s->mb_y&1)*2+(i>>4)-1);
218 const int left_ref= h->ref_cache[0][ scan8[0] - 1 ]; 218 const int left_ref= h->ref_cache[0][ scan8[0] - 1 ];
219 219
220 tprintf(h->s.avctx, "pred_pskip: (%d) (%d) at %2d %2d\n", top_ref, left_ref, h->s.mb_x, h->s.mb_y); 220 tprintf(h->s.avctx, "pred_pskip: (%d) (%d) at %2d %2d\n", top_ref, left_ref, h->s.mb_x, h->s.mb_y);
221 221
222 if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE 222 if(top_ref == PART_NOT_AVAILABLE || left_ref == PART_NOT_AVAILABLE
223 || !( top_ref | *(uint32_t*)h->mv_cache[0][ scan8[0] - 8 ]) 223 || !( top_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 8 ]))
224 || !(left_ref | *(uint32_t*)h->mv_cache[0][ scan8[0] - 1 ])){ 224 || !(left_ref | AV_RN32A(h->mv_cache[0][ scan8[0] - 1 ]))){
225 225
226 *mx = *my = 0; 226 *mx = *my = 0;
227 return; 227 return;
228 } 228 }
229 229