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

gitlab.com/quite/celt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <Jean-Marc.Valin@csiro.au>2008-02-13 08:00:10 +0300
committerJean-Marc Valin <Jean-Marc.Valin@csiro.au>2008-02-13 08:00:10 +0300
commit0df0eb4c67443e0434368ddc9a979bce626b5ab7 (patch)
tree4f8197a82766088e8e1b455aa471cf97abfa76a7 /libcelt/vq.c
parent1b074d6600d0eae3c44abdd354e4059ba36d7f1f (diff)
doing the folding properly.
Diffstat (limited to 'libcelt/vq.c')
-rw-r--r--libcelt/vq.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/libcelt/vq.c b/libcelt/vq.c
index 83cb22d..fb2dd6e 100644
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -419,16 +419,28 @@ void intra_unquant(float *x, int N, int K, float *Y, float *P, int B, int N0, ec
}
}
-void intra_fold(float *x, int N, int K, float *Y, float *P, int B, int N0)
+void intra_fold(float *x, int N, float *Y, float *P, int B, int N0, int Nmax)
{
- int j;
+ int i, j;
float E;
E = 1e-10;
- for (j=0;j<N;j++)
+ if (N0 >= Nmax/2)
{
- P[j] = Y[j];
- E += P[j]*P[j];
+ for (i=0;i<B;i++)
+ {
+ for (j=0;j<N/B;j++)
+ {
+ P[j*B+i] = Y[(Nmax-N0-j-1)*B+i];
+ E += P[j*B+i]*P[j*B+i];
+ }
+ }
+ } else {
+ for (j=0;j<N;j++)
+ {
+ P[j] = Y[j];
+ E += P[j]*P[j];
+ }
}
E = 1.f/sqrt(E);
for (j=0;j<N;j++)