summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2017-08-30 21:06:25 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2017-09-01 10:52:15 +0200
commita0b69e2b0a7ba994b722393a0273bb3464fd5efe (patch)
tree5a410ab426320e955110d497ee828f6befeccefc /libavcodec/nvenc.c
parent78a7af823b7c2a1e3184e6680f2b49bf67101e5c (diff)
avcodec/nvenc: add support for specifying entropy coding mode
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index f79b9a502e..422ac6c73e 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -317,6 +317,12 @@ static int nvenc_check_capabilities(AVCodecContext *avctx)
return AVERROR(ENOSYS);
}
+ ret = nvenc_check_cap(avctx, NV_ENC_CAPS_SUPPORT_CABAC);
+ if (ctx->coder == NV_ENC_H264_ENTROPY_CODING_MODE_CABAC && ret <= 0) {
+ av_log(avctx, AV_LOG_VERBOSE, "CABAC entropy coding not supported\n");
+ return AVERROR(ENOSYS);
+ }
+
return 0;
}
@@ -916,6 +922,9 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
h264->level = ctx->level;
+ if (ctx->coder >= 0)
+ h264->entropyCodingMode = ctx->coder;
+
return 0;
}