shithub: opus

Download patch

ref: aed1009df97a0e116c276751d83455bbbf47d3fb
parent: 65471dd567beb6b1156dc292858c0a28ca55ca3e
author: Jean-Marc Valin <[email protected]>
date: Thu Dec 5 08:36:48 EST 2013

Turns a 16x32 multiply into a 16x16 one in celt_preemphasis().

--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -520,11 +520,11 @@
    {
       for (i=0;i<N;i++)
       {
-         celt_sig x;
-         x = SHL32(inp[i], SIG_SHIFT);
+         opus_val16 x;
+         x = inp[i];
          /* Apply pre-emphasis */
-         inp[i] = x + m;
-         m = - MULT16_32_Q15(coef0, x);
+         inp[i] = SHL32(x, SIG_SHIFT) - m;
+         m = SHR32(MULT16_16(coef0, x), 15-SIG_SHIFT);
       }
    }
    *mem = m;