You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
nvenc: allow setting the number of slices
Based on a patch by Agatha Hu <ahu@nvidia.com>
This commit is contained in:
@@ -618,6 +618,9 @@ static int nvenc_setup_h264_config(AVCodecContext *avctx)
|
|||||||
h264->maxNumRefFrames = avctx->refs;
|
h264->maxNumRefFrames = avctx->refs;
|
||||||
h264->idrPeriod = cc->gopLength;
|
h264->idrPeriod = cc->gopLength;
|
||||||
|
|
||||||
|
h264->sliceMode = 3;
|
||||||
|
h264->sliceModeData = FFMAX(avctx->slices, 1);
|
||||||
|
|
||||||
if (ctx->flags & NVENC_LOSSLESS)
|
if (ctx->flags & NVENC_LOSSLESS)
|
||||||
h264->qpPrimeYZeroTransformBypassFlag = 1;
|
h264->qpPrimeYZeroTransformBypassFlag = 1;
|
||||||
|
|
||||||
@@ -693,6 +696,9 @@ static int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
|||||||
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
|
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
|
||||||
avctx->profile = FF_PROFILE_HEVC_MAIN;
|
avctx->profile = FF_PROFILE_HEVC_MAIN;
|
||||||
|
|
||||||
|
hevc->sliceMode = 3;
|
||||||
|
hevc->sliceModeData = FFMAX(avctx->slices, 1);
|
||||||
|
|
||||||
if (ctx->level) {
|
if (ctx->level) {
|
||||||
hevc->level = ctx->level;
|
hevc->level = ctx->level;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user