avcodec/nvenc: make number of slices per frame configurable

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
Limin Wang 2021-09-02 18:38:55 +08:00 committed by Timo Rothenpieler
parent 60515a6d61
commit 85489e0308
1 changed files with 2 additions and 2 deletions

View File

@ -1074,7 +1074,7 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
|| vui->videoFullRangeFlag != 0);
h264->sliceMode = 3;
h264->sliceModeData = 1;
h264->sliceModeData = avctx->slices > 0 ? avctx->slices : 1;
h264->disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
h264->repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;
@ -1171,7 +1171,7 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|| vui->videoFullRangeFlag != 0);
hevc->sliceMode = 3;
hevc->sliceModeData = 1;
hevc->sliceModeData = avctx->slices > 0 ? avctx->slices : 1;
hevc->disableSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 1 : 0;
hevc->repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1;