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;
}
return 0;
}
+static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = {
+ { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 },
+ { FF_PROFILE_UNKNOWN }
+};
+
static const VAAPIEncodeType vaapi_encode_type_vp8 = {
+ .profiles = vaapi_encode_vp8_profiles,
+
.configure = &vaapi_encode_vp8_configure,
.sequence_params_size = sizeof(VAEncSequenceParameterBufferVP8),
ctx->codec = &vaapi_encode_type_vp8;
- ctx->va_profile = VAProfileVP8Version0_3;
- ctx->va_entrypoint = VAEntrypointEncSlice;
- ctx->va_rt_format = VA_RT_FORMAT_YUV420;
-
- 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;
#define OFFSET(x) offsetof(VAAPIEncodeVP8Context, x)
#define FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
static const AVOption vaapi_encode_vp8_options[] = {
+ VAAPI_ENCODE_COMMON_OPTIONS,
{ "loop_filter_level", "Loop filter level",
OFFSET(loop_filter_level), AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 63, FLAGS },
{ "loop_filter_sharpness", "Loop filter sharpness",