You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/nvenc: fix intraRefreshPeriod setting
Regression since 99dfdb45
. intraRefreshPeriod access cc->gopLength,
which has been overwritten to NVENC_INFINITE_GOPLENGTH before.
Fixes #10445.
This commit is contained in:
committed by
Timo Rothenpieler
parent
ac616afa62
commit
0d0c39832f
@@ -1173,6 +1173,7 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
|
|||||||
h264->enableIntraRefresh = 1;
|
h264->enableIntraRefresh = 1;
|
||||||
h264->intraRefreshPeriod = cc->gopLength;
|
h264->intraRefreshPeriod = cc->gopLength;
|
||||||
h264->intraRefreshCnt = cc->gopLength - 1;
|
h264->intraRefreshCnt = cc->gopLength - 1;
|
||||||
|
cc->gopLength = NVENC_INFINITE_GOPLENGTH;
|
||||||
#ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
|
#ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
|
||||||
h264->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
|
h264->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
|
||||||
#endif
|
#endif
|
||||||
@@ -1297,6 +1298,7 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
|
|||||||
hevc->enableIntraRefresh = 1;
|
hevc->enableIntraRefresh = 1;
|
||||||
hevc->intraRefreshPeriod = cc->gopLength;
|
hevc->intraRefreshPeriod = cc->gopLength;
|
||||||
hevc->intraRefreshCnt = cc->gopLength - 1;
|
hevc->intraRefreshCnt = cc->gopLength - 1;
|
||||||
|
cc->gopLength = NVENC_INFINITE_GOPLENGTH;
|
||||||
#ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
|
#ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
|
||||||
hevc->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
|
hevc->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
|
||||||
#endif
|
#endif
|
||||||
@@ -1415,6 +1417,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx)
|
|||||||
av1->enableIntraRefresh = 1;
|
av1->enableIntraRefresh = 1;
|
||||||
av1->intraRefreshPeriod = cc->gopLength;
|
av1->intraRefreshPeriod = cc->gopLength;
|
||||||
av1->intraRefreshCnt = cc->gopLength - 1;
|
av1->intraRefreshCnt = cc->gopLength - 1;
|
||||||
|
cc->gopLength = NVENC_INFINITE_GOPLENGTH;
|
||||||
|
|
||||||
av1->idrPeriod = NVENC_INFINITE_GOPLENGTH;
|
av1->idrPeriod = NVENC_INFINITE_GOPLENGTH;
|
||||||
} else if (cc->gopLength > 0) {
|
} else if (cc->gopLength > 0) {
|
||||||
@@ -1619,9 +1622,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
if(ctx->single_slice_intra_refresh)
|
if(ctx->single_slice_intra_refresh)
|
||||||
ctx->intra_refresh = 1;
|
ctx->intra_refresh = 1;
|
||||||
|
|
||||||
if (ctx->intra_refresh)
|
|
||||||
ctx->encode_config.gopLength = NVENC_INFINITE_GOPLENGTH;
|
|
||||||
|
|
||||||
nvenc_recalc_surfaces(avctx);
|
nvenc_recalc_surfaces(avctx);
|
||||||
|
|
||||||
nvenc_setup_rate_control(avctx);
|
nvenc_setup_rate_control(avctx);
|
||||||
|
Reference in New Issue
Block a user