Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: webrtc/modules/audio_coding/codecs/ilbc/do_plc.c

Issue 1230693002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/do_plc.h ('k') | webrtc/modules/audio_coding/codecs/ilbc/encode.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/codecs/ilbc/do_plc.c
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/do_plc.c b/webrtc/modules/audio_coding/codecs/ilbc/do_plc.c
index b313b58b8d4895a9185d383158813ce9dc237025..f74439ede6e481b9e347fe3ab26d4cbc8c9f3985 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/do_plc.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/do_plc.c
@@ -33,18 +33,19 @@ void WebRtcIlbcfix_DoThePlc(
0 - no PL, 1 = PL */
int16_t *decresidual, /* (i) decoded residual */
int16_t *lpc, /* (i) decoded LPC (only used for no PL) */
- int16_t inlag, /* (i) pitch lag */
+ size_t inlag, /* (i) pitch lag */
IlbcDecoder *iLBCdec_inst
/* (i/o) decoder instance */
){
- int16_t i;
+ size_t i;
int32_t cross, ener, cross_comp, ener_comp = 0;
int32_t measure, maxMeasure, energy;
int16_t max, crossSquareMax, crossSquare;
- int16_t j, lag, tmp1, tmp2, randlag;
+ size_t j, lag, randlag;
+ int16_t tmp1, tmp2;
int16_t shift1, shift2, shift3, shiftMax;
int16_t scale3;
- int16_t corrLen;
+ size_t corrLen;
int32_t tmpW32, tmp2W32;
int16_t use_gain;
int16_t tot_gain;
@@ -54,7 +55,7 @@ void WebRtcIlbcfix_DoThePlc(
int32_t nom;
int16_t denom;
int16_t pitchfact;
- int16_t use_lag;
+ size_t use_lag;
int ind;
int16_t randvec[BLOCKL_MAX];
@@ -71,7 +72,7 @@ void WebRtcIlbcfix_DoThePlc(
/* Maximum 60 samples are correlated, preserve as high accuracy
as possible without getting overflow */
max = WebRtcSpl_MaxAbsValueW16((*iLBCdec_inst).prevResidual,
- (int16_t)iLBCdec_inst->blockl);
+ iLBCdec_inst->blockl);
scale3 = (WebRtcSpl_GetSizeInBits(max)<<1) - 25;
if (scale3 < 0) {
scale3 = 0;
@@ -86,7 +87,7 @@ void WebRtcIlbcfix_DoThePlc(
lag = inlag - 3;
/* Guard against getting outside the frame */
- corrLen = WEBRTC_SPL_MIN(60, iLBCdec_inst->blockl-(inlag+3));
+ corrLen = (size_t)WEBRTC_SPL_MIN(60, iLBCdec_inst->blockl-(inlag+3));
WebRtcIlbcfix_CompCorr( &cross, &ener,
iLBCdec_inst->prevResidual, lag, iLBCdec_inst->blockl, corrLen, scale3);
@@ -234,7 +235,7 @@ void WebRtcIlbcfix_DoThePlc(
/* noise component - 52 < randlagFIX < 117 */
iLBCdec_inst->seed = (int16_t)(iLBCdec_inst->seed * 31821 + 13849);
- randlag = 53 + (int16_t)(iLBCdec_inst->seed & 63);
+ randlag = 53 + (iLBCdec_inst->seed & 63);
if (randlag > i) {
randvec[i] =
iLBCdec_inst->prevResidual[iLBCdec_inst->blockl + i - randlag];
« no previous file with comments | « webrtc/modules/audio_coding/codecs/ilbc/do_plc.h ('k') | webrtc/modules/audio_coding/codecs/ilbc/encode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698