aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-12-16 20:26:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-12-16 20:26:22 +0000
commit89db0bae260ca55eaa054fa4ff63ea76ade41560 (patch)
treec25a83b857e27b3bfb57d2e125d15dfae1aa201f
parent41e4055b63d64f62fd259858ca0bca83e867878f (diff)
downloadffmpeg-89db0bae260ca55eaa054fa4ff63ea76ade41560.tar.gz
Do not recalculate constant part of is_complex for every MB.
Originally committed as revision 16172 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h264.c7
-rw-r--r--libavcodec/h264.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 47965263a3..dab2d07f38 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2610,9 +2610,7 @@ static void hl_decode_mb(H264Context *h){
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 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){
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 --git a/libavcodec/h264.h b/libavcodec/h264.h
index 5599af9bd0..7708195f5b 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -491,6 +491,8 @@ typedef struct H264Context{
* pic_struct in picture timing SEI message
*/
SEI_PicStructType sei_pic_struct;
+
+ int is_complex;
}H264Context;
#endif /* AVCODEC_H264_H */