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@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-10-02 21:32:19 +02:00
parent 406c7fceeb
commit 40e4ddf619
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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');