diff --git a/webrtc/modules/audio_coding/codecs/ilbc/ilbc.c b/webrtc/modules/audio_coding/codecs/ilbc/ilbc.c index 4d815fa97..88ad33b5a 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/ilbc.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/ilbc.c @@ -141,11 +141,11 @@ int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst) { } -int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst, - const int16_t *encoded, +int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType) + int16_t* decoded, + int16_t* speechType) { int i=0; /* Allow for automatic switching between the frame sizes @@ -185,7 +185,7 @@ int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst, WebRtcIlbcfix_DecodeImpl( &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], (const uint16_t*)&encoded - [i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], + [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], (IlbcDecoder*)iLBCdec_inst, 1); i++; } @@ -194,11 +194,11 @@ int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst, return(i*((IlbcDecoder*)iLBCdec_inst)->blockl); } -int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst, - const int16_t *encoded, +int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType) + int16_t* decoded, + int16_t* speechType) { int i=0; if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| @@ -213,7 +213,7 @@ int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst, WebRtcIlbcfix_DecodeImpl( &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], (const uint16_t*)&encoded - [i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], + [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], (IlbcDecoder*)iLBCdec_inst, 1); i++; } @@ -222,11 +222,11 @@ int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst, return(i*((IlbcDecoder*)iLBCdec_inst)->blockl); } -int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst, - const int16_t *encoded, +int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType) + int16_t* decoded, + int16_t* speechType) { int i=0; if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)|| @@ -241,7 +241,7 @@ int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst, WebRtcIlbcfix_DecodeImpl( &decoded[i * ((IlbcDecoder*)iLBCdec_inst)->blockl], (const uint16_t*)&encoded - [i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], + [2 * i * ((IlbcDecoder*)iLBCdec_inst)->no_of_words], (IlbcDecoder*)iLBCdec_inst, 1); i++; } diff --git a/webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h b/webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h index 2acb9ca9d..b7e1735e5 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h +++ b/webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h @@ -180,21 +180,21 @@ extern "C" { * -1 - Error */ - int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance *iLBCdec_inst, - const int16_t* encoded, + int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType); - int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance *iLBCdec_inst, - const int16_t *encoded, + int16_t* decoded, + int16_t* speechType); + int16_t WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType); - int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance *iLBCdec_inst, - const int16_t *encoded, + int16_t* decoded, + int16_t* speechType); + int16_t WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst, + const uint8_t* encoded, int16_t len, - int16_t *decoded, - int16_t *speechType); + int16_t* decoded, + int16_t* speechType); /**************************************************************************** * WebRtcIlbcfix_DecodePlc(...) diff --git a/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_test.c b/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_test.c index 35f91519d..3daf186ce 100644 --- a/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_test.c +++ b/webrtc/modules/audio_coding/codecs/ilbc/test/iLBC_test.c @@ -45,7 +45,8 @@ int main(int argc, char* argv[]) FILE *ifileid,*efileid,*ofileid, *cfileid; int16_t data[BLOCKL_MAX]; - int16_t encoded_data[ILBCNOOFWORDS_MAX], decoded_data[BLOCKL_MAX]; + uint8_t encoded_data[2 * ILBCNOOFWORDS_MAX]; + int16_t decoded_data[BLOCKL_MAX]; int len; short pli, mode; int blockcount = 0; @@ -163,8 +164,7 @@ int main(int argc, char* argv[]) /* encoding */ fprintf(stderr, "--- Encoding block %i --- ",blockcount); - len=WebRtcIlbcfix_Encode(Enc_Inst, data, (int16_t)frameLen, - (uint8_t*)encoded_data); + len = WebRtcIlbcfix_Encode(Enc_Inst, data, (int16_t)frameLen, encoded_data); fprintf(stderr, "\r"); /* write byte file */ diff --git a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc index 882c8f352..43ba2415d 100644 --- a/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc +++ b/webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc @@ -106,8 +106,7 @@ AudioDecoderIlbc::~AudioDecoderIlbc() { int AudioDecoderIlbc::Decode(const uint8_t* encoded, size_t encoded_len, int16_t* decoded, SpeechType* speech_type) { int16_t temp_type = 1; // Default is speech. - int16_t ret = WebRtcIlbcfix_Decode(dec_state_, - reinterpret_cast(encoded), + int16_t ret = WebRtcIlbcfix_Decode(dec_state_, encoded, static_cast(encoded_len), decoded, &temp_type); *speech_type = ConvertSpeechType(temp_type);