From be00ec832c519427cd92218abac77dafdc1d5487 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Mon, 30 Nov 2015 12:17:31 -0500 Subject: 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 --- libavcodec/libopenh264enc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libavcodec/libopenh264enc.c') diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c index da03b29d51..7369c12a53 100644 --- a/libavcodec/libopenh264enc.c +++ b/libavcodec/libopenh264enc.c @@ -40,6 +40,7 @@ typedef struct SVCContext { int max_nal_size; int skip_frames; int skipped; + int cabac; } SVCContext; #define OPENH264_VER_AT_LEAST(maj, min) \ @@ -58,6 +59,7 @@ static const AVOption options[] = { { "profile", "Set profile restrictions", OFFSET(profile), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VE }, { "max_nal_size", "Set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "allow_skip_frames", "Allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { "cabac", "Enable cabac", OFFSET(cabac), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { NULL } }; @@ -139,6 +141,13 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) (*s->encoder)->GetDefaultParams(s->encoder, ¶m); +#if FF_API_CODER_TYPE +FF_DISABLE_DEPRECATION_WARNINGS + if (!s->cabac) + s->cabac = avctx->coder_type == FF_CODER_TYPE_AC; +FF_ENABLE_DEPRECATION_WARNINGS +#endif + param.fMaxFrameRate = avctx->time_base.den / avctx->time_base.num; param.iPicWidth = avctx->width; param.iPicHeight = avctx->height; @@ -165,7 +174,7 @@ static av_cold int svc_encode_init(AVCodecContext *avctx) param.iMultipleThreadIdc = avctx->thread_count; if (s->profile && !strcmp(s->profile, "main")) param.iEntropyCodingModeFlag = 1; - else if (!s->profile && avctx->coder_type == FF_CODER_TYPE_AC) + else if (!s->profile && s->cabac) param.iEntropyCodingModeFlag = 1; param.sSpatialLayers[0].iVideoWidth = param.iPicWidth; -- cgit v1.2.1