summaryrefslogtreecommitdiff
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-07-17 23:48:53 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-07-17 23:48:53 +0000
commit96e8987e5bc98e27c8583b4db7e948e9654b2d95 (patch)
treea8a041c887b2ffabe25d490ed0a73d43df752ca9 /libavcodec/ra288.c
parentd78c1ea16fd18eeca9d7f8a0c5b80716cf84a163 (diff)
Simplify: do not overuse pointer aritmetic
Originally committed as revision 14271 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 28dca658c8..bc7d9a91eb 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -111,19 +111,16 @@ static int pred(const float *in, float *tgt, int n)
in--; // To avoid a -1 subtraction in the inner loop
for (x=1; x <= n; x++) {
- float *p1 = tgt + x - 1;
- float *p2 = tgt;
-
f1 = in[x+1];
for (y=0; y < x - 1; y++)
f1 += in[x-y]*tgt[y];
- *(p1--) = f2 = -f1/f0;
- for (y=x >> 1; y--;) {
- float temp = *p2 + *p1 * f2;
- *(p1--) += *p2 * f2;
- *(p2++) = temp;
+ tgt[x-1] = f2 = -f1/f0;
+ for (y=0; y < x >> 1; y++) {
+ float temp = tgt[y] + tgt[x-y-2]*f2;
+ tgt[x-y-2] += tgt[y]*f2;
+ tgt[y] = temp;
}
if ((f0 += f1*f2) < 0)
return 0;