This is redundant with a != 0xff below.
Unified · Split
| @@ -599,7 +599,6 @@ DECLARE_CMP_FUNC(b, 2) · 598 unmodified lines | |||
| 599 | static const cmp_func cmp_funcs[] = {cmp_r, cmp_g, cmp_b}; | 599 | static const cmp_func cmp_funcs[] = {cmp_r, cmp_g, cmp_b}; |
| 600 | 600 | ||
| 601 | static int get_next_color(const uint8_t *color_used, const uint32_t *palette, | 601 | static int get_next_color(const uint8_t *color_used, const uint32_t *palette, |
| 602 | const int trans_thresh, | ||
| 603 | int *component, const struct color_rect *box) | 602 | int *component, const struct color_rect *box) |
| 604 | { | 603 | { |
| 605 | int wr, wg, wb; | 604 | int wr, wg, wb; |
| @@ -619,10 +618,6 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette, · 13 unmodified lines | |||
| 619 | const uint8_t g = c >> 8 & 0xff; | 618 | const uint8_t g = c >> 8 & 0xff; |
| 620 | const uint8_t b = c & 0xff; | 619 | const uint8_t b = c & 0xff; |
| 621 | 620 | ||
| 622 | if (a < trans_thresh) { | ||
| 623 | continue; | ||
| 624 | } | ||
| 625 | |||
| 626 | if (color_used[i] || (a != 0xff) || | 621 | if (color_used[i] || (a != 0xff) || |
| 627 | r < box->min[0] || g < box->min[1] || b < box->min[2] || | 622 | r < box->min[0] || g < box->min[1] || b < box->min[2] || |
| 628 | r > box->max[0] || g > box->max[1] || b > box->max[2]) | 623 | r > box->max[0] || g > box->max[1] || b > box->max[2]) |
| @@ -674,7 +669,7 @@ static int colormap_insert(struct color_node *map, · 45 unmodified lines | |||
| 674 | int node_left_id = -1, node_right_id = -1; | 669 | int node_left_id = -1, node_right_id = -1; |
| 675 | struct color_node *node; | 670 | struct color_node *node; |
| 676 | struct color_rect box1, box2; | 671 | struct color_rect box1, box2; |
| 677 | const int pal_id = get_next_color(color_used, palette, trans_thresh, &component, box); | 672 | const int pal_id = get_next_color(color_used, palette, &component, box); |
| 678 | 673 | ||
| 679 | if (pal_id < 0) | 674 | if (pal_id < 0) |
| 680 | return -1; | 675 | return -1; |