[FFmpeg-devel,2/2] lavc/qsvenc: add the Access Unit Delimiter NAL Unit support

Submitted by Zhong Li on March 16, 2018, 5:53 a.m.

Details

Message ID 1521179592-11861-2-git-send-email-zhong.li@intel.com
State New
Headers show

Commit Message

Zhong Li March 16, 2018, 5:53 a.m.
Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc.c      | 1 +
 libavcodec/qsvenc.h      | 2 ++
 libavcodec/qsvenc_h264.c | 2 ++
 3 files changed, 5 insertions(+)

Comments

Steven Liu March 16, 2018, 8:34 a.m.
> On 16 Mar 2018, at 13:53, Zhong Li <zhong.li@intel.com> wrote:
> 
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
> libavcodec/qsvenc.c      | 1 +
> libavcodec/qsvenc.h      | 2 ++
> libavcodec/qsvenc_h264.c | 2 ++
> 3 files changed, 5 insertions(+)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 0d2e223..afb953e 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -595,6 +595,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
>             if (q->recovery_point_sei >= 0)
>                 q->extco.RecoveryPointSEI = q->recovery_point_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
>             q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering;
> +            q->extco.AUDelimiter          = q->aud ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
>         }
> 
>         q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco;
> diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
> index fb5fd68..080f6f0 100644
> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -138,6 +138,8 @@ typedef struct QSVEncContext {
>     int max_frame_size;
>     int max_slice_size;
> 
> +    int aud;
> +
>     int single_sei_nal_unit;
>     int max_dec_frame_buffering;
>     int trellis;
> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
> index e01a2a3..3f090ce 100644
> --- a/libavcodec/qsvenc_h264.c
> +++ b/libavcodec/qsvenc_h264.c
> @@ -141,6 +141,8 @@ static const AVOption options[] = {
>     { "main"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_MAIN     }, INT_MIN, INT_MAX,     VE, "profile" },
>     { "high"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_HIGH     }, INT_MIN, INT_MAX,     VE, "profile" },
> 
> +    { "aud", "Insert the Access Unit Delimiter NAL", OFFSET(qsv.aud), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
What about add the option document into doc/encoders.texi ?
> +
>     { "a53cc" , "Use A53 Closed Captions (if available)", OFFSET(qsv.a53_cc), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, VE},
>     { NULL },
> };
> -- 
> 1.8.3.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Thanks
Steven
Zhong Li March 16, 2018, 10:21 a.m.
> From: Steven Liu [mailto:lq@chinaffmpeg.org]
> Sent: Friday, March 16, 2018 4:34 PM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel@ffmpeg.org>
> Cc: Steven Liu <lq@chinaffmpeg.org>; Li, Zhong <zhong.li@intel.com>
> Subject: Re: [FFmpeg-devel] [PATCH 2/2] lavc/qsvenc: add the Access Unit
> Delimiter NAL Unit support
> What about add the option document into doc/encoders.texi ?

Good idea. 
The problem is currently qsv encoding options hasn't been added into doc/encoders.texi (except some rate control options.)
So I thinks firstly we need a patch to add the legacy qsv encoding options, then add this options.

> > +
> >     { "a53cc" , "Use A53 Closed Captions (if available)",
> OFFSET(qsv.a53_cc), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, VE},
> >     { NULL },
> > };
> > --
> > 1.8.3.1
> > 
> Thanks
> Steven

Patch hide | download patch | download mbox

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 0d2e223..afb953e 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -595,6 +595,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
             if (q->recovery_point_sei >= 0)
                 q->extco.RecoveryPointSEI = q->recovery_point_sei ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
             q->extco.MaxDecFrameBuffering = q->max_dec_frame_buffering;
+            q->extco.AUDelimiter          = q->aud ? MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
         }
 
         q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer *)&q->extco;
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index fb5fd68..080f6f0 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -138,6 +138,8 @@  typedef struct QSVEncContext {
     int max_frame_size;
     int max_slice_size;
 
+    int aud;
+
     int single_sei_nal_unit;
     int max_dec_frame_buffering;
     int trellis;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index e01a2a3..3f090ce 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -141,6 +141,8 @@  static const AVOption options[] = {
     { "main"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_MAIN     }, INT_MIN, INT_MAX,     VE, "profile" },
     { "high"    , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_AVC_HIGH     }, INT_MIN, INT_MAX,     VE, "profile" },
 
+    { "aud", "Insert the Access Unit Delimiter NAL", OFFSET(qsv.aud), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE},
+
     { "a53cc" , "Use A53 Closed Captions (if available)", OFFSET(qsv.a53_cc), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, VE},
     { NULL },
 };