summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode_h265.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-09-18 23:30:45 +0100
committerMark Thompson <sw@jkqxz.net>2018-09-23 14:42:33 +0100
commitaf532c921575eb8ee805cc2c64a914f6302442e1 (patch)
tree374d7b38b0f404530c2102cda7e77c947d57b354 /libavcodec/vaapi_encode_h265.c
parent2562dd9e7831743ba6dc5680501fb7d26a2ec62c (diff)
downloadffmpeg-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_h265.c')
-rw-r--r--libavcodec/vaapi_encode_h265.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index b8b66b87cb..b296919b37 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -512,7 +512,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
.intra_period = avctx->gop_size,
.intra_idr_period = avctx->gop_size,
.ip_period = ctx->b_per_p + 1,
- .bits_per_second = avctx->bit_rate,
+ .bits_per_second = ctx->va_bit_rate,
.pic_width_in_luma_samples = sps->pic_width_in_luma_samples,
.pic_height_in_luma_samples = sps->pic_height_in_luma_samples,
@@ -1014,10 +1014,6 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)
priv->fixed_qp_p = 30;
priv->fixed_qp_b = 30;
- av_log(avctx, AV_LOG_DEBUG, "Using %s-bitrate = %"PRId64" bps.\n",
- ctx->va_rc_mode == VA_RC_CBR ? "constant" : "variable",
- avctx->bit_rate);
-
} else {
av_assert0(0 && "Invalid RC mode.");
}
@@ -1068,14 +1064,6 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
if (avctx->level == FF_LEVEL_UNKNOWN)
avctx->level = priv->level;
- 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;
-
ctx->va_packed_headers =
VA_ENC_PACKED_HEADER_SEQUENCE | // VPS, SPS and PPS.
VA_ENC_PACKED_HEADER_SLICE | // Slice headers.