Skipping transient shape renormalisation in the encoder because
our search can now work on vectors that don't have unit norm
diff --git a/libcelt/celt.c b/libcelt/celt.c
index 90c484d..8f654d4 100644
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -529,7 +529,9 @@
}
}
-static void mdct_shape(const CELTMode *mode, celt_norm *X, int start, int end, int N, int nbShortMdcts, int mdct_weight_shift, int _C)
+static void mdct_shape(const CELTMode *mode, celt_norm *X, int start,
+ int end, int N, int nbShortMdcts,
+ int mdct_weight_shift, int _C, int renorm)
{
int m, i, c;
const int C = CHANNELS(_C);
@@ -541,7 +543,8 @@
#else
X[i] = (1.f/(1<<mdct_weight_shift))*X[i];
#endif
- renormalise_bands(mode, X, C);
+ if (renorm)
+ renormalise_bands(mode, X, C);
}
@@ -754,10 +757,7 @@
} while (m<st->mode->nbShortMdcts-1);
#endif
if (mdct_weight_shift)
- {
- mdct_shape(st->mode, X, mdct_weight_pos+1, st->mode->nbShortMdcts, N, st->mode->nbShortMdcts, mdct_weight_shift, C);
- renormalise_bands(st->mode, X, C);
- }
+ mdct_shape(st->mode, X, mdct_weight_pos+1, st->mode->nbShortMdcts, N, st->mode->nbShortMdcts, mdct_weight_shift, C, 0);
}
@@ -887,7 +887,7 @@
if (mdct_weight_shift)
{
- mdct_shape(st->mode, X, 0, mdct_weight_pos+1, N, st->mode->nbShortMdcts, mdct_weight_shift, C);
+ mdct_shape(st->mode, X, 0, mdct_weight_pos+1, N, st->mode->nbShortMdcts, mdct_weight_shift, C, 1);
}
/* Synthesis */
@@ -1554,7 +1554,7 @@
if (mdct_weight_shift)
{
- mdct_shape(st->mode, X, 0, mdct_weight_pos+1, N, st->mode->nbShortMdcts, mdct_weight_shift, C);
+ mdct_shape(st->mode, X, 0, mdct_weight_pos+1, N, st->mode->nbShortMdcts, mdct_weight_shift, C, 1);
}
/* Synthesis */