mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-21 14:53:10 +00:00
avcodec/mpegvideo_enc: Move MJPEG init checks to mjpegenc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
26e117a14d
commit
4d39a4db68
@ -276,6 +276,16 @@ av_cold int ff_mjpeg_encode_init(MpegEncContext *s)
|
|||||||
|
|
||||||
av_assert0(s->slice_context_count == 1);
|
av_assert0(s->slice_context_count == 1);
|
||||||
|
|
||||||
|
if (s->codec_id == AV_CODEC_ID_AMV || (s->avctx->active_thread_type & FF_THREAD_SLICE))
|
||||||
|
s->huffman = 0;
|
||||||
|
|
||||||
|
if (s->mpv_flags & FF_MPV_FLAG_QP_RD) {
|
||||||
|
// Used to produce garbage with MJPEG.
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
|
"QP RD is no longer compatible with MJPEG or AMV\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
/* The following check is automatically true for AMV,
|
/* The following check is automatically true for AMV,
|
||||||
* but it doesn't hurt either. */
|
* but it doesn't hurt either. */
|
||||||
ret = ff_mjpeg_encode_check_pix_fmt(s->avctx);
|
ret = ff_mjpeg_encode_check_pix_fmt(s->avctx);
|
||||||
|
@ -370,9 +370,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->codec_id == AV_CODEC_ID_AMV || (avctx->active_thread_type & FF_THREAD_SLICE))
|
|
||||||
s->huffman = 0;
|
|
||||||
|
|
||||||
if (s->intra_dc_precision > (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO ? 3 : 0)) {
|
if (s->intra_dc_precision > (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO ? 3 : 0)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "intra dc precision too large\n");
|
av_log(avctx, AV_LOG_ERROR, "intra dc precision too large\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
@ -573,15 +570,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((s->mpv_flags & FF_MPV_FLAG_QP_RD) &&
|
|
||||||
(s->codec_id == AV_CODEC_ID_AMV ||
|
|
||||||
s->codec_id == AV_CODEC_ID_MJPEG)) {
|
|
||||||
// Used to produce garbage with MJPEG.
|
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
|
||||||
"QP RD is no longer compatible with MJPEG or AMV\n");
|
|
||||||
return AVERROR(EINVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s->scenechange_threshold < 1000000000 &&
|
if (s->scenechange_threshold < 1000000000 &&
|
||||||
(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) {
|
(avctx->flags & AV_CODEC_FLAG_CLOSED_GOP)) {
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
Loading…
Reference in New Issue
Block a user