summaryrefslogtreecommitdiff
path: root/libavcodec/h264.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-03-03 01:38:27 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-03-03 01:38:27 +0000
commit16b802fe934d5af0d2d388bcf0796dded80a00ed (patch)
tree30269570ff144ab65ffffde0198ba894befea636 /libavcodec/h264.h
parent741a17e6b4b1bc6655718e7fd5e34fb224da763f (diff)
Load the whole left side of mv&ref only when needed.
30 cpu cycles faster Originally committed as revision 22161 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r--libavcodec/h264.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 1afce71c50..8383c20b1f 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -995,6 +995,7 @@ static void fill_decode_caches(H264Context *h, int mb_type){
AV_WN32A(&h->ref_cache[list][scan8[0] + 0 - 1*8], ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE)&0xFF)*0x01010101);
}
+ if(mb_type & (MB_TYPE_16x8|MB_TYPE_8x8)){
for(i=0; i<2; i++){
int cache_idx = scan8[0] - 1 + i*2*8;
if(USES_LIST(left_type[i], list)){
@@ -1011,6 +1012,17 @@ static void fill_decode_caches(H264Context *h, int mb_type){
h->ref_cache[list][cache_idx+8]= (left_type[i]) ? LIST_NOT_USED : PART_NOT_AVAILABLE;
}
}
+ }else{
+ if(USES_LIST(left_type[0], list)){
+ const int b_xy= h->mb2b_xy[left_xy[0]] + 3;
+ const int b8_xy= 4*left_xy[0] + 1;
+ AV_COPY32(h->mv_cache[list][scan8[0] - 1], s->current_picture.motion_val[list][b_xy + h->b_stride*left_block[0]]);
+ h->ref_cache[list][scan8[0] - 1]= s->current_picture.ref_index[list][b8_xy + (left_block[0]&~1)];
+ }else{
+ AV_ZERO32(h->mv_cache [list][scan8[0] - 1]);
+ h->ref_cache[list][scan8[0] - 1]= left_type[0] ? LIST_NOT_USED : PART_NOT_AVAILABLE;
+ }
+ }
if(USES_LIST(topright_type, list)){
const int b_xy= h->mb2b_xy[topright_xy] + 3*h->b_stride;