diff mbox series

[FFmpeg-devel,v2,08/32] avfilter/paletteuse: remove redundant alpha condition

Message ID 20221227231814.2520181-9-u@pkh.me
State New
Headers show
Series [FFmpeg-devel,v2,01/32] avfilter/palettegen: allow a minimum of 2 colors | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Clément Bœsch Dec. 27, 2022, 11:17 p.m. UTC
This is redundant with a != 0xff below.
---
 libavfilter/vf_paletteuse.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

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;