mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
avfilter/af_adynamicequalizer: refactor code to gain small speedup
This commit is contained in:
parent
153aaae457
commit
5564ba49a1
@ -199,16 +199,25 @@ static int filter_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
|
||||
if (detection > 0)
|
||||
state[5] = fmax(state[5], detect);
|
||||
|
||||
if (direction == 0 && mode == 0 && detect < threshold)
|
||||
detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
|
||||
else if (direction == 0 && mode == 1 && detect < threshold)
|
||||
detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
|
||||
else if (direction == 1 && mode == 0 && detect > threshold)
|
||||
detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
|
||||
else if (direction == 1 && mode == 1 && detect > threshold)
|
||||
detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
|
||||
else
|
||||
detect = 1.;
|
||||
if (direction == 0) {
|
||||
if (detect < threshold) {
|
||||
if (mode == 0)
|
||||
detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
|
||||
else
|
||||
detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
|
||||
} else {
|
||||
detect = 1.;
|
||||
}
|
||||
} else {
|
||||
if (detect > threshold) {
|
||||
if (mode == 0)
|
||||
detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
|
||||
else
|
||||
detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range);
|
||||
} else {
|
||||
detect = 1.;
|
||||
}
|
||||
}
|
||||
|
||||
if (direction == 0) {
|
||||
if (detect > state[4]) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user