diff mbox series

[FFmpeg-devel] libavcodec/qsvenc: add DisableDeblockingIdc support for qsv

Message ID 20201204053417.228843-1-wenbin.chen@intel.com
State New
Headers show
Series [FFmpeg-devel] libavcodec/qsvenc: add DisableDeblockingIdc support for qsv
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Chen, Wenbin Dec. 4, 2020, 5:34 a.m. UTC
From: Wenbinc-Bin <wenbin.chen@intel.com>

MediaSDK already has a flag to control deblocking (DisableDeblockingIdc). Add dblk_idc parameter in ffmpeg to expose this flag to user.

Sigend-off-by: Wenbin Chen <wenbin.chen@intel.com>
---
 libavcodec/qsvenc.c | 4 ++++
 libavcodec/qsvenc.h | 3 +++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index aba98dd689..0d20d1968f 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -710,6 +710,10 @@  FF_ENABLE_DEPRECATION_WARNINGS
             if (q->max_slice_size >= 0)
                 q->extco2.MaxSliceSize = q->max_slice_size;
 #endif
+#if QSV_HAVE_DISABLEDEBLOCKIDC
+            if(q->dblk_idc >= 0)
+                q->extco2.DisableDeblockingIdc = q->dblk_idc;
+#endif
 
 #if QSV_HAVE_TRELLIS
             if (avctx->trellis >= 0)
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 6d305f87dd..3720320789 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -44,6 +44,7 @@ 
 
 #define QSV_HAVE_TRELLIS QSV_VERSION_ATLEAST(1, 8)
 #define QSV_HAVE_MAX_SLICE_SIZE QSV_VERSION_ATLEAST(1, 9)
+#define QSV_HAVE_DISABLEDEBLOCKIDC QSV_VERSION_ATLEAST(1, 9)
 #define QSV_HAVE_BREF_TYPE      QSV_VERSION_ATLEAST(1, 8)
 
 #define QSV_HAVE_LA     QSV_VERSION_ATLEAST(1, 7)
@@ -97,6 +98,7 @@ 
 { "b_strategy",     "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy),    AV_OPT_TYPE_INT, { .i64 = -1 }, -1,          1, VE },                         \
 { "forced_idr",     "Forcing I frames as IDR frames",         OFFSET(qsv.forced_idr),     AV_OPT_TYPE_BOOL,{ .i64 = 0  },  0,          1, VE },                         \
 { "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, VE},\
+{ "dblk_idc", "value of DisableDeblockingIdc (default is 0), in range [0,2]",   OFFSET(qsv.dblk_idc),   AV_OPT_TYPE_INT,    { .i64 = 0 },   0,  2,  VE},    \
 
 extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[];
 
@@ -167,6 +169,7 @@  typedef struct QSVEncContext {
     int rdo;
     int max_frame_size;
     int max_slice_size;
+    int dblk_idc;
 
     int tile_cols;
     int tile_rows;