From patchwork Fri Feb 11 02:37:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chen, Wenbin" X-Patchwork-Id: 34218 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:14aa:0:0:0:0 with SMTP id bz10csp2853497nkb; Thu, 10 Feb 2022 18:37:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDf8Chbsa/OawjsLJCZr6WCXRi665rX4MGxOpjYd5qszaWyQLxfMWYj1DvU70RjQ7CklSs X-Received: by 2002:a17:906:8c6:: with SMTP id o6mr8831751eje.234.1644547073642; Thu, 10 Feb 2022 18:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644547073; cv=none; d=google.com; s=arc-20160816; b=w5AgImtJoAFi/2xXJMlpu550HiTdxJkCJ/F467fP8AwN/ydH6z8QPlYC90mNAU897Q 67Ov7bzbbKJZUAMMvT/GBsw58w3cKptiXIJbZ9MTVeIiJBcYEbrL0NS0DQWvLE6QzIlL gEsmMC6esh9V29FXbblpFNADByjW7xYeHeu2+J9pqxNvrK6sRiDlRYIZcBL3h92bemUw oLw7NcsTFL4zFWl0GaS9U68XHf5Ccmac7EvOslDVN2aMx6LfsuZ2Y0Jf7zQqTqxQ4wIB 8llvKrxMemEYd2G2JTDiOchXEkEt+g+csmaXswqhkEaqx6UjcgtJ9aHEm+ulcHVhRVzx orVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=8LgWs8czcB8FyF/oGC+Wut0IaDiHaP4FloKRc1JVWAY=; b=O4TQuARB1SinXPliREsj72TXW9Z7BGZ2ykk7IDZjUI0Bm3nZPD7aYfQxCTzCW6P1El hrR2VN1IX+n7Wt4UyKWMMcK2t2Oa2cZjHxWGy+VxYLdTrp2zlRp1Q86u0jfi9qVLqNL1 OUViyzH2H8FO5l0q3kVAf9RGPVJQgNCLw1JLEvIcwaUVhgjSRhr/qm/EVmZv+X/cTg4v hpqvKePZfwsjI61et3f17gU9SIbkcfy/hJXpk1B8pQSWeBXxaNUWR7hidRSE3NkUfjcJ PEUAB3QPXP4rVIQ+qlBtL3juoO6/k1K8G9+tReVodzTGMASP/G3GFN+NB/q6WHagwSZf xKfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=gOMGQh4g; 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 hp33si19091385ejc.663.2022.02.10.18.37.53; Thu, 10 Feb 2022 18:37:53 -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; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b=gOMGQh4g; 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 9F8E868B1E1; Fri, 11 Feb 2022 04:37:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 137EC68A48D for ; Fri, 11 Feb 2022 04:37:41 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644547067; x=1676083067; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=4B675sFcpwy5jLKGalnXkwi1LSD7AQ72wWL3hMiq13g=; b=gOMGQh4g5boRRpxBoxVIt3BrcxBkKjqggjQ6KXT90cCe7PkIOfzmqMmf M83iMmgQHQEpFhMfqBKG5ZJz2GJiHJoZ/PqfZcTtdXzKFiTpHUEEocD1m lmZMG9QOYp1ma524wO4fDtCChh4zKph/djjaZLg1peTReOZoY76lg+ky+ KyRnBkvkZu+RYgyzzLzXEr9cdf98nOKR0pffJj8XL8/2+F7biHl3+SJqa iZOJvtiKhcl20T6SvstxapIACEvGbgGkE4+w91TZtqmOxTnROD0AD2nLL PcyUkmmtnvZ5VZdNcWDfXM8X1ahdF3Yk8UTv11wfwgJxW2YO2XWlRKRsK w==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="248475279" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="248475279" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 18:37:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="771941730" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.35.110]) by fmsmga006.fm.intel.com with ESMTP; 10 Feb 2022 18:37:39 -0800 From: Wenbin Chen To: ffmpeg-devel@ffmpeg.org Date: Fri, 11 Feb 2022 10:37:36 +0800 Message-Id: <20220211023736.501863-1-wenbin.chen@intel.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavcodec/qsvdec: use the parameter from decodeHeader to configure surface X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JRuagbpfU/EO MSDK recognizes both yuv420p10 and yuv420p9 as MFX_FOURCC_P010, but parameters are different. When decode yuv420p9 video, ffmpeg-qsv will use yuv420p10le to configure surface which is different with param from DecoderHeader and this will lead to error. Now change it use param from decoderHeader to configure surface. Signed-off-by: Wenbin Chen --- libavcodec/qsvdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index f81737ab6d..6236391357 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -423,13 +423,13 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext *q, QSVFrame *frame) if (frame->frame->format == AV_PIX_FMT_QSV) { frame->surface = *(mfxFrameSurface1*)frame->frame->data[3]; } else { - frame->surface.Info = q->frame_info; - frame->surface.Data.PitchLow = frame->frame->linesize[0]; frame->surface.Data.Y = frame->frame->data[0]; frame->surface.Data.UV = frame->frame->data[1]; } + frame->surface.Info = q->frame_info; + if (q->frames_ctx.mids) { ret = ff_qsv_find_surface_idx(&q->frames_ctx, frame); if (ret < 0)