From fd152f55f55a384213f35c95e592f2b25509dd44 Mon Sep 17 00:00:00 2001 From: Koen Vos Date: Sat, 29 Oct 2011 00:24:46 -0400 Subject: [PATCH] fixes a mixup between decoder and PLC states --- silk/PLC.c | 6 +++--- silk/PLC.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/silk/PLC.c b/silk/PLC.c index 38216319..a30f23b6 100644 --- a/silk/PLC.c +++ b/silk/PLC.c @@ -56,6 +56,8 @@ void silk_PLC_Reset( psDec->sPLC.pitchL_Q8 = silk_LSHIFT( psDec->frame_length, 8 - 1 ); psDec->sPLC.prevGain_Q16[ 0 ] = SILK_FIX_CONST( 1, 16 ); psDec->sPLC.prevGain_Q16[ 1 ] = SILK_FIX_CONST( 1, 16 ); + psDec->sPLC.subfr_length = 20; + psDec->sPLC.nb_subfr = 2; } void silk_PLC( @@ -123,10 +125,8 @@ static inline void silk_PLC_update( } } -#if USE_SINGLE_TAP silk_memset( psPLC->LTPCoef_Q14, 0, LTP_ORDER * sizeof( opus_int16 ) ); psPLC->LTPCoef_Q14[ LTP_ORDER / 2 ] = LTP_Gain_Q14; -#endif /* Limit LT coefs */ if( LTP_Gain_Q14 < V_PITCH_GAIN_START_MIN_Q14 ) { @@ -196,7 +196,7 @@ static inline void silk_PLC_conceal( } /* Find the subframe with lowest energy of the last two and use that as random noise generator */ silk_sum_sqr_shift( &energy1, &shift1, exc_buf, psPLC->subfr_length ); - silk_sum_sqr_shift( &energy2, &shift2, &exc_buf[ psDec->subfr_length ], psPLC->subfr_length ); + silk_sum_sqr_shift( &energy2, &shift2, &exc_buf[ psPLC->subfr_length ], psPLC->subfr_length ); if( silk_RSHIFT( energy1, shift2 ) < silk_RSHIFT( energy2, shift1 ) ) { /* First sub-frame has lowest energy */ diff --git a/silk/PLC.h b/silk/PLC.h index c1f1e7eb..5be504f2 100644 --- a/silk/PLC.h +++ b/silk/PLC.h @@ -35,7 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define V_PITCH_GAIN_START_MAX_Q14 15565 /* 0.95 in Q14 */ #define MAX_PITCH_LAG_MS 18 #define SA_THRES_Q8 50 -#define USE_SINGLE_TAP 1 #define RAND_BUF_SIZE 128 #define RAND_BUF_MASK ( RAND_BUF_SIZE - 1 ) #define LOG2_INV_LPC_GAIN_HIGH_THRES 3 /* 2^3 = 8 dB LPC gain */