You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-30 22:24:04 +02:00
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 <benoit.fouet@free.fr> Reviewed-by: Clément Bœsch <u@pkh.me> Reviewed-by: Nicolas George <george@nsup.org> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -65,8 +65,7 @@ static av_cold int libwebp_encode_init(AVCodecContext *avctx)
|
|||||||
LibWebPContext *s = avctx->priv_data;
|
LibWebPContext *s = avctx->priv_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (avctx->global_quality < 0)
|
if (avctx->global_quality >= 0)
|
||||||
avctx->global_quality = 75 * FF_QP2LAMBDA;
|
|
||||||
s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA,
|
s->quality = av_clipf(avctx->global_quality / (float)FF_QP2LAMBDA,
|
||||||
0.0f, 100.0f);
|
0.0f, 100.0f);
|
||||||
|
|
||||||
@ -327,6 +326,7 @@ static const AVOption options[] = {
|
|||||||
{ "text", "text-like", 0, AV_OPT_TYPE_CONST, { .i64 = WEBP_PRESET_TEXT }, 0, 0, VE, "preset" },
|
{ "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_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 },
|
{ "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 },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 56
|
#define LIBAVCODEC_VERSION_MAJOR 56
|
||||||
#define LIBAVCODEC_VERSION_MINOR 10
|
#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, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
|
Reference in New Issue
Block a user