aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorMiroslav Slugen <thunder.m@email.cz>2016-12-30 22:04:31 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-01-01 14:47:25 +0100
commit9b425bd24c48085b0d96bc0698af82bd46e57d03 (patch)
treec03ca63492ce63cda7418179073b1c6ac869768a /libavcodec/nvenc.c
parent1841eda6796671cc761e446bbca0f73d629ade4e (diff)
downloadffmpeg-9b425bd24c48085b0d96bc0698af82bd46e57d03.tar.gz
avcodec/nvenc: Add bluray_compat basic implementation
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 93979f3dd9..4ee99a9f30 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -958,6 +958,21 @@ static av_cold int nvenc_setup_encoder(AVCodecContext *avctx)
ctx->init_encode_params.enableEncodeAsync = 0;
ctx->init_encode_params.enablePTD = 1;
+ if (ctx->bluray_compat) {
+ ctx->aud = 1;
+ avctx->refs = 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:
+ /* maximum level depends on used resolution */
+ break;
+ case AV_CODEC_ID_HEVC:
+ ctx->level = NV_ENC_LEVEL_HEVC_51;
+ ctx->tier = NV_ENC_TIER_HEVC_HIGH;
+ break;
+ }
+ }
+
if (avctx->gop_size > 0) {
if (avctx->max_b_frames >= 0) {
/* 0 is intra-only, 1 is I/P only, 2 is one B-Frame, 3 two B-frames, and so on. */