diff options
author | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2010-02-21 23:10:22 +0300 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2010-02-26 06:46:55 +0300 |
commit | 3a0bc3d95c8a844d4f39e793a93567b02131d4a7 (patch) | |
tree | 0d297200697b600ea573ce9571bfcfad26dd02fd /libcelt/vq.c | |
parent | 5378bf82530b1d431c34010f693637cb826fbc51 (diff) |
Allowing CELT to skip the low frequencies
Diffstat (limited to 'libcelt/vq.c')
-rw-r--r-- | libcelt/vq.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 @@ celt_word16 renormalise_vector(celt_norm *X, celt_word16 value, int N, int strid 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 @@ static void fold(const CELTMode *m, int N, const celt_norm * restrict Y, celt_no 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); } |