@@ -208,7 +208,7 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
param.mfx.FrameInfo.BitDepthLuma = desc->comp[0].depth;
param.mfx.FrameInfo.BitDepthChroma = desc->comp[0].depth;
- param.mfx.FrameInfo.Shift = desc->comp[0].depth > 8;
+ param.mfx.FrameInfo.Shift = desc->comp[0].shift > 0;
param.mfx.FrameInfo.FourCC = q->fourcc;
param.mfx.FrameInfo.Width = frame_width;
param.mfx.FrameInfo.Height = frame_height;
@@ -323,7 +323,7 @@ static int qsv_init_surface(AVHWFramesContext *ctx, mfxFrameSurface1 *surf)
surf->Info.BitDepthLuma = desc->comp[0].depth;
surf->Info.BitDepthChroma = desc->comp[0].depth;
- surf->Info.Shift = desc->comp[0].depth > 8;
+ surf->Info.Shift = desc->comp[0].shift > 0;
if (desc->log2_chroma_w && desc->log2_chroma_h)
surf->Info.ChromaFormat = MFX_CHROMAFORMAT_YUV420;
Currently, Info.Shift in libmfx is set according to the depth of the pixfmt. As QSV now supports Y410 (depth > 8 but shift = 0), it doesn't work any more. Modify to set Info.Shift according to the setting in desc. Signed-off-by: Linjie Fu <linjie.fu@intel.com> --- libavcodec/qsvdec.c | 2 +- libavutil/hwcontext_qsv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)