diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-09-18 23:30:43 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-09-23 14:42:33 +0100 |
commit | ac31d84506cde8e055edf8fab807cb0ee5878554 (patch) | |
tree | 7c6001a16f666adfc0d57ee3a302241d05d00c4f /libavcodec/vaapi_encode_h264.c | |
parent | 95f6f7b704a443fb4b3f4b26e3f0d88d620775c7 (diff) | |
download | ffmpeg-ac31d84506cde8e055edf8fab807cb0ee5878554.tar.gz |
vaapi_encode: Clean up the encode quality configuration
Diffstat (limited to 'libavcodec/vaapi_encode_h264.c')
-rw-r--r-- | libavcodec/vaapi_encode_h264.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 5ef72b222d..69e95dd340 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -831,9 +831,6 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) av_assert0(0 && "Invalid RC mode."); } - if (avctx->compression_level == FF_COMPRESSION_DEFAULT) - avctx->compression_level = priv->quality; - if (priv->sei & SEI_IDENTIFIER) { const char *lavc = LIBAVCODEC_IDENT; const char *vaapi = VA_VERSION_S; @@ -907,6 +904,8 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) avctx->profile = priv->profile; if (avctx->level == FF_LEVEL_UNKNOWN) avctx->level = priv->level; + if (avctx->compression_level == FF_COMPRESSION_DEFAULT) + avctx->compression_level = priv->quality; // Reject unsupported profiles. switch (avctx->profile) { @@ -972,7 +971,7 @@ static const AVOption vaapi_encode_h264_options[] = { { "qp", "Constant QP (for P-frames; scaled by qfactor/qoffset for I/B)", OFFSET(qp), AV_OPT_TYPE_INT, { .i64 = 20 }, 0, 52, FLAGS }, { "quality", "Set encode quality (trades off against speed, higher is faster)", - OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, FLAGS }, + OFFSET(quality), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, FLAGS }, { "coder", "Entropy coder type", OFFSET(coder), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS, "coder" }, { "cavlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS, "coder" }, |