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

Unified Diff: webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h

Issue 1227213002: Update audio code to use size_t more correctly, webrtc/modules/audio_processing/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: 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_utils.h
diff --git a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
index 075b8ad46bea1823fb78a9376001c3bb06bd20bf..dd991e45d8f0a81f6a9f940fc3595fec03a92cf0 100644
--- a/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
+++ b/webrtc/modules/audio_processing/intelligibility/intelligibility_utils.h
@@ -51,7 +51,7 @@ class VarianceArray {
// |window_size| is the number of samples for kStepWindowed and
// the number of blocks for kStepBlocked. |decay| is the forgetting factor
// for kStepDecaying.
- VarianceArray(int freqs, StepType type, int window_size, float decay);
+ VarianceArray(size_t freqs, StepType type, size_t window_size, float decay);
// Add a new data point to the series and compute the new variances.
// TODO(bercic) |skip_fudge| is a flag for kStepWindowed and kStepDecaying,
@@ -99,11 +99,11 @@ class VarianceArray {
rtc::scoped_ptr<float[]> variance_;
rtc::scoped_ptr<float[]> conj_sum_;
- const int freqs_;
- const int window_size_;
+ const size_t freqs_;
+ const size_t window_size_;
const float decay_;
- int history_cursor_;
- int count_;
+ size_t history_cursor_;
+ size_t count_;
float array_mean_;
void (VarianceArray::*step_func_)(const std::complex<float>*, bool);
};
@@ -113,7 +113,7 @@ class VarianceArray {
// constrained by a limit on the magnitude of the changes.
class GainApplier {
public:
- GainApplier(int freqs, float change_limit);
+ GainApplier(size_t freqs, float change_limit);
// Copy |in_block| to |out_block|, multiplied by the current set of gains,
// and step the current set of gains towards the target set.
@@ -124,7 +124,7 @@ class GainApplier {
float* target() const { return target_.get(); }
private:
- const int freqs_;
+ const size_t freqs_;
const float change_limit_;
rtc::scoped_ptr<float[]> target_;
rtc::scoped_ptr<float[]> current_;

Powered by Google App Engine
This is Rietveld 408576698