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;
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;
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:
int coder;
int b_ref_mode;
int a53_cc;
+ int dpb_size;
} NvencContext;
int ff_nvenc_encode_init(AVCodecContext *avctx);
{ "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" },
#endif
{ "a53cc", "Use A53 Closed Captions (if available)", OFFSET(a53_cc), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE },
+ { "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)",
+ OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ NULL }
};
{ "each", "", 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, VE, "b_ref_mode" },
{ "middle", "", 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, VE, "b_ref_mode" },
#endif
+ { "dpb_size", "Specifies the DPB size used for encoding (0 means automatic)",
+ OFFSET(dpb_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ NULL }
};