Commit f4c18ee3 authored by rbultje's avatar rbultje

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.



git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20489 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 88d35d73
...@@ -67,12 +67,9 @@ int ff_celp_lp_synthesis_filter(int16_t *out, ...@@ -67,12 +67,9 @@ int ff_celp_lp_synthesis_filter(int16_t *out,
{ {
int i,n; int i,n;
// Avoids a +1 in the inner loop.
filter_length++;
for (n = 0; n < buffer_length; n++) { for (n = 0; n < buffer_length; n++) {
int sum = rounder; 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 -= filter_coeffs[i-1] * out[n-i];
sum = (sum >> 12) + in[n]; sum = (sum >> 12) + in[n];
...@@ -96,12 +93,9 @@ void ff_celp_lp_synthesis_filterf(float *out, ...@@ -96,12 +93,9 @@ void ff_celp_lp_synthesis_filterf(float *out,
{ {
int i,n; int i,n;
// Avoids a +1 in the inner loop.
filter_length++;
for (n = 0; n < buffer_length; n++) { for (n = 0; n < buffer_length; n++) {
out[n] = in[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]; out[n] -= filter_coeffs[i-1] * out[n-i];
} }
} }
...@@ -114,12 +108,9 @@ void ff_celp_lp_zero_synthesis_filterf(float *out, ...@@ -114,12 +108,9 @@ void ff_celp_lp_zero_synthesis_filterf(float *out,
{ {
int i,n; int i,n;
// Avoids a +1 in the inner loop.
filter_length++;
for (n = 0; n < buffer_length; n++) { for (n = 0; n < buffer_length; n++) {
out[n] = in[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]; out[n] += filter_coeffs[i-1] * in[n-i];
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment