diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-09-18 23:30:45 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-09-23 14:42:33 +0100 |
commit | af532c921575eb8ee805cc2c64a914f6302442e1 (patch) | |
tree | 374d7b38b0f404530c2102cda7e77c947d57b354 /libavcodec/vaapi_encode_vp8.c | |
parent | 2562dd9e7831743ba6dc5680501fb7d26a2ec62c (diff) | |
download | ffmpeg-af532c921575eb8ee805cc2c64a914f6302442e1.tar.gz |
vaapi_encode: Clean up rate control configuration
Query which modes are supported and select between VBR and CBR based
on that - this removes all of the codec-specific rate control mode
selection code.
Diffstat (limited to 'libavcodec/vaapi_encode_vp8.c')
-rw-r--r-- | libavcodec/vaapi_encode_vp8.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c index 9588826bfb..40871a6bbf 100644 --- a/libavcodec/vaapi_encode_vp8.c +++ b/libavcodec/vaapi_encode_vp8.c @@ -65,7 +65,7 @@ static int vaapi_encode_vp8_init_sequence_params(AVCodecContext *avctx) vseq->kf_auto = 0; if (!(ctx->va_rc_mode & VA_RC_CQP)) { - vseq->bits_per_second = avctx->bit_rate; + vseq->bits_per_second = ctx->va_bit_rate; vseq->intra_period = avctx->gop_size; } @@ -205,17 +205,6 @@ static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx) ctx->codec = &vaapi_encode_type_vp8; - if (avctx->flags & AV_CODEC_FLAG_QSCALE) { - ctx->va_rc_mode = VA_RC_CQP; - } else if (avctx->bit_rate > 0) { - if (avctx->rc_max_rate == avctx->bit_rate) - ctx->va_rc_mode = VA_RC_CBR; - else - ctx->va_rc_mode = VA_RC_VBR; - } else { - ctx->va_rc_mode = VA_RC_CQP; - } - // Packed headers are not currently supported. ctx->va_packed_headers = 0; |