History

avfilter/af_adynamicequalizer: improve threshold usage

Paul B Mahol committed 4 years ago

Commit 4e284831 parent ec07b151 file · +3 −3Browse files

Unified · Split

libavfilter/af_adynamicequalizer.c+3−3
@@ -113,7 +113,7 @@ static double get_gain(double in, double srate, double makeup, · 112 unmodified lines
113113 if (Lyg >= state[2])
114114 attslew = 1;
115115 }
116− } else if (2. * (Lxg-thresdb) > width) {
116+ } else if (2. * (Lxg - thresdb) > width) {
117117 Lyg = thresdb + (Lxg - thresdb) * iratio;
118118 }
119119
@@ -121,7 +121,7 @@ static double get_gain(double in, double srate, double makeup, · 1 unmodified line
121121
122122 Lxl = Lxg - Lyg;
123123
124− Ly1 = fmaxf(Lxl, release_coeff * state[1] +(1. - release_coeff) * Lxl);
124+ Ly1 = fmax(Lxl, release_coeff * state[1] +(1. - release_coeff) * Lxl);
125125 Lyl = attack_coeff * state[0] + (1. - attack_coeff) * Ly1;
126126
127127 cdb = -Lyl;
@@ -150,7 +150,7 @@ static int filter_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo · 22 unmodified lines
150150 const double range = s->range;
151151 const double dfrequency = fmin(s->dfrequency, sample_rate * 0.5);
152152 const double tfrequency = fmin(s->tfrequency, sample_rate * 0.5);
153− const double threshold = log(s->threshold + DBL_EPSILON);
153+ const double threshold = to_dB(s->threshold + DBL_EPSILON);
154154 const double release = s->release_coef;
155155 const double attack = s->attack_coef;
156156 const double dqfactor = s->dqfactor;

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