From patchwork Thu Nov 18 04:24:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31475 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234743iob; Wed, 17 Nov 2021 20:26:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLFtE8a85rZDjBgl+hQW5YTdAKuK5P0jLsAI90EEOOD8i9MZsKfWaZ2VWiFS4yXPYViitP X-Received: by 2002:a05:6402:350a:: with SMTP id b10mr6810871edd.184.1637209577385; Wed, 17 Nov 2021 20:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209577; cv=none; d=google.com; s=arc-20160816; b=JNGlHCwGeHZxyGF3ux88N0V4Kh93IlJYsJ86RBZT2KRXUUz9yY/hefvr6VfBBZ41PJ cPgg7Ntj7DS8tc85TiB+2dWrmDqF4YXYRuruZ27hSHNSwNpI0nlXWplbhhyAbRq4ppaS 21oTnyhwu/ErIyIGf/pFTiIj8DWtpGyxDXiD+Bmjm1FEvPd3EYiJxI6Whpc3kkJCPRwh 6LuIUH42vzuKGKtFSkVPke9Kwf9a3TvqNGWRXEjX8NaSmL7I7rjYdllVcM2vqqjNfBhm TQ92my9hbY9qx6mAw+P6PQSTDag/XU1Hpg5PSJlNDxq+QHMcyorhLlhCsE2fbLGKr1K3 otSQ== 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=TcDc6uqNJi6+oDC3e2Q4OwzbuKcC3TkslLzfpBKcoJI=; b=EkotbXikxSy8F2ZrWxwJkZKuBRDGjI/Is81vuWEdflg+NAkIbpx9GEHQqErS8kXHkC gxSQzMyOvVl/CHpgukoxOJaOAtTVWmQzad6XGkDR+gLygeBSMAZwOY9O1nudNRcf8kWC 4wEdzynQcgOtzgjv1wCwFl1YXbaJ0NY2tjv6pR7POfij2cK8lVkq0m2HcSbNRoSyANgN bmg95QRZlCsaJh+eFa8H2wupAYgDvIzc329K4ZlwnwQekfVfbAO05rkKkezH000gO+qF 5Zwdbh5PhrsQuReTBoDpJHPnVzKLuS0re6nsnhD5UMDBo/pZz17aBZgn8bzjQaJ5BqzH Kv9g== 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 l7si4805770edk.334.2021.11.17.20.26.16; Wed, 17 Nov 2021 20:26:17 -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 6369668AE9E; Thu, 18 Nov 2021 06:25:14 +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 3B79268AE68 for ; Thu, 18 Nov 2021 06:25:09 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945284" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945284" 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:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212264" 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:02 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:48 +0800 Message-Id: <20211118042449.8038-9-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 09/10] 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: uN+nY8sziSWt 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 413c2cb294..77c970473e 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -302,6 +302,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(avctx, s->exec); @@ -310,12 +312,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], + output_formats[i], ff_comp_identity_map)); s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;