diff options
author | Paul B Mahol <onemda@gmail.com> | 2015-12-28 11:41:53 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2015-12-28 12:23:59 +0100 |
commit | b841fe002a2bf67ca4381fd4dd522c2cfee22be8 (patch) | |
tree | 65fc58134f836b05171649a86b60c93646f4e87a | |
parent | 50401f5fb7d778583b03a13bc4440f71063d319d (diff) | |
download | ffmpeg-b841fe002a2bf67ca4381fd4dd522c2cfee22be8.tar.gz |
avfilter/af_silenceremove: lower number of operations in for loop
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r-- | libavfilter/af_silenceremove.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index c5479013e1..dc3f4ff91d 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -256,8 +256,8 @@ silence_trim: for (j = 0; j < inlink->channels; j++) { s->update(s, *ibuf); s->start_holdoff[s->start_holdoff_end++] = *ibuf++; - nb_samples_read++; } + nb_samples_read += inlink->channels; if (s->start_holdoff_end >= s->start_duration * inlink->channels) { if (++s->start_found_periods >= s->start_periods) { @@ -334,9 +334,9 @@ silence_copy: for (j = 0; j < inlink->channels; j++) { s->update(s, *ibuf); *obuf++ = *ibuf++; - nb_samples_read++; - nb_samples_written++; } + nb_samples_read += inlink->channels; + nb_samples_written += inlink->channels; } else if (!threshold) { for (j = 0; j < inlink->channels; j++) { s->update(s, *ibuf); @@ -346,8 +346,8 @@ silence_copy: } s->stop_holdoff[s->stop_holdoff_end++] = *ibuf++; - nb_samples_read++; } + nb_samples_read += inlink->channels; if (s->stop_holdoff_end >= s->stop_duration * inlink->channels) { if (++s->stop_found_periods >= s->stop_periods) { |