diff options
author | Michael Niedermayer <[email protected]> | 2014-11-01 20:28:31 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2014-11-03 19:10:22 +0100 |
commit | 716674b151c15b465e98630108845a228a136793 (patch) | |
tree | 4a7f3bccaa34ac71ff4e35b5375f26993bcef079 | |
parent | bd0f866731ac8fed122100e5a4b86ac8f0d81dd1 (diff) |
avcodec/libwebpenc: add quality option
previously quality could only be set through qscale/global_quality but the scale
was inverted. Using a separate option avoids the confusion from qscale working
backward.
Reviewed-by: Benoit Fouet <[email protected]>
Reviewed-by: Clément Bœsch <[email protected]>
Reviewed-by: Nicolas George <[email protected]>
Reviewed-by: James Almer <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/libwebpenc.c | 8 | ||||
-rw-r--r-- | libavcodec/version.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c index c4c880fab0..95d56acd0b 100644 --- a/libavcodec/libwebpenc.c +++ b/libavcodec/libwebpenc.c @@ -65,10 +65,9 @@ static av_cold int libwebp_encode_init(AVCodecContext *avctx) LibWebPContext *s = avctx->priv_data; int ret; - if (avctx->global_quality < 0) - avctx->global_quality = 75 * FF_QP2LAMBDA; - s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA, - 0.0f, 100.0f); + if (avctx->global_quality >= 0) + s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA, + 0.0f, 100.0f); if (avctx->compression_level < 0 || avctx->compression_level > 6) { av_log(avctx, AV_LOG_WARNING, "invalid compression level: %d\n", @@ -327,6 +326,7 @@ static const AVOption options[] = { { "text", "text-like", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_TEXT }, 0, 0, VE, "preset" }, { "cr_threshold","Conditional replenishment threshold", OFFSET(cr_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "cr_size" ,"Conditional replenishment block size", OFFSET(cr_size) , AV_OPT_TYPE_INT, { .i64 = 16 }, 0, 256, VE }, + { "quality" ,"Quality", OFFSET(quality), AV_OPT_TYPE_FLOAT, { .dbl = 75 }, 0, 100, VE }, { NULL }, }; diff --git a/libavcodec/version.h b/libavcodec/version.h index ea9207a63a..c0fd2595ec 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -30,7 +30,7 @@ #define LIBAVCODEC_VERSION_MAJOR 56 #define LIBAVCODEC_VERSION_MINOR 10 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ |