[FFmpeg-devel] [PATCH] avcodec/nvenc: Add default value for AVCodecContext::refs

Srinath K R skr at nvidia.com
Thu Jun 1 10:58:07 EEST 2017


AVCodecContext::refs is used to control the DPB size to be used by the
encoder. The default value for AVCodecContext::refs as set in
libavcodec/options_table.h is 1.

This patch sets AVCodecContext::refs to 0 for h264_nvenc and hevc_nvenc in
order to let the driver take the decision of the correct DPB size to use in
all cases.

Signed-off-by: Srinath K R <skr at nvidia.com>
---
 libavcodec/nvenc_h264.c | 1 +
 libavcodec/nvenc_hevc.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 20f47ec..5fcbcb9 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -131,6 +131,7 @@ static const AVCodecDefault defaults[] = {
     { "qcomp", "-1" },
     { "g", "250" },
     { "bf", "0" },
+    { "refs", "0" },
     { NULL },
 };
 
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 66db145..81da9d2 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -128,6 +128,7 @@ static const AVCodecDefault defaults[] = {
     { "qcomp", "-1" },
     { "g", "250" },
     { "bf", "0" },
+    { "refs", "0" },
     { NULL },
 };
 
-- 
2.7.4



More information about the ffmpeg-devel mailing list