History

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

Andreas Rheinhardt committed 1 year ago

Commit d9dea701 parent fca1ac22 files · +9 −10Browse files

Showing the changes to libavcodec (2 of 2 files). Show all

Unified · Split

2 files
  1. libavcodec/mpeg4videoenc.c +9 −0
  2. libavcodec/mpegvideo_enc.c +0 −10
libavcodec/mpeg4videoenc.c+9−0
@@ -1305,6 +1305,15 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1304 unmodified lines
13051305
13061306 ff_thread_once(&init_static_once, mpeg4_encode_init_static);
13071307
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+
13081317 m4->time_increment_bits = av_log2(avctx->time_base.den - 1) + 1;
13091318
13101319 s->fcode_tab = fcode_tab + MAX_MV;
libavcodec/mpegvideo_enc.c+0−10
@@ -737,16 +737,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 736 unmodified lines
737737
738738 av_log(avctx, AV_LOG_DEBUG, "intra_quant_bias = %d inter_quant_bias = %d\n",s->intra_quant_bias,s->inter_quant_bias);
739739
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−
750740 switch (avctx->codec->id) {
751741 #if CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER
752742 case AV_CODEC_ID_MPEG2VIDEO:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t