diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-04-30 19:27:54 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-08-06 14:42:04 +0100 |
commit | 19388a7200e5d99c703271f05dba1c806720e808 (patch) | |
tree | c609e142ab22e134c5826af04fb1bc00468ec515 /libavcodec/vaapi_encode_h264.c | |
parent | 1329c08ad6d2ddb304858f2972c67b508e8b0f0e (diff) |
vaapi_encode: Move quality option to common code
Use AVCodecContext.compression_level rather than a private option,
replacing the H.264-specific quality option (which stays only for
compatibility).
This now works with the H.265 encoder in the i965 driver, as well as
the existing cases with the H.264 encoder.
Diffstat (limited to 'libavcodec/vaapi_encode_h264.c')
-rw-r--r-- | libavcodec/vaapi_encode_h264.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 7583a20c14..e08cf61167 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -154,14 +154,6 @@ typedef struct VAAPIEncodeH264Context { // Rate control configuration. int send_timing_sei; - -#if VA_CHECK_VERSION(0, 36, 0) - // Speed-quality tradeoff setting. - struct { - VAEncMiscParameterBuffer misc; - VAEncMiscParameterBufferQualityLevel quality; - } quality_params; -#endif } VAAPIEncodeH264Context; typedef struct VAAPIEncodeH264Options { @@ -1141,21 +1133,8 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) av_assert0(0 && "Invalid RC mode."); } - if (opt->quality > 0) { -#if VA_CHECK_VERSION(0, 36, 0) - priv->quality_params.misc.type = - VAEncMiscParameterTypeQualityLevel; - priv->quality_params.quality.quality_level = opt->quality; - - ctx->global_params[ctx->nb_global_params] = - &priv->quality_params.misc; - ctx->global_params_size[ctx->nb_global_params++] = - sizeof(priv->quality_params); -#else - av_log(avctx, AV_LOG_WARNING, "The encode quality option is not " - "supported with this VAAPI version.\n"); -#endif - } + if (avctx->compression_level == FF_COMPRESSION_DEFAULT) + avctx->compression_level = opt->quality; return 0; } |