summaryrefslogtreecommitdiffstats
path: root/apps/dsp.c
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-02-15 22:51:45 +0000
committerThom Johansen <thomj@rockbox.org>2007-02-15 22:51:45 +0000
commit96e5e9eef81a3758fd7bca3b21a5874c4e9f760e (patch)
treea5bd806ea64658d8d58f2a5e692d407023a62678 /apps/dsp.c
parent7ba8aec5af73d7ff4ce4d9a788d6a5911c621e88 (diff)
downloadrockbox-96e5e9eef81a3758fd7bca3b21a5874c4e9f760e.tar.gz
rockbox-96e5e9eef81a3758fd7bca3b21a5874c4e9f760e.tar.bz2
rockbox-96e5e9eef81a3758fd7bca3b21a5874c4e9f760e.zip
Optimise/touchup some asm macros in dsp.h, and also remove some now unneeded ones. Add config.h to dsp.c so that these macros actually get used, and also do some minor nitpicks to the resampler while I'm at it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12322 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r--apps/dsp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index 533342ecf1..e0fb4475da 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -19,6 +19,7 @@
#include <inttypes.h>
#include <string.h>
#include <sound.h>
+#include "config.h"
#include "dsp.h"
#include "eq.h"
#include "kernel.h"
@@ -268,7 +269,6 @@ static int downsample(int32_t **dst, int32_t **src, int count,
/* Wrap phase accumulator back to start of next frame. */
r->phase = phase - (count << 16);
- r->delta = delta;
r->last_sample[0] = src[0][count - 1];
r->last_sample[1] = src[1][count - 1];
return i;
@@ -282,12 +282,12 @@ static long upsample(int32_t **dst, int32_t **src, int count, struct resample_da
int i = 0, j;
int pos;
int num_channels = dsp->stereo_mode == STEREO_MONO ? 1 : 2;
-
- while ((pos = phase >> 16) == 0)
+
+ while ((phase >> 16) == 0)
{
for (j = 0; j < num_channels; j++)
*d[j]++ = r->last_sample[j] + FRACMUL((phase & 0xffff) << 15,
- src[j][pos] - r->last_sample[j]);
+ src[j][0] - r->last_sample[j]);
phase += delta;
i++;
}
@@ -303,7 +303,6 @@ static long upsample(int32_t **dst, int32_t **src, int count, struct resample_da
/* Wrap phase accumulator back to start of next frame. */
r->phase = phase - (count << 16);
- r->delta = delta;
r->last_sample[0] = src[0][count - 1];
r->last_sample[1] = src[1][count - 1];
return i;