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

avcodec/mpegvideo_enc: Move MPEG-4 specific check to mpeg4videoenc.c

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-02 02:20:03 +01:00
parent fca1ac2cba
commit d9dea7088d
2 changed files with 9 additions and 10 deletions

View File

@ -1305,6 +1305,15 @@ static av_cold int encode_init(AVCodecContext *avctx)
ff_thread_once(&init_static_once, mpeg4_encode_init_static);
if (avctx->time_base.den > (1 << 16) - 1) {
av_log(avctx, AV_LOG_ERROR,
"timebase %d/%d not supported by MPEG 4 standard, "
"the maximum admitted value for the timebase denominator "
"is %d\n", avctx->time_base.num, avctx->time_base.den,
(1 << 16) - 1);
return AVERROR(EINVAL);
}
m4->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1;
s->fcode_tab = fcode_tab + MAX_MV;

View File

@ -737,16 +737,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias);
if (avctx->codec_id == AV_CODEC_ID_MPEG4 &&
avctx->time_base.den > (1 << 16) - 1) {
av_log(avctx, AV_LOG_ERROR,
"timebase %d/%d not supported by MPEG 4 standard, "
"the maximum admitted value for the timebase denominator "
"is %d\n", avctx->time_base.num, avctx->time_base.den,
(1 << 16) - 1);
return AVERROR(EINVAL);
}
switch (avctx->codec->id) {
#if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER
case AV_CODEC_ID_MPEG2VIDEO: