From 9de2595e2b5fd03d427fa72b586540e356b05311 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 25 Mar 2025 12:12:59 +0100 Subject: [PATCH 25/44] avcodec/mpegvideo_dec: Remove ff_mpv_common_frame_size_change() No longer used anywhere. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegvideo_dec.c | 46 +------------------------------------- libavcodec/mpegvideodec.h | 2 -- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index eb9e69871f..7e300bcdc2 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -26,8 +26,8 @@ #include "libavutil/avassert.h" #include "libavutil/emms.h" -#include "libavutil/imgutils.h" #include "libavutil/internal.h" +#include "libavutil/pixdesc.h" #include "libavutil/video_enc_params.h" #include "avcodec.h" @@ -152,50 +152,6 @@ av_cold int ff_mpv_decode_close(AVCodecContext *avctx) return 0; } -av_cold int ff_mpv_common_frame_size_change(MpegEncContext *s) -{ - int err = 0; - - if (!s->context_initialized) - return AVERROR(EINVAL); - - ff_mpv_free_context_frame(s); - - ff_mpv_unref_picture(&s->last_pic); - ff_mpv_unref_picture(&s->next_pic); - ff_mpv_unref_picture(&s->cur_pic); - - if ((s->width || s->height) && - (err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0) - goto fail; - - /* set chroma shifts */ - err = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, - &s->chroma_x_shift, - &s->chroma_y_shift); - if (err < 0) - goto fail; - - if ((err = ff_mpv_init_context_frame(s))) - goto fail; - - memset(s->thread_context, 0, sizeof(s->thread_context)); - s->thread_context[0] = s; - - if (s->width && s->height) { - err = ff_mpv_init_duplicate_contexts(s); - if (err < 0) - goto fail; - } - s->context_reinit = 0; - - return 0; - fail: - ff_mpv_free_context_frame(s); - s->context_reinit = 1; - return err; -} - static int alloc_picture(MpegEncContext *s, MPVWorkPicture *dst, int reference) { AVCodecContext *avctx = s->avctx; diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h index ef6e657c0b..df587732fe 100644 --- a/libavcodec/mpegvideodec.h +++ b/libavcodec/mpegvideodec.h @@ -54,8 +54,6 @@ int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx); */ int ff_mpv_decode_reinit(MpegEncContext *s); -int ff_mpv_common_frame_size_change(MpegEncContext *s); - int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); /** * Ensure that the dummy frames are allocated according to pict_type if necessary. -- 2.45.2