comparison mpegvideo_common.h @ 12020:f0a87ee1f6a9 libavcodec

Fix strict-aliasing violations in MPV_motion_internal. Patch by Eli Friedman, eli D friedman A gmail
author cehoyos
date Wed, 30 Jun 2010 01:47:42 +0000
parents c5e03082fd94
children 25e9cb2b9477
comparison
equal deleted inserted replaced
12019:570816e8d347 12020:f0a87ee1f6a9
668 }else{ 668 }else{
669 memcpy(mv_cache[0][1], s->current_picture.motion_val[0][mot_xy-mot_stride], sizeof(int16_t)*4); 669 memcpy(mv_cache[0][1], s->current_picture.motion_val[0][mot_xy-mot_stride], sizeof(int16_t)*4);
670 } 670 }
671 671
672 if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){ 672 if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){
673 *(int32_t*)mv_cache[1][0]= *(int32_t*)mv_cache[1][1]; 673 AV_COPY32(mv_cache[1][0], mv_cache[1][1]);
674 *(int32_t*)mv_cache[2][0]= *(int32_t*)mv_cache[2][1]; 674 AV_COPY32(mv_cache[2][0], mv_cache[2][1]);
675 }else{ 675 }else{
676 *(int32_t*)mv_cache[1][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1]; 676 AV_COPY32(mv_cache[1][0], s->current_picture.motion_val[0][mot_xy-1]);
677 *(int32_t*)mv_cache[2][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1+mot_stride]; 677 AV_COPY32(mv_cache[2][0], s->current_picture.motion_val[0][mot_xy-1+mot_stride]);
678 } 678 }
679 679
680 if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){ 680 if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){
681 *(int32_t*)mv_cache[1][3]= *(int32_t*)mv_cache[1][2]; 681 AV_COPY32(mv_cache[1][3], mv_cache[1][2]);
682 *(int32_t*)mv_cache[2][3]= *(int32_t*)mv_cache[2][2]; 682 AV_COPY32(mv_cache[2][3], mv_cache[2][2]);
683 }else{ 683 }else{
684 *(int32_t*)mv_cache[1][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2]; 684 AV_COPY32(mv_cache[1][3], s->current_picture.motion_val[0][mot_xy+2]);
685 *(int32_t*)mv_cache[2][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2+mot_stride]; 685 AV_COPY32(mv_cache[2][3], s->current_picture.motion_val[0][mot_xy+2+mot_stride]);
686 } 686 }
687 687
688 mx = 0; 688 mx = 0;
689 my = 0; 689 my = 0;
690 for(i=0;i<4;i++) { 690 for(i=0;i<4;i++) {