Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t. This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects. This was be reviewed and approved in pieces: https://codereview.webrtc.org/1224093003 https://codereview.webrtc.org/1224123002 https://codereview.webrtc.org/1224163002 https://codereview.webrtc.org/1225133003 https://codereview.webrtc.org/1225173002 https://codereview.webrtc.org/1227163003 https://codereview.webrtc.org/1227203003 https://codereview.webrtc.org/1227213002 https://codereview.webrtc.org/1227893002 https://codereview.webrtc.org/1228793004 https://codereview.webrtc.org/1228803003 https://codereview.webrtc.org/1228823002 https://codereview.webrtc.org/1228823003 https://codereview.webrtc.org/1228843002 https://codereview.webrtc.org/1230693002 https://codereview.webrtc.org/1231713002 The change is being landed as TBR to all the folks who reviewed the above. BUG=chromium:81439 TEST=none R=andrew@webrtc.org, pbos@webrtc.org TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher Review URL: https://codereview.webrtc.org/1230503003 . Cr-Commit-Position: refs/heads/master@{#9768}
This commit is contained in:
@ -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];
|
||||
|
||||
Reference in New Issue
Block a user