Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2008-09-06 05:44:59 +0400
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2008-09-06 07:01:20 +0400
commitdc31cc4b56d29d4c7f3d84efbb0b2d61577ca99a (patch)
treea1b916d02d4f0b8f69fa15fdcbdf26e3902661fa /libspeex
parentbf848c46ea60f1b4a3c2c9d26661e66211e2dfc3 (diff)
removed some if()s from an ltp inner loop
Diffstat (limited to 'libspeex')
-rw-r--r--libspeex/ltp.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/libspeex/ltp.c b/libspeex/ltp.c
index 2815587..f20bca5 100644
--- a/libspeex/ltp.c
+++ b/libspeex/ltp.c
@@ -394,18 +394,22 @@ int scaledown
new_target[j] = target[j];
{
+ int bound;
VARDECL(spx_mem_t *mm);
int pp=pitch-1;
ALLOC(mm, p, spx_mem_t);
- for (j=0;j<nsf;j++)
- {
- if (j-pp<0)
- e[j]=exc2[j-pp];
- else if (j-pp-pitch<0)
- e[j]=exc2[j-pp-pitch];
- else
- e[j]=0;
- }
+ bound = nsf;
+ if (nsf-pp>0)
+ bound = pp;
+ for (j=0;j<bound;j++)
+ e[j]=exc2[j-pp];
+ bound = nsf;
+ if (nsf-pp-pitch>0)
+ bound = pp+pitch;
+ for (;j<bound;j++)
+ e[j]=exc2[j-pp-pitch];
+ for (;j<nsf;j++)
+ e[j]=0;
#ifdef FIXED_POINT
/* Scale target and excitation down if needed (avoiding overflow) */
if (scaledown)
@@ -596,7 +600,7 @@ spx_word32_t *cumul_gain
break;
}
}
- for (i=-end;i<nsf;i++)
+ for (i=-end;i<0;i++)
{
if (ABS16(exc2[i])>16383)
{