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)) );