diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2019-09-27 17:55:23 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2019-09-27 20:00:59 +0200 |
commit | e929b2f248a9c49761475e07d1a089e05912d1c6 (patch) | |
tree | 1acbd99469615d50375188108ad2ea7e77b2ae28 /libavcodec/nvenc.c | |
parent | 460f74495fa93c4bb85503c5443580e2bb857efa (diff) |
avcodec/nvenc: switch to dedicated dpb_size option
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r-- | libavcodec/nvenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 316e4a3679..158e304a0c 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -949,9 +949,9 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx) h264->repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1; h264->outputAUD = ctx->aud; - if (avctx->refs >= 0) { + if (ctx->dpb_size >= 0) { /* 0 means "let the hardware decide" */ - h264->maxNumRefFrames = avctx->refs; + h264->maxNumRefFrames = ctx->dpb_size; } if (avctx->gop_size >= 0) { h264->idrPeriod = cc->gopLength; @@ -1041,9 +1041,9 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx) hevc->repeatSPSPPS = (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) ? 0 : 1; hevc->outputAUD = ctx->aud; - if (avctx->refs >= 0) { + if (ctx->dpb_size >= 0) { /* 0 means "let the hardware decide" */ - hevc->maxNumRefFramesInDPB = avctx->refs; + hevc->maxNumRefFramesInDPB = ctx->dpb_size; } if (avctx->gop_size >= 0) { hevc->idrPeriod = cc->gopLength; @@ -1175,7 +1175,7 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx) if (ctx->bluray_compat) { ctx->aud = 1; - avctx->refs = FFMIN(FFMAX(avctx->refs, 0), 6); + ctx->dpb_size = FFMIN(FFMAX(avctx->refs, 0), 6); avctx->max_b_frames = FFMIN(avctx->max_b_frames, 3); switch (avctx->codec->id) { case AV_CODEC_ID_H264: |