comparison h264.c @ 8411:b749b637ecfa libavcodec

Optimize get_dct8x8_allowed(). 30 cpu cycles faster on pentium dual.
author michael
date Sat, 20 Dec 2008 23:11:30 +0000
parents f94a6d6df87e
children 938824a1f42f
comparison
equal deleted inserted replaced
8410:b0ec9768b39b 8411:b749b637ecfa
4037 4037
4038 return log-1; 4038 return log-1;
4039 } 4039 }
4040 4040
4041 static inline int get_dct8x8_allowed(H264Context *h){ 4041 static inline int get_dct8x8_allowed(H264Context *h){
4042 int i; 4042 if(h->sps.direct_8x8_inference_flag)
4043 for(i=0; i<4; i++){ 4043 return !(*(uint64_t*)h->sub_mb_type & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8 )*0x0001000100010001ULL));
4044 if(!IS_SUB_8X8(h->sub_mb_type[i]) 4044 else
4045 || (!h->sps.direct_8x8_inference_flag && IS_DIRECT(h->sub_mb_type[i]))) 4045 return !(*(uint64_t*)h->sub_mb_type & ((MB_TYPE_16x8|MB_TYPE_8x16|MB_TYPE_8x8|MB_TYPE_DIRECT2)*0x0001000100010001ULL));
4046 return 0;
4047 }
4048 return 1;
4049 } 4046 }
4050 4047
4051 /** 4048 /**
4052 * decodes a residual block. 4049 * decodes a residual block.
4053 * @param n block index 4050 * @param n block index