[FFmpeg-cvslog] r16172 - in trunk/libavcodec: h264.c h264.h

michael subversion
Tue Dec 16 21:26:22 CET 2008


Author: michael
Date: Tue Dec 16 21:26:22 2008
New Revision: 16172

Log:
Do not recalculate constant part of is_complex for every MB.


Modified:
   trunk/libavcodec/h264.c
   trunk/libavcodec/h264.h

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Tue Dec 16 21:26:22 2008
@@ -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 AVCodecCo
 
     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;
 

Modified: trunk/libavcodec/h264.h
==============================================================================
--- trunk/libavcodec/h264.h	(original)
+++ trunk/libavcodec/h264.h	Tue Dec 16 21:26:22 2008
@@ -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 */




More information about the ffmpeg-cvslog mailing list