| Index: webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
|
| diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
|
| index ac211e9a2c2429667a494d9fadf1deb4ca260546..190277eb66ee98c5fc1cdd17495bdf989c6f4c2a 100644
|
| --- a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
|
| +++ b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
|
| @@ -507,7 +507,7 @@ int WebRtcIsac_Encode(ISACStruct* ISAC_main_inst,
|
| int streamLenLB = 0;
|
| int streamLenUB = 0;
|
| int streamLen = 0;
|
| - int16_t k = 0;
|
| + size_t k = 0;
|
| uint8_t garbageLen = 0;
|
| int32_t bottleneck = 0;
|
| int16_t bottleneckIdx = 0;
|
| @@ -528,12 +528,12 @@ int WebRtcIsac_Encode(ISACStruct* ISAC_main_inst,
|
|
|
| if (instISAC->in_sample_rate_hz == 48000) {
|
| /* Samples in 10 ms @ 48 kHz. */
|
| - const int kNumInputSamples = FRAMESAMPLES_10ms * 3;
|
| + const size_t kNumInputSamples = FRAMESAMPLES_10ms * 3;
|
| /* Samples 10 ms @ 32 kHz. */
|
| - const int kNumOutputSamples = FRAMESAMPLES_10ms * 2;
|
| + const size_t kNumOutputSamples = FRAMESAMPLES_10ms * 2;
|
| /* Resampler divide the input into blocks of 3 samples, i.e.
|
| * kNumInputSamples / 3. */
|
| - const int kNumResamplerBlocks = FRAMESAMPLES_10ms;
|
| + const size_t kNumResamplerBlocks = FRAMESAMPLES_10ms;
|
| int32_t buffer32[FRAMESAMPLES_10ms * 3 + SIZE_RESAMPLER_STATE];
|
|
|
| /* Restore last samples from the past to the beginning of the buffer
|
| @@ -1006,7 +1006,7 @@ int16_t WebRtcIsac_DecoderInit(ISACStruct* ISAC_main_inst) {
|
| */
|
| int16_t WebRtcIsac_UpdateBwEstimate(ISACStruct* ISAC_main_inst,
|
| const uint8_t* encoded,
|
| - int32_t packet_size,
|
| + size_t packet_size,
|
| uint16_t rtp_seq_number,
|
| uint32_t send_ts,
|
| uint32_t arr_ts) {
|
| @@ -1056,7 +1056,7 @@ int16_t WebRtcIsac_UpdateBwEstimate(ISACStruct* ISAC_main_inst,
|
|
|
| static int Decode(ISACStruct* ISAC_main_inst,
|
| const uint8_t* encoded,
|
| - int16_t lenEncodedBytes,
|
| + size_t lenEncodedBytes,
|
| int16_t* decoded,
|
| int16_t* speechType,
|
| int16_t isRCUPayload) {
|
| @@ -1069,13 +1069,14 @@ static int Decode(ISACStruct* ISAC_main_inst,
|
| float outFrame[MAX_FRAMESAMPLES];
|
| int16_t outFrameLB[MAX_FRAMESAMPLES];
|
| int16_t outFrameUB[MAX_FRAMESAMPLES];
|
| - int numDecodedBytesLB;
|
| + int numDecodedBytesLBint;
|
| + size_t numDecodedBytesLB;
|
| int numDecodedBytesUB;
|
| - int16_t lenEncodedLBBytes;
|
| + size_t lenEncodedLBBytes;
|
| int16_t validChecksum = 1;
|
| int16_t k;
|
| uint16_t numLayer;
|
| - int16_t totSizeBytes;
|
| + size_t totSizeBytes;
|
| int16_t err;
|
|
|
| ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
|
| @@ -1089,7 +1090,7 @@ static int Decode(ISACStruct* ISAC_main_inst,
|
| return -1;
|
| }
|
|
|
| - if (lenEncodedBytes <= 0) {
|
| + if (lenEncodedBytes == 0) {
|
| /* return error code if the packet length is null. */
|
| instISAC->errorCode = ISAC_EMPTY_PACKET;
|
| return -1;
|
| @@ -1115,11 +1116,12 @@ static int Decode(ISACStruct* ISAC_main_inst,
|
| /* Regardless of that the current codec is setup to work in
|
| * wideband or super-wideband, the decoding of the lower-band
|
| * has to be performed. */
|
| - numDecodedBytesLB = WebRtcIsac_DecodeLb(&instISAC->transform_tables,
|
| - outFrame, decInstLB,
|
| - &numSamplesLB, isRCUPayload);
|
| -
|
| - if ((numDecodedBytesLB < 0) || (numDecodedBytesLB > lenEncodedLBBytes) ||
|
| + numDecodedBytesLBint = WebRtcIsac_DecodeLb(&instISAC->transform_tables,
|
| + outFrame, decInstLB,
|
| + &numSamplesLB, isRCUPayload);
|
| + numDecodedBytesLB = (size_t)numDecodedBytesLBint;
|
| + if ((numDecodedBytesLBint < 0) ||
|
| + (numDecodedBytesLB > lenEncodedLBBytes) ||
|
| (numSamplesLB > MAX_FRAMESAMPLES)) {
|
| instISAC->errorCode = ISAC_LENGTH_MISMATCH;
|
| return -1;
|
| @@ -1362,7 +1364,7 @@ static int Decode(ISACStruct* ISAC_main_inst,
|
|
|
| int WebRtcIsac_Decode(ISACStruct* ISAC_main_inst,
|
| const uint8_t* encoded,
|
| - int16_t lenEncodedBytes,
|
| + size_t lenEncodedBytes,
|
| int16_t* decoded,
|
| int16_t* speechType) {
|
| int16_t isRCUPayload = 0;
|
| @@ -1394,7 +1396,7 @@ int WebRtcIsac_Decode(ISACStruct* ISAC_main_inst,
|
|
|
| int WebRtcIsac_DecodeRcu(ISACStruct* ISAC_main_inst,
|
| const uint8_t* encoded,
|
| - int16_t lenEncodedBytes,
|
| + size_t lenEncodedBytes,
|
| int16_t* decoded,
|
| int16_t* speechType) {
|
| int16_t isRCUPayload = 1;
|
| @@ -1417,13 +1419,12 @@ int WebRtcIsac_DecodeRcu(ISACStruct* ISAC_main_inst,
|
| * Output:
|
| * - decoded : The decoded vector
|
| *
|
| - * Return value : >0 - number of samples in decoded PLC vector
|
| - * -1 - Error
|
| + * Return value : Number of samples in decoded PLC vector
|
| */
|
| -int16_t WebRtcIsac_DecodePlc(ISACStruct* ISAC_main_inst,
|
| - int16_t* decoded,
|
| - int16_t noOfLostFrames) {
|
| - int16_t numSamples = 0;
|
| +size_t WebRtcIsac_DecodePlc(ISACStruct* ISAC_main_inst,
|
| + int16_t* decoded,
|
| + size_t noOfLostFrames) {
|
| + size_t numSamples = 0;
|
| ISACMainStruct* instISAC = (ISACMainStruct*)ISAC_main_inst;
|
|
|
| /* Limit number of frames to two = 60 millisecond.
|
|
|