From patchwork Tue Dec 27 23:17:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 39797 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp3763005pzb; Tue, 27 Dec 2022 15:23:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXuXoUCOD+sWi5I/mtthdQ72hpLr5aUqI6ecfK7H+n/DYKBaoa5MJGlOw6Ln9ztaq3ACRYYW X-Received: by 2002:a05:6402:25c6:b0:46c:d2a3:76b3 with SMTP id x6-20020a05640225c600b0046cd2a376b3mr21456708edb.14.1672183385998; Tue, 27 Dec 2022 15:23:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672183385; cv=none; d=google.com; s=arc-20160816; b=dkQy0qsid2xCWMSgCicoisYibGPV21HewZnGiWeNRBFCE/ZdPsQ/ejiz23DI57M4M5 /dcnQgs7vBpyJB+cB05zbh0ba6fN9kPmv1VobXQnqRcQy1nhnK42aRFS9STFwkB/v7cO wAk1zAT2XA0p/O8GdDq1g/L9rx48xkRd9CDSJcHNNkcJR0aLakEnQYNNWXyDgv+TlB6l 3Fl3xPa8jZWfbOBLfw/8Aif9g5nmoPCjSYNukNY9JsF3rfoO1SRtaiqVPZe5tmC1pM2m dzy7ZAOfHqBOVdnGkkN9H9HNHXwPPhQ4aqKxgs1TQ0XqIGfMcLbNlySn6pH5jd2zZGlY VPiw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=98xDDPMwVKXXGhNyw3GKGdlK3U01dpN6ksjRHPOiCzA=; b=GCYS77UlOYc5NID6wzIeKjkJVS4XWGssKZJsd2ZEZsFeT3ZoujQMNZ0yATIRaNfHv8 oqPawO1I5FJ7HjtvC6sF//2eviHTMkL8Q1dzSOHEE9m0597RP6yI7pNFRRKw5p9mtn2k mIyOWDSbmlJrroY7Wbty3f7rIkZ2M2mqaQchSZ51Pk5rBXy50JWVNl0eyY9sqo0FPLen xnuz6h90HpKQbCfOdgzTAWiB4EkJixwbOuzorPuxxOgdg1ZtDXKXCr9IS9c6ahwujc+h gnevm8TlXKzM3mEQ52Zt9ms8SCN6u6sqYrtiupkS6uV4dZJslpGWN/2ZKfqYVpvH698r 4bCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b="bHcdkHw/"; 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=pkh.me Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f16-20020a0564021e9000b00478c8cfd5bbsi13433177edf.16.2022.12.27.15.23.05; Tue, 27 Dec 2022 15:23:05 -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; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b="bHcdkHw/"; 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=pkh.me Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 021CB68BDE9; Wed, 28 Dec 2022 01:19:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ssq0.pkh.me (laubervilliers-656-1-228-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E461768BD11 for ; Wed, 28 Dec 2022 01:18:31 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1672183097; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NXFVRFlsU5rTzmv83u4zXVPOLYxggriaqXmbNfYASgg=; b=bHcdkHw/AMXGLeKZaxVi24duwjyTNTVuYZ51O9cgBX8HPnDcUM+ab2nkIjfrfxnUUMs6pL fptLtShOwGaX2NARqcbUAxzgB/Ip7/5nDsCMKCdpZT0bKMqs84dppYTR1EraykNDa8nC62 TFi0b/wlJHW7CPpFzUP8jHloAsr73bk= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id f7df6e34; Tue, 27 Dec 2022 23:18:17 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Dec 2022 00:17:50 +0100 Message-Id: <20221227231814.2520181-9-u@pkh.me> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221227231814.2520181-1-u@pkh.me> References: <20221105152617.1809282-1-u@pkh.me> <20221227231814.2520181-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 08/32] avfilter/paletteuse: remove redundant alpha condition 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: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: TsImoiuevPfm This is redundant with a != 0xff below. --- libavfilter/vf_paletteuse.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 8954a02524..0861a70a0b 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -599,7 +599,6 @@ DECLARE_CMP_FUNC(b, 2) static const cmp_func cmp_funcs[] = {cmp_r, cmp_g, cmp_b}; static int get_next_color(const uint8_t *color_used, const uint32_t *palette, - const int trans_thresh, int *component, const struct color_rect *box) { int wr, wg, wb; @@ -619,10 +618,6 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette, const uint8_t g = c >> 8 & 0xff; const uint8_t b = c & 0xff; - if (a < trans_thresh) { - continue; - } - if (color_used[i] || (a != 0xff) || r < box->min[0] || g < box->min[1] || b < box->min[2] || r > box->max[0] || g > box->max[1] || b > box->max[2]) @@ -674,7 +669,7 @@ static int colormap_insert(struct color_node *map, int node_left_id = -1, node_right_id = -1; struct color_node *node; struct color_rect box1, box2; - const int pal_id = get_next_color(color_used, palette, trans_thresh, &component, box); + const int pal_id = get_next_color(color_used, palette, &component, box); if (pal_id < 0) return -1;