[FFmpeg-cvslog] avcodec/mpegvideo_enc: Move SpeedHQ check to speedhqenc.c

Andreas Rheinhardt git at videolan.org
Thu Oct 6 16:28:36 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Oct  2 21:32:19 2022 +0200| [40e4ddf61943404582b5506b7b7ab487c4025864] | committer: Andreas Rheinhardt

avcodec/mpegvideo_enc: Move SpeedHQ check to speedhqenc.c

Also set this only once and not for every frame.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=40e4ddf61943404582b5506b7b7ab487c4025864
---

 libavcodec/mpegvideo_enc.c | 3 ---
 libavcodec/speedhqenc.c    | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 06c3ff4cbe..f16fc1aaed 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -3753,9 +3753,6 @@ static int encode_picture(MpegEncContext *s, int picture_number)
                               s->chroma_intra_matrix, s->intra_quant_bias, 8, 8, 1);
             s->qscale = 8;
         }
-    } else if (s->out_format == FMT_SPEEDHQ) {
-        s->y_dc_scale_table=
-        s->c_dc_scale_table= ff_mpeg2_dc_scale_table[3];
     }
 
     //FIXME var duplication
diff --git a/libavcodec/speedhqenc.c b/libavcodec/speedhqenc.c
index 4a009bd070..4c1d76631b 100644
--- a/libavcodec/speedhqenc.c
+++ b/libavcodec/speedhqenc.c
@@ -36,6 +36,7 @@
 #include "mpeg12data.h"
 #include "mpeg12vlc.h"
 #include "mpegvideo.h"
+#include "mpegvideodata.h"
 #include "mpegvideoenc.h"
 #include "speedhqenc.h"
 
@@ -111,6 +112,9 @@ av_cold int ff_speedhq_encode_init(MpegEncContext *s)
     s->intra_chroma_ac_vlc_length      =
     s->intra_chroma_ac_vlc_last_length = uni_speedhq_ac_vlc_len;
 
+    s->y_dc_scale_table =
+    s->c_dc_scale_table = ff_mpeg2_dc_scale_table[3];
+
     switch (s->avctx->pix_fmt) {
     case AV_PIX_FMT_YUV420P:
         s->avctx->codec_tag = MKTAG('S','H','Q','0');



More information about the ffmpeg-cvslog mailing list