History

avfilter/af_adynamicequalizer: improve threshold usage

Paul B Mahol committed 4 years ago

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

Showing the changes to libavfilter (1 of 1 file). Show all

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
113 if (Lyg >= state[2])113 if (Lyg >= state[2])
114 attslew = 1;114 attslew = 1;
115 }115 }
116 } else if (2. * (Lxg-thresdb) > width) {116 } else if (2. * (Lxg - thresdb) > width) {
117 Lyg = thresdb + (Lxg - thresdb) * iratio;117 Lyg = thresdb + (Lxg - thresdb) * iratio;
118 }118 }
119 119
@@ -121,7 +121,7 @@ static double get_gain(double in, double srate, double makeup, · 1 unmodified line
121 121
122 Lxl = Lxg - Lyg;122 Lxl = Lxg - Lyg;
123 123
124 Ly1 = fmaxf(Lxl, release_coeff * state[1] +(1. - release_coeff) * Lxl);124 Ly1 = fmax(Lxl, release_coeff * state[1] +(1. - release_coeff) * Lxl);
125 Lyl = attack_coeff * state[0] + (1. - attack_coeff) * Ly1;125 Lyl = attack_coeff * state[0] + (1. - attack_coeff) * Ly1;
126 126
127 cdb = -Lyl;127 cdb = -Lyl;
@@ -150,7 +150,7 @@ static int filter_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo · 22 unmodified lines
150 const double range = s->range;150 const double range = s->range;
151 const double dfrequency = fmin(s->dfrequency, sample_rate * 0.5);151 const double dfrequency = fmin(s->dfrequency, sample_rate * 0.5);
152 const double tfrequency = fmin(s->tfrequency, sample_rate * 0.5);152 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);
154 const double release = s->release_coef;154 const double release = s->release_coef;
155 const double attack = s->attack_coef;155 const double attack = s->attack_coef;
156 const double dqfactor = s->dqfactor;156 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