summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/silk/decode_frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/silk/decode_frame.c')
-rw-r--r--lib/rbcodec/codecs/libopus/silk/decode_frame.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/rbcodec/codecs/libopus/silk/decode_frame.c b/lib/rbcodec/codecs/libopus/silk/decode_frame.c
index 6a7cffbbe0..e73825b267 100644
--- a/lib/rbcodec/codecs/libopus/silk/decode_frame.c
+++ b/lib/rbcodec/codecs/libopus/silk/decode_frame.c
@@ -42,7 +42,8 @@ opus_int silk_decode_frame(
42 opus_int16 pOut[], /* O Pointer to output speech frame */ 42 opus_int16 pOut[], /* O Pointer to output speech frame */
43 opus_int32 *pN, /* O Pointer to size of output frame */ 43 opus_int32 *pN, /* O Pointer to size of output frame */
44 opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */ 44 opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */
45 opus_int condCoding /* I The type of conditional coding to use */ 45 opus_int condCoding, /* I The type of conditional coding to use */
46 int arch /* I Run-time architecture */
46) 47)
47{ 48{
48 VARDECL( silk_decoder_control, psDecCtrl ); 49 VARDECL( silk_decoder_control, psDecCtrl );
@@ -54,7 +55,7 @@ opus_int silk_decode_frame(
54 psDecCtrl->LTP_scale_Q14 = 0; 55 psDecCtrl->LTP_scale_Q14 = 0;
55 56
56 /* Safety checks */ 57 /* Safety checks */
57 silk_assert( L > 0 && L <= MAX_FRAME_LENGTH ); 58 celt_assert( L > 0 && L <= MAX_FRAME_LENGTH );
58 59
59 if( lostFlag == FLAG_DECODE_NORMAL || 60 if( lostFlag == FLAG_DECODE_NORMAL ||
60 ( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) ) 61 ( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) )
@@ -81,28 +82,29 @@ opus_int silk_decode_frame(
81 /********************************************************/ 82 /********************************************************/
82 /* Run inverse NSQ */ 83 /* Run inverse NSQ */
83 /********************************************************/ 84 /********************************************************/
84 silk_decode_core( psDec, psDecCtrl, pOut, pulses ); 85 silk_decode_core( psDec, psDecCtrl, pOut, pulses, arch );
85 86
86 /********************************************************/ 87 /********************************************************/
87 /* Update PLC state */ 88 /* Update PLC state */
88 /********************************************************/ 89 /********************************************************/
89 silk_PLC( psDec, psDecCtrl, pOut, 0 ); 90 silk_PLC( psDec, psDecCtrl, pOut, 0, arch );
90 91
91 psDec->lossCnt = 0; 92 psDec->lossCnt = 0;
92 psDec->prevSignalType = psDec->indices.signalType; 93 psDec->prevSignalType = psDec->indices.signalType;
93 silk_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 ); 94 celt_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 );
94 95
95 /* A frame has been decoded without errors */ 96 /* A frame has been decoded without errors */
96 psDec->first_frame_after_reset = 0; 97 psDec->first_frame_after_reset = 0;
97 } else { 98 } else {
98 /* Handle packet loss by extrapolation */ 99 /* Handle packet loss by extrapolation */
99 silk_PLC( psDec, psDecCtrl, pOut, 1 ); 100 psDec->indices.signalType = psDec->prevSignalType;
101 silk_PLC( psDec, psDecCtrl, pOut, 1, arch );
100 } 102 }
101 103
102 /*************************/ 104 /*************************/
103 /* Update output buffer. */ 105 /* Update output buffer. */
104 /*************************/ 106 /*************************/
105 silk_assert( psDec->ltp_mem_length >= psDec->frame_length ); 107 celt_assert( psDec->ltp_mem_length >= psDec->frame_length );
106 mv_len = psDec->ltp_mem_length - psDec->frame_length; 108 mv_len = psDec->ltp_mem_length - psDec->frame_length;
107 silk_memmove( psDec->outBuf, &psDec->outBuf[ psDec->frame_length ], mv_len * sizeof(opus_int16) ); 109 silk_memmove( psDec->outBuf, &psDec->outBuf[ psDec->frame_length ], mv_len * sizeof(opus_int16) );
108 silk_memcpy( &psDec->outBuf[ mv_len ], pOut, psDec->frame_length * sizeof( opus_int16 ) ); 110 silk_memcpy( &psDec->outBuf[ mv_len ], pOut, psDec->frame_length * sizeof( opus_int16 ) );