diff mbox series

[FFmpeg-devel,3/6] avcodec/mpegvideo_enc: Call ff_h261_encode_init() earlier

Message ID GV1P250MB0737913A665E9D8A6C14FE398F589@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 759d216c47080660bbcee7f0c693d383fdf45808
Headers show
Series [FFmpeg-devel,1/6] fate/vcodec: Add speedhq tests | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 2, 2022, 9:18 p.m. UTC
It does not require anything that is being set between
the new position where it is called and the old position
where it used to be called; and nothing that it sets
gets overwritten between these two positions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo_enc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 3af0c1c0f3..e7e2e60a9a 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -689,6 +689,7 @@  av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
                     s->width, s->height);
             return AVERROR(EINVAL);
         }
+        ff_h261_encode_init(s);
         s->out_format = FMT_H261;
         avctx->delay  = 0;
         s->low_delay  = 1;
@@ -899,9 +900,7 @@  av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
     ff_set_cmp(&s->mecc, s->mecc.ildct_cmp,      avctx->ildct_cmp);
     ff_set_cmp(&s->mecc, s->mecc.frame_skip_cmp, s->frame_skip_cmp);
 
-    if (CONFIG_H261_ENCODER && s->out_format == FMT_H261) {
-        ff_h261_encode_init(s);
-    } else if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
+    if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER)
                && s->out_format == FMT_MPEG1) {
         ff_mpeg1_encode_init(s);
     } else if (CONFIG_H263_ENCODER && s->out_format == FMT_H263) {