diff options
author | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-10-07 14:56:03 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2009-10-07 14:56:03 +0400 |
commit | f7a1e165aa8be3b2cad7c8c304e8fe15e5d32433 (patch) | |
tree | 49b16b1d6b5e0b9ab95ec448a4cd04c4d04c32e6 | |
parent | f6dc1eba2615444d24cc84dfc2043d961418a035 (diff) |
Renamed mix_pitch_and_residual() to normalise_residual(), after minor
simplification.
-rw-r--r-- | libcelt/bands.c | 2 | ||||
-rw-r--r-- | libcelt/vq.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libcelt/bands.c b/libcelt/bands.c index 1e7a3df..194e34c 100644 --- a/libcelt/bands.c +++ b/libcelt/bands.c @@ -315,7 +315,7 @@ void apply_pitch(const CELTMode *m, celt_sig_t *X, const celt_sig_t *P, int gain celt_word16_t gg = gain; for (j=0;j<len;j++) { - X[j+c*N] += SHL(MULT16_32_Q15(gg,P[j+c*N]),1); + X[j+c*N] += SHL32(MULT16_32_Q15(gg,P[j+c*N]),1); gg = ADD16(gg, delta); } } diff --git a/libcelt/vq.c b/libcelt/vq.c index 62a8784..429ff4c 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -99,7 +99,7 @@ static void exp_rotation(celt_norm_t *X, int len, int dir, int stride, int K) /** Takes the pitch vector and the decoded residual vector, computes the gain that will give ||p+g*y||=1 and mixes the residual with the pitch. */ -static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X, int N, int K, celt_word32_t Ryy) +static void normalise_residual(int * restrict iy, celt_norm_t * restrict X, int N, int K, celt_word32_t Ryy) { int i; celt_word32_t g; @@ -108,7 +108,7 @@ static void mix_pitch_and_residual(int * restrict iy, celt_norm_t * restrict X, i=0; do - X[i] = MULT16_32_P15(g, SHL32(EXTEND32(iy[i]),14)); + X[i] = SHR16(MULT16_16_16(g, iy[i]),1); while (++i < N); } @@ -270,7 +270,7 @@ void alg_quant(celt_norm_t *X, int N, int K, int spread, ec_enc *enc) /* Recompute the gain in one pass to reduce the encoder-decoder mismatch due to the recursive computation used in quantisation. */ - mix_pitch_and_residual(iy, X, N, K, EXTRACT16(SHR32(yy,2*yshift))); + normalise_residual(iy, X, N, K, EXTRACT16(SHR32(yy,2*yshift))); if (spread) exp_rotation(X, N, -1, spread, K); RESTORE_STACK; @@ -293,7 +293,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, int spread, ec_dec *dec) do { Ryy = MAC16_16(Ryy, iy[i], iy[i]); } while (++i < N); - mix_pitch_and_residual(iy, X, N, K, Ryy); + normalise_residual(iy, X, N, K, Ryy); if (spread) exp_rotation(X, N, -1, spread, K); RESTORE_STACK; |