History

avcodec/mpegvideo_enc: Move vbv_delay warning to mpeg12enc.c

It is MPEG-1/2 only.

Andreas Rheinhardt committed 1 year ago

Commit c3ab7361 parent 137060d2 files · +9 −11Browse files

Unified · Split

2 files
  1. libavcodec/mpeg12enc.c +9 −0
  2. libavcodec/mpegvideo_enc.c +0 −11
libavcodec/mpeg12enc.c+9−0
@@ -255,6 +255,15 @@ static av_cold int encode_init(AVCodecContext *avctx) · 254 unmodified lines
255255 }
256256 }
257257
258+ if (avctx->rc_max_rate &&
259+ avctx->rc_min_rate == avctx->rc_max_rate &&
260+ 90000LL * (avctx->rc_buffer_size - 1) >
261+ avctx->rc_max_rate * 0xFFFFLL) {
262+ av_log(avctx, AV_LOG_INFO,
263+ "Warning vbv_delay will be set to 0xFFFF (=VBR) as the "
264+ "specified vbv buffer is too large for the given bitrate!\n");
265+ }
266+
258267 if (mpeg12->drop_frame_timecode)
259268 mpeg12->tc.flags |= AV_TIMECODE_FLAG_DROPFRAME;
260269 if (mpeg12->drop_frame_timecode && mpeg12->frame_rate_index != 4) {
libavcodec/mpegvideo_enc.c+0−11
@@ -588,17 +588,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) · 587 unmodified lines
588588 avctx->bit_rate_tolerance = INT_MAX;
589589 }
590590
591− if (avctx->rc_max_rate &&
592− avctx->rc_min_rate == avctx->rc_max_rate &&
593− (s->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
594− s->codec_id == AV_CODEC_ID_MPEG2VIDEO) &&
595− 90000LL * (avctx->rc_buffer_size - 1) >
596− avctx->rc_max_rate * 0xFFFFLL) {
597− av_log(avctx, AV_LOG_INFO,
598− "Warning vbv_delay will be set to 0xFFFF (=VBR) as the "
599− "specified vbv buffer is too large for the given bitrate!\n");
600− }
601−
602591 if ((avctx->flags & AV_CODEC_FLAG_4MV) && s->codec_id != AV_CODEC_ID_MPEG4 &&
603592 s->codec_id != AV_CODEC_ID_H263 && s->codec_id != AV_CODEC_ID_H263P &&
604593 s->codec_id != AV_CODEC_ID_FLV1) {

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