From patchwork Sat Nov 5 15:26:09 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: 39172 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1085592pzb; Sat, 5 Nov 2022 08:27:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BgILNtNZ3sjv/dE5RWAlXC2bCYrTSsSXGbXIuhxYBLF6R81NR5t7NnlGMlPN5WxpHMlvp X-Received: by 2002:a05:6402:3709:b0:459:279e:fdc6 with SMTP id ek9-20020a056402370900b00459279efdc6mr41555374edb.338.1667662075954; Sat, 05 Nov 2022 08:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667662075; cv=none; d=google.com; s=arc-20160816; b=SLIbcCXLKp+yDhCaf7j3vBHiuKwaGR0w/AueiDnCQfNTrTzZ/5daXYY81Oa7ruGxlJ vbJYTFlaou1p3G9jvLCYg9Ac34gGN6fBFyPY5ZyxLx6dhJ8XMRZMGflV0PcWYzSoObQ7 118VO0b/vvdGdwnlwDLFqug1zUzIom4oQSCZRhu514U2z8QHHGgOB+YBd+qcoUzSUspZ b3eUg+PHUTbmvGJJq7fEuovdcXsglysbijvEQIJ4DH9TfoLPFCU7bOCjmHs+anlqX8g8 vhvAHqDYwOG7j0VZD1VKAGS8NyV0ZprBLQe/dvXufEAZI9A0A+ZP/mFZ75cN5KUmaWZx SdNA== 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=wWNTufZFPwywqizFT9ouuGbxeq16KEPqwK1Tl863erc=; b=A28HnMb2oImHXv3wmbM75ZvXca/Si3Jc2jwY8GJqJmR2ySn55ZMk2ixmvNNe7kHfnN g3Ngca72RiSFxoCk92HEWMHC3Q5X0Ke09y5/Cn5WGeb60Gy8mkfk4Hu5oEp7Liaze9UM 64rRHASQ2vtaQRKFzUQjJy3hp2/O7/yORj3Komu2o+yWEg8Cvt+S7+WWKIrBjx+1X3PD J+5d5lZo4Veauul7icwhSbFS8sFqu9SwpazEdUGJd8gbCFXs7cmUUyrrk9Dk00jilwNV MssztC9M0EQbio4fUK8KBhPG51jD1nTmToqoHfy/80GMk+0NIeopa7ZmAtxYTK47pBZK hUuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=azlZHgGF; 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 os18-20020a170906af7200b0076fa1e1274bsi1917894ejb.202.2022.11.05.08.27.55; Sat, 05 Nov 2022 08:27:55 -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=@pkh.me header.s=selector1 header.b=azlZHgGF; 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 9D28268B32D; Sat, 5 Nov 2022 17:26:44 +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 1E42268B32D for ; Sat, 5 Nov 2022 17:26:36 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pkh.me; s=selector1; t=1667661981; 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=c7OwYE6lMuhoHTl5ROrJBOC2gRDuIjrJ0RQb7FOcTgQ=; b=azlZHgGFD5kaTIa7QRvB0Q2WX55xqUB1u6EfFjwq45uVJDYxWoF7NLzTbL2f5nfYHRg0+Z S0nMRzi8QnP9gYOvIXoJ4qeNpEDw0tLfZkaM9zungY246MeQaAHahpf3poMe3uh/27TfTA SDl0Kw8PTx08vQU0/Co9vpIPQZS/qtI= Received: from localhost (ssq0.pkh.me [local]) by ssq0.pkh.me (OpenSMTPD) with ESMTPA id 3b46bb7a; Sat, 5 Nov 2022 15:26:21 +0000 (UTC) From: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= To: ffmpeg-devel@ffmpeg.org Date: Sat, 5 Nov 2022 16:26:09 +0100 Message-Id: <20221105152617.1809282-8-u@pkh.me> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221105152617.1809282-1-u@pkh.me> References: <20221105152617.1809282-1-u@pkh.me> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 07/15] 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: h3iWTrEPv8uY 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;