diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-09-18 23:30:47 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-09-23 14:42:33 +0100 |
commit | bf726c26fde26601a90daacf1b10a9860d21321c (patch) | |
tree | 9ed0e2a816515ea53a488410333c86f18e522e1f /libavcodec/vaapi_encode_vp9.c | |
parent | 8479f99c7dd227d9cb94d262602f1298f71cf33b (diff) |
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).
Diffstat (limited to 'libavcodec/vaapi_encode_vp9.c')
-rw-r--r-- | libavcodec/vaapi_encode_vp9.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c index 2b0658ec1f..d4069ec850 100644 --- a/libavcodec/vaapi_encode_vp9.c +++ b/libavcodec/vaapi_encode_vp9.c @@ -72,7 +72,7 @@ static int vaapi_encode_vp9_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; } vpic->frame_width_src = avctx->width; @@ -86,6 +86,7 @@ static int vaapi_encode_vp9_init_sequence_params(AVCodecContext *avctx) static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, VAAPIEncodePicture *pic) { + VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodeVP9Context *priv = avctx->priv_data; VAEncPictureParameterBufferVP9 *vpic = pic->codec_picture_params; int i; @@ -102,7 +103,7 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, break; case PICTURE_TYPE_P: av_assert0(pic->nb_refs == 1); - if (avctx->max_b_frames > 0) { + if (ctx->b_per_p > 0) { if (priv->last_ref_dir) { vpic->ref_flags.bits.ref_frame_ctrl_l0 = 2; vpic->ref_flags.bits.ref_gf_idx = 1; @@ -174,7 +175,7 @@ static int vaapi_encode_vp9_init_picture_params(AVCodecContext *avctx, vpic->filter_level = priv->loop_filter_level; vpic->sharpness_level = priv->loop_filter_sharpness; - if (avctx->max_b_frames > 0 && pic->type == PICTURE_TYPE_P) + if (ctx->b_per_p > 0 && pic->type == PICTURE_TYPE_P) priv->last_ref_dir = !priv->last_ref_dir; return 0; |