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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc

Issue 1238083005: [NOT FOR REVIEW] Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@size_t
Patch Set: Checkpoint Created 5 years, 5 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/intelligibility/intelligibility_enhancer.cc
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
index 2f5e99433a38a830cf11cb4ef8af6bfda5b32245..5d6ec24f94e0f1dd33ab35885c5cd3043088b7c6 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc
@@ -54,19 +54,19 @@ IntelligibilityEnhancer::TransformCallback::TransformCallback(
void IntelligibilityEnhancer::TransformCallback::ProcessAudioBlock(
const complex<float>* const* in_block,
- int in_channels,
+ size_t in_channels,
size_t frames,
- int /* out_channels */,
+ size_t /* out_channels */,
complex<float>* const* out_block) {
DCHECK_EQ(parent_->freqs_, frames);
- for (int i = 0; i < in_channels; ++i) {
+ for (size_t i = 0; i < in_channels; ++i) {
parent_->DispatchAudio(source_, in_block[i], out_block[i]);
}
}
IntelligibilityEnhancer::IntelligibilityEnhancer(size_t erb_resolution,
int sample_rate_hz,
- int channels,
+ size_t channels,
int cv_type,
float cv_alpha,
size_t cv_win,
@@ -117,7 +117,7 @@ IntelligibilityEnhancer::IntelligibilityEnhancer(size_t erb_resolution,
temp_out_buffer_ = static_cast<float**>(
malloc(sizeof(*temp_out_buffer_) * channels_ +
sizeof(**temp_out_buffer_) * chunk_length_ * channels_));
- for (int i = 0; i < channels_; ++i) {
+ for (size_t i = 0; i < channels_; ++i) {
temp_out_buffer_[i] =
reinterpret_cast<float*>(temp_out_buffer_ + channels_) +
chunk_length_ * i;
@@ -159,7 +159,7 @@ void IntelligibilityEnhancer::ProcessRenderAudio(float* const* audio) {
// Process and enhance chunk of |audio|
render_mangler_->ProcessChunk(audio, temp_out_buffer_);
- for (int i = 0; i < channels_; ++i) {
+ for (size_t i = 0; i < channels_; ++i) {
memcpy(audio[i], temp_out_buffer_[i],
chunk_length_ * sizeof(**temp_out_buffer_));
}

Powered by Google App Engine
This is Rietveld 408576698