From d910274f790ba586c40a625bb9120d13554c3443 Mon Sep 17 00:00:00 2001 From: "Timothy B.B Terriberry" Date: Fri, 19 Sep 2008 02:32:42 -0400 Subject: Change CWRS indexing to use Pyramid VQ's magnitude ordering. This lets us encode and decode directly from the pulse vector without an intermediate transformation. This makes old streams undecodable. Additionally, ncwrs_u32() has been sped up for large N by using the sliding recurrence from Mohorko et al. ncwrs_u64 could be sped up in a similar manner, but would require a larger table of multiplicative inverses (or several 32x32->64 bit multiplies). Note that U(N,M) is now everywhere 1/2 the value it used to be. --- tests/cwrs32-test.c | 29 ++++++++++------------------- tests/cwrs64-test.c | 27 +++++++++------------------ 2 files changed, 19 insertions(+), 37 deletions(-) (limited to 'tests') diff --git a/tests/cwrs32-test.c b/tests/cwrs32-test.c index b9ea1a8..6b193e3 100644 --- a/tests/cwrs32-test.c +++ b/tests/cwrs32-test.c @@ -21,33 +21,24 @@ int main(int _argc,char **_argv){ inc=nc/10000; if(inc<1)inc=1; for(i=0;iMMAX+2?NMAX:MMAX+2]; int y[NMAX]; + celt_uint32_t v; int k; memcpy(u,uu,n*sizeof(*u)); - cwrsi32(n,m,i,x,s,u); - /*printf("%6u of %u:",i,nc);*/ - /*for(k=0;k0&&x[k]==x[k-1]?' ':s[k]?'-':'+',x[k]); - } + cwrsi32(n,m,i,nc,y,u); + /*printf("%6u of %u:",i,nc); + for(k=0;k");*/ - memcpy(u,uu,n*sizeof(*u)); - if(icwrs32(n,m,x,s,u)!=i){ + if(icwrs32(n,m,&v,y,u)!=i){ fprintf(stderr,"Combination-index mismatch.\n"); return 1; } - comb2pulse(n,m,y,x,s); - /*for(j=0;jMMAX+2?NMAX:MMAX+2]; int y[NMAX]; + celt_uint64_t v; int k; memcpy(u,uu,n*sizeof(*u)); - cwrsi64(n,m,i,x,s,u); + cwrsi64(n,m,i,nc,y,u); /*printf("%llu of %llu:",i,nc); - for(k=0;k0&&x[k]==x[k-1]?' ':s[k]?'-':'+',x[k]); - } + for(k=0;k");*/ - memcpy(u,uu,n*sizeof(*u)); - if(icwrs64(n,m,x,s,u)!=i){ + if(icwrs64(n,m,&v,y,u)!=i){ fprintf(stderr,"Combination-index mismatch.\n"); return 1; } - comb2pulse(n,m,y,x,s); - /*for(j=0;j