avfilter/af_adynamicequalizer: refactor code to gain small speedup

pull/389/head
Paul B Mahol 2 years ago
parent 153aaae457
commit 5564ba49a1
  1. 29
      libavfilter/af_adynamicequalizer.c

@ -199,16 +199,25 @@ static int filter_channels(AVFilterContext *ctx, void *arg, int jobnr, int nb_jo
if (detection > 0) if (detection > 0)
state[5] = fmax(state[5], detect); state[5] = fmax(state[5], detect);
if (direction == 0 && mode == 0 && detect < threshold) if (direction == 0) {
detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range); if (detect < threshold) {
else if (direction == 0 && mode == 1 && detect < threshold) if (mode == 0)
detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range); detect = 1. / av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
else if (direction == 1 && mode == 0 && detect > threshold) else
detect = 1. / av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range); detect = av_clipd(1. + makeup + (threshold - detect) * ratio, 1., range);
else if (direction == 1 && mode == 1 && detect > threshold) } else {
detect = av_clipd(1. + makeup + (detect - threshold) * ratio, 1., range); detect = 1.;
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 (direction == 0) {
if (detect > state[4]) { if (detect > state[4]) {

Loading…
Cancel
Save