diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-10-27 13:51:16 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-11-14 09:39:43 +0100 |
commit | 8941971a8f2e24b9a84fe29f128d13ceb89c0a65 (patch) | |
tree | 50b1f70ff5efc6822740413768f0b187af98c43b /libavcodec/mpegvideo_enc.c | |
parent | 728c4658563dc82115ade0f1679679eddb7be5ff (diff) | |
download | ffmpeg-8941971a8f2e24b9a84fe29f128d13ceb89c0a65.tar.gz |
lavc: make error_rate a private option of mpegvideo encoders
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 76ddc5d491..383025aab0 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -769,6 +769,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) if (ff_rate_control_init(s) < 0) return -1; +#if FF_API_ERROR_RATE + FF_DISABLE_DEPRECATION_WARNINGS + if (avctx->error_rate) + s->error_rate = avctx->error_rate; + FF_ENABLE_DEPRECATION_WARNINGS; +#endif + return 0; } @@ -2421,9 +2428,9 @@ static int encode_thread(AVCodecContext *c, void *arg){ assert((put_bits_count(&s->pb)&7) == 0); current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob; - if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){ + if (s->error_rate && s->resync_mb_x + s->resync_mb_y > 0) { int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y; - int d= 100 / s->avctx->error_rate; + int d = 100 / s->error_rate; if(r % d == 0){ current_packet_size=0; s->pb.buf_ptr= s->ptr_lastgob; |