From patchwork Sat Jan 27 03:53:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhong Li X-Patchwork-Id: 7426 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.156.27 with SMTP id q27csp1457016jak; Fri, 26 Jan 2018 19:55:03 -0800 (PST) X-Google-Smtp-Source: AH8x226xXDfPWY706holdbrtMUj/QdM5RLq3yaEP4OPh4+lL0A/fl/urwSI1S7cDcX4QB8mr09ZG X-Received: by 10.223.175.196 with SMTP id y4mr7900345wrd.195.1517025303011; Fri, 26 Jan 2018 19:55:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517025302; cv=none; d=google.com; s=arc-20160816; b=WLUZ65zUp9DwM4vpcVmeyS+a3aTTuEsbJf5SgsTiMDFm5vhh1WHlLTNLmGZtkvl9qG 5tQnwC3DMGo7sbgAU0+9c24hjcm7wxSWZYrSq8+HP5P+zWBwRcUNB/ShEze1BAaKbAOt H5YIZEZJkPlaDGtglVoIQG1CT9vP1Z/qQxY9g7PVXNuv1o8yI9zzfVvx0e+p4/RF34fC 3DOvdmyt9sPQp2ZfNVfmwo84R5aUQ79+yBa1PvwIKYK0n8d/G/tvngc8uavg//wre/y9 uh44t0SLgeT/K8uFB0MhaJmkRCiKlwvHuK65DK6goeZj5BH+Fy6/UtG3gsTNOkcCh8cg IThg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=9tueZY38cewxK9eo1t7gsGqnLaHKb7oPF12JpR0+g1c=; b=AcRYszL609dqZlOgmzDFR8nRaZ9GWev0xWNbgEsqxHVNuAcRmnIWbMhj9HQ70JkxJy pbgAHlOKT0BaTJktTTJ6tR1IK0diqc+1CsucNQa+iD5rXt4VwvMOFbtDl4j0/l0wcEM5 701vvBi6oZMNZHnjWkeA/j1Ow7Id67m6UGPedaQflew/pWN7QQu95bD48A+yDOyGa2TM jWBppx33Db5r21nxtiObl8gXuyIiKpkxwq5Nn5UqGa6+8+XAtC1UOGLC1SOsVLuz8PLZ +uwSW137RFhoXZ88pGwTV9rMWaV2oQWuYE6oh/IXkld5bXd2tccvsJtl26cxpOjWiGdw HiwA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f2si6455397wrg.343.2018.01.26.19.55.02; Fri, 26 Jan 2018 19:55:02 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4C106687EC8; Sat, 27 Jan 2018 05:54:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 41427680475 for ; Sat, 27 Jan 2018 05:54:51 +0200 (EET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2018 19:54:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,420,1511856000"; d="scan'208";a="14672813" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.239.13.18]) by fmsmga002.fm.intel.com with ESMTP; 26 Jan 2018 19:54:51 -0800 From: Zhong Li To: ffmpeg-devel@ffmpeg.org Date: Sat, 27 Jan 2018 11:53:05 +0800 Message-Id: <1517025185-20172-1-git-send-email-zhong.li@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [FFmpeg-devel] [PATCH] qsvdec: Relax the surface vs coded dimension check X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhong Li , Luca Barbato MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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: -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: Zhong Li Signed-off-by: Luca Barbato --- libavcodec/qsv.c | 2 +- libavcodec/qsvdec.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 250b4e6..5217adf 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -389,7 +389,7 @@ static mfxStatus qsv_frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameInfo *i = &req->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) { av_log(ctx->logctx, AV_LOG_ERROR, "Mismatching surface properties in an " "allocation request: %dx%d %d %d vs %dx%d %d %d\n", diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index abbede5..45bedf9 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -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) iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY; } - - frame_width = frames_hwctx->surfaces[0].Info.Width; - frame_height = frames_hwctx->surfaces[0].Info.Height; } if (!iopattern)