From patchwork Thu Nov 18 04:24:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31474 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp233778iob; Wed, 17 Nov 2021 20:25:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJze/H69DxdehNvsPZjRQOFHU0rWh5ydYT/2Wp8O7T73eJaaIZvrRTAsKFGaMw5PXdXzxQLD X-Received: by 2002:a17:906:5653:: with SMTP id v19mr29078043ejr.360.1637209509137; Wed, 17 Nov 2021 20:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209509; cv=none; d=google.com; s=arc-20160816; b=EiDXMWX/oBZqhQlogN0Ndmz3WtyI3RNvZfASg/6iDz7CPtwlUqn0tFKlCP+oe+vxhy cg7goYx7KFXQz8BvKMfckCia+K3udpZyGUb3mdRfSzvFZuG2LGGc3g2qIt2LPspLVerc wEzmh3PU2uEB5QmlmeqtbEsf2AECYmGq4SA1+8d5detok4S1uSIfpeFNtiYxQSQfyMGg Hte2mri5c71ZM68YwUbShPR1+n5EIsFdK+KDQj5zblJUv0Tz+VaJ9iZSX7XRaYPoGe2Y eaB1IYlJ5h46WVGDEUYbh/cej6DUowd4lupDeIQuz30pHSBZ4RGS0klQtwnT2AbBCu4I 3g4w== 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:message-id:date:to:from:delivered-to; bh=gDkBS8RxUOXlmCuycKpOcvrQSxyaoDmY5mtt0GB0LIs=; b=qoi6Bc7cYKi/6+yYRFcj33QtYzcrqmMeiLRiY5Uglay66Xm+C54+vtpJsOOfSvcKRf Q9ybMLmyRjWcHdaJFFgr9ETuS/gKlIqnuQWH82byQpFPNl79QB7Rh0+QYV9TJDiabBQj m4KBMJHheoA/0Q0noKFNsfIpwKMlL36AKl3Jdk4d0vLgVPkk9xNfVP9Sw60LAo1LuYCb 6l/wC6+Kl2TNsbiZ4c6tiSP3QlVj2eRn5CAbp1tGvXmPw8rkeYqb/QblBQUpswkkHe1h ZKIOp2JMJlDZ9En4Mk7cmYDXhOqQ4X+bQlVuwjbmbsxXc+xvXJDoGpgQtotjckUHCFUV B5Kg== 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 sa35si5980108ejc.64.2021.11.17.20.25.05; Wed, 17 Nov 2021 20:25:09 -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 8099968A72B; Thu, 18 Nov 2021 06:25:02 +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 CB91668A764 for ; Thu, 18 Nov 2021 06:24:55 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945263" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945263" 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:24:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212193" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:51 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:40 +0800 Message-Id: <20211118042449.8038-1-jianhua.wu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 01/10] avfilter/avgblur_vulkan: check if shader is created with success 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: SurvN8Gixoq6 Signed-off-by: Wu Jianhua --- libavfilter/vf_avgblur_vulkan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c index 4795e482a9..253290663b 100644 --- a/libavfilter/vf_avgblur_vulkan.c +++ b/libavfilter/vf_avgblur_vulkan.c @@ -110,6 +110,8 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) shd = ff_vk_init_shader(ctx, s->pl_hor, "avgblur_compute_hor", VK_SHADER_STAGE_COMPUTE_BIT); + if (!shd) + return AVERROR(ENOMEM); ff_vk_set_compute_shader_sizes(ctx, shd, (int [3]){ CGS, 1, 1 }); @@ -153,6 +155,8 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) shd = ff_vk_init_shader(ctx, s->pl_ver, "avgblur_compute_ver", VK_SHADER_STAGE_COMPUTE_BIT); + if (!shd) + return AVERROR(ENOMEM); ff_vk_set_compute_shader_sizes(ctx, shd, (int [3]){ 1, CGS, 1 }); From patchwork Thu Nov 18 04:24:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31468 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp233896iob; Wed, 17 Nov 2021 20:25:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFOQ4c7gHN5TeHO+cMd/yrDOItrEsdPd/NeB0ai9YDPY8Hdv5jHy/R6X+iPpuIhu4SYRbN X-Received: by 2002:a17:906:81cb:: with SMTP id e11mr21014441ejx.186.1637209515862; Wed, 17 Nov 2021 20:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209515; cv=none; d=google.com; s=arc-20160816; b=oMFTsUwzi2bTbL76Lf6Xt8Zo5QpNH54M/c22txd4VPsuwL9ROiIYY/6KlgSUqpbTsj A1eE5Okofqud3hbij5keiK2v6sjtIKIqWKdt3vk0uGNxd2Clo6qsMrwx5RMKlpO9KcI2 guRfyP+syA0G+tYmhEtFYy+JPs+ecsBitAC9n/QzIOBWJuR+n2kUi5NxdhHq5C+Lpag6 xcusG8vv/ldXV9OuzByQ4XAu9gcn3iyAMuLHwoDv3jT09YhcZIXjlMH+A4RDCaJWeJ9h tbZ/03eS/5c6iAiqm9VKP9VoUfSwTGFvhMR5LHjz3Zukk7CBdOZUExgl1idYhaocz8Df dqsw== 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=0DUXJxrKZDOLr4pahtrCIHvr/+oZyZab/BkcFfYIQQA=; b=asHFQ2bgoMOvu82bxuv2zE9WXm//eoAXRj0K5KcO7Mw7pYN+65cr4OEioZGLTiRmFR Jq2W/tFKpT7rVu9TO/D5dNrK7AUx+Egn3i4FQpiQJUXUL/+/7oLJRrLWTYmS7z0jCJqV 9aSpp6eSFzHXMn7YbDUjPsbqSmUvGzMWsJ941KigrSDa75eG+7vzOrPcYa6n7dY73AHz Yao6NtTrhIouqASHYGRob6pmvZO1yRwpPkV1jJcSbCppj/se+iAQZIQwZe3yfjvXPsMI EU1M+py5swPCT/yGisbIO968KaVmivNAq86FITZ70aXOIB4nl5wZaRRODetZ46Ww2f/b vLcw== 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 go40si4277296ejc.27.2021.11.17.20.25.15; Wed, 17 Nov 2021 20:25:15 -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 9C0A368AE7A; Thu, 18 Nov 2021 06:25:04 +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 494A268AE46 for ; Thu, 18 Nov 2021 06:24:57 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945266" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945266" 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:24:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212197" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:53 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:41 +0800 Message-Id: <20211118042449.8038-2-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 02/10] avfilter/avgblur_vulkan: use FF_ARRAY_ELEMS instead of magic number 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: l8z7hHZbO2WK Signed-off-by: Wu Jianhua --- libavfilter/vf_avgblur_vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c index 253290663b..243e932f35 100644 --- a/libavfilter/vf_avgblur_vulkan.c +++ b/libavfilter/vf_avgblur_vulkan.c @@ -115,7 +115,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) ff_vk_set_compute_shader_sizes(ctx, shd, (int [3]){ CGS, 1, 1 }); - RET(ff_vk_add_descriptor_set(ctx, s->pl_hor, shd, desc_i, 2, 0)); + RET(ff_vk_add_descriptor_set(ctx, s->pl_hor, shd, desc_i, FF_ARRAY_ELEMS(desc_i), 0)); GLSLF(0, #define FILTER_RADIUS (%i) ,s->size_x - 1); GLSLC(0, #define INC(x) (ivec2(x, 0)) ); @@ -160,7 +160,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) ff_vk_set_compute_shader_sizes(ctx, shd, (int [3]){ 1, CGS, 1 }); - RET(ff_vk_add_descriptor_set(ctx, s->pl_ver, shd, desc_i, 2, 0)); + RET(ff_vk_add_descriptor_set(ctx, s->pl_ver, shd, desc_i, FF_ARRAY_ELEMS(desc_i), 0)); GLSLF(0, #define FILTER_RADIUS (%i) ,s->size_y - 1); GLSLC(0, #define INC(x) (ivec2(0, x)) ); From patchwork Thu Nov 18 04:24:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31471 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234049iob; Wed, 17 Nov 2021 20:25:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeKj83tAaVlXKg/nzJsr7Sx9NjlEndF1MmsdG6u0NJ4L7Hhn09wbBKziSxvxKrqlvP0J/G X-Received: by 2002:a05:6402:5194:: with SMTP id q20mr6587883edd.123.1637209525315; Wed, 17 Nov 2021 20:25:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209525; cv=none; d=google.com; s=arc-20160816; b=bTTy3qS2J+iqLhn3FIN3BQC2/jQaCZyFDcjVrPxq5m3CDpxJwihlb9odpajvd3sOv1 qQTOEJ3QfzPUis0QkvraK0tBavA5DoSirwSXKAOvh0humntxabUAGnyYZbuMzKlUR/ii zwCO9f1IEltmtnimVQZuk39CjUJi+oeFIOGtHOn5zL1J3L4yKuii/FB/fwOrzJs0jqhd YLeWS4wLZVLTjKZF0dVwEvYIQEhSp8VhKlRFvOyLset7JvE/JuEu6xyDLo8s4JIQlMJq Alk7N/Azb2eQnDKVb//nyXzgyF3bU1AHerNh8LtsKZDI1OAIaP+IZ5e/4u6SwZocgeZP VN1A== 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=sEbRk/P0Z2N1hPtee+DGEmqb4ypddGAQ0VXWFfKoQBU=; b=n/bV8xjgTWH5N02Wvxody3BG05al5BaxjUQR46yCGRdoWjDeAwV+HbubB45rIVPiYZ AIgV/ojPRqfC61GqD4cKcNdow/a97y7ktcOLjsQtwCaN3ryejEwEXCRGceBaveJs+/+t EDJ5/+GjtBB0/LK/OxYEQGoRSAJeO8VnFLRHGtsaYp1t8O4g0jYNhDgpt6ArQO8ZUZXY ut9U9nFlb18/8wH3ts2kP+hdpvA/o3clDbzLZvM5l8i3zOqipzT5V42sKMfP3n+mnGMI D4g3UydSVtgc0NRRZoGm38tM9qPouJhFPdVjqNcchYDydFFmQyaScz8vcMT5Uo5oBeVD 9Lhg== 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 gs42si5341446ejc.704.2021.11.17.20.25.25; Wed, 17 Nov 2021 20:25:25 -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 BC66D68AE8C; Thu, 18 Nov 2021 06:25:05 +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 78247680243 for ; Thu, 18 Nov 2021 06:24:58 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945267" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945267" 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:24:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212202" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:54 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:42 +0800 Message-Id: <20211118042449.8038-3-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 03/10] avfilter/chromaber_vulkan: use FF_ARRAY_ELEMS instead of magic number 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: Pkgkqoq7m0RO Signed-off-by: Wu Jianhua --- libavfilter/vf_chromaber_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c index 83ab72f716..b817dd12f7 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -125,7 +125,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) ff_vk_add_push_constant(ctx, s->pl, 0, sizeof(s->opts), VK_SHADER_STAGE_COMPUTE_BIT); - RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, 2, 0)); /* set 0 */ + RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, FF_ARRAY_ELEMS(desc_i), 0)); /* set 0 */ GLSLD( distort_chroma_kernel ); GLSLC(0, void main() ); From patchwork Thu Nov 18 04:24:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31478 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234197iob; Wed, 17 Nov 2021 20:25:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwdy1lnImqsgad1BrfZfsjpJjTcVwLGFfFOZKzuX1fFZWH0vqJjCJvKNRauRf08Tkc1k9H X-Received: by 2002:aa7:c2c6:: with SMTP id m6mr6425231edp.42.1637209535314; Wed, 17 Nov 2021 20:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209535; cv=none; d=google.com; s=arc-20160816; b=aJByH61VclRTKZxLcel5RkR8jZ+42aKIl6a7vE7QDXk52moqMA+Hm1uLFjllmI66VT w65wwDYM1Zaip4CytbcwZDOtPlyUu/N8VpBYQdvnkSAjyDFsA4oSFaq7dgUFPCAZcEp+ lcrcnscDPhAASKiHNl8ZM5WWMz9Qfh9Xh4+8r+nDB4yUzngirIH9YtuwuifXrq6nHyqb K1/JrXifiywV/iFWT+XY1ZiRJGTR80RRdqKxXNtpeQXjk58oIz0FU8VOowMfueAFr34Q xqDbh9gJ1XTMdtRZuiPzKTzpdrylO5P/akLJH272qPBJwIZG6CxSiNpIcavwdoPqSt4o BTqw== 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=B6EwgBQRbfL3rDkijK9iSdNI/VWR7I3X4GevMNAUEUQ=; b=njhLbFhWRzotFrfUAMpLH2grY73fWh7coqW69h3c6zYI3WkFo1tKBANNwwOfOOe1Nb r7zAeGVOrWi3aycaWZJY9juNK8ZfaUio+b6l6zfA423QnIJxcXC95mcVhLX4NMsi+W6H 3tJ2un++69JQPBvOKWL2q/GrsCFZQp09RcUk64CR+kzcMUVsAjkMdTjFVaMsBIsKU70a Q7KcJIpwd4kcEIM3hD6HSPD0jgft6c1i+dMIYE1/wjxYhVvjAe9vBhcshZtCK6ChDved JJwhPnNjZzLGAGsEFdwQFOmlsBdAr7vbVkbkuiXrh+SwH84tvsHjYAx9urBTVzQbok7l SlZQ== 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 c12si4805191edx.280.2021.11.17.20.25.35; Wed, 17 Nov 2021 20:25:35 -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 016F068AE9A; Thu, 18 Nov 2021 06:25:09 +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 C94BE68AE95 for ; Thu, 18 Nov 2021 06:25:01 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945268" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945268" 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:24:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212212" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:55 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:43 +0800 Message-Id: <20211118042449.8038-4-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 04/10] avfilter/scale_vulkan: use FF_ARRAY_ELEMS instead of magic number 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: pF6aDO029oM4 Signed-off-by: Wu Jianhua --- libavfilter/vf_scale_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index 3a2251f8df..7d7120df79 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -178,7 +178,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) ff_vk_set_compute_shader_sizes(ctx, shd, CGROUPS); - RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, 2, 0)); /* set 0 */ + RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, FF_ARRAY_ELEMS(desc_i), 0)); /* set 0 */ RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, &desc_b, 1, 0)); /* set 1 */ GLSLD( scale_bilinear ); From patchwork Thu Nov 18 04:24: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: 31477 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234501iob; Wed, 17 Nov 2021 20:25:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWr1CMnlxZmE09wuNq22AGrbzXUmJDpX6YJL2lol7dyksaVxgmi1Nm+/lbjpn8h1HdiP0X X-Received: by 2002:a17:907:60ca:: with SMTP id hv10mr28803353ejc.500.1637209557118; Wed, 17 Nov 2021 20:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209557; cv=none; d=google.com; s=arc-20160816; b=NqEh24/UcbSeCM0IzlSodgBl/aUOGrnxbXe2kZOB9qW3F+ivb78gluX7YJh8ux9t8R /1G+CgFatDSpzb00NadGFVfi8LoYAne7Zh0guRSndcmGlYv3qR9+Q1HHjqYaMgXacyEA ZI0g+nw3UaNBtwgOYC0+KQmuIbFYNeX6toiUawaSt47vzc01FpIR5s1N55l5N4Yi//h5 cm/WbytcDyrMfiWSBpKIR/oe3Act+7mLhtmnPyMFEHe2jGUfKVXZlNJmgj1LJK7G3azv HMuELGAEoUb+n0xopvYv31BCIVehiYghP7xgUI1dSY3WpmYva9SSjqBryrWo6BkijvK6 pVYQ== 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=3rG96M0ik0zlOa2rvreUMmLzIQDhDSaGBQRjkoGYS14=; b=NVvRmklY1Ck6ofwkAEEGPVlWiicLVoNFfWVW+8x9XZ6HY2T54eO6yScMsJj32jrMC7 AvmkVR9pUIvZt1Lx+Us5IRBrVMwSfxoBxE/co2j5emH5BRW82pi11D4Za9G6ePzBInz/ oqbaxwYpwPoeKXZQ3UpifS/+3QVuuTWLcuCjGmZJIKXf4vRpf5WiJwH9pFOuYFFC+T+4 eWp1HK5VybAEW/BSRSx1AyYiasDrs8bJ27Yd8pAFvA4vG4YdHnykBRkWSYERXovnkNMy 62z6ZnmRhhHhk70V83/cm2YxDoCcWo3DnXDRRQN/DkxCldQPQ9dTFiZ5xCm7jb3YdN3v 3jvA== 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 e19si6190515edz.264.2021.11.17.20.25.56; Wed, 17 Nov 2021 20:25:57 -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 4D72168AEC1; Thu, 18 Nov 2021 06:25:12 +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 3F60268AE9A for ; Thu, 18 Nov 2021 06:25:03 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945278" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945278" 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:24:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212218" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:57 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:44 +0800 Message-Id: <20211118042449.8038-5-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 05/10] avfilter/overlay_vulkan: use FF_ARRAY_ELEMS instead of magic number 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: mgp/pAHgxl4V Signed-off-by: Wu Jianhua --- libavfilter/vf_overlay_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c index b902ad83f5..29eb11c89d 100644 --- a/libavfilter/vf_overlay_vulkan.c +++ b/libavfilter/vf_overlay_vulkan.c @@ -145,7 +145,7 @@ static av_cold int init_filter(AVFilterContext *ctx) ff_vk_set_compute_shader_sizes(ctx, shd, CGROUPS); - RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, 3, 0)); /* set 0 */ + RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, desc_i, FF_ARRAY_ELEMS(desc_i), 0)); /* set 0 */ RET(ff_vk_add_descriptor_set(ctx, s->pl, shd, &desc_b, 1, 0)); /* set 1 */ GLSLD( overlay_noalpha ); From patchwork Thu Nov 18 04:24:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31472 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234897iob; Wed, 17 Nov 2021 20:26:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhbDVEubC7yr+2fX/4LlCNl5jQjSiHpiXwwqlOUk8oCjv+M867CHKOy+vfz8h/5nFWHZMX X-Received: by 2002:aa7:d652:: with SMTP id v18mr6931299edr.68.1637209587264; Wed, 17 Nov 2021 20:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209587; cv=none; d=google.com; s=arc-20160816; b=YZa/4j+GxoFo1DgB3p19W59GuRQZcSjzsCqWkqLiLt2h2YV7khyhfo+6mzPj7q7Jqv KQ8xCDazzhXhTw50NRJkv26uwtlj7iXIO6FtRXOw4PaB73z8ERgQ4XiTAj2GjQGg+VhG pjaJG0oHl6o1VLKaCqvMtVYwvTdM8lElseeNQlwE53cln1Ujr7SCRlsOcJ/SfsjDj9Qh sLQ/A4sJllyucrvww72z8rjSEwqY+NAvVX+1bpcBGhhsogfcDgVmg82n0Rs4HoXgHlLT JLLUp04IM+X6BEP9Rs/+TXMAzhd6I4iPdDz8nNie1Oe+Y8TkrnwhbrjdLhBCXrzcKhTu gNnw== 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=1V8lLiKu0KUZQx20b755zi/6iAXf1Y1Q76P1PRmN8kw=; b=cG9QPvsrsya60FRk5fLT68SOEtVfTeEFdrw/Tuqho3vOVAGUogbZ0qreXizxhwDV+Y OKMhjlA68mAxDgKLoG+wkhfqCxSDOhz/LdxLrkBZpl6adN/fkneEZUj6XEYVYyIlVmBB st5dbDOdJIFKa7oUll5v7Bc8qbB5VtssMFZIpSCoqleEYQfkTR2JpZ9DNgei5zODvwE0 3eFfQPgqNhyv1QMYe3NEusyScx6S2RoRcAhxQ1gWDgwe/t64YuPenmrifIzwdnJfqV+p NMXAa9k6jcNvnB3Di+dToBEORISokna9F0MJswfVrLpgti/MRCcLS5sqqoW6x49pz4Ty gQag== 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 p23si4299397edw.135.2021.11.17.20.26.26; Wed, 17 Nov 2021 20:26:27 -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 83F1068AED3; Thu, 18 Nov 2021 06:25:15 +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 DEE9868AEA2 for ; Thu, 18 Nov 2021 06:25:04 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945280" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945280" 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:24:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212227" Received: from otc-skl-e5-server.sh.intel.com ([10.239.43.106]) by orsmga007.jf.intel.com with ESMTP; 17 Nov 2021 20:24:58 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:45 +0800 Message-Id: <20211118042449.8038-6-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 06/10] avfilter/avgblur_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: DvUMWz1MHmAs There is a loop in av_vkfmt_from_pixfmt. And, even though some compilers will optimize it when the optimization option is on, to consider more situations, just call the function only one time here. Signed-off-by: Wu Jianhua --- libavfilter/vf_avgblur_vulkan.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c index 243e932f35..080a8b1b63 100644 --- a/libavfilter/vf_avgblur_vulkan.c +++ b/libavfilter/vf_avgblur_vulkan.c @@ -210,6 +210,10 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *tmp_f AVVkFrame *in = (AVVkFrame *)in_f->data[0]; AVVkFrame *tmp = (AVVkFrame *)tmp_f->data[0]; AVVkFrame *out = (AVVkFrame *)out_f->data[0]; + + const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format); + const VkFormat *output_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format); + int planes = av_pix_fmt_count_planes(s->vkctx.output_format); /* Update descriptors and init the exec context */ @@ -219,17 +223,17 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *tmp_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->tmp_images[i].imageView, tmp->img[i], - av_vkfmt_from_pixfmt(s->vkctx.output_format)[i], + output_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; 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; From patchwork Thu Nov 18 04:24:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31467 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp234620iob; Wed, 17 Nov 2021 20:26:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxv2YT1efTOIgF/2aZ0Al7URLuVkXVsiZHAbQhxplmELJkV5OcoSs1kWf2wVh+wEhqjFkRF X-Received: by 2002:a05:6402:4394:: with SMTP id o20mr6646213edc.342.1637209568181; Wed, 17 Nov 2021 20:26:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209568; cv=none; d=google.com; s=arc-20160816; b=lDKPCQbLPzRYUe+sdToxXHnLak99X/xi5dXxVuEu0DxZzhDbinsASJ2ukikDTDRjzo 88Y/Ho4G1DGwSaoGeRn0Ujx5O7dDxgHhNE+Y8Ypfyo03pH0FrqQuukl3iiBmaa71D6Ie 7T9qoMox1+SfmzsLP7PCIxK7cdDnHd0gSvIN+8+VC/qW7qWQUVSYKf903WZ1sCpDer1L 1tCtY5zKPRAJDSSANEJBrMTj8Nz5Aear4+0SPeYMNqre4z7NAXkAT0Pp9Cs9LUSzvpEN A7hLPZP8P05XyD49qT0Noni2nd7L0qDeOYn4k4hpKbRR8ubgsImCsDuo2brwM12B5fBY iCDw== 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=0pMZ5kp7iXW4UBRf0WMBT2yTxo5hGS2XtOvPhAlX3UQ=; b=SlKbbOHLC1vN+lUcXJZWepm89ew3VGLt45gZrUeoC9Ouyw8DquwS27YCQdxxGhlZrQ 5KktZEUr46c+IlWImWFnV4JTRRyBO3A3bv0V/8MExyArXw9xViDSxFBdFli70RVBIPR7 C6JE9zaRcE8qOuR3bzMEUwkY9jfB9LJZQ31UpJ9LPZceNwPY9KFXANn7TgigXwFs3A9G eivM4q/0u8w4fCp0uaIy9iogQZyptzheQ9CTwiOPjLonXnqT4Onn9n7ZEvy6lFYQmGHi lvmEGC7CP8QYlZeNz8/NJlD8allbeJg8bP5cgax5c/q+YRpaQknKa5IdaeMutynUo3VO 9bqg== 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 hb14si4711495ejc.610.2021.11.17.20.26.07; Wed, 17 Nov 2021 20:26:08 -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 5493E68AEC5; Thu, 18 Nov 2021 06:25:13 +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 0655468AEA2 for ; Thu, 18 Nov 2021 06:25:08 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945283" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945283" 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:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212244" 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:01 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:47 +0800 Message-Id: <20211118042449.8038-8-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 08/10] avfilter/scale_vulkan: call av_pix_fmt_count_planes 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: 6Swf1ByGlKOy Signed-off-by: Wu Jianhua --- libavfilter/vf_scale_vulkan.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index 7d7120df79..413c2cb294 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -301,32 +301,30 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) AVVkFrame *out = (AVVkFrame *)out_f->data[0]; VkImageMemoryBarrier barriers[AV_NUM_DATA_POINTERS*2]; int barrier_count = 0; + const int planes = av_pix_fmt_count_planes(s->vkctx.input_format); /* Update descriptors and init the exec context */ ff_vk_start_exec_recording(avctx, s->exec); cmd_buf = ff_vk_get_exec_buf(avctx, s->exec); - for (int i = 0; i < av_pix_fmt_count_planes(s->vkctx.input_format); i++) { + 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], ff_comp_identity_map)); - s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; - } - - for (int i = 0; i < av_pix_fmt_count_planes(s->vkctx.output_format); i++) { 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], ff_comp_identity_map)); + s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; s->output_images[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL; } ff_vk_update_descriptor_set(avctx, s->pl, 0); - for (int i = 0; i < av_pix_fmt_count_planes(s->vkctx.input_format); i++) { + for (int i = 0; i < planes; i++) { VkImageMemoryBarrier bar = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, .srcAccessMask = 0, 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; From patchwork Thu Nov 18 04:24:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wu Jianhua X-Patchwork-Id: 31473 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp235041iob; Wed, 17 Nov 2021 20:26:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyUgGVluP1HEZkL1g5j580xGjYlVxo2ZV59ARcYaW8oKQp9Cw62hA+8OjiunR2pUIfoKxV4 X-Received: by 2002:a17:907:3e0c:: with SMTP id hp12mr28944373ejc.293.1637209597712; Wed, 17 Nov 2021 20:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637209597; cv=none; d=google.com; s=arc-20160816; b=O8yNRfImtnrok/oplgJJKdAw4nyjhafimWXCnA50KhUfwO8/NgORDx9ovQpvZD6lEw /xpaOy+Lq+69/mlHwsuBN/+5IyKAglmHJdUKhZAE9q7hbLvxE4Eum/sXGHZke/7aLq+0 q4Sr4asmqA2nWNLcYZsOVP54mNx8hKNE3yXkn6cSs/PEjRjANYa+/nLBn56ydqvxT+fo AJ2zE5qzQxTDnDvOAj/9GEqwpLoCoQJGdwcCgf5FLv/FpzdXgw2J/dek/yBRt7eJ+hVk SN/K6D/uziETYZq3Ufu2xmVWz2+Z+SKLgeLdrDvCI3IwEnSQWjoFc50IZejicIEM+nTT YD8w== 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=Vreoi5RF9zqBOPz36MaJyH1R4NMx4r1dNyXdWWm5I6w=; b=a23nx6p8AI5W0Hmds9pZcn1AAD50zB/fy21fV8+FTDJAEGdSbIc7hz312aRzbeChlm zgAZOAo0MC86P8+dPbjULpZDVWtShXJVHi9RGkHxBB8+iPq/A/n2q9oSmqxwQ76N33Zj UOrz45ouocAypLXPt3UwQQbe6Qq8GjjR1Uf6UkJ4fzlmyiJHtRGh/04fxSqrLK6LrTze OV9DGcxZpP8nhOSyYfO8LCmbfOqlDluqfOcmRn431b840Ax8C7XFFqZYQfkwM/RCKe2T PGwcxcxOCijQLhPIVCiglWmLUXD5UuEGwdQXUECVN+qguaLbUx3bv0BfTa6Xh0jYKC4x Byzg== 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 bo2si3596559ejb.666.2021.11.17.20.26.37; Wed, 17 Nov 2021 20:26:37 -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 C9CA968A412; Thu, 18 Nov 2021 06:25:16 +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 13F4468AE68 for ; Thu, 18 Nov 2021 06:25:09 +0200 (EET) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="233945287" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="233945287" 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:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="495212296" 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:03 -0800 From: Wu Jianhua To: ffmpeg-devel@ffmpeg.org Date: Thu, 18 Nov 2021 12:24:49 +0800 Message-Id: <20211118042449.8038-10-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 10/10] avfilter/overlay_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: EOTFpVqu77lQ Signed-off-by: Wu Jianhua --- libavfilter/vf_overlay_vulkan.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c index 29eb11c89d..03197ae712 100644 --- a/libavfilter/vf_overlay_vulkan.c +++ b/libavfilter/vf_overlay_vulkan.c @@ -240,9 +240,13 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVVkFrame *main = (AVVkFrame *)main_f->data[0]; AVVkFrame *overlay = (AVVkFrame *)overlay_f->data[0]; - AVHWFramesContext *main_fc = (AVHWFramesContext*)main_f->hw_frames_ctx->data; + AVHWFramesContext *main_fc = (AVHWFramesContext*)main_f->hw_frames_ctx->data; AVHWFramesContext *overlay_fc = (AVHWFramesContext*)overlay_f->hw_frames_ctx->data; + const VkFormat *output_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format); + const VkFormat *main_sw_formats = av_vkfmt_from_pixfmt(main_fc->sw_format); + const VkFormat *overlay_sw_formats = av_vkfmt_from_pixfmt(overlay_fc->sw_format); + /* Update descriptors and init the exec context */ ff_vk_start_exec_recording(avctx, s->exec); cmd_buf = ff_vk_get_exec_buf(avctx, s->exec); @@ -250,17 +254,17 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, for (int i = 0; i < planes; i++) { RET(ff_vk_create_imageview(avctx, s->exec, &s->main_images[i].imageView, main->img[i], - av_vkfmt_from_pixfmt(main_fc->sw_format)[i], + main_sw_formats[i], ff_comp_identity_map)); RET(ff_vk_create_imageview(avctx, s->exec, &s->overlay_images[i].imageView, overlay->img[i], - av_vkfmt_from_pixfmt(overlay_fc->sw_format)[i], + overlay_sw_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->main_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;