From patchwork Thu Nov 18 04:24: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: 31476 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234381iob; Wed, 17 Nov 2021 20:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwEyRZQY6zI4QdGCic/mDmwoxycPCVN08B+/UETARiNu8OWhk42O2BpxJAqPjdVtFBOjV7p X-Received: by 2002:a17:907:97d4:: with SMTP id js20mr30136613ejc.416.1637209546735; Wed, 17 Nov 2021 20:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209546; cv=none; d=google.com; s=arc-20160816; b=dgj7WANKVvCPKRPi/pupaVB2tI0rqB3U1xQd3+7flT/wwSKr82S/cTmAP46f7mCn/M BqYBUKll3QF0xkasbJu06nNLEwwEChIH/xcfw/Dce1O4xxVgnNpquc5TR8JoOJNo3jO+ hohzfofezIAbxpZ1743/n9qaSF/cSTKu9Ak2VFVkIqgHyVeXDNm0nQRKTIo5y9UhP921 8yF1V+yNqZQeY4n7Q+iT8rICAoxRu+2JXm+RQN/Mq4dp7HrcgGr2NoNeiEOVYzi8nwAZ 7BsFJQ7IN3+kp13r5YLiLt0cNysfGypjiQ3E0fkayfmDc2gshMnGCoLFuNHRvhmjgFeg yCtw== 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=iOHoR775vlLbF/queRZa8ZBNFUXlzji9R1IkTwnkQVA=; b=DUQM+raL+Un9iANDybYLlUk3d3xnExZwKIHDNkQZrQFgfPYyOhD2Qo3ah726XXCHou u5/TYf/SZFPYx8gg1Sxo+fcryWyn2phRC0MUQDq447Fwg97JobWMJUTCbvWhUg6fqwLM HihO+lUwjNumkoz0noCPJYF7NekgKDbzhTq6a2S8k1Zl1/rAVuNlUn/ApHSFOPrA8thm rXzKAihy/G+O7HEyAs7GrbAnx1UmLNSwb2eW0/pUl9ExQ4ETXNviJrD2E81JkSKomOfy JlSkNvxeWHNcSZEdFjSi1bu6+z/wy/wc4HULdGQoBL8f/NOEaoOTES7NDIKRejc6FS48 6u9A== 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 r3si3942997edq.242.2021.11.17.20.25.46; Wed, 17 Nov 2021 20:25:46 -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 4946B68AE9D; Thu, 18 Nov 2021 06:25:11 +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 E98F168AE95 for ; Thu, 18 Nov 2021 06:25:07 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945282" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945282" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 20:25:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212235" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:25:00 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:46 +0800 Message-Id: <20211118042449.8038-7-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211118042449.8038-1-jianhua.wu@intel.com> References: <20211118042449.8038-1-jianhua.wu@intel.com> Subject: [FFmpeg-devel] [PATCH 07/10] avfilter/chromaber_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: 6jpEwGrmaNKk Signed-off-by: Wu Jianhua --- libavfilter/vf_chromaber_vulkan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c index b817dd12f7..c4f84d792e 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -178,6 +178,8 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) AVVkFrame *in = (AVVkFrame *)in_f->data[0]; AVVkFrame *out = (AVVkFrame *)out_f->data[0]; int planes = av_pix_fmt_count_planes(s->vkctx.output_format); + const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format); + const VkFormat *ouput_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format); /* Update descriptors and init the exec context */ ff_vk_start_exec_recording(avctx, s->exec); @@ -186,12 +188,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(avctx, 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(avctx, s->exec, &s->output_images[i].imageView, out->img[i], - av_vkfmt_from_pixfmt(s->vkctx.output_format)[i], + ouput_formats[i], ff_comp_identity_map)); s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;