diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-06 01:40:59 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-12-06 01:40:59 +0400 |
commit | 5626908ec3c96a79640b26bee42549c82eb26689 (patch) | |
tree | 0653c1763b58f61d7cf4fb211c5e40dcea940a46 | |
parent | aed1009df97a0e116c276751d83455bbbf47d3fb (diff) |
Fixed-point fast-path for normal 48 kHz encoding in celt_preemphasis()
-rw-r--r-- | celt/celt_encoder.c | 18 |
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) { |