WebRtcIsac_UpdateBwEstimate et al.: Type byte streams as uint8, not uint16

This patch changes the signature of WebRtcIsac_UpdateBwEstimate,
WebRtcIsacfix_UpdateBwEstimate, and WebRtcIsacfix_UpdateBwEstimate1 so
that they expect the encoded data to be uint8 arrays, not uint16,
which is more natural. The implementations of the functions are left
unchanged for now.

BUG=909
R=aluebs@webrtc.org, bjornv@webrtc.org, henrik.lundin@webrtc.org, turaj@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7430 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
kwiberg@webrtc.org
2014-10-13 11:07:06 +00:00
parent 1172988c79
commit 3f7f899a15
11 changed files with 45 additions and 36 deletions

View File

@ -636,7 +636,7 @@ int16_t WebRtcIsacfix_DecoderInit(ISACFIX_MainStruct *ISAC_main_inst)
*/
int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst,
const uint16_t *encoded,
const uint8_t* encoded,
int32_t packet_size,
uint16_t rtp_seq_number,
uint32_t arr_ts)
@ -673,7 +673,8 @@ int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst,
#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < kRequiredEncodedLenBytes / 2; k++) {
streamdata.stream[k] = (uint16_t) (((uint16_t)encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
uint16_t ek = ((const uint16_t*)encoded)[k];
streamdata.stream[k] = (uint16_t) ((ek >> 8)|((ek & 0xff) << 8));
}
#else
memcpy(streamdata.stream, encoded, kRequiredEncodedLenBytes);
@ -717,7 +718,7 @@ int16_t WebRtcIsacfix_UpdateBwEstimate1(ISACFIX_MainStruct *ISAC_main_inst,
*/
int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst,
const uint16_t *encoded,
const uint8_t* encoded,
int32_t packet_size,
uint16_t rtp_seq_number,
uint32_t send_ts,
@ -758,7 +759,8 @@ int16_t WebRtcIsacfix_UpdateBwEstimate(ISACFIX_MainStruct *ISAC_main_inst,
#ifndef WEBRTC_ARCH_BIG_ENDIAN
for (k = 0; k < kRequiredEncodedLenBytes / 2; k++) {
streamdata.stream[k] = (uint16_t) ((encoded[k] >> 8)|((encoded[k] & 0xFF)<<8));
uint16_t ek = ((const uint16_t*)encoded)[k];
streamdata.stream[k] = (uint16_t) ((ek >> 8)|((ek & 0xff) <<8 ));
}
#else
memcpy(streamdata.stream, encoded, kRequiredEncodedLenBytes);