[FFmpeg-cvslog] avcodec/vc1dec: Don't call ff_get_format() twice
Andreas Rheinhardt
git at videolan.org
Fri Feb 9 11:19:42 EET 2024
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon Feb 5 22:49:21 2024 +0100| [ca9586375828bbb4d8ef7eeeb3ad3b55116c6fd7] | committer: Andreas Rheinhardt
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 <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca9586375828bbb4d8ef7eeeb3ad3b55116c6fd7
---
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);
More information about the ffmpeg-cvslog
mailing list