diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-11-30 20:17:31 +0300 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-12-07 19:01:22 +0300 |
commit | be00ec832c519427cd92218abac77dafdc1d5487 (patch) | |
tree | 970ca330447b69c3dc6b1efc734cbdffd613e4eb /libavcodec/ffv1enc.c | |
parent | f1ccd076801444ab7f524cb13e0886faaf10fd50 (diff) |
lavc: Deprecate coder_type and its symbols
Most option values are simply unused or ignored and in practice the
majory of codecs only need to check whether to enable rle or not.
Add appropriate codec private options which better expose the allowed
features.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/ffv1enc.c')
-rw-r--r-- | libavcodec/ffv1enc.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index fe144b821c..0158605b91 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -587,7 +587,12 @@ static av_cold int ffv1_encode_init(AVCodecContext *avctx) return AVERROR(ENOSYS); } - s->ac = avctx->coder_type > 0 ? AC_RANGE_CUSTOM_TAB : AC_GOLOMB_RICE; +#if FF_API_CODER_TYPE +FF_DISABLE_DEPRECATION_WARNINGS + if (avctx->coder_type != -1) + s->ac = avctx->coder_type > 0 ? AC_RANGE_CUSTOM_TAB : AC_GOLOMB_RICE; +FF_ENABLE_DEPRECATION_WARNINGS +#endif s->plane_count = 3; switch (avctx->pix_fmt) { @@ -1068,6 +1073,15 @@ static av_cold int ffv1_encode_close(AVCodecContext *avctx) static const AVOption options[] = { { "slicecrc", "Protect slices with CRCs", OFFSET(ec), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + { "coder", "Coder type", OFFSET(ac), AV_OPT_TYPE_INT, + { .i64 = AC_GOLOMB_RICE }, 0, 2, VE, "coder" }, + { "rice", "Golomb rice", 0, AV_OPT_TYPE_CONST, + { .i64 = AC_GOLOMB_RICE }, INT_MIN, INT_MAX, VE, "coder" }, + { "range_def", "Range with default table", 0, AV_OPT_TYPE_CONST, + { .i64 = AC_RANGE_DEFAULT_TAB }, INT_MIN, INT_MAX, VE, "coder" }, + { "range_tab", "Range with custom table", 0, AV_OPT_TYPE_CONST, + { .i64 = AC_RANGE_CUSTOM_TAB }, INT_MIN, INT_MAX, VE, "coder" }, + { NULL } }; @@ -1078,10 +1092,12 @@ static const AVClass class = { .version = LIBAVUTIL_VERSION_INT, }; +#if FF_API_CODER_TYPE static const AVCodecDefault ffv1_defaults[] = { { "coder", "-1" }, { NULL }, }; +#endif AVCodec ff_ffv1_encoder = { .name = "ffv1", @@ -1106,6 +1122,8 @@ AVCodec ff_ffv1_encoder = { AV_PIX_FMT_NONE }, +#if FF_API_CODER_TYPE .defaults = ffv1_defaults, +#endif .priv_class = &class, }; |