aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-05-17 20:20:05 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-05-26 04:02:32 +0200
commita0a136e57b9dd58d25119112579227f5f3ac68cf (patch)
tree8a102aa2dca9894ff91fab68a6067dd22dfc6b24
parent99187419676dadeb6560950fac4706577fdc2bfb (diff)
downloadffmpeg-a0a136e57b9dd58d25119112579227f5f3ac68cf.tar.gz
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>
-rw-r--r--libavcodec/h263dec.c5
-rw-r--r--libavcodec/intelh263dec.c3
-rw-r--r--libavcodec/ituh263dec.c2
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)