forked from len0rd/rockbox
Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
This commit is contained in:
parent
75d9393796
commit
14c6bb798d
286 changed files with 48931 additions and 1278 deletions
|
@ -42,7 +42,8 @@ opus_int silk_decode_frame(
|
|||
opus_int16 pOut[], /* O Pointer to output speech frame */
|
||||
opus_int32 *pN, /* O Pointer to size of output frame */
|
||||
opus_int lostFlag, /* I 0: no loss, 1 loss, 2 decode fec */
|
||||
opus_int condCoding /* I The type of conditional coding to use */
|
||||
opus_int condCoding, /* I The type of conditional coding to use */
|
||||
int arch /* I Run-time architecture */
|
||||
)
|
||||
{
|
||||
VARDECL( silk_decoder_control, psDecCtrl );
|
||||
|
@ -54,7 +55,7 @@ opus_int silk_decode_frame(
|
|||
psDecCtrl->LTP_scale_Q14 = 0;
|
||||
|
||||
/* Safety checks */
|
||||
silk_assert( L > 0 && L <= MAX_FRAME_LENGTH );
|
||||
celt_assert( L > 0 && L <= MAX_FRAME_LENGTH );
|
||||
|
||||
if( lostFlag == FLAG_DECODE_NORMAL ||
|
||||
( lostFlag == FLAG_DECODE_LBRR && psDec->LBRR_flags[ psDec->nFramesDecoded ] == 1 ) )
|
||||
|
@ -81,28 +82,29 @@ opus_int silk_decode_frame(
|
|||
/********************************************************/
|
||||
/* Run inverse NSQ */
|
||||
/********************************************************/
|
||||
silk_decode_core( psDec, psDecCtrl, pOut, pulses );
|
||||
silk_decode_core( psDec, psDecCtrl, pOut, pulses, arch );
|
||||
|
||||
/********************************************************/
|
||||
/* Update PLC state */
|
||||
/********************************************************/
|
||||
silk_PLC( psDec, psDecCtrl, pOut, 0 );
|
||||
silk_PLC( psDec, psDecCtrl, pOut, 0, arch );
|
||||
|
||||
psDec->lossCnt = 0;
|
||||
psDec->prevSignalType = psDec->indices.signalType;
|
||||
silk_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 );
|
||||
celt_assert( psDec->prevSignalType >= 0 && psDec->prevSignalType <= 2 );
|
||||
|
||||
/* A frame has been decoded without errors */
|
||||
psDec->first_frame_after_reset = 0;
|
||||
} else {
|
||||
/* Handle packet loss by extrapolation */
|
||||
silk_PLC( psDec, psDecCtrl, pOut, 1 );
|
||||
psDec->indices.signalType = psDec->prevSignalType;
|
||||
silk_PLC( psDec, psDecCtrl, pOut, 1, arch );
|
||||
}
|
||||
|
||||
/*************************/
|
||||
/* Update output buffer. */
|
||||
/*************************/
|
||||
silk_assert( psDec->ltp_mem_length >= psDec->frame_length );
|
||||
celt_assert( psDec->ltp_mem_length >= psDec->frame_length );
|
||||
mv_len = psDec->ltp_mem_length - psDec->frame_length;
|
||||
silk_memmove( psDec->outBuf, &psDec->outBuf[ psDec->frame_length ], mv_len * sizeof(opus_int16) );
|
||||
silk_memcpy( &psDec->outBuf[ mv_len ], pOut, psDec->frame_length * sizeof( opus_int16 ) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue