Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-10-27 19:46:01 +0400
committerAnton Khirnov <anton@khirnov.net>2013-11-14 12:41:03 +0400
commitaa241229891173b0357eee04e6ca78f806cc9c0c (patch)
tree2e5e24d9697d1f31e68523790d8530a669fe9f16 /libavcodec/mpegvideo_enc.c
parentb6094811f9fca66cdf853420696e96fdc3e4987a (diff)
lavc: deprecate FF_MAX_B_FRAMES
We should not arbitrarily decide the maximum B-frame number for all encoders supported by Libav, each encoder should be able to set its own limits.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 383025aab0..1acd0ffcb1 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -290,6 +290,10 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
s->avctx = avctx;
s->flags = avctx->flags;
s->flags2 = avctx->flags2;
+ if (avctx->max_b_frames > MAX_B_FRAMES) {
+ av_log(avctx, AV_LOG_ERROR, "Too many B-frames requested, maximum "
+ "is %d.\n", MAX_B_FRAMES);
+ }
s->max_b_frames = avctx->max_b_frames;
s->codec_id = avctx->codec->id;
s->strict_std_compliance = avctx->strict_std_compliance;
@@ -1021,7 +1025,7 @@ static int estimate_best_b_count(MpegEncContext *s)
{
AVCodec *codec = avcodec_find_encoder(s->avctx->codec_id);
AVCodecContext *c = avcodec_alloc_context3(NULL);
- AVFrame input[FF_MAX_B_FRAMES + 2];
+ AVFrame input[MAX_B_FRAMES + 2];
const int scale = s->avctx->brd_scale;
int i, j, out_size, p_lambda, b_lambda, lambda2;
int64_t best_rd = INT64_MAX;