From patchwork Fri Nov 19 13:52:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31490 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp2414351iob; Fri, 19 Nov 2021 05:54:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4LqIhBxemlBRePTP8vvC1WlpybWx9rQastcBb7y+YXKFe59OSES7oXjqj2mZ/2qA4tZIg X-Received: by 2002:a17:907:1c15:: with SMTP id nc21mr8067682ejc.260.1637330060548; Fri, 19 Nov 2021 05:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637330060; cv=none; d=google.com; s=arc-20160816; b=b7BGcjzkwmwgeu9vNQJM/vtwM5e2Dkt4t+5nT9+poWnfYNcbF+1iPYnsYfRXeuxrhj uN76lSAXLEyFoOewJWnvGsfaj/hxreyCqY6myp2dkZrmDDmFFMgc6a74/X0ih4XvrSQx kGAiCs4hago1f6cDn9UNegE40tZ5XOeENbq/IdUUZHfVrWSy3vQRhb2azfkBJZtbMMXQ ISXMAX5b6iUlfLpuWDj9koCvDjeWVmgBW7O6TB4kzqjuJeatM4hXRh9fa/kYUJo4RqZS aOVkXBJaK3qXM6qgmGqkvjgMsWa7AElTvW7mnz8UONxkjsD/nIckcAW+LsPKNWzHorLO 6Kgg== 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:references:in-reply-to:message-id:date :to:from:delivered-to; bh=0f71GsND1JXH1gfjlzm4e3Ut0UmwP0+uNCbTzuNJ8Ks=; b=cR4E/FyhOhXEiPlgbSltg/FIupf9PKmMO7XPcH8Gnrzd8N4Pm11HXDz/tB8uzTZlJj nG1fEBgWHkgtZdE24VAP7ufy+aHKc/TJIYQ8sXKpqe6uZKmTi24cWhq8Fg6qhyMXwYLh U98hfAYCrQCspMfywrZfLAtcNQLp/Nhkqd66V4Iz56qfaBAMpnMdLowTn+1gqViM0JNs lE0xKXsp9NqHOMOEVJa1igcqspoojD7XUmo367x/c8ucQWfYgutFTj2ULyMmH8/+2UJt SdNQN8gfVj9p+Jpa4vy9A8r33jsGP/i+Juofoy3Nc1aQ34zcKLhVHeSdbt8aqsNxfT6n 6QwA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ho42si7530666ejc.203.2021.11.19.05.54.19; Fri, 19 Nov 2021 05:54:20 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9D3A868AB9D; Fri, 19 Nov 2021 15:53:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC9F368A96A for ; Fri, 19 Nov 2021 15:53:10 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10172"; a="231896472" X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="231896472" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Nov 2021 05:53:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="507906018" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga008.jf.intel.com with ESMTP; 19 Nov 2021 05:53:02 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Nov 2021 21:52:46 +0800 Message-Id: <20211119135248.14518-9-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211119135248.14518-1-jianhua.wu@intel.com> References: <20211119135248.14518-1-jianhua.wu@intel.com> Subject: [FFmpeg-devel] [PATCH 09/11] avfilter/scale_vulkan: call av_vkfmt_from_pixfmt only one time 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 Cc: Wu Jianhua MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: XtsoEiPosyA4 Signed-off-by: Wu Jianhua --- libavfilter/vf_scale_vulkan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index caa08ff19b..6b836e7e26 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -304,6 +304,8 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) VkImageMemoryBarrier barriers[AV_NUM_DATA_POINTERS*2]; int barrier_count = 0; const int planes = av_pix_fmt_count_planes(s->vkctx.input_format); + const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format); + const VkFormat *output_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format); /* Update descriptors and init the exec context */ ff_vk_start_exec_recording(vkctx, s->exec); @@ -312,12 +314,12 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) for (int i = 0; i < planes; i++) { RET(ff_vk_create_imageview(vkctx, s->exec, &s->input_images[i].imageView, in->img[i], - av_vkfmt_from_pixfmt(s->vkctx.input_format)[i], + input_formats[i], ff_comp_identity_map)); RET(ff_vk_create_imageview(vkctx, s->exec, &s->output_images[i].imageView, out->img[i], - av_vkfmt_from_pixfmt(s->vkctx.output_format)[i], + output_formats[i], ff_comp_identity_map)); s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;