Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@amazon.com>2022-03-03 06:51:16 +0300
committerJean-Marc Valin <jmvalin@amazon.com>2022-03-03 06:51:16 +0300
commit928a1dddfca80baf95f4b49bb95e62578dc52026 (patch)
tree89c77fa9906e30aa52fbfa45b7931198c59a72e8
parent6be9697aa05f643dc04e208e708aa35752dbde31 (diff)
update
-rw-r--r--silk/PLC.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/silk/PLC.c b/silk/PLC.c
index 431c7214..ecb34b9e 100644
--- a/silk/PLC.c
+++ b/silk/PLC.c
@@ -66,10 +66,10 @@ void silk_PLC_Reset(
psDec->sPLC.nb_subfr = 2;
#ifdef NEURAL_PLC
if( psDec->sPLC.lpcnet != NULL ) {
- lpcnet_plc_init( psDec->sPLC.lpcnet );
+ lpcnet_plc_init( psDec->sPLC.lpcnet, LPCNET_PLC_CODEC );
} else {
/* 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
}
@@ -462,12 +462,16 @@ void silk_PLC_glue_frames(
slope_Q16 = silk_DIV32_16( ( (opus_int32)1 << 16 ) - gain_Q16, length );
/* Make slope 4x steeper to avoid missing onsets after DTX */
slope_Q16 = silk_LSHIFT( slope_Q16, 2 );
-
- for( i = 0; i < length; i++ ) {
- frame[ i ] = silk_SMULWB( gain_Q16, frame[ i ] );
- gain_Q16 += slope_Q16;
- if( gain_Q16 > (opus_int32)1 << 16 ) {
- break;
+#ifdef NEURAL_PLC
+ if ( psDec->sPLC.fs_kHz != 16 )
+#endif
+ {
+ for( i = 0; i < length; i++ ) {
+ frame[ i ] = silk_SMULWB( gain_Q16, frame[ i ] );
+ gain_Q16 += slope_Q16;
+ if( gain_Q16 > (opus_int32)1 << 16 ) {
+ break;
+ }
}
}
}