[FFmpeg-devel] [PATCH] lavc/qsvenc: expose low_power option in H264 QSV

Li, Zhong zhong.li at intel.com
Tue Mar 26 06:01:36 EET 2019


> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> Of Linjie Fu
> Sent: Monday, March 25, 2019 9:32 PM
> To: ffmpeg-devel at ffmpeg.org
> Cc: Fu, Linjie <linjie.fu at intel.com>
> Subject: [FFmpeg-devel] [PATCH] lavc/qsvenc: expose low_power option in
> H264 QSV
> 
> Always exposes low_power option for h264 qsv, and reports a warning if
> VDENC is not supported with current version of MSDK.
> 
> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> ---
>  libavcodec/qsvenc.c      | 11 ++++++++++-
>  libavcodec/qsvenc_h264.c |  2 --
>  2 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
> 5aa020d47b..8264d0a413 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -495,9 +495,18 @@ static int init_video_param(AVCodecContext *avctx,
> QSVEncContext *q)
>          }
>      }
> 
> +    if (q->low_power) {
>  #if QSV_HAVE_VDENC
> -    q->param.mfx.LowPower           = q->low_power ?
> MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
> +        q->param.mfx.LowPower = MFX_CODINGOPTION_ON; #else
> +        av_log(avctx, AV_LOG_WARNING, "The QSV VDENC option is "
> +                            "not supported with this MSDK
> version.\n");

VDEnc is driver and hardware scope should not be exposed in FFmpeg level. 
Lower power is easier for user to understand, and it is the option user set. So I believe the would be better to change the log to be
"low power mode is not supported ..."

> +        q->low_power = 0;
> +        q->param.mfx.LowPower = MFX_CODINGOPTION_OFF;
>  #endif
> +    } else
> +        q->param.mfx.LowPower = MFX_CODINGOPTION_OFF;

The rest LGTM


More information about the ffmpeg-devel mailing list