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
199 if (detection > 0)199 if (detection > 0)
200 state[5] = fmax(state[5], detect);200 state[5] = fmax(state[5], detect);
201 201
202 if (direction == 0 && mode == 0 && detect < threshold)202 if (direction == 0) {
203 detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);203 if (detect < threshold) {
204 else if (direction == 0 && mode == 1 && detect < threshold)204 if (mode == 0)
205 detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);205 detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
206 else if (direction == 1 && mode == 0 && detect > threshold)206 else
207 detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);207 detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
208 else if (direction == 1 && mode == 1 && detect > threshold)208 } else {
209 detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);209 detect = 1.;
210 else210 }
211 detect = 1.;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 }
212 221
213 if (direction == 0) {222 if (direction == 0) {
214 if (detect > state[4]) {223 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