History

avfilter/vf_pseudocolor: do not leave alpha uninitialized

Paul B Mahol committed 5 years ago

Commit 44facfb1 parent 0ef53cc1 file · +9 −6Browse files

Unified · Split

libavfilter/vf_pseudocolor.c+9−6
@@ -88,7 +88,7 @@ typedef struct Curve { · 87 unmodified lines
88} Curve;88} Curve;
89 89
90typedef struct Fill {90typedef struct Fill {
91 float fill[3];91 float fill[4];
92} Fill;92} Fill;
93 93
94typedef struct Range {94typedef struct Range {
@@ -108,10 +108,10 @@ static const Range spec2_range[] = {{0, 16}, {16, 22}, {22, 226}, {226, 236}, {2 · 13 unmodified lines
108static const Range shadows_range[] = {{0, 32}, {32, 256}};108static const Range shadows_range[] = {{0, 32}, {32, 256}};
109static const Range highlights_range[] = {{0, 214}, {214, 224}, {224, 256}};109static const Range highlights_range[] = {{0, 214}, {214, 224}, {224, 256}};
110 110
111static const Fill spec1_fills[] = {{0.5f, 0.f, .5f}, {-1.f, -1.f, -1.f}, {1.f, 0.f, 0.f}};111static const Fill spec1_fills[] = {{0.5f, 0.f, .5f, 1.f}, {-1.f, -1.f, -1.f, 1.f}, {1.f, 0.f, 0.f, 1.f}};
112static const Fill spec2_fills[] = {{0.5f, 0.f, .5f}, {0.f, 1.f, 1.f}, {-1.f, -1.f, -1.f}, {1.f, 1.f, 0.f}, {1.f, 0.f, 0.f}};112static const Fill spec2_fills[] = {{0.5f, 0.f, .5f, 1.f}, {0.f, 1.f, 1.f, 1.f}, {-1.f, -1.f, -1.f, 1.f}, {1.f, 1.f, 0.f, 1.f}, {1.f, 0.f, 0.f, 1.f}};
113static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f}, {-1.f, -1.f, -1.f}};113static const Fill shadows_fills[] = {{0.8f, 0.4f, .8f, 1.f}, {-1.f, -1.f, -1.f, 1.f}};
114static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f}, {1.f, 0.3f, 0.6f}, {1.f, 0.2f, .5f}};114static const Fill highlights_fills[] = {{-1.f, -1.f, -1.f, 1.f}, {1.f, 0.3f, 0.6f, 1.f}, {1.f, 0.2f, .5f, 1.f}};
115 115
116static const Curve curves[] =116static const Curve curves[] =
117{117{
@@ -627,11 +627,12 @@ static int config_input(AVFilterLink *inlink) · 509 unmodified lines
627 const Fill fill = presets[s->preset].fills[seg];627 const Fill fill = presets[s->preset].fills[seg];
628 628
629 for (int j = 0; j < factor; j++) {629 for (int j = 0; j < factor; j++) {
630 double r, g, b;630 double r, g, b, a;
631 631
632 g = fill.fill[1];632 g = fill.fill[1];
633 b = fill.fill[2];633 b = fill.fill[2];
634 r = fill.fill[0];634 r = fill.fill[0];
635 a = fill.fill[3];
635 636
636 if (g >= 0.f && b >= 0.f && r >= 0.f) {637 if (g >= 0.f && b >= 0.f && r >= 0.f) {
637 g *= s->max;638 g *= s->max;
@@ -652,6 +653,7 @@ static int config_input(AVFilterLink *inlink) · 14 unmodified lines
652 s->lut[0][i*factor+j] = g;653 s->lut[0][i*factor+j] = g;
653 s->lut[1][i*factor+j] = b;654 s->lut[1][i*factor+j] = b;
654 s->lut[2][i*factor+j] = r;655 s->lut[2][i*factor+j] = r;
656 s->lut[3][i*factor+j] = a * s->max;
655 }657 }
656 } else {658 } else {
657 const Curve curve = presets[s->preset].curves[seg];659 const Curve curve = presets[s->preset].curves[seg];
@@ -677,6 +679,7 @@ static int config_input(AVFilterLink *inlink) · 19 unmodified lines
677 s->lut[0][i*factor+j] = g;679 s->lut[0][i*factor+j] = g;
678 s->lut[1][i*factor+j] = b;680 s->lut[1][i*factor+j] = b;
679 s->lut[2][i*factor+j] = r;681 s->lut[2][i*factor+j] = r;
682 s->lut[3][i*factor+j] = 1.f * s->max;
680 }683 }
681 }684 }
682 }685 }

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