[FFmpeg-cvslog] avcodec/h263dec: Move calculating gob_index to {intel,itu}h263dec.c

Andreas Rheinhardt git at videolan.org
Mon May 26 06:24:51 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat May 17 20:20:05 2025 +0200| [a0a136e57b9dd58d25119112579227f5f3ac68cf] | committer: Andreas Rheinhardt

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 at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0a136e57b9dd58d25119112579227f5f3ac68cf
---

 libavcodec/h263dec.c      | 5 -----
 libavcodec/intelh263dec.c | 3 +++
 libavcodec/ituh263dec.c   | 2 ++
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index eb4c48f68c..f59012fda4 100644
--- a/libavcodec/h263dec.c
+++ b/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))
diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c
index 374dfdc0de..b2e7fa6c54 100644
--- a/libavcodec/intelh263dec.c
+++ b/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;
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index d19bdc4dab..7965b77ff3 100644
--- a/libavcodec/ituh263dec.c
+++ b/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)



More information about the ffmpeg-cvslog mailing list