Browse Source

avcodec/h263dec: Move calculating gob_index to {intel,itu}h263dec.c

This avoids checks for whether it should be calculated at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Andreas Rheinhardt 6 months ago
parent
commit
a0a136e57b
3 changed files with 5 additions and 5 deletions
  1. 0 5
      libavcodec/h263dec.c
  2. 3 0
      libavcodec/intelh263dec.c
  3. 2 0
      libavcodec/ituh263dec.c

+ 0 - 5
libavcodec/h263dec.c

@@ -535,11 +535,6 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict,
         }
     }
 
-    if (s->codec_id == AV_CODEC_ID_H263  ||
-        s->codec_id == AV_CODEC_ID_H263P ||
-        s->codec_id == AV_CODEC_ID_H263I)
-        s->gob_index = H263_GOB_HEIGHT(s->height);
-
     /* skip B-frames if we don't have reference frames */
     if (!s->last_pic.ptr &&
         (s->pict_type == AV_PICTURE_TYPE_B || s->droppable))

+ 3 - 0
libavcodec/intelh263dec.c

@@ -19,6 +19,7 @@
  */
 
 #include "codec_internal.h"
+#include "h263.h"
 #include "mpegvideo.h"
 #include "mpegvideodec.h"
 #include "h263data.h"
@@ -119,6 +120,8 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
     if (skip_1stop_8data_bits(&s->gb) < 0)
         return AVERROR_INVALIDDATA;
 
+    s->gob_index = H263_GOB_HEIGHT(s->height);
+
     ff_h263_show_pict_info(s);
 
     return 0;

+ 2 - 0
libavcodec/ituh263dec.c

@@ -1314,6 +1314,8 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
     s->mb_height = (s->height  + 15) / 16;
     s->mb_num = s->mb_width * s->mb_height;
 
+    s->gob_index = H263_GOB_HEIGHT(s->height);
+
     if (s->pb_frame) {
         skip_bits(&s->gb, 3); /* Temporal reference for B-pictures */
         if (s->custom_pcf)