diff options
author | Felicia Lim <flim@google.com> | 2016-03-30 16:46:59 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2016-06-02 22:13:36 +0300 |
commit | 48c78d80edac84c550650f616fe0c8a9ecfc3ebb (patch) | |
tree | fea9c827f2b49ad586b628b74623415e92be99dd | |
parent | a16fb953a705f7e76951fd0158b69e43b12d6ba1 (diff) |
Attenuate SILK PLC gain only for unvoiced speech
-rw-r--r-- | silk/PLC.c | 6 | ||||
-rw-r--r-- | silk/decode_frame.c | 1 |
2 files changed, 5 insertions, 2 deletions
@@ -328,8 +328,10 @@ static OPUS_INLINE void silk_PLC_conceal( for( j = 0; j < LTP_ORDER; j++ ) { B_Q14[ j ] = silk_RSHIFT( silk_SMULBB( harm_Gain_Q15, B_Q14[ j ] ), 15 ); } - /* Gradually reduce excitation gain */ - rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); + if ( psDec->indices.signalType != TYPE_NO_VOICE_ACTIVITY ) { + /* Gradually reduce excitation gain */ + rand_scale_Q14 = silk_RSHIFT( silk_SMULBB( rand_scale_Q14, rand_Gain_Q15 ), 15 ); + } /* Slowly increase pitch lag */ psPLC->pitchL_Q8 = silk_SMLAWB( psPLC->pitchL_Q8, psPLC->pitchL_Q8, PITCH_DRIFT_FAC_Q16 ); diff --git a/silk/decode_frame.c b/silk/decode_frame.c index a605d95a..dfa73c4a 100644 --- a/silk/decode_frame.c +++ b/silk/decode_frame.c @@ -97,6 +97,7 @@ opus_int silk_decode_frame( psDec->first_frame_after_reset = 0; } else { /* Handle packet loss by extrapolation */ + psDec->indices.signalType = psDec->prevSignalType; silk_PLC( psDec, psDecCtrl, pOut, 1, arch ); } |