[FFmpeg-devel] [PATCH 2/4] Set bdirect mode

Philip Langdale philipl at overt.org
Tue Jan 6 08:36:16 CET 2015


Signed-off-by: Philip Langdale <philipl at overt.org>
---
 libavcodec/libnvenc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/libavcodec/libnvenc.c b/libavcodec/libnvenc.c
index 6ba150e..3c64234 100644
--- a/libavcodec/libnvenc.c
+++ b/libavcodec/libnvenc.c
@@ -208,6 +208,23 @@ static av_cold int ff_libnvenc_init(AVCodecContext *avctx)
     OPT_NUMSTR("nal_hrd", nvenc_ctx->nal_hrd);
     OPT_NUMSTR("8x8dct", nvenc_ctx->dct8x8);
 
+    switch (nvenc_ctx->direct_pred) {
+    case 0:
+      nvenc_ctx->nvenc_cfg.bdirectMode = 1;
+      break;
+    case 1:
+      nvenc_ctx->nvenc_cfg.bdirectMode = 3;
+      break;
+    case 2:
+      nvenc_ctx->nvenc_cfg.bdirectMode = 2;
+      break;
+    case 3:
+      nvenc_ctx->nvenc_cfg.bdirectMode = 0;
+      break;
+    default:
+      break;
+    }
+
     // x264-style extra parameters
     if (nvenc_ctx->x264_params) {
         AVDictionary *param_dict = NULL;
-- 
2.1.0



More information about the ffmpeg-devel mailing list