shithub: opus

Download patch

ref: 5626908ec3c96a79640b26bee42549c82eb26689
parent: aed1009df97a0e116c276751d83455bbbf47d3fb
author: Jean-Marc Valin <[email protected]>
date: Thu Dec 5 11:40:59 EST 2013

Fixed-point fast-path for normal 48 kHz encoding in celt_preemphasis()

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -469,7 +469,24 @@
    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 @@
 #else
    (void)clip; /* Avoids a warning about clip being unused. */
 #endif
-   m = *mem;
 #ifdef CUSTOM_MODES
    if (coef[1] != 0)
    {