diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-12 10:11:48 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-12 10:13:58 +0300 |
commit | bbb4cf554c3a892a9245dd684b225d1ff1651da7 (patch) | |
tree | 1108082a5712a7fdd5538ea60a2cb89326e3f886 | |
parent | 3510404ad5a5287148d89ee523aa1edb7ef8e257 (diff) |
Fix DRED/neural PLC for SILK stereo
Don't attempt to run the neural PLC on the side channel since
we only have one state.
-rw-r--r-- | silk/PLC.c | 12 | ||||
-rw-r--r-- | silk/dec_API.c | 2 |
2 files changed, 7 insertions, 7 deletions
@@ -103,7 +103,7 @@ void silk_PLC( /****************************/ silk_PLC_update( psDec, psDecCtrl ); #ifdef NEURAL_PLC - if ( psDec->sPLC.fs_kHz == 16 ) { + if ( lpcnet != NULL && psDec->sPLC.fs_kHz == 16 ) { int k; for( k = 0; k < psDec->nb_subfr; k += 2 ) { lpcnet_plc_update( lpcnet, frame + k * psDec->subfr_length ); @@ -397,14 +397,14 @@ static OPUS_INLINE void silk_PLC_conceal( frame[ i ] = (opus_int16)silk_SAT16( silk_SAT16( silk_RSHIFT_ROUND( silk_SMULWW( sLPC_Q14_ptr[ MAX_LPC_ORDER + i ], prevGain_Q10[ 1 ] ), 8 ) ) ); } #ifdef NEURAL_PLC - if ( psDec->sPLC.fs_kHz == 16 ) { + if ( lpcnet != NULL && psDec->sPLC.fs_kHz == 16 ) { for( k = 0; k < psDec->nb_subfr; k += 2 ) { lpcnet_plc_conceal( lpcnet, frame + k * psDec->subfr_length ); } - } - /* We *should* be able to copy only from psDec->frame_length-MAX_LPC_ORDER, i.e. the last MAX_LPC_ORDER samples. */ - for( i = 0; i < psDec->frame_length; i++ ) { - sLPC_Q14_ptr[ MAX_LPC_ORDER + i ] = (int)floor(.5 + frame[ i ] * (float)(1 << 24) / prevGain_Q10[ 1 ] ); + /* We *should* be able to copy only from psDec->frame_length-MAX_LPC_ORDER, i.e. the last MAX_LPC_ORDER samples. */ + for( i = 0; i < psDec->frame_length; i++ ) { + sLPC_Q14_ptr[ MAX_LPC_ORDER + i ] = (int)floor(.5 + frame[ i ] * (float)(1 << 24) / prevGain_Q10[ 1 ] ); + } } #endif diff --git a/silk/dec_API.c b/silk/dec_API.c index 5d040409..67d1d3e5 100644 --- a/silk/dec_API.c +++ b/silk/dec_API.c @@ -302,7 +302,7 @@ opus_int silk_Decode( /* O Returns error co } ret += silk_decode_frame( &channel_state[ n ], psRangeDec, &samplesOut1_tmp[ n ][ 2 ], &nSamplesOutDec, lostFlag, condCoding, #ifdef NEURAL_PLC - lpcnet, + n == 0 ? lpcnet : NULL, #endif arch); } else { |