summaryrefslogtreecommitdiff
path: root/libavcodec/ra288.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-07-24 03:19:52 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-07-24 03:19:52 +0000
commitbf75ac57b8aef5cd9753e8466b9b9b9ae2b1e80a (patch)
tree212634f0b4b848eea6029ee530c1fc055e7dd6e1 /libavcodec/ra288.c
parenta149c1a59f057b40f1a28f2d1ebe710b368d7ccb (diff)
Simplify co(), use memcpy/memmove and colmult() when useful.
Originally committed as revision 14355 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ra288.c')
-rw-r--r--libavcodec/ra288.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index 44a456836a..5603db47e8 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -141,19 +141,15 @@ static void co(int n, int i, int j, const float *in, float *out, float *st1,
float *st2, const float *table)
{
unsigned int x;
- const float *fp;
float buffer1[37];
float buffer2[37];
float work[111];
/* rotate and multiply */
- fp = st1 + i;
- for (x=0; x < n + i + j; x++) {
- if (x == n + j)
- fp=in;
- st1[x] = *(fp++);
- work[x] = table[x] * st1[x];
- }
+ memmove(st1 , st1 + i, (n + j)*sizeof(*st1));
+ memcpy (st1 + n + j, in , i *sizeof(*st1));
+
+ colmult(work, table, st1, n + i + j);
prodsum(buffer1, work + n , i, n);
prodsum(buffer2, work + n + i, j, n);