From patchwork Fri Nov 19 13:52:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31491 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp2414926iob; Fri, 19 Nov 2021 05:54:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDVmsOlC3+GsdTY/PbNPgUp3amXcbz+l8QBX1GbbwyjlHGlo1aqWalo4GL99GlVbfmN/RY X-Received: by 2002:a17:906:9bf9:: with SMTP id de57mr8121383ejc.439.1637330089588; Fri, 19 Nov 2021 05:54:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637330089; cv=none; d=google.com; s=arc-20160816; b=nEfzRIbi8Ig2i2X9KAtHrahPWjqeYTB1NlLi5/VCasRHH9gWvLaa2YlzCuEEQB7z85 ajyqRyZgGuF/sMvWSZj+w/zlCQNvTrqwOAOi0fZNgl8QkIX/xt1uNBdbry3dH+IrsYmj 15MSqnDm7jlqqiP7rGWmrip8GFTqKIA9U9poV0tfGAhOueLCPFcypVrRnUaDIvAUR3J3 Bp2r0NGLpKlI7dLGEkYRa7434GtgXVwVoCyBWDKu112eL9CAvU/2gdC0NHn6LPywGp1j KPZDFAUiTnDW3UWIa/ExVtpNgjKgAN6ivmkGu9w3a0so8ZcTrV7KHk1j2Wo5/LtQG4nN Nbyw== 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=p73dwdVSKJRXcTT5p+gCKeP/rH5kK4hYkZuVIQYlbRY=; b=bwbD9IP/yblQ8Z9DN8FrCAORG9Xk9OD3lwy2wVC3DRIM2odS+qSsTaYn4T+QpXoxal Omz7a6cfRsGcs1qJlcHwjvn+mZmL8/d/S5F8ziWHvHobiJCvbPc7q+bv4Xyd5BkQjwR9 qhJ317kDTibmmBb1hIFqEnUNigBVeirMOlSSvPIHRYkQ/sCn8T9V2mSUVeEZn9rT65Ne K9Y40HctkAkEdl51SC5C4sGigz00kdmvJHORmLZFD3C+ecTWhqscOQI9dR36II/F4JGk uWBQaNVdx9q9CEHVwpxAzL2UsrNyHehZMw8CJFXyhiICGWbTDt2y0Nip9KnIlrTEWIcM x0hw== 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 dp12si7169273ejc.79.2021.11.19.05.54.49; Fri, 19 Nov 2021 05:54:49 -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 7F88968AD5F; Fri, 19 Nov 2021 15:53:17 +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 CAAF168AB71 for ; Fri, 19 Nov 2021 15:53:07 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10172"; a="231896467" X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="231896467" 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:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,247,1631602800"; d="scan'208";a="507906001" 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:00 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Fri, 19 Nov 2021 21:52:44 +0800 Message-Id: <20211119135248.14518-7-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 07/11] 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: sadMQkiKVgHY 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 eff6554960..a4f66ac839 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -180,6 +180,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(vkctx, s->exec); @@ -188,12 +190,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], + ouput_formats[i], ff_comp_identity_map)); s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;