summaryrefslogtreecommitdiff
path: root/libavcodec/libopenh264enc.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-11-30 12:17:31 -0500
committerVittorio Giovara <vittorio.giovara@gmail.com>2015-12-07 11:01:22 -0500
commitbe00ec832c519427cd92218abac77dafdc1d5487 (patch)
tree970ca330447b69c3dc6b1efc734cbdffd613e4eb /libavcodec/libopenh264enc.c
parentf1ccd076801444ab7f524cb13e0886faaf10fd50 (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/libopenh264enc.c')
-rw-r--r--libavcodec/libopenh264enc.c11
1 files changed, 10 insertions, 1 deletions
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, &param);
+#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;