# HG changeset patch # User michael # Date 1229459182 0 # Node ID add1a0d6537004031355253743e5bd9debfeea6a # Parent 82790b28b6e01fb5994cecb0b1c61e2fc1f9aef7 Do not recalculate constant part of is_complex for every MB. diff -r 82790b28b6e0 -r add1a0d65370 h264.c --- a/h264.c Tue Dec 16 20:09:09 2008 +0000 +++ b/h264.c Tue Dec 16 20:26:22 2008 +0000 @@ -2610,9 +2610,7 @@ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; const int mb_type= s->current_picture.mb_type[mb_xy]; - int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 || - (ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding) || ENABLE_SMALL || - s->qscale == 0; + int is_complex = h->is_complex || IS_INTRA_PCM(mb_type) || s->qscale == 0; if(ENABLE_H264_ENCODER && !s->decode) return; @@ -6573,6 +6571,9 @@ s->mb_skip_run= -1; + h->is_complex = FRAME_MBAFF || s->picture_structure != PICT_FRAME || s->codec_id != CODEC_ID_H264 || + (ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding) || ENABLE_SMALL; + if( h->pps.cabac ) { int i; diff -r 82790b28b6e0 -r add1a0d65370 h264.h --- a/h264.h Tue Dec 16 20:09:09 2008 +0000 +++ b/h264.h Tue Dec 16 20:26:22 2008 +0000 @@ -491,6 +491,8 @@ * pic_struct in picture timing SEI message */ SEI_PicStructType sei_pic_struct; + + int is_complex; }H264Context; #endif /* AVCODEC_H264_H */