summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libspeex/cb_search.c
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2007-02-10 11:44:26 +0000
committerDan Everton <dan@iocaine.org>2007-02-10 11:44:26 +0000
commit7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1 (patch)
treec9db4558a73ae3094839c4655fa0b8ebc2231c56 /apps/codecs/libspeex/cb_search.c
parent51587512635a8b19e6a5f19a20074d0d4d1f17da (diff)
downloadrockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.tar.gz
rockbox-7bf62e8da66ca8ff0acc2702f92ea4fe06eb94b1.zip
* Sync Speex codec with Speex SVN revision 12449 (roughly Speex 1.2beta1).
* Redo the changes required to make Speex compile in Rockbox. Should be a bit easier to keep in sync with Speex SVN now. * Fix name of Speex library in codecs Makefile. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12254 a1c6a512-1295-4272-9138-f99709370657
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;
}