summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libspeex/cb_search.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libspeex/cb_search.c')
-rw-r--r--apps/codecs/libspeex/cb_search.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/apps/codecs/libspeex/cb_search.c b/apps/codecs/libspeex/cb_search.c
index 5c68826095..6c4f0680a5 100644
--- a/apps/codecs/libspeex/cb_search.c
+++ b/apps/codecs/libspeex/cb_search.c
@@ -226,11 +226,13 @@ int update_target
/* Update target: only update target if necessary */
if (update_target)
{
- VARDECL(spx_sig_t *r2);
- ALLOC(r2, nsf, spx_sig_t);
- syn_percep_zero(e, ak, awk1, awk2, r2, nsf,p, stack);
+ VARDECL(spx_word16_t *r2);
+ ALLOC(r2, nsf, spx_word16_t);
for (j=0;j<nsf;j++)
- target[j]=SUB16(target[j],EXTRACT16(PSHR32(r2[j],8)));
+ r2[j] = EXTRACT16(PSHR32(e[j] ,6));
+ syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
+ for (j=0;j<nsf;j++)
+ target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
@@ -263,7 +265,6 @@ int update_target
#endif
VARDECL(spx_word16_t *t);
VARDECL(spx_sig_t *e);
- VARDECL(spx_sig_t *r2);
VARDECL(spx_word16_t *tmp);
VARDECL(spx_word32_t *ndist);
VARDECL(spx_word32_t *odist);
@@ -316,7 +317,6 @@ int update_target
#endif
ALLOC(t, nsf, spx_word16_t);
ALLOC(e, nsf, spx_sig_t);
- ALLOC(r2, nsf, spx_sig_t);
ALLOC(ind, nb_subvect, int);
ALLOC(tmp, 2*N*nsf, spx_word16_t);
@@ -495,9 +495,13 @@ int update_target
/* Update target: only update target if necessary */
if (update_target)
{
- syn_percep_zero(e, ak, awk1, awk2, r2, nsf,p, stack);
+ VARDECL(spx_word16_t *r2);
+ ALLOC(r2, nsf, spx_word16_t);
+ for (j=0;j<nsf;j++)
+ r2[j] = EXTRACT16(PSHR32(e[j] ,6));
+ syn_percep_zero16(r2, ak, awk1, awk2, r2, nsf,p, stack);
for (j=0;j<nsf;j++)
- target[j]=SUB16(target[j],EXTRACT16(PSHR32(r2[j],8)));
+ target[j]=SUB16(target[j],PSHR16(r2[j],2));
}
}
@@ -577,14 +581,12 @@ int update_target
)
{
int i;
- VARDECL(spx_sig_t *tmp);
- ALLOC(tmp, nsf, spx_sig_t);
- for (i=0;i<nsf;i++)
- tmp[i]=PSHR32(EXTEND32(target[i]),SIG_SHIFT);
- residue_percep_zero(tmp, ak, awk1, awk2, tmp, nsf, p, stack);
+ VARDECL(spx_word16_t *tmp);
+ ALLOC(tmp, nsf, spx_word16_t);
+ residue_percep_zero16(target, ak, awk1, awk2, tmp, nsf, p, stack);
for (i=0;i<nsf;i++)
- exc[i]+=tmp[i];
+ exc[i]+=SHL32(EXTEND32(tmp[i]),8);
for (i=0;i<nsf;i++)
target[i]=0;
}