mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +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)
|
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…
x
Reference in New Issue
Block a user