1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mpegvideo_enc: Move q_scale_type check to mpeg12enc.c

The MPEG-2 encoder is the only encoder supporting q_scale_type.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-02-28 00:05:28 +01:00
parent 0c4b091bd6
commit 137060d586
2 changed files with 8 additions and 8 deletions

View File

@ -201,6 +201,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
} }
} }
if (mpeg12->mpeg.q_scale_type == 1) {
if (avctx->qmax > 28) {
av_log(avctx, AV_LOG_ERROR,
"non linear quant only supports qmax <= 28 currently\n");
return AVERROR_PATCHWELCOME;
}
}
if (avctx->profile == AV_PROFILE_UNKNOWN) { if (avctx->profile == AV_PROFILE_UNKNOWN) {
if (avctx->level != AV_LEVEL_UNKNOWN) { if (avctx->level != AV_LEVEL_UNKNOWN) {
av_log(avctx, AV_LOG_ERROR, "Set profile and level\n"); av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");

View File

@ -705,14 +705,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
} }
} }
if (s->q_scale_type == 1) {
if (avctx->qmax > 28) {
av_log(avctx, AV_LOG_ERROR,
"non linear quant only supports qmax <= 28 currently\n");
return AVERROR_PATCHWELCOME;
}
}
if (avctx->slices > 1 && if (avctx->slices > 1 &&
!(avctx->codec->capabilities & AV_CODEC_CAP_SLICE_THREADS)) { !(avctx->codec->capabilities & AV_CODEC_CAP_SLICE_THREADS)) {
av_log(avctx, AV_LOG_ERROR, "Multiple slices are not supported by this codec\n"); av_log(avctx, AV_LOG_ERROR, "Multiple slices are not supported by this codec\n");