shithub: opus

Download patch

ref: 5a70097d7940a1e5a6a1a419ca1c55948d3d0e87
parent: 54669dc89bf23fa3cc531338b2bb8f9971e8acd9
author: Jean-Marc Valin <[email protected]>
date: Sat Aug 8 09:23:03 EDT 2009

C89 and 16-bit fixes

--- a/libcelt/bands.c
+++ b/libcelt/bands.c
@@ -619,7 +619,9 @@
       /* If pitch isn't available, use intra-frame prediction */
       if ((eBands[i] >= m->pitchEnd && fold) || (q1+q2)<=0)
       {
-         int K[2] = {q1, q2};
+         int K[2];
+         K[0] = q1;
+         K[1] = q2;
          intra_fold(m, X+C*eBands[i], eBands[i+1]-eBands[i], K, norm, P+C*eBands[i], eBands[i], B);
          deinterleave(P+C*eBands[i], C*N);
       } else if (pitch_used && eBands[i] < m->pitchEnd) {
@@ -890,7 +892,9 @@
       /* If pitch isn't available, use intra-frame prediction */
       if ((eBands[i] >= m->pitchEnd && fold) || (q1+q2)<=0)
       {
-         int K[2] = {q1, q2};
+         int K[2];
+         K[0] = q1;
+         K[1] = q2;
          intra_fold(m, X+C*eBands[i], eBands[i+1]-eBands[i], K, norm, P+C*eBands[i], eBands[i], B);
          deinterleave(P+C*eBands[i], C*N);
       } else if (pitch_used && eBands[i] < m->pitchEnd) {
--- a/libcelt/celt.c
+++ b/libcelt/celt.c
@@ -426,13 +426,13 @@
 }
 
 #define FLAG_NONE        0
-#define FLAG_INTRA       1U<<16
-#define FLAG_PITCH       1U<<15
-#define FLAG_SHORT       1U<<14
-#define FLAG_FOLD        1U<<13
+#define FLAG_INTRA       (1U<<13)
+#define FLAG_PITCH       (1U<<12)
+#define FLAG_SHORT       (1U<<11)
+#define FLAG_FOLD        (1U<<10)
 #define FLAG_MASK        (FLAG_INTRA|FLAG_PITCH|FLAG_SHORT|FLAG_FOLD)
 
-celt_int32_t flaglist[8] = {
+int flaglist[8] = {
       0 /*00  */ | FLAG_FOLD,
       1 /*01  */ | FLAG_PITCH|FLAG_FOLD,
       8 /*1000*/ | FLAG_NONE,
@@ -1034,7 +1034,7 @@
       break;
       case CELT_SET_VBR_RATE_REQUEST:
       {
-         int value = va_arg(ap, celt_int32_t);
+         celt_int32_t value = va_arg(ap, celt_int32_t);
          if (value<0)
             goto bad_arg;
          if (value>3072000)