Revert "Upconvert various types to int."

This reverts commit 83ad33a8aed1fb00e422b6abd33c3e8942821c24.

BUG=499241
TBR=hlundin

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

Cr-Commit-Position: refs/heads/master@{#9418}
This commit is contained in:
Peter Kasting
2015-06-11 12:42:27 -07:00
parent 66a641a9c6
commit cb180976dd
61 changed files with 314 additions and 313 deletions

View File

@ -31,7 +31,7 @@ void WebRtcIlbcfix_AugmentedCbCorr(
int16_t low, /* (i) Lag to start from (typically
20) */
int16_t high, /* (i) Lag to end at (typically 39) */
int scale) /* (i) Scale factor to use for
int16_t scale) /* (i) Scale factor to use for
the crossDot */
{
int lagcount;

View File

@ -36,6 +36,7 @@ void WebRtcIlbcfix_AugmentedCbCorr(
int16_t low, /* (i) Lag to start from (typically
20) */
int16_t high, /* (i) Lag to end at (typically 39 */
int scale); /* (i) Scale factor to use for the crossDot */
int16_t scale); /* (i) Scale factor to use for
the crossDot */
#endif

View File

@ -34,7 +34,7 @@ void WebRtcIlbcfix_CbMemEnergy(
int16_t lTarget, /* (i) Length of the target vector */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size /* (i) Index to where the energy values should be stored */
) {
int16_t *ppi, *ppo, *pp;

View File

@ -27,7 +27,7 @@ void WebRtcIlbcfix_CbMemEnergy(
int16_t lTarget, /* (i) Length of the target vector */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size /* (i) Index to where the energy values should be stored */
);

View File

@ -22,7 +22,7 @@
void WebRtcIlbcfix_CbMemEnergyAugmentation(
int16_t *interpSamples, /* (i) The interpolated samples */
int16_t *CBmem, /* (i) The CB memory */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size, /* (i) Index to where the energy values should be stored */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts /* (o) Shift value of the energy */

View File

@ -22,7 +22,7 @@
void WebRtcIlbcfix_CbMemEnergyAugmentation(
int16_t *interpSamples, /* (i) The interpolated samples */
int16_t *CBmem, /* (i) The CB memory */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size, /* (i) Index to where the energy values should be stored */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts /* (o) Shift value of the energy */

View File

@ -28,7 +28,7 @@ void WebRtcIlbcfix_CbMemEnergyCalc(
int16_t *ppo, /* (i) input pointer 2 */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size /* (i) Index to where the energy values should be stored */
)
{

View File

@ -26,7 +26,7 @@ void WebRtcIlbcfix_CbMemEnergyCalc(
int16_t *ppo, /* (i) input pointer 2 */
int16_t *energyW16, /* (o) Energy in the CB vectors */
int16_t *energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
int16_t scale, /* (i) The scaling of all energy values */
int16_t base_size /* (i) Index to where the energy values should be stored */
);

View File

@ -46,9 +46,7 @@ void WebRtcIlbcfix_CbSearch(
int16_t block /* (i) the subblock number */
) {
int16_t i, j, stage, range;
int16_t *pp;
int16_t tmp;
int scale;
int16_t *pp, scale, tmp;
int16_t bits, temp1, temp2;
int16_t base_size;
int32_t codedEner, targetEner;

View File

@ -120,8 +120,8 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
shifts = WEBRTC_SPL_MAX(0, shifts);
/* compute cross correlation */
WebRtcSpl_CrossCorrelation(corr32, target, regressor, ENH_BLOCKL_HALF, 50,
shifts, -1);
WebRtcSpl_CrossCorrelation(corr32, target, regressor,
ENH_BLOCKL_HALF, 50, (int16_t)shifts, -1);
/* Find 3 highest correlations that should be compared for the
highest (corr*corr)/ener */
@ -206,8 +206,8 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
shifts=0;
/* compute cross correlation */
WebRtcSpl_CrossCorrelation(corr32, target, regressor, plc_blockl, 3, shifts,
1);
WebRtcSpl_CrossCorrelation(corr32, target, regressor,
plc_blockl, 3, (int16_t)shifts, 1);
/* find lag */
lag=WebRtcSpl_MaxIndexW32(corr32, 3);

View File

@ -88,10 +88,10 @@ int16_t WebRtcIlbcfix_EncoderInit(IlbcEncoderInstance* iLBCenc_inst,
}
}
int WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
const int16_t* speechIn,
int16_t len,
uint8_t* encoded) {
int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance* iLBCenc_inst,
const int16_t* speechIn,
int16_t len,
uint8_t* encoded) {
int16_t pos = 0;
int16_t encpos = 0;
@ -141,11 +141,11 @@ int16_t WebRtcIlbcfix_Decoderinit30Ms(IlbcDecoderInstance *iLBCdec_inst) {
}
int WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speechType)
int16_t WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speechType)
{
int i=0;
/* Allow for automatic switching between the frame sizes
@ -194,11 +194,11 @@ int WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst,
return(i*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
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)
{
int i=0;
if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||
@ -222,11 +222,11 @@ int WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst,
return(i*((IlbcDecoder*)iLBCdec_inst)->blockl);
}
int WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
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)
{
int i=0;
if ((len==((IlbcDecoder*)iLBCdec_inst)->no_of_bytes)||

View File

@ -23,7 +23,7 @@
* Initiation of decoder instance.
*---------------------------------------------------------------*/
int WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
int16_t WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
IlbcDecoder *iLBCdec_inst, /* (i/o) Decoder instance */
int16_t mode, /* (i) frame size mode */
int use_enhancer) { /* (i) 1: use enhancer, 0: no enhancer */

View File

@ -25,7 +25,7 @@
* Initiation of decoder instance.
*---------------------------------------------------------------*/
int WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
int16_t WebRtcIlbcfix_InitDecode( /* (o) Number of decoded samples */
IlbcDecoder *iLBCdec_inst, /* (i/o) Decoder instance */
int16_t mode, /* (i) frame size mode */
int use_enhancer /* (i) 1 to use enhancer

View File

@ -23,7 +23,7 @@
* Initiation of encoder instance.
*---------------------------------------------------------------*/
int WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
int16_t WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
IlbcEncoder *iLBCenc_inst, /* (i/o) Encoder instance */
int16_t mode) { /* (i) frame size mode */
iLBCenc_inst->mode = mode;

View File

@ -25,7 +25,7 @@
* Initiation of encoder instance.
*---------------------------------------------------------------*/
int WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
int16_t WebRtcIlbcfix_InitEncode( /* (o) Number of bytes encoded */
IlbcEncoder *iLBCenc_inst, /* (i/o) Encoder instance */
int16_t mode /* (i) frame size mode */
);

View File

@ -135,10 +135,10 @@ extern "C" {
* -1 - Error
*/
int WebRtcIlbcfix_Encode(IlbcEncoderInstance *iLBCenc_inst,
const int16_t *speechIn,
int16_t len,
uint8_t* encoded);
int16_t WebRtcIlbcfix_Encode(IlbcEncoderInstance *iLBCenc_inst,
const int16_t *speechIn,
int16_t len,
uint8_t* encoded);
/****************************************************************************
* WebRtcIlbcfix_DecoderInit(...)
@ -180,21 +180,21 @@ extern "C" {
* -1 - Error
*/
int WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speechType);
int WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speechType);
int WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst,
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 uint8_t* encoded,
int16_t len,
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);
/****************************************************************************
* WebRtcIlbcfix_DecodePlc(...)

View File

@ -29,8 +29,7 @@ void WebRtcIlbcfix_MyCorr(
const int16_t *seq2, /* (i) second sequence */
int16_t dim2 /* (i) dimension seq2 */
){
int16_t max, loops;
int scale;
int16_t max, scale, loops;
/* Calculate correlation between the two sequences. Scale the
result of the multiplcication to maximum 26 bits in order
@ -38,7 +37,7 @@ void WebRtcIlbcfix_MyCorr(
max=WebRtcSpl_MaxAbsValueW16(seq1, dim1);
scale=WebRtcSpl_GetSizeInBits(max);
scale = 2 * scale - 26;
scale = (int16_t)(2 * scale - 26);
if (scale<0) {
scale=0;
}

View File

@ -41,8 +41,7 @@ int main(int argc, char* argv[])
{
FILE *ifileid,*efileid,*ofileid, *chfileid;
short encoded_data[55], data[240], speechType;
int len;
short mode, pli;
short len, mode, pli;
int blockcount = 0;
IlbcEncoderInstance *Enc_Inst;
@ -178,7 +177,7 @@ int main(int argc, char* argv[])
/* decoding */
fprintf(stderr, "--- Decoding block %i --- ",blockcount);
if (pli==1) {
len=WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, (int16_t)len, data,
len=WebRtcIlbcfix_Decode(Dec_Inst, encoded_data, len, data,
&speechType);
if (len < 0) {
fprintf(stderr, "Error decoding\n");