More assert updates, make the initialization in silk_warped_autocorrelation_FLP more explicit to make tools happy, and allow resetting to auto with OPUS_SET_FORCE_CHANNELS.

This commit is contained in:
Gregory Maxwell 2011-10-04 01:20:39 -04:00
parent 2779df7ff6
commit b9f443d521
3 changed files with 4 additions and 4 deletions

View file

@ -77,7 +77,7 @@ void silk_NLSF2A(
opus_int32 maxabs, absval, idx=0, sc_Q16, invGain_Q30; opus_int32 maxabs, absval, idx=0, sc_Q16, invGain_Q30;
silk_assert( LSF_COS_TAB_SZ_FIX == 128 ); 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 */ /* convert LSFs to 2*cos(LSF), using piecewise linear curve from table */
for( k = 0; k < d; k++ ) { for( k = 0; k < d; k++ ) {

View file

@ -42,8 +42,8 @@ void silk_warped_autocorrelation_FLP(
{ {
opus_int n, i; opus_int n, i;
double tmp1, tmp2; double tmp1, tmp2;
double state[ 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 }; 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 */ /* Order must be even */
silk_assert( ( order & 1 ) == 0 ); silk_assert( ( order & 1 ) == 0 );

View file

@ -1107,7 +1107,7 @@ int opus_encoder_ctl(OpusEncoder *st, int request, ...)
case OPUS_SET_FORCE_CHANNELS_REQUEST: case OPUS_SET_FORCE_CHANNELS_REQUEST:
{ {
opus_int32 value = va_arg(ap, opus_int32); 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; return OPUS_BAD_ARG;
st->force_channels = value; st->force_channels = value;
} }