diff mbox

[FFmpeg-devel] nvenc: add support for b_adapt option also for HEVC encoder

Message ID e8a2ec16-55a8-a509-b52d-7484ed2b309b@email.cz
State New
Headers show

Commit Message

Miroslav Slugeň Feb. 14, 2019, 6:13 p.m. UTC
Hi,

this will add support for b_adapt for HEVC encoder, now Turing HEVC 
NVENC with SDK 9.0 also supports B-frames and this option is in default 
mode disabled. Enable it by default, because it could add around 0.02 
PSNR for free.
diff mbox

Patch

diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index d567d960ba..19c04e4aa7 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -95,6 +95,8 @@  static const AVOption options[] = {
                                                             OFFSET(no_scenecut),  AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
     { "forced-idr",   "If forcing keyframes, force them as IDR frames.",
                                                             OFFSET(forced_idr),   AV_OPT_TYPE_BOOL,  { .i64 = 0 }, -1, 1, VE },
+    { "b_adapt",      "When lookahead is enabled, set this to 0 to disable adaptive B-frame decision",
+                                                            OFFSET(b_adapt),      AV_OPT_TYPE_BOOL,  { .i64 = 1 }, 0, 1, VE },
     { "spatial_aq",   "set to 1 to enable Spatial AQ",      OFFSET(aq),           AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
     { "temporal_aq",  "set to 1 to enable Temporal AQ",     OFFSET(temporal_aq),  AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, VE },
     { "zerolatency",  "Set 1 to indicate zero latency operation (no reordering delay)",