Unified · Split
| @@ -1305,6 +1305,15 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1304 unmodified lines | |||
| 1305 | 1305 | ||
| 1306 | ff_thread_once(&init_static_once, mpeg4_encode_init_static); | 1306 | ff_thread_once(&init_static_once, mpeg4_encode_init_static); |
| 1307 | 1307 | ||
| 1308 | if (avctx->time_base.den > (1 << 16) - 1) { | ||
| 1309 | av_log(avctx, AV_LOG_ERROR, | ||
| 1310 | "timebase %d/%d not supported by MPEG 4 standard, " | ||
| 1311 | "the maximum admitted value for the timebase denominator " | ||
| 1312 | "is %d\n", avctx->time_base.num, avctx->time_base.den, | ||
| 1313 | (1 << 16) - 1); | ||
| 1314 | return AVERROR(EINVAL); | ||
| 1315 | } | ||
| 1316 | |||
| 1308 | m4->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1; | 1317 | m4->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1; |
| 1309 | 1318 | ||
| 1310 | s->fcode_tab = fcode_tab + MAX_MV; | 1319 | s->fcode_tab = fcode_tab + MAX_MV; |
| @@ -737,16 +737,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 736 unmodified lines | |||
| 737 | 737 | ||
| 738 | av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias); | 738 | av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias); |
| 739 | 739 | ||
| 740 | if (avctx->codec_id == AV_CODEC_ID_MPEG4 && | ||
| 741 | avctx->time_base.den > (1 << 16) - 1) { | ||
| 742 | av_log(avctx, AV_LOG_ERROR, | ||
| 743 | "timebase %d/%d not supported by MPEG 4 standard, " | ||
| 744 | "the maximum admitted value for the timebase denominator " | ||
| 745 | "is %d\n", avctx->time_base.num, avctx->time_base.den, | ||
| 746 | (1 << 16) - 1); | ||
| 747 | return AVERROR(EINVAL); | ||
| 748 | } | ||
| 749 | |||
| 750 | switch (avctx->codec->id) { | 740 | switch (avctx->codec->id) { |
| 751 | #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER | 741 | #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER |
| 752 | case AV_CODEC_ID_MPEG2VIDEO: | 742 | case AV_CODEC_ID_MPEG2VIDEO: |