diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-02-26 15:26:11 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-02-26 15:26:11 +0000 |
commit | cf41a02b1bac717d3adac1def9a531dc9d078b4a (patch) | |
tree | 248949a4705042790bbb4e30715718399df150fa /libavcodec/h264.h | |
parent | cf7b67bc40d22694f13988d261b92de23493a810 (diff) | |
download | ffmpeg-cf41a02b1bac717d3adac1def9a531dc9d078b4a.tar.gz |
Only load the topleft mv/ref when the topright is unavailable.
8 cpu cycles faster.
Originally committed as revision 22079 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 1ef7403a86..5eae1e2526 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1006,16 +1006,6 @@ static void fill_decode_caches(H264Context *h, int mb_type){ } } - if(USES_LIST(topleft_type, list)){ - const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride); - const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2); - AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]); - h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy]; - }else{ - AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]); - h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? 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; AV_COPY32(h->mv_cache[list][scan8[0] + 4 - 1*8], s->current_picture.motion_val[list][b_xy]); @@ -1024,6 +1014,17 @@ static void fill_decode_caches(H264Context *h, int mb_type){ AV_ZERO32(h->mv_cache [list][scan8[0] + 4 - 1*8]); h->ref_cache[list][scan8[0] + 4 - 1*8]= topright_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; } + if(h->ref_cache[list][scan8[0] + 4 - 1*8] < 0){ + if(USES_LIST(topleft_type, list)){ + const int b_xy = h->mb2b_xy [topleft_xy] + 3 + h->b_stride + (h->topleft_partition & 2*h->b_stride); + const int b8_xy= 4*topleft_xy + 1 + (h->topleft_partition & 2); + AV_COPY32(h->mv_cache[list][scan8[0] - 1 - 1*8], s->current_picture.motion_val[list][b_xy]); + h->ref_cache[list][scan8[0] - 1 - 1*8]= s->current_picture.ref_index[list][b8_xy]; + }else{ + AV_ZERO32(h->mv_cache[list][scan8[0] - 1 - 1*8]); + h->ref_cache[list][scan8[0] - 1 - 1*8]= topleft_type ? LIST_NOT_USED : PART_NOT_AVAILABLE; + } + } if((mb_type&(MB_TYPE_SKIP|MB_TYPE_DIRECT2)) && !FRAME_MBAFF) continue; |