vaapi_encode: Clean up the GOP structure configuration

Choose what types of reference frames will be used based on what types
are available, and make the intra-only mode explicit (GOP size one,
which must be used for MJPEG).
This commit is contained in:
Mark Thompson 2018-09-18 23:30:47 +01:00
parent 8479f99c7d
commit bf726c26fd
8 changed files with 68 additions and 41 deletions

View file

@ -66,7 +66,7 @@ static int vaapi_encode_vp8_init_sequence_params(AVCodecContext *avctx)
if (!(ctx->va_rc_mode & VA_RC_CQP)) {
vseq->bits_per_second = ctx->va_bit_rate;
vseq->intra_period = avctx->gop_size;
vseq->intra_period = ctx->gop_size;
}
return 0;
@ -198,11 +198,6 @@ static av_cold int vaapi_encode_vp8_init(AVCodecContext *avctx)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
if (avctx->max_b_frames > 0) {
av_log(avctx, AV_LOG_ERROR, "B-frames are not supported.\n");
return AVERROR_PATCHWELCOME;
}
ctx->codec = &vaapi_encode_type_vp8;
// Packed headers are not currently supported.