shithub: opus

Download patch

ref: 65a487069d26cb2328d303fcda250406f26e92c3
parent: 628c025373296bb68569b18a27f936ca6a70bcd3
author: Jean-Marc Valin <[email protected]>
date: Sat Apr 17 13:29:03 EDT 2010

Corrected some non-sensical code

--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -102,7 +102,7 @@
    }*/
    gain = celt_div((celt_word32)MULT16_16(Q15_ONE,len),(celt_word32)(3+len+4*K));
    /* FIXME: Make that HALF16 instead of HALF32 */
-   theta = HALF32(MULT16_16_Q15(gain,gain));
+   theta = MIN16(QCONST16(.25f,15),HALF32(MULT16_16_Q15(gain,gain)));
    c[0] = celt_cos_norm(EXTEND32(theta));
    s[0] = celt_cos_norm(EXTEND32(SUB16(Q15ONE,theta))); /*  sin(theta) */
 
@@ -109,8 +109,6 @@
    do {
       istride[N] = stride;
       stride *= 2;
-      if (K==1)
-         theta = QCONST16(.25f,15);
       c[N] = c[0];
       s[N] = s[0];
       N++;