H264: use alias-safe macros
[ffmpeg.git] / libavcodec / h264_mvpred.h
index 3409919..4a6780a 100644 (file)
@@ -54,11 +54,11 @@ static inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, int i, in
                 return s->current_picture_ptr->ref_index[list][(x4>>1) + (y4>>1)*h->b8_stride] REF_OP;
 
         if(topright_ref == PART_NOT_AVAILABLE
-           && ((s->mb_y&1) || i >= scan8[0]+8) && (i&7)==4
+           && i >= scan8[0]+8 && (i&7)==4
            && 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
@@ -66,8 +66,7 @@ static inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, int i, in
                 SET_DIAG_MV(*2, >>1, s->mb_x*4-1, (s->mb_y|1)*4+(s->mb_y&1)*2+(i>>4)-1);
             }
             if(MB_FIELD
-               && !IS_INTERLACED(mb_types[h->left_mb_xy[0]])
-               && i >= scan8[0]+8){
+               && !IS_INTERLACED(mb_types[h->left_mb_xy[0]])){
                 // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK.
                 SET_DIAG_MV(/2, <<1, s->mb_x*4-1, (s->mb_y&~1)*4 - 1 + ((i-scan8[0])>>3)*2);
             }
@@ -221,8 +220,8 @@ static inline void pred_pskip_motion(H264Context * const h, int * const mx, int
     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;