aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAgatha Hu <ahu@nvidia.com>2015-12-14 10:27:36 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2015-12-14 10:27:36 +0100
commitf1a889737532ad8696574cdb95b844371f74c864 (patch)
tree6f5fe3bf84ffedd5ed17ad653b7cdbd1dd004597
parent906c0b77164e19e3263292eb3f22e20519fda402 (diff)
downloadffmpeg-f1a889737532ad8696574cdb95b844371f74c864.tar.gz
avcodec/nvenc: set slice number to 1 to improve encoding quality
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
-rw-r--r--libavcodec/nvenc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 43b8e788a3..4ab56fe8b7 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -876,6 +876,9 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
+ ctx->encode_config.encodeCodecConfig.h264Config.sliceMode = 3;
+ ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData = 1;
+
ctx->encode_config.encodeCodecConfig.h264Config.disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
ctx->encode_config.encodeCodecConfig.h264Config.repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
@@ -940,6 +943,9 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx)
break;
case AV_CODEC_ID_H265:
+ ctx->encode_config.encodeCodecConfig.hevcConfig.sliceMode = 3;
+ ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData = 1;
+
ctx->encode_config.encodeCodecConfig.hevcConfig.disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
ctx->encode_config.encodeCodecConfig.hevcConfig.repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;