History

avfilter/paletteuse: remove redundant alpha condition

This is redundant with a != 0xff below.

Clément Bœsch committed 4 years ago

Commit 1159c361 parent 4c061bc1 file · +1 −6Browse files

Unified · Split

libavfilter/vf_paletteuse.c+1−6
@@ -599,7 +599,6 @@ DECLARE_CMP_FUNC(b, 2) · 598 unmodified lines
599static const cmp_func cmp_funcs[] = {cmp_r, cmp_g, cmp_b};599static const cmp_func cmp_funcs[] = {cmp_r, cmp_g, cmp_b};
600 600
601static int get_next_color(const uint8_t *color_used, const uint32_t *palette,601static 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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t