Reland "Upconvert various types to int.", isac portion.

This reverts portions of commit cb180976dd0e9672cde4523d87b5f4857478b5e9, which
reverted commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24.  Specifically, the
files in webrtc/modules/audio_coding/codecs/isac/ are relanded.

The original commit message is below:

Upconvert various types to int.

Per comments from HL/kwiberg on https://webrtc-codereview.appspot.com/42569004 , when there is existing usage of mixed types (int16_t, int, etc.), we'd prefer to standardize on larger types like int and phase out use of int16_t.

Specifically, "Using int16 just because we're sure all reasonable values will fit in 16 bits isn't usually meaningful in C."

This converts some existing uses of int16_t (and, in a few cases, other types such as uint16_t) to int (or, in a few places, int32_t).  Other locations will be converted to size_t in a separate change.

BUG=none
TBR=kwiberg

Review URL: https://codereview.webrtc.org/1179093002

Cr-Commit-Position: refs/heads/master@{#9422}
This commit is contained in:
Peter Kasting
2015-06-11 18:19:24 -07:00
parent 7faba36f79
commit aba07ef6d9
21 changed files with 138 additions and 137 deletions

View File

@ -24,12 +24,12 @@ struct IsacFloat {
static const bool has_swb = true;
static inline int16_t Control(instance_type* inst,
int32_t rate,
int16_t framesize) {
int framesize) {
return WebRtcIsac_Control(inst, rate, framesize);
}
static inline int16_t ControlBwe(instance_type* inst,
int32_t rate_bps,
int16_t frame_size_ms,
int frame_size_ms,
int16_t enforce_frame_size) {
return WebRtcIsac_ControlBwe(inst, rate_bps, frame_size_ms,
enforce_frame_size);
@ -37,11 +37,11 @@ struct IsacFloat {
static inline int16_t Create(instance_type** inst) {
return WebRtcIsac_Create(inst);
}
static inline int16_t DecodeInternal(instance_type* inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speech_type) {
static inline int DecodeInternal(instance_type* inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speech_type) {
return WebRtcIsac_Decode(inst, encoded, len, decoded, speech_type);
}
static inline int16_t DecodePlc(instance_type* inst,
@ -53,9 +53,9 @@ struct IsacFloat {
static inline int16_t DecoderInit(instance_type* inst) {
return WebRtcIsac_DecoderInit(inst);
}
static inline int16_t Encode(instance_type* inst,
const int16_t* speech_in,
uint8_t* encoded) {
static inline int Encode(instance_type* inst,
const int16_t* speech_in,
uint8_t* encoded) {
return WebRtcIsac_Encode(inst, speech_in, encoded);
}
static inline int16_t EncoderInit(instance_type* inst, int16_t coding_mode) {

View File

@ -144,7 +144,7 @@ extern "C" {
* : -1 - Error
*/
int16_t WebRtcIsac_Encode(
int WebRtcIsac_Encode(
ISACStruct* ISAC_main_inst,
const int16_t* speechIn,
uint8_t* encoded);
@ -214,7 +214,7 @@ extern "C" {
* -1 - Error.
*/
int16_t WebRtcIsac_Decode(
int WebRtcIsac_Decode(
ISACStruct* ISAC_main_inst,
const uint8_t* encoded,
int16_t len,
@ -269,7 +269,7 @@ extern "C" {
int16_t WebRtcIsac_Control(
ISACStruct* ISAC_main_inst,
int32_t rate,
int16_t framesize);
int framesize);
/******************************************************************************
@ -300,7 +300,7 @@ extern "C" {
int16_t WebRtcIsac_ControlBwe(
ISACStruct* ISAC_main_inst,
int32_t rateBPS,
int16_t frameSizeMs,
int frameSizeMs,
int16_t enforceFrameSize);
@ -701,7 +701,7 @@ extern "C" {
* Return value : >0 - number of samples in decoded vector
* -1 - Error
*/
int16_t WebRtcIsac_DecodeRcu(
int WebRtcIsac_DecodeRcu(
ISACStruct* ISAC_main_inst,
const uint8_t* encoded,
int16_t len,