Commit 6829a079 authored by Zhong Li's avatar Zhong Li Committed by Luca Barbato

qsvdec: Relax the surface vs coded dimension check

Fix a common vp8 decoding failure.

Many vp8 clips cannot decode if hw_frames_ctx is enabled, reporting
"Error during QSV decoding.: incompatible video parameters (-14)".

It is due to mfx.FrameInfo.Width/Height not matching coded_w/coded_h.

See: avconv -hwaccel qsv -init_hw_device qsv -c:v vp8_qsv -i vp8-test-vectors-r1/vp80-00-comprehensive-001.ivf
-vf "hwdownload,format=nv12" -pix_fmt yuv420p -f md5 -
Signed-off-by: 's avatarZhong Li <zhong.li@intel.com>
Signed-off-by: 's avatarLuca Barbato <lu_zero@gentoo.org>
parent 559370f2
...@@ -389,7 +389,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, ...@@ -389,7 +389,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
mfxFrameInfo *i = &req->Info; mfxFrameInfo *i = &req->Info;
mfxFrameInfo *i1 = &frames_hwctx->surfaces[0].Info; mfxFrameInfo *i1 = &frames_hwctx->surfaces[0].Info;
if (i->Width != i1->Width || i->Height != i1->Height || if (i->Width > i1->Width || i->Height > i1->Height ||
i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) { i->FourCC != i1->FourCC || i->ChromaFormat != i1->ChromaFormat) {
av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties in an " av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties in an "
"allocation request: %dx%d %d %d vs %dx%d %d %d\n", "allocation request: %dx%d %d %d vs %dx%d %d %d\n",
......
...@@ -149,9 +149,6 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q) ...@@ -149,9 +149,6 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q)
else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET) else if (frames_hwctx->frame_type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
} }
frame_width = frames_hwctx->surfaces[0].Info.Width;
frame_height = frames_hwctx->surfaces[0].Info.Height;
} }
if (!iopattern) if (!iopattern)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment