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

Unified Diff: webrtc/modules/audio_processing/aec/aec_core.c

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync 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
Index: webrtc/modules/audio_processing/aec/aec_core.c
diff --git a/webrtc/modules/audio_processing/aec/aec_core.c b/webrtc/modules/audio_processing/aec/aec_core.c
index 70927074f8e66caeb1278e44a67a427d1416d704..4ddfa4a05441498a3ecd6dae5802bd699a5395b9 100644
--- a/webrtc/modules/audio_processing/aec/aec_core.c
+++ b/webrtc/modules/audio_processing/aec/aec_core.c
@@ -945,7 +945,8 @@ static void NonLinearProcessing(AecCore* aec,
float fft[PART_LEN2];
float scale, dtmp;
float nlpGainHband;
- int i, j;
+ int i;
+ size_t j;
// Coherence and non-linear filter
float cohde[PART_LEN1], cohxd[PART_LEN1];
@@ -1160,8 +1161,8 @@ static void NonLinearProcessing(AecCore* aec,
memcpy(aec->eBuf, aec->eBuf + PART_LEN, sizeof(float) * PART_LEN);
// Copy the current block to the old position for H band
- for (i = 0; i < aec->num_bands - 1; ++i) {
- memcpy(aec->dBufH[i], aec->dBufH[i] + PART_LEN, sizeof(float) * PART_LEN);
+ for (j = 0; j < aec->num_bands - 1; ++j) {
+ memcpy(aec->dBufH[j], aec->dBufH[j] + PART_LEN, sizeof(float) * PART_LEN);
}
memmove(aec->xfwBuf + PART_LEN1,
@@ -1170,7 +1171,7 @@ static void NonLinearProcessing(AecCore* aec,
}
static void ProcessBlock(AecCore* aec) {
- int i;
+ size_t i;
float y[PART_LEN], e[PART_LEN];
float scale;
@@ -1557,7 +1558,7 @@ int WebRtcAec_InitAec(AecCore* aec, int sampFreq) {
} else {
aec->normal_mu = 0.5f;
aec->normal_error_threshold = 1.5e-6f;
- aec->num_bands = sampFreq / 16000;
+ aec->num_bands = (size_t)(sampFreq / 16000);
}
WebRtc_InitBuffer(aec->nearFrBuf);
@@ -1731,11 +1732,11 @@ int WebRtcAec_MoveFarReadPtr(AecCore* aec, int elements) {
void WebRtcAec_ProcessFrames(AecCore* aec,
const float* const* nearend,
- int num_bands,
- int num_samples,
+ size_t num_bands,
+ size_t num_samples,
int knownDelay,
float* const* out) {
- int i, j;
+ size_t i, j;
int out_elements = 0;
aec->frame_count++;
« no previous file with comments | « webrtc/modules/audio_processing/aec/aec_core.h ('k') | webrtc/modules/audio_processing/aec/aec_core_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698