update
This commit is contained in:
parent
4086a691af
commit
c943d4b145
1 changed files with 12 additions and 8 deletions
20
silk/PLC.c
20
silk/PLC.c
|
@ -66,10 +66,10 @@ void silk_PLC_Reset(
|
||||||
psDec->sPLC.nb_subfr = 2;
|
psDec->sPLC.nb_subfr = 2;
|
||||||
#ifdef NEURAL_PLC
|
#ifdef NEURAL_PLC
|
||||||
if( psDec->sPLC.lpcnet != NULL ) {
|
if( psDec->sPLC.lpcnet != NULL ) {
|
||||||
lpcnet_plc_init( psDec->sPLC.lpcnet );
|
lpcnet_plc_init( psDec->sPLC.lpcnet, LPCNET_PLC_CODEC );
|
||||||
} else {
|
} else {
|
||||||
/* FIXME: This is leaking memory. The right fix is for the LPCNet state to be part of the PLC struct itself. */
|
/* FIXME: This is leaking memory. The right fix is for the LPCNet state to be part of the PLC struct itself. */
|
||||||
psDec->sPLC.lpcnet = lpcnet_plc_create();
|
psDec->sPLC.lpcnet = lpcnet_plc_create(LPCNET_PLC_CODEC);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -462,12 +462,16 @@ void silk_PLC_glue_frames(
|
||||||
slope_Q16 = silk_DIV32_16( ( (opus_int32)1 << 16 ) - gain_Q16, length );
|
slope_Q16 = silk_DIV32_16( ( (opus_int32)1 << 16 ) - gain_Q16, length );
|
||||||
/* Make slope 4x steeper to avoid missing onsets after DTX */
|
/* Make slope 4x steeper to avoid missing onsets after DTX */
|
||||||
slope_Q16 = silk_LSHIFT( slope_Q16, 2 );
|
slope_Q16 = silk_LSHIFT( slope_Q16, 2 );
|
||||||
|
#ifdef NEURAL_PLC
|
||||||
for( i = 0; i < length; i++ ) {
|
if ( psDec->sPLC.fs_kHz != 16 )
|
||||||
frame[ i ] = silk_SMULWB( gain_Q16, frame[ i ] );
|
#endif
|
||||||
gain_Q16 += slope_Q16;
|
{
|
||||||
if( gain_Q16 > (opus_int32)1 << 16 ) {
|
for( i = 0; i < length; i++ ) {
|
||||||
break;
|
frame[ i ] = silk_SMULWB( gain_Q16, frame[ i ] );
|
||||||
|
gain_Q16 += slope_Q16;
|
||||||
|
if( gain_Q16 > (opus_int32)1 << 16 ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue