diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-09 03:15:06 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2016-01-21 15:33:19 -0500 |
commit | 2862b63783b5556f7f3fb2d097629bc6879f833a (patch) | |
tree | 990909a954f2ce1a6cd5ed5f7e94c305426b5b66 /libavcodec/mjpegenc.c | |
parent | 243df1351d2d928caa084a5704ed783f0b83f072 (diff) | |
download | ffmpeg-2862b63783b5556f7f3fb2d097629bc6879f833a.tar.gz |
lavc: Move prediction_method to codec private options
This options is only used by huffyuv, ffvhuv, jpegls, mjpeg,
mpegvideoenc, png, utvideo.
It is a very codec-specific options, so deprecate the global variant.
Set proper limits to the maximum allowed values, and update utvideoenc
tests to use the new option name.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mjpegenc.c')
-rw-r--r-- | libavcodec/mjpegenc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 6724310d98..e48c945072 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -154,12 +154,31 @@ void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[8][64]) s->i_tex_bits += get_bits_diff(s); } +#define OFFSET(x) offsetof(MpegEncContext, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { +{ "pred", "Prediction method", OFFSET(pred), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 3, VE, "pred" }, + { "left", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "pred" }, + { "plane", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "pred" }, + { "median", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, INT_MIN, INT_MAX, VE, "pred" }, + + { NULL}, +}; + +static const AVClass mjpeg_class = { + .class_name = "mjpeg", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_mjpeg_encoder = { .name = "mjpeg", .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MJPEG, .priv_data_size = sizeof(MpegEncContext), + .priv_class = &mjpeg_class, .init = ff_mpv_encode_init, .encode2 = ff_mpv_encode_picture, .close = ff_mpv_encode_end, |