shithub: opus

Download patch

ref: 381d05aa0b13843d931542cbb781fca1fb42172f
parent: fa4a3bf52c47bf97d157b3341d6f48c91c738dba
author: Jean-Marc Valin <[email protected]>
date: Tue May 19 06:12:34 EDT 2009

Make it possible to use more than 255 pulses (not used yet).

--- a/libcelt/cwrs.c
+++ b/libcelt/cwrs.c
@@ -83,10 +83,10 @@
 int fits_in32(int _n, int _m)
 {
    static const celt_int16_t maxN[15] = {
-      255, 255, 255, 255, 255, 109,  60,  40,
+      32767, 32767, 32767, 1476, 283, 109,  60,  40,
        29,  24,  20,  18,  16,  14,  13};
    static const celt_int16_t maxM[15] = {
-      255, 255, 255, 255, 255, 238,  95,  53,
+      32767, 32767, 32767, 32767, 1172, 238,  95,  53,
        36,  27,  22,  18,  16,  15,  13};
    if (_n>=14)
    {
@@ -208,7 +208,7 @@
   len=_m+2;
   _u[0]=0;
   _u[1]=um2=1;
-  if(_n<=6){
+  if(_n<=6 || _m>255){
     /*If _n==0, _u[0] should be 1 and the rest should be 0.*/
     /*If _n==1, _u[i] should be 1 for i>1.*/
     celt_assert(_n>=2);