History

avfilter/af_adynamicequalizer: refactor code to gain small speedup

Paul B Mahol committed 3 years ago

Commit 5564ba41 parent 153aaae1 file · +19 −10Browse files

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

Unified · Split

libavfilter/af_adynamicequalizer.c+19−10
@@ -199,16 +199,25 @@ static int filter_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo · 198 unmodified lines
199199 if (detection > 0)
200200 state[5] = fmax(state[5], detect);
201201
202− if (direction == 0 && mode == 0 && detect < threshold)
203− detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
204− else if (direction == 0 && mode == 1 && detect < threshold)
205− detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
206− else if (direction == 1 && mode == 0 && detect > threshold)
207− detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
208− else if (direction == 1 && mode == 1 && detect > threshold)
209− detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
210− else
211− detect = 1.;
202+ if (direction == 0) {
203+ if (detect < threshold) {
204+ if (mode == 0)
205+ detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
206+ else
207+ detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
208+ } else {
209+ detect = 1.;
210+ }
211+ } else {
212+ if (detect > threshold) {
213+ if (mode == 0)
214+ detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
215+ else
216+ detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
217+ } else {
218+ detect = 1.;
219+ }
220+ }
212221
213222 if (direction == 0) {
214223 if (detect > state[4]) {

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