diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-05-14 16:47:55 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-05-19 14:17:04 +0200 |
commit | 3399a26d3f57d462e839c0ee51223ae9aca20852 (patch) | |
tree | 1580fb3666165e41c5adb01412040bc51a9c2a96 | |
parent | 10545f84b83405ca91bce9f62804e1669d1775fb (diff) | |
download | ffmpeg-3399a26d3f57d462e839c0ee51223ae9aca20852.tar.gz |
nvenc: allow setting the number of slices
Based on a patch by Agatha Hu <ahu@nvidia.com>
-rw-r--r-- | libavcodec/nvenc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 2593ba4cff..1ff27a1932 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -618,6 +618,9 @@ static int nvenc_setup_h264_config(AVCodecContext *avctx) h264->maxNumRefFrames = avctx->refs; h264->idrPeriod = cc->gopLength; + h264->sliceMode = 3; + h264->sliceModeData = FFMAX(avctx->slices, 1); + if (ctx->flags & NVENC_LOSSLESS) h264->qpPrimeYZeroTransformBypassFlag = 1; @@ -693,6 +696,9 @@ static int nvenc_setup_hevc_config(AVCodecContext *avctx) cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; avctx->profile = FF_PROFILE_HEVC_MAIN; + hevc->sliceMode = 3; + hevc->sliceModeData = FFMAX(avctx->slices, 1); + if (ctx->level) { hevc->level = ctx->level; } else { |