aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-08-29 07:15:53 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-09 13:48:24 +0200
commit3e950f53496d53a45c9e1ba03aa83dfaa90b2ac0 (patch)
treed17b7f8f5ae6675264796144597538e5cadf6854
parent7b841cf6b706055164d5db3f2b901ed32e8092af (diff)
downloadffmpeg-3e950f53496d53a45c9e1ba03aa83dfaa90b2ac0.tar.gz
avfilter/af_headphone: Don't check for clipping in separate loop
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavfilter/af_headphone.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index 03ef88c4a4..edf8e773d7 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -281,6 +281,8 @@ static int headphone_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr,
for (j = 0; j < in->nb_samples; j++) {
dst[2 * j] += fft_acc[j].re * fft_scale;
+ if (fabsf(dst[2 * j]) > 1)
+ n_clippings[0]++;
}
for (j = 0; j < ir_len - 1; j++) {
@@ -289,14 +291,6 @@ static int headphone_fast_convolute(AVFilterContext *ctx, void *arg, int jobnr,
*(ringbuffer + write_pos) += fft_acc[in->nb_samples + j].re * fft_scale;
}
- for (i = 0; i < out->nb_samples; i++) {
- if (fabsf(dst[0]) > 1) {
- n_clippings[0]++;
- }
-
- dst += 2;
- }
-
*write = wr;
return 0;