summaryrefslogtreecommitdiff
path: root/libavcodec/celp_filters.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2009-11-09 22:04:03 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2009-11-09 22:04:03 +0000
commitb1ade3d1821a29174963b28cd0caa5f7ed394998 (patch)
treec6a328768164f6706996838241899ab581fd7a83 /libavcodec/celp_filters.c
parent5c3c0e3f2e2a1393bcc03967e005aa2d03b0cdd9 (diff)
And on the sixth day, God gave us the <= operand, which makes the loop
"for (i = 1; i < num + 1; i++)" look like "for (i = 1; i <= num; i++)". Programmers worldwide rejoiced and used the operand, e.g. in the thread "[PATCH] remove ugliness in cel_filters.c", and He saw that it was good. Originally committed as revision 20489 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/celp_filters.c')
-rw-r--r--libavcodec/celp_filters.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libavcodec/celp_filters.c b/libavcodec/celp_filters.c
index d54e2fa709..d886085557 100644
--- a/libavcodec/celp_filters.c
+++ b/libavcodec/celp_filters.c
@@ -67,12 +67,9 @@ int ff_celp_lp_synthesis_filter(int16_t *out,
{
int i,n;
- // Avoids a +1 in the inner loop.
- filter_length++;
-
for (n = 0; n < buffer_length; n++) {
int sum = rounder;
- for (i = 1; i < filter_length; i++)
+ for (i = 1; i <= filter_length; i++)
sum -= filter_coeffs[i-1] * out[n-i];
sum = (sum >> 12) + in[n];
@@ -96,12 +93,9 @@ void ff_celp_lp_synthesis_filterf(float *out,
{
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 +108,9 @@ void ff_celp_lp_zero_synthesis_filterf(float *out,
{
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];
}
}