diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-12-20 23:11:30 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-12-20 23:11:30 +0000 |
commit | 66c07ca96f0703134cd52f2332186c286f3dab39 (patch) | |
tree | 9126374fa5c98eed36d08c23e1df8cece44bb3d9 | |
parent | 6beb8b2612e9f212fb1415647be4c5e87a7f1b97 (diff) | |
download | ffmpeg-66c07ca96f0703134cd52f2332186c286f3dab39.tar.gz |
Optimize get_dct8x8_allowed().
30 cpu cycles faster on pentium dual.
Originally committed as revision 16248 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 11 | ||||
-rw-r--r-- | libavcodec/h264.h | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 5a2bb7f5c2..202ff91f92 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -4039,13 +4039,10 @@ static inline int get_level_prefix(GetBitContext *gb){ } static inline int get_dct8x8_allowed(H264Context *h){ - int i; - for(i=0; i<4; i++){ - if(!IS_SUB_8X8(h->sub_mb_type[i]) - || (!h->sps.direct_8x8_inference_flag && IS_DIRECT(h->sub_mb_type[i]))) - return 0; - } - return 1; + if(h->sps.direct_8x8_inference_flag) + return !(*(uint64_t*)h->sub_mb_type & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL)); + else + return !(*(uint64_t*)h->sub_mb_type & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8|MB_TYPE_DIRECT2)*0x0001000100010001ULL)); } /** diff --git a/libavcodec/h264.h b/libavcodec/h264.h index 7708195f5b..40a94a0228 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -339,7 +339,7 @@ typedef struct H264Context{ int mb_field_decoding_flag; int mb_mbaff; ///< mb_aff_frame && mb_field_decoding_flag - unsigned int sub_mb_type[4]; + uint16_t sub_mb_type[4]; //POC stuff int poc_lsb; |