Allowing CELT to skip the low frequencies
diff --git a/libcelt/vq.c b/libcelt/vq.c
index e75d55e..ffb4e51 100644
--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -336,10 +336,12 @@
return rE;
}
-static void fold(const CELTMode *m, int N, const celt_norm * restrict Y, celt_norm * restrict P, int N0, int B)
+static void fold(const CELTMode *m, int start, int N, const celt_norm * restrict Y, celt_norm * restrict P, int N0, int B)
{
int j;
int id = N0 % B;
+ while (id < m->eBands[start])
+ id += B;
/* Here, we assume that id will never be greater than N0, i.e. that
no band is wider than N0. In the unlikely case it happens, we set
everything to zero */
@@ -361,9 +363,9 @@
P[j] = Y[id++];
}
-void intra_fold(const CELTMode *m, int N, const celt_norm * restrict Y, celt_norm * restrict P, int N0, int B)
+void intra_fold(const CELTMode *m, int start, int N, const celt_norm * restrict Y, celt_norm * restrict P, int N0, int B)
{
- fold(m, N, Y, P, N0, B);
+ fold(m, start, N, Y, P, N0, B);
renormalise_vector(P, Q15ONE, N, 1);
}