Skip to content
Snippets Groups Projects
Commit fd152f55 authored by Koen Vos's avatar Koen Vos Committed by Jean-Marc Valin
Browse files

fixes a mixup between decoder and PLC states

parent 1ee6b48c
No related merge requests found
......@@ -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 */
......
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment