summaryrefslogtreecommitdiff
path: root/libavcodec/libopenh264enc.c
diff options
context:
space:
mode:
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;