shithub: opus

Download patch

ref: 96408b62958bb7b337311103a5bbb6cd5613cf5a
parent: 086ea7c7e567b68e01ea15561e8b825ecfc78606
author: Jean-Marc Valin <[email protected]>
date: Mon Dec 2 15:02:37 EST 2013

Fixes Opus-custom preemphasis

Also adds denorm avoidance for non-48 kHz rates

--- a/celt/celt_decoder.c
+++ b/celt/celt_decoder.c
@@ -213,7 +213,7 @@
          opus_val16 coef3 = coef[3];
          for (j=0;j<N;j++)
          {
-            celt_sig tmp = x[j] + m;
+            celt_sig tmp = x[j] + m + VERY_SMALL;
             m = MULT16_32_Q15(coef0, tmp)
                           - MULT16_32_Q15(coef1, x[j]);
             tmp = SHL32(MULT16_32_Q15(coef3, tmp), 2);
@@ -227,7 +227,7 @@
          /* Shortcut for the standard (non-custom modes) case */
          for (j=0;j<N;j++)
          {
-            celt_sig tmp = x[j] + m;
+            celt_sig tmp = x[j] + m + VERY_SMALL;
             m = MULT16_32_Q15(coef0, tmp);
             scratch[j] = tmp;
          }
--- a/celt/celt_encoder.c
+++ b/celt/celt_encoder.c
@@ -508,7 +508,7 @@
       opus_val16 coef2 = coef[2];
       for (i=0;i<N;i++)
       {
-         opus_val16 x, tmp;
+         celt_sig x, tmp;
          x = inp[i];
          /* Apply pre-emphasis */
          tmp = MULT16_16(coef2, x);