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

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-06 01:40:59 +0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2013-12-06 01:40:59 +0400
commit5626908ec3c96a79640b26bee42549c82eb26689 (patch)
tree0653c1763b58f61d7cf4fb211c5e40dcea940a46
parentaed1009df97a0e116c276751d83455bbbf47d3fb (diff)
Fixed-point fast-path for normal 48 kHz encoding in celt_preemphasis()
-rw-r--r--celt/celt_encoder.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/celt/celt_encoder.c b/celt/celt_encoder.c
index 859f4199..ab28c8cd 100644
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -469,7 +469,24 @@ void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RES
int Nu;
coef0 = coef[0];
+ m = *mem;
+#ifdef FIXED_POINT
+ /* Fast path for fixed-point in the normal 48kHz case */
+ if (coef[1] == 0 && upsample == 1)
+ {
+ for (i=0;i<N;i++)
+ {
+ opus_val16 x;
+ x = SCALEIN(pcmp[CC*i]);
+ /* Apply pre-emphasis */
+ inp[i] = SHL32(x, SIG_SHIFT) - m;
+ m = SHR32(MULT16_16(coef0, x), 15-SIG_SHIFT);
+ }
+ *mem = m;
+ return;
+ }
+#endif
Nu = N/upsample;
if (upsample!=1)
@@ -500,7 +517,6 @@ void celt_preemphasis(const opus_val16 * OPUS_RESTRICT pcmp, celt_sig * OPUS_RES
#else
(void)clip; /* Avoids a warning about clip being unused. */
#endif
- m = *mem;
#ifdef CUSTOM_MODES
if (coef[1] != 0)
{