Mercurial > libavcodec.hg
comparison h264_direct.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 | 421c6cd2fb9f |
children | 411ab09ada91 |
comparison
equal
deleted
inserted
replaced
11202:778139a5e058 | 11203:10c06a9bd3d9 |
---|---|
181 mv[list]= pack16to32(mid_pred(A[0], B[0], C[0]), | 181 mv[list]= pack16to32(mid_pred(A[0], B[0], C[0]), |
182 mid_pred(A[1], B[1], C[1]) ); | 182 mid_pred(A[1], B[1], C[1]) ); |
183 }else { | 183 }else { |
184 assert(match_count==1); | 184 assert(match_count==1); |
185 if(left_ref==ref[list]){ | 185 if(left_ref==ref[list]){ |
186 mv[list]= *(uint32_t*)A; | 186 mv[list]= AV_RN32A(A); |
187 }else if(top_ref==ref[list]){ | 187 }else if(top_ref==ref[list]){ |
188 mv[list]= *(uint32_t*)B; | 188 mv[list]= AV_RN32A(B); |
189 }else{ | 189 }else{ |
190 mv[list]= *(uint32_t*)C; | 190 mv[list]= AV_RN32A(C); |
191 } | 191 } |
192 } | 192 } |
193 }else{ | 193 }else{ |
194 int mask= ~(MB_TYPE_L0 << (2*list)); | 194 int mask= ~(MB_TYPE_L0 << (2*list)); |
195 mv[list] = 0; | 195 mv[list] = 0; |
360 int m=0; | 360 int m=0; |
361 for(i4=0; i4<4; i4++){ | 361 for(i4=0; i4<4; i4++){ |
362 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; | 362 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; |
363 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ | 363 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ |
364 if(ref[0] == 0) | 364 if(ref[0] == 0) |
365 *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; | 365 AV_ZERO32(h->mv_cache[0][scan8[i8*4+i4]]); |
366 if(ref[1] == 0) | 366 if(ref[1] == 0) |
367 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; | 367 AV_ZERO32(h->mv_cache[1][scan8[i8*4+i4]]); |
368 m++; | 368 m++; |
369 } | 369 } |
370 } | 370 } |
371 if(!(m&3)) | 371 if(!(m&3)) |
372 h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8; | 372 h->sub_mb_type[i8]+= MB_TYPE_16x16 - MB_TYPE_8x8; |
569 for(i4=0; i4<4; i4++){ | 569 for(i4=0; i4<4; i4++){ |
570 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; | 570 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; |
571 int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; | 571 int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; |
572 mv_l0[0] = (scale * mv_col[0] + 128) >> 8; | 572 mv_l0[0] = (scale * mv_col[0] + 128) >> 8; |
573 mv_l0[1] = (scale * mv_col[1] + 128) >> 8; | 573 mv_l0[1] = (scale * mv_col[1] + 128) >> 8; |
574 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = | 574 AV_WN32A(h->mv_cache[1][scan8[i8*4+i4]], |
575 pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); | 575 pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1])); |
576 } | 576 } |
577 } | 577 } |
578 } | 578 } |
579 } | 579 } |
580 } | 580 } |