From patchwork Mon Aug 26 13:30:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 51147 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:b3c7:0:b0:48e:c0f8:d0de with SMTP id g7csp1767613vqt; Mon, 26 Aug 2024 06:31:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWhM3eFsxA/Lk91nhqa5nv6LrWskKN3CMRBUNBugXtHE8LMdf/y7bJ3nt+b3HjhisaEwCGd7vkInNIm+76hyBe0@gmail.com X-Google-Smtp-Source: AGHT+IE1Gn/IhqtiQy8Se0HTgR2sVhHSpkW/OnWSlo2u7ptXLFQSNCeFptIY7t5V22NOVtjX279+ X-Received: by 2002:a17:906:6a28:b0:a86:8000:be46 with SMTP id a640c23a62f3a-a86a52b3672mr438020666b.3.1724679083144; Mon, 26 Aug 2024 06:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724679083; cv=none; d=google.com; s=arc-20160816; b=Pyr7alalo4LfOpb8fchosysQhR1MLAr/dz7mNdVHpVpsDGeZ7mD3EM1vFt4fER4D6H veCSgk5cADYA2XJIbq4ebMv6LGVU7XyA70ODE3fjuLcAZypqqoiYG4QvNfeU/+suXusb l6F+dCtO7Vf+M4fi/b4AJO7jLXG93kbosmgoAtRthHnQyRAlAL+J3VNyzg5UBVPx89WE iE0UTFeXqf7aQHFLi0ApIvMsfCLgpzcoMcxEmwC0ZxfDjXWAzdK4Ucqp23lZNOuV10c7 H8pCnr+YnoJwOqIpzXXtt/icrQNjVzl2xGwLVU1UHDcOdn7COqi4LF/XC09RDJAzaEem d+Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:date:to:from:message-id :dkim-signature:delivered-to; bh=4+wVjGQdxEADhJAWy0wZGbYRqiXyu4LOUmIWF7sv1YU=; fh=HnHYuZ9XgUo86ZRXTLWWmQxhslYEI9B9taZ5X1DLFfc=; b=VUpbj2UN9llY/EfVYleK5u/DbOgChP1zjJ1HojXhYTffoIgUxjbDTG1yXt2PN4oLVx 0m0qBH47tLJLDkf6qbBSJ1cpMBIA/SyFk7i768gxekKvd40THR098zN8buBeSr8W8KBd oVWrbX6kBkZNi5frasdQBqTTc+VfPrbPRPpB1uagJLi1CbWlkVwpnITieU7Um4LCL0Ha wQngse3ksNn+NA41yS56CbkeisQkf/Y0Z6DEfIhBvpJeOthBU3myimRwrZe8HtFQ9ad3 wagXiRAMZHs4D9E5vi6F0quYdQX6xr0B1nkNnVsIail+iA61xZYwTkr+uurBa6Apwbhj HdPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=iHTqkQHI; 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=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a868f22099csi666938766b.186.2024.08.26.06.31.22; Mon, 26 Aug 2024 06:31:23 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=iHTqkQHI; 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=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 497FB68DB86; Mon, 26 Aug 2024 16:31:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out162-62-58-211.mail.qq.com (out162-62-58-211.mail.qq.com [162.62.58.211]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C4F8968DB86 for ; Mon, 26 Aug 2024 16:31:10 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1724679061; bh=HM///QhEpSrjbaR+6pFyugDCJYMsUog9pxI9WsDD9BI=; h=From:To:Cc:Subject:Date; b=iHTqkQHIgdRXrrGFGRjWxisG5vi1EI7N35mUj9YU1b/W5tMQ3G/5UZx9pHyZX2fzi oWc2j25KcP0W6CNR+omYpikbkDeZywXsDZQVIpyhwTOdCxK6kmFvPjydw/xsl5A43s 144aOm6roAChmcR5BCzBYaXyDZxleYyBbkEmuHt8= Received: from ZHILIZHAO-MB1.tencent.com ([113.108.77.69]) by newxmesmtplogicsvrszc19-0.qq.com (NewEsmtp) with SMTP id 7BBB7EBB; Mon, 26 Aug 2024 21:30:59 +0800 X-QQ-mid: xmsmtpt1724679059tpei3aasf Message-ID: X-QQ-XMAILINFO: N7pVCJF/rxxTKUu+QlC4C+1KVDM4FdZXFfWkVianR9S9zDwrAEMGWgbjvJ+pfE HyYhkWCc9G3gr+BvlOWMeulaWj3bqlsSAC57Jp+2yoiTZBwHqVqxMusHb7IE7glzFZdISF63e+lW OhzqNXZn8JsDS5EdvSDGrcLUqDlPCTfRUGHOe/AnWcUpZJKfVb4KNnd0zGQzJsEFKyrVXVfpzd67 XfGEMLmS1F1qUzD8TJpiN3o2n809pmtiUtRpkIV7kmZxBVM5SHfDkgo0WjQZCG9Rs0qEMdefFbER MWvAnLmID+rI9EaH5ReggoWI2JzJIIbyDuSnVyf6Zug0tYTw5u/laCZSiRnALDST81gJJeeVZC7k MXbDFYmCKZGpw8FIuu7xGruNiE1qvaqJYtQb2RRE/x9unO6WimT/p+kud6mo6Dc9Nw1xk07cC8dJ btIRVNk6GfSEn3BaEvm4txZtyI1BVLAx1d+cvZ0Nv+yOUB2forXQx9nohZnXq830x2TQ7thRsy4f ujuJFXLA3yCrHjWZ2Fq6yy8Eb35ddRIo+M5Ls2+75ToyZsIamhBIyk/0luoa6Y5cF2Myd2YRL0fK kQdA89HTvfObB1tu2uLcNdB7HN1EZTKZKXJYwuqB2haHU7SrDMRLg/99DfAZm3uP9OwY7EmbY5C2 yYfRbaFBdOKVURs0ZHm+Zrz6qEJZ09mH6U3nXc3LZFFoxupkqPnCNmcs59kb+7jD9BG382VK3V+0 mucIUQMSXw560JxNWAjbJku0WvtQeDkH+izydKY2PiTxFDZxweZfflQ5NASmIONCVot0ROwjeVmx fpekcoCizDkfqLof39RdQhlWXaiJfRlyu7kOME9h+lqYPrlKjSAFWEPTEbwA2Lsk0Nr+YdD48ARv pXjX8JeFIh7ns2L1F0i/+YgKmDAniEBj4RPXk2K3i0qN7alF7UW5+VvDtNQ07ifmPzPJjbKxEBUn 89pDHghmMmSkBLJDNCgOS0LvVBFyFo46+cHJgLvjgUXJ+OYV/401qlh1JX/uc9 X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Aug 2024 21:30:57 +0800 X-OQ-MSGID: <20240826133057.90383-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avfilter/unsharp: Call function directly rather than via function pointer 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: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Wx28bvJErcax From: Zhao Zhili --- libavfilter/vf_unsharp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 52b2ab8d44..b5dd468b6f 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -74,7 +74,6 @@ typedef struct UnsharpContext { int bitdepth; int bps; int nb_threads; - int (* apply_unsharp)(AVFilterContext *ctx, AVFrame *in, AVFrame *out); int (* unsharp_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); } UnsharpContext; @@ -173,7 +172,7 @@ static int name##_##nbits(AVFilterContext *ctx, void *arg, int jobnr, int nb_job DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 16) DEF_UNSHARP_SLICE_FUNC(unsharp_slice, 8) -static int apply_unsharp_c(AVFilterContext *ctx, AVFrame *in, AVFrame *out) +static int apply_unsharp(AVFilterContext *ctx, AVFrame *in, AVFrame *out) { AVFilterLink *inlink = ctx->inputs[0]; UnsharpContext *s = ctx->priv; @@ -240,7 +239,6 @@ static av_cold int init(AVFilterContext *ctx) SET_FILTER_PARAM(chroma, c); SET_FILTER_PARAM(alpha, a); - s->apply_unsharp = apply_unsharp_c; return 0; } @@ -337,7 +335,6 @@ static av_cold void uninit(AVFilterContext *ctx) static int filter_frame(AVFilterLink *link, AVFrame *in) { - UnsharpContext *s = link->dst->priv; AVFilterLink *outlink = link->dst->outputs[0]; AVFrame *out; int ret = 0; @@ -349,7 +346,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in) } av_frame_copy_props(out, in); - ret = s->apply_unsharp(link->dst, in, out); + ret = apply_unsharp(link->dst, in, out); av_frame_free(&in);