iLBC: Use uint8_t[] for byte arrays
BUG=909 This is the same as https://review.webrtc.org/41779004/ with the review comments addressed. R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/40769004 Cr-Commit-Position: refs/heads/master@{#8394} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8394 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
640313ce4f
commit
71b35a4ce4
@ -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++;
|
||||
}
|
||||
|
@ -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(...)
|
||||
|
@ -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 */
|
||||
|
@ -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<const int16_t*>(encoded),
|
||||
int16_t ret = WebRtcIlbcfix_Decode(dec_state_, encoded,
|
||||
static_cast<int16_t>(encoded_len), decoded,
|
||||
&temp_type);
|
||||
*speech_type = ConvertSpeechType(temp_type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user