diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-03 16:49:19 +0000 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-02-03 16:49:19 +0000 |
commit | f3af379b5c1816271b1afce0ccb2a935dc29940c (patch) | |
tree | 629aec01a415bfe4a0552d31292adbb01b31d180 /libavcodec/pngenc.c | |
parent | 908d010b12fadc36d8cadf6bba5e073e23b9603c (diff) | |
parent | 2862b63783b5556f7f3fb2d097629bc6879f833a (diff) | |
download | ffmpeg-f3af379b5c1816271b1afce0ccb2a935dc29940c.tar.gz |
Merge commit '2862b63783b5556f7f3fb2d097629bc6879f833a'
* commit '2862b63783b5556f7f3fb2d097629bc6879f833a':
lavc: Move prediction_method to codec private options
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r-- | libavcodec/pngenc.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index a6233075c1..e9e8bc2782 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -999,9 +999,15 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_huffyuvencdsp_init(&s->hdsp); - s->filter_type = av_clip(avctx->prediction_method, - PNG_FILTER_VALUE_NONE, - PNG_FILTER_VALUE_MIXED); +#if FF_API_PRIVATE_OPT +FF_DISABLE_DEPRECATION_WARNINGS + if (avctx->prediction_method) + s->filter_type = av_clip(avctx->prediction_method, + PNG_FILTER_VALUE_NONE, + PNG_FILTER_VALUE_MIXED); +FF_ENABLE_DEPRECATION_WARNINGS +#endif + if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK) s->filter_type = PNG_FILTER_VALUE_NONE; @@ -1087,7 +1093,14 @@ static av_cold int png_enc_close(AVCodecContext *avctx) static const AVOption options[] = { {"dpi", "Set image resolution (in dots per inch)", OFFSET(dpi), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x10000, VE}, {"dpm", "Set image resolution (in dots per meter)", OFFSET(dpm), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 0x10000, VE}, - { NULL } + { "pred", "Prediction method", OFFSET(filter_type), AV_OPT_TYPE_INT, { .i64 = PNG_FILTER_VALUE_NONE }, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED, VE, "pred" }, + { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_NONE }, INT_MIN, INT_MAX, VE, "pred" }, + { "sub", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_SUB }, INT_MIN, INT_MAX, VE, "pred" }, + { "up", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_UP }, INT_MIN, INT_MAX, VE, "pred" }, + { "avg", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_AVG }, INT_MIN, INT_MAX, VE, "pred" }, + { "paeth", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_PAETH }, INT_MIN, INT_MAX, VE, "pred" }, + { "mixed", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = PNG_FILTER_VALUE_MIXED }, INT_MIN, INT_MAX, VE, "pred" }, + { NULL}, }; static const AVClass pngenc_class = { |