[FFmpeg-devel] [PATCH] remove ugliness in cel_filters.c
Ronald S. Bultje
rsbultje
Mon Nov 9 16:30:45 CET 2009
Hi,
$attached. God invented the >= and <= instructions for us, let us be
thankful and use it.
Ronald
-------------- next part --------------
Index: celp_filters.c
===================================================================
--- celp_filters.c (revision 19703)
+++ celp_filters.c (working copy)
@@ -96,12 +96,9 @@
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
-
for (n = 0; n < buffer_length; n++) {
out[n] = in[n];
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
out[n] -= filter_coeffs[i-1] * out[n-i];
}
}
@@ -114,12 +111,9 @@
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
-
for (n = 0; n < buffer_length; n++) {
out[n] = in[n];
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
out[n] += filter_coeffs[i-1] * in[n-i];
}
}
More information about the ffmpeg-devel
mailing list