| Index: webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c
|
| diff --git a/webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c b/webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c
|
| index b8a067e0f3d5d4dfcea879e1efdd5b9d83dfb35b..727eb44b3fe816cf665c554e684fb8ab2feef60f 100644
|
| --- a/webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c
|
| +++ b/webrtc/modules/audio_coding/codecs/ilbc/decode_residual.c
|
| @@ -32,7 +32,7 @@
|
| * frame residual decoder function (subrutine to iLBC_decode)
|
| *---------------------------------------------------------------*/
|
|
|
| -void WebRtcIlbcfix_DecodeResidual(
|
| +int WebRtcIlbcfix_DecodeResidual(
|
| IlbcDecoder *iLBCdec_inst,
|
| /* (i/o) the decoder state structure */
|
| iLBC_bits *iLBC_encbits, /* (i/o) Encoded bits, which are used
|
| @@ -72,11 +72,11 @@ void WebRtcIlbcfix_DecodeResidual(
|
|
|
| /* construct decoded vector */
|
|
|
| - WebRtcIlbcfix_CbConstruct(
|
| - &decresidual[start_pos+iLBCdec_inst->state_short_len],
|
| - iLBC_encbits->cb_index, iLBC_encbits->gain_index,
|
| - mem+CB_MEML-ST_MEM_L_TBL,
|
| - ST_MEM_L_TBL, diff);
|
| + if (!WebRtcIlbcfix_CbConstruct(
|
| + &decresidual[start_pos + iLBCdec_inst->state_short_len],
|
| + iLBC_encbits->cb_index, iLBC_encbits->gain_index,
|
| + mem + CB_MEML - ST_MEM_L_TBL, ST_MEM_L_TBL, diff))
|
| + return 0; // Error.
|
|
|
| }
|
| else {/* put adaptive part in the beginning */
|
| @@ -90,12 +90,11 @@ void WebRtcIlbcfix_DecodeResidual(
|
|
|
| /* construct decoded vector */
|
|
|
| - WebRtcIlbcfix_CbConstruct(
|
| - reverseDecresidual,
|
| - iLBC_encbits->cb_index, iLBC_encbits->gain_index,
|
| - mem+CB_MEML-ST_MEM_L_TBL,
|
| - ST_MEM_L_TBL, diff
|
| - );
|
| + if (!WebRtcIlbcfix_CbConstruct(reverseDecresidual, iLBC_encbits->cb_index,
|
| + iLBC_encbits->gain_index,
|
| + mem + CB_MEML - ST_MEM_L_TBL, ST_MEM_L_TBL,
|
| + diff))
|
| + return 0; // Error.
|
|
|
| /* get decoded residual from reversed vector */
|
|
|
| @@ -122,12 +121,12 @@ void WebRtcIlbcfix_DecodeResidual(
|
| for (subframe=0; subframe<Nfor; subframe++) {
|
|
|
| /* construct decoded vector */
|
| - WebRtcIlbcfix_CbConstruct(
|
| - &decresidual[(iLBC_encbits->startIdx+1+subframe)*SUBL],
|
| - iLBC_encbits->cb_index+subcount*CB_NSTAGES,
|
| - iLBC_encbits->gain_index+subcount*CB_NSTAGES,
|
| - mem, MEM_LF_TBL, SUBL
|
| - );
|
| + if (!WebRtcIlbcfix_CbConstruct(
|
| + &decresidual[(iLBC_encbits->startIdx + 1 + subframe) * SUBL],
|
| + iLBC_encbits->cb_index + subcount * CB_NSTAGES,
|
| + iLBC_encbits->gain_index + subcount * CB_NSTAGES, mem, MEM_LF_TBL,
|
| + SUBL))
|
| + return 0; // Error;
|
|
|
| /* update memory */
|
| memmove(mem, mem + SUBL, (CB_MEML - SUBL) * sizeof(*mem));
|
| @@ -160,12 +159,12 @@ void WebRtcIlbcfix_DecodeResidual(
|
| for (subframe=0; subframe<Nback; subframe++) {
|
|
|
| /* construct decoded vector */
|
| - WebRtcIlbcfix_CbConstruct(
|
| - &reverseDecresidual[subframe*SUBL],
|
| - iLBC_encbits->cb_index+subcount*CB_NSTAGES,
|
| - iLBC_encbits->gain_index+subcount*CB_NSTAGES,
|
| - mem, MEM_LF_TBL, SUBL
|
| - );
|
| + if (!WebRtcIlbcfix_CbConstruct(
|
| + &reverseDecresidual[subframe * SUBL],
|
| + iLBC_encbits->cb_index + subcount * CB_NSTAGES,
|
| + iLBC_encbits->gain_index + subcount * CB_NSTAGES, mem, MEM_LF_TBL,
|
| + SUBL))
|
| + return 0; // Error.
|
|
|
| /* update memory */
|
| memmove(mem, mem + SUBL, (CB_MEML - SUBL) * sizeof(*mem));
|
| @@ -179,4 +178,6 @@ void WebRtcIlbcfix_DecodeResidual(
|
| WebRtcSpl_MemCpyReversedOrder(decresidual+SUBL*Nback-1,
|
| reverseDecresidual, SUBL*Nback);
|
| }
|
| +
|
| + return 1; // Success.
|
| }
|
|
|