mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
libvpxenc: use the default bitrate if not set
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
77f47e3288
commit
4aa3d7b3f2
@ -245,11 +245,16 @@ static av_cold int vp8_init(AVCodecContext *avctx)
|
||||
else
|
||||
enccfg.g_pass = VPX_RC_ONE_PASS;
|
||||
|
||||
if (!avctx->bit_rate)
|
||||
avctx->bit_rate = enccfg.rc_target_bitrate * 1000;
|
||||
else
|
||||
enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
|
||||
AV_ROUND_NEAR_INF);
|
||||
|
||||
if (avctx->rc_min_rate == avctx->rc_max_rate &&
|
||||
avctx->rc_min_rate == avctx->bit_rate)
|
||||
enccfg.rc_end_usage = VPX_CBR;
|
||||
enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
|
||||
AV_ROUND_NEAR_INF);
|
||||
|
||||
if (avctx->qmin > 0)
|
||||
enccfg.rc_min_quantizer = avctx->qmin;
|
||||
if (avctx->qmax > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user