comparison h264.h @ 11334:e0428148bcf7 libavcodec

Load the whole left side of mv&ref only when needed. 30 cpu cycles faster
author michael
date Wed, 03 Mar 2010 01:38:27 +0000
parents eefbe8dadcd2
children a184cfcdae54
comparison
equal deleted inserted replaced
11333:e7c30cba2c7b 11334:e0428148bcf7
993 }else{ 993 }else{
994 AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]); 994 AV_ZERO128(h->mv_cache[list][scan8[0] + 0 - 1*8]);
995 AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101); 995 AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
996 } 996 }
997 997
998 if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
998 for(i=0; i<2; i++){ 999 for(i=0; i<2; i++){
999 int cache_idx = scan8[0] - 1 + i*2*8; 1000 int cache_idx = scan8[0] - 1 + i*2*8;
1000 if(USES_LIST(left_type[i], list)){ 1001 if(USES_LIST(left_type[i], list)){
1001 const int b_xy= h->mb2b_xy[left_xy[i]] + 3; 1002 const int b_xy= h->mb2b_xy[left_xy[i]] + 3;
1002 const int b8_xy= 4*left_xy[i] + 1; 1003 const int b8_xy= 4*left_xy[i] + 1;
1007 }else{ 1008 }else{
1008 AV_ZERO32(h->mv_cache [list][cache_idx ]); 1009 AV_ZERO32(h->mv_cache [list][cache_idx ]);
1009 AV_ZERO32(h->mv_cache [list][cache_idx+8]); 1010 AV_ZERO32(h->mv_cache [list][cache_idx+8]);
1010 h->ref_cache[list][cache_idx ]= 1011 h->ref_cache[list][cache_idx ]=
1011 h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE; 1012 h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1013 }
1014 }
1015 }else{
1016 if(USES_LIST(left_type[0], list)){
1017 const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
1018 const int b8_xy= 4*left_xy[0] + 1;
1019 AV_COPY32(h->mv_cache[list][scan8[0] - 1], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]]);
1020 h->ref_cache[list][scan8[0] - 1]= s->current_picture.ref_index[list][b8_xy + (left_block[0]&~1)];
1021 }else{
1022 AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);
1023 h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
1012 } 1024 }
1013 } 1025 }
1014 1026
1015 if(USES_LIST(topright_type, list)){ 1027 if(USES_LIST(topright_type, list)){
1016 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride; 1028 const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;