From b9f443d5218a781856196561b1cd4efde938bafc Mon Sep 17 00:00:00 2001 From: Gregory Maxwell <greg@xiph.org> Date: Tue, 4 Oct 2011 01:20:39 -0400 Subject: [PATCH] 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. --- silk/NLSF2A.c | 2 +- silk/float/warped_autocorrelation_FLP.c | 4 ++-- src/opus_encoder.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/silk/NLSF2A.c b/silk/NLSF2A.c index eca855b73..d0a8667bc 100644 --- a/silk/NLSF2A.c +++ b/silk/NLSF2A.c @@ -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++ ) { diff --git a/silk/float/warped_autocorrelation_FLP.c b/silk/float/warped_autocorrelation_FLP.c index 236dbed80..2f15fa522 100644 --- a/silk/float/warped_autocorrelation_FLP.c +++ b/silk/float/warped_autocorrelation_FLP.c @@ -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 ); diff --git a/src/opus_encoder.c b/src/opus_encoder.c index d203bfdca..156412cf7 100644 --- a/src/opus_encoder.c +++ b/src/opus_encoder.c @@ -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; } -- GitLab