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

Unified Diff: webrtc/modules/audio_coding/neteq/accelerate.cc

Issue 1228843002: 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
Index: webrtc/modules/audio_coding/neteq/accelerate.cc
diff --git a/webrtc/modules/audio_coding/neteq/accelerate.cc b/webrtc/modules/audio_coding/neteq/accelerate.cc
index ad7423810dfcc1f21c1e55da7238129f817a5dcc..1c36fa8c612a225cbe16e0a1a06bb84be98d744d 100644
--- a/webrtc/modules/audio_coding/neteq/accelerate.cc
+++ b/webrtc/modules/audio_coding/neteq/accelerate.cc
@@ -18,11 +18,11 @@ Accelerate::ReturnCodes Accelerate::Process(const int16_t* input,
size_t input_length,
bool fast_accelerate,
AudioMultiVector* output,
- int16_t* length_change_samples) {
+ size_t* length_change_samples) {
// Input length must be (almost) 30 ms.
- static const int k15ms = 120; // 15 ms = 120 samples at 8 kHz sample rate.
- if (num_channels_ == 0 || static_cast<int>(input_length) / num_channels_ <
- (2 * k15ms - 1) * fs_mult_) {
+ static const size_t k15ms = 120; // 15 ms = 120 samples at 8 kHz sample rate.
+ if (num_channels_ == 0 ||
+ input_length / num_channels_ < (2 * k15ms - 1) * fs_mult_) {
// Length of input data too short to do accelerate. Simply move all data
// from input to output.
output->PushBackInterleaved(input, input_length);
@@ -34,7 +34,7 @@ Accelerate::ReturnCodes Accelerate::Process(const int16_t* input,
void Accelerate::SetParametersForPassiveSpeech(size_t /*len*/,
int16_t* best_correlation,
- int* /*peak_index*/) const {
+ size_t* /*peak_index*/) const {
// When the signal does not contain any active speech, the correlation does
// not matter. Simply set it to zero.
*best_correlation = 0;
« no previous file with comments | « webrtc/modules/audio_coding/neteq/accelerate.h ('k') | webrtc/modules/audio_coding/neteq/audio_decoder_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698