From ca9586375828bbb4d8ef7eeeb3ad3b55116c6fd7 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Mon, 5 Feb 2024 22:49:21 +0100 Subject: [PATCH] avcodec/vc1dec: Don't call ff_get_format() twice It is currently called once in the codecs' init function and once when (re)initializing the VC-1 decode context (which happens upon frame size changes as well as before decoding the first frame). The first one is unnecessary now that vc1_decode_frame() no longer requires avctx->hwaccel to be already set for hwaccel to work properly. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1dec.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 6462a40fd3..4f4aa8aa07 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -691,14 +691,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (v->profile == PROFILE_ADVANCED) avctx->level = v->level; - if (!CONFIG_GRAY || !(avctx->flags & AV_CODEC_FLAG_GRAY)) - avctx->pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); - else { - avctx->pix_fmt = AV_PIX_FMT_GRAY8; - if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED) - avctx->color_range = AVCOL_RANGE_MPEG; - } - ff_blockdsp_init(&s->bdsp); ff_h264chroma_init(&v->h264chroma, 8);