[1/2] lavc/qsvenc: add detail options for MFE mode

Message ID 1525471612-3430-1-git-send-email-zhong.li@intel.com
State New
Headers show
Series
  • [1/2] lavc/qsvenc: add detail options for MFE mode
Related show

Commit Message

Li, Zhong May 4, 2018, 10:06 p.m.
Not convenient if using numerals to set MFE mode. It is ambiguous
and misleading (e.g: user may misunderstand setting mfmode to 1 is to
enable MFE but actually it is to disable MFE, and set it to be 5 or above is meaningless).

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc_h264.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Luca Barbato May 4, 2018, 9:26 a.m. | #1
The set looks fine, I would add a alias for "on" as "manual" for
usability but beside that looks fine to me.
Li, Zhong May 7, 2018, 10:46 a.m. | #2
Thanks for review. : )
Do you need me to update it, or you can help to add the alias when you merge it? 

> -----Original Message-----
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of Luca
> Barbato
> Sent: Friday, May 4, 2018 5:26 PM
> To: libav-devel@libav.org
> Subject: Re: [libav-devel] [PATCH 1/2] lavc/qsvenc: add detail options for
> MFE mode
> 
> The set looks fine, I would add a alias for "on" as "manual" for usability but
> beside that looks fine to me.
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
Luca Barbato May 7, 2018, 11:50 a.m. | #3
On 07/05/2018 12:46, Li, Zhong wrote:
> Thanks for review. : )

No problem :)

> Do you need me to update it, or you can help to add the alias when you merge it? 
> 

+    { "on" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_MANUAL   },
INT_MIN, INT_MAX,     VE, "mfmode" },

Folded in, I'd push this evening.

lu

Patch

diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index ae00ff8..7f3fd5a 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -94,7 +94,11 @@  static const AVOption options[] = {
     { "aud", "Insert the Access Unit Delimiter NAL", OFFSET(qsv.aud), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
 
 #if QSV_HAVE_MF
-    { "mfmode", "Multi-Frame Mode", OFFSET(qsv.mfmode), AV_OPT_TYPE_INT, { .i64 = MFX_MF_AUTO }, 0, INT_MAX, VE },
+    { "mfmode", "Multi-Frame Mode", OFFSET(qsv.mfmode), AV_OPT_TYPE_INT, { .i64 = MFX_MF_AUTO }, MFX_MF_DEFAULT, MFX_MF_MANUAL, VE, "mfmode"},
+    { "default", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_DEFAULT  }, INT_MIN, INT_MAX,     VE, "mfmode" },
+    { "off"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_DISABLED }, INT_MIN, INT_MAX,     VE, "mfmode" },
+    { "auto"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_AUTO     }, INT_MIN, INT_MAX,     VE, "mfmode" },
+    { "manual" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_MANUAL   }, INT_MIN, INT_MAX,     VE, "mfmode" },
 #endif
 
     { NULL },