# HG changeset patch # User vitor # Date 1216869592 0 # Node ID d346c4da00bd0a0b77ed6cf85bc8372af80d2435 # Parent 443fdc440854f864d9f83cf85614cf525f7feecd Simplify co(), use memcpy/memmove and colmult() when useful. diff -r 443fdc440854 -r d346c4da00bd ra288.c --- a/ra288.c Thu Jul 24 00:45:18 2008 +0000 +++ b/ra288.c Thu Jul 24 03:19:52 2008 +0000 @@ -141,19 +141,15 @@ 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);