From 4527ee66d9fc5b13b6946ed3912de88b4d738a3f Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 17 May 2025 20:20:05 +0200 Subject: [PATCH 02/19] 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 --- 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 c36070e23c..501b8b44ff 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -537,11 +537,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) -- 2.45.2