diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-03-04 05:00:05 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-03-04 05:00:05 +0300 |
commit | 38768cb70a3688f7b71c5104130b31d6a3834bee (patch) | |
tree | 61d099f6b3b21a6150c3934c4cff55a156bb55a0 /libavcodec/h264.h | |
parent | b46b5ac9f8d013e238931fef9783e91c12d50b71 (diff) |
Port Optimizations about *_type init from decode to filter code.
1 cpu cycle faster
Originally committed as revision 22193 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7caf7b3ed2..0ca6ed15ad 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1215,15 +1215,20 @@ static int fill_filter_caches(H264Context *h, int mb_type){ } } + top_type = s->current_picture.mb_type[top_xy] ; + left_type[0] = s->current_picture.mb_type[left_xy[0]]; + left_type[1] = s->current_picture.mb_type[left_xy[1]]; if(h->deblocking_filter == 2){ - h->top_type = top_type = h->slice_table[top_xy ] == h->slice_num ? s->current_picture.mb_type[top_xy] : 0; - h->left_type[0]= left_type[0] = h->slice_table[left_xy[0] ] == h->slice_num ? s->current_picture.mb_type[left_xy[0]] : 0; - h->left_type[1]= left_type[1] = h->slice_table[left_xy[1] ] == h->slice_num ? s->current_picture.mb_type[left_xy[1]] : 0; + if(h->slice_table[top_xy ] != h->slice_num) top_type= 0; + if(h->slice_table[left_xy[0] ] != h->slice_num) left_type[0]= left_type[1]= 0; }else{ - h->top_type = top_type = h->slice_table[top_xy ] < 0xFFFF ? s->current_picture.mb_type[top_xy] : 0; - h->left_type[0]= left_type[0] = h->slice_table[left_xy[0] ] < 0xFFFF ? s->current_picture.mb_type[left_xy[0]] : 0; - h->left_type[1]= left_type[1] = h->slice_table[left_xy[1] ] < 0xFFFF ? s->current_picture.mb_type[left_xy[1]] : 0; + if(h->slice_table[top_xy ] == 0xFFFF) top_type= 0; + if(h->slice_table[left_xy[0] ] == 0xFFFF) left_type[0]= left_type[1] =0; } + h->top_type = top_type ; + h->left_type[0]= left_type[0]; + h->left_type[1]= left_type[1]; + if(IS_INTRA(mb_type)) return 0; |