[FFmpeg-devel] [PATCH] qsv: get FrameInfo.Shift by desc->comp[0].shift

Li, Zhong zhong.li at intel.com
Thu Sep 12 16:23:00 EEST 2019


> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Linjie Fu
> Sent: Wednesday, September 11, 2019 12:09 AM
> To: ffmpeg-devel at ffmpeg.org
> Cc: Fu, Linjie <linjie.fu at intel.com>
> Subject: [FFmpeg-devel] [PATCH] qsv: get FrameInfo.Shift by desc->comp[0].shift
> 
> Since Y410 is a pixel format with depth > 8 but shift = 0, get Shift info by depth is
> not quite accurate.
> 
> Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> ---
>  libavcodec/qsvenc.c       | 4 ++--
>  libavutil/hwcontext_qsv.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 9bf8574..912f2a8
> 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -437,7 +437,7 @@ static int init_video_param_jpeg(AVCodecContext
> *avctx, QSVEncContext *q)
>      q->param.mfx.FrameInfo.ChromaFormat   = MFX_CHROMAFORMAT_YUV420;
>      q->param.mfx.FrameInfo.BitDepthLuma   = desc->comp[0].depth;
>      q->param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
> -    q->param.mfx.FrameInfo.Shift          = desc->comp[0].depth > 8;
> +    q->param.mfx.FrameInfo.Shift          = desc->comp[0].shift > 0;

Is it safe enough? 
As MSDK docs: "Not all codecs and SDK implementations support this value. Use Query function to check if this feature is supported."


More information about the ffmpeg-devel mailing list