ref: 4f5557c3095a1d212161609ff638cdae67a9b303
parent: 0e69e4ee168de21c38673b92286cc75d5f155eea
author: Felicia Lim <flim@google.com>
date: Wed Mar 30 11:46:59 EDT 2016
Attenuate SILK PLC gain only for unvoiced speech
--- a/silk/PLC.c
+++ b/silk/PLC.c
@@ -328,8 +328,10 @@
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 );
--- a/silk/decode_frame.c
+++ b/silk/decode_frame.c
@@ -97,6 +97,7 @@
psDec->first_frame_after_reset = 0;
} else {
/* Handle packet loss by extrapolation */
+ psDec->indices.signalType = psDec->prevSignalType;
silk_PLC( psDec, psDecCtrl, pOut, 1, arch );
}