iSAC tests: Type buffers as uint8_t[] to avoid casts

The iSAC interface functions now expect uint8_t arrays, so change some
arrays to be of that type instead of casting at each point of use.

R=bjornv@webrtc.org, henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/31689004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7433 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kwiberg@webrtc.org 2014-10-13 13:29:04 +00:00
parent d4fe824862
commit a3722b643d
2 changed files with 14 additions and 15 deletions

View File

@ -93,7 +93,7 @@ int main(int argc, char* argv[])
//FILE logFile; //FILE logFile;
bool doTransCoding = false; bool doTransCoding = false;
int32_t rateTransCoding = 0; int32_t rateTransCoding = 0;
uint16_t streamDataTransCoding[600]; uint8_t streamDataTransCoding[1200];
int16_t streamLenTransCoding = 0; int16_t streamLenTransCoding = 0;
FILE* transCodingFile = NULL; FILE* transCodingFile = NULL;
FILE* transcodingBitstream = NULL; FILE* transcodingBitstream = NULL;
@ -691,7 +691,7 @@ int main(int argc, char* argv[])
bnIdxTC, bnIdxTC,
jitterInfoTC, jitterInfoTC,
rateTransCoding, rateTransCoding,
reinterpret_cast<uint8_t*>(streamDataTransCoding), streamDataTransCoding,
false); false);
if(streamLenTransCoding < 0) if(streamLenTransCoding < 0)
{ {
@ -710,7 +710,7 @@ int main(int argc, char* argv[])
return -1; return -1;
} }
if (fwrite((uint8_t*)streamDataTransCoding, if (fwrite(streamDataTransCoding,
sizeof(uint8_t), sizeof(uint8_t),
streamLenTransCoding, streamLenTransCoding,
transcodingBitstream) != transcodingBitstream) !=
@ -718,8 +718,7 @@ int main(int argc, char* argv[])
return -1; return -1;
} }
WebRtcIsac_ReadBwIndex(reinterpret_cast<const uint8_t*>( WebRtcIsac_ReadBwIndex(streamDataTransCoding,
streamDataTransCoding),
&indexStream); &indexStream);
if (indexStream != bnIdxTC) { if (indexStream != bnIdxTC) {
fprintf(stderr, "Error in inserting Bandwidth index into transcoding stream.\n"); fprintf(stderr, "Error in inserting Bandwidth index into transcoding stream.\n");
@ -795,7 +794,7 @@ int main(int argc, char* argv[])
bnIdxTC, bnIdxTC,
jitterInfoTC, jitterInfoTC,
rateTransCoding, rateTransCoding,
reinterpret_cast<uint8_t*>(streamDataTransCoding), streamDataTransCoding,
true); true);
if(streamLenTransCoding < 0) if(streamLenTransCoding < 0)
{ {
@ -920,7 +919,7 @@ int main(int argc, char* argv[])
{ {
declenTC = WebRtcIsac_DecodeRcu( declenTC = WebRtcIsac_DecodeRcu(
decoderTransCoding, decoderTransCoding,
reinterpret_cast<const uint8_t*>(streamDataTransCoding), streamDataTransCoding,
streamLenTransCoding, streamLenTransCoding,
decodedTC, decodedTC,
speechType); speechType);
@ -938,7 +937,7 @@ int main(int argc, char* argv[])
{ {
declenTC = WebRtcIsac_Decode( declenTC = WebRtcIsac_Decode(
decoderTransCoding, decoderTransCoding,
reinterpret_cast<const uint8_t*>(streamDataTransCoding), streamDataTransCoding,
streamLenTransCoding, streamLenTransCoding,
decodedTC, decodedTC,
speechType); speechType);

View File

@ -102,8 +102,8 @@ int main(int argc, char* argv[])
unsigned int tmpSumStreamLen = 0; unsigned int tmpSumStreamLen = 0;
unsigned int packetCntr = 0; unsigned int packetCntr = 0;
unsigned int lostPacketCntr = 0; unsigned int lostPacketCntr = 0;
uint16_t payload[600]; uint8_t payload[1200];
uint16_t payloadRCU[600]; uint8_t payloadRCU[1200];
uint16_t packetLossPercent = 0; uint16_t packetLossPercent = 0;
int16_t rcuStreamLen = 0; int16_t rcuStreamLen = 0;
int onlyEncode; int onlyEncode;
@ -376,7 +376,7 @@ valid values are 8 and 16.\n", sampFreqKHz);
stream_len = WebRtcIsac_Encode( stream_len = WebRtcIsac_Encode(
ISAC_main_inst, ISAC_main_inst,
shortdata, shortdata,
(uint8_t*)payload); payload);
if(stream_len < 0) if(stream_len < 0)
{ {
@ -396,12 +396,12 @@ valid values are 8 and 16.\n", sampFreqKHz);
} }
rcuStreamLen = WebRtcIsac_GetRedPayload( rcuStreamLen = WebRtcIsac_GetRedPayload(
ISAC_main_inst, (uint8_t*)payloadRCU); ISAC_main_inst, payloadRCU);
get_arrival_time(cur_framesmpls, stream_len, bottleneck, &packetData, get_arrival_time(cur_framesmpls, stream_len, bottleneck, &packetData,
sampFreqKHz * 1000, sampFreqKHz * 1000); sampFreqKHz * 1000, sampFreqKHz * 1000);
if(WebRtcIsac_UpdateBwEstimate(ISAC_main_inst, if(WebRtcIsac_UpdateBwEstimate(ISAC_main_inst,
(const uint8_t*)payload, payload,
stream_len, stream_len,
packetData.rtp_number, packetData.rtp_number,
packetData.sample_count, packetData.sample_count,
@ -460,7 +460,7 @@ valid values are 8 and 16.\n", sampFreqKHz);
{ {
declen = WebRtcIsac_DecodeRcu( declen = WebRtcIsac_DecodeRcu(
ISAC_main_inst, ISAC_main_inst,
(const uint8_t*)payloadRCU, payloadRCU,
rcuStreamLen, rcuStreamLen,
decoded, decoded,
speechType); speechType);
@ -470,7 +470,7 @@ valid values are 8 and 16.\n", sampFreqKHz);
{ {
declen = WebRtcIsac_Decode( declen = WebRtcIsac_Decode(
ISAC_main_inst, ISAC_main_inst,
(const uint8_t*)payload, payload,
stream_len, stream_len,
decoded, decoded,
speechType); speechType);