More assert updates, make the initialization in silk_warped_autocorrelation_FLP more...
authorGregory Maxwell <greg@xiph.org>
Tue, 4 Oct 2011 05:20:39 +0000 (01:20 -0400)
committerGregory Maxwell <greg@xiph.org>
Tue, 4 Oct 2011 17:33:53 +0000 (13:33 -0400)
silk/NLSF2A.c
silk/float/warped_autocorrelation_FLP.c
src/opus_encoder.c

index eca855b..d0a8667 100644 (file)
@@ -77,7 +77,7 @@ void silk_NLSF2A(
     opus_int32 maxabs, absval, idx=0, sc_Q16, invGain_Q30;
 
     silk_assert( LSF_COS_TAB_SZ_FIX == 128 );
-    silk_assert( d==6||d==8||d==10||d==12||d==14||d==16 );
+    silk_assert( d==10||d==16 );
 
     /* convert LSFs to 2*cos(LSF), using piecewise linear curve from table */
     for( k = 0; k < d; k++ ) {
index 236dbed..2f15fa5 100644 (file)
@@ -42,8 +42,8 @@ void silk_warped_autocorrelation_FLP(
 {
     opus_int   n, i;
     double tmp1, tmp2;
-    double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 };
-    double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 };
+    double state[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
+    double C[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
 
     /* Order must be even */
     silk_assert( ( order & 1 ) == 0 );
index d203bfd..156412c 100644 (file)
@@ -1107,7 +1107,7 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...)
         case OPUS_SET_FORCE_CHANNELS_REQUEST:
         {
             opus_int32 value = va_arg(ap, opus_int32);
-            if(value<1 || value>st->channels)
+            if((value<1 || value>st->channels) && value != OPUS_AUTO)
                 return OPUS_BAD_ARG;
             st->force_channels = value;
         }