[FFmpeg-devel,1/2] lavc/qsvenc_jpeg: add async_depth support

Submitted by Zhong Li on Oct. 11, 2018, 9:30 a.m.

Details

Message ID 1539250228-30384-1-git-send-email-zhong.li@intel.com
State New
Headers show

Commit Message

Zhong Li Oct. 11, 2018, 9:30 a.m.
Currently qsv (m)jpeg encoding is broken.
Regression introducing by the commit(id: c1bcd3): fix async support,
which requires the minimum async_depth to be 1, instead previous zero.
But the default async_depth of qsv (m)jpeg encoding is still initialized
(mostly) as zero.

This patch also abviously improves qsv (m)jpeg encoding performance
due to the default async_depth is changed to 4.

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/qsvenc_jpeg.c | 1 +
 1 file changed, 1 insertion(+)

Comments

U. Artie Eoff Oct. 12, 2018, 5:44 p.m.
> -----Original Message-----

> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf Of Zhong Li

> Sent: Thursday, October 11, 2018 2:30 AM

> To: ffmpeg-devel@ffmpeg.org

> Cc: Li, Zhong <zhong.li@intel.com>

> Subject: [FFmpeg-devel] [PATCH 1/2] lavc/qsvenc_jpeg: add async_depth support

> 

> Currently qsv (m)jpeg encoding is broken.

> Regression introducing by the commit(id: c1bcd3): fix async support,

> which requires the minimum async_depth to be 1, instead previous zero.

> But the default async_depth of qsv (m)jpeg encoding is still initialized

> (mostly) as zero.

> 

> This patch also abviously improves qsv (m)jpeg encoding performance

> due to the default async_depth is changed to 4.

> 

> Signed-off-by: Zhong Li <zhong.li@intel.com>

> ---

>  libavcodec/qsvenc_jpeg.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c

> index c18fe91..01c10125 100644

> --- a/libavcodec/qsvenc_jpeg.c

> +++ b/libavcodec/qsvenc_jpeg.c

> @@ -64,6 +64,7 @@ static av_cold int qsv_enc_close(AVCodecContext *avctx)

>  #define OFFSET(x) offsetof(QSVMJPEGEncContext, x)

>  #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

>  static const AVOption options[] = {

> +    { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 =

> ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE },

>      { NULL },

>  };

> 

> --

> 2.7.4

> 

> _______________________________________________

> ffmpeg-devel mailing list

> ffmpeg-devel@ffmpeg.org

> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


This fixes it for me.  Please merge.

Patch hide | download patch | download mbox

diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c
index c18fe91..01c10125 100644
--- a/libavcodec/qsvenc_jpeg.c
+++ b/libavcodec/qsvenc_jpeg.c
@@ -64,6 +64,7 @@  static av_cold int qsv_enc_close(AVCodecContext *avctx)
 #define OFFSET(x) offsetof(QSVMJPEGEncContext, x)
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
+    { "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE },
     { NULL },
 };