Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_DISTRIBUTION_H_ | |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_DISTRIBUTION_H_ | |
| 13 | |
| 14 #include <vector> | |
| 15 | |
| 16 namespace webrtc { | |
| 17 class Distribution { | |
|
stefan-webrtc
2016/03/01 08:52:10
Prefer calling this Histogram. To me, a distributi
philipel
2016/03/01 10:27:06
Done.
| |
| 18 public: | |
| 19 Distribution(int num_buckets, int max_num_values); | |
| 20 | |
| 21 // Add a value to the distribution. If there already is | |
| 22 // max_num_values in the distribution then the oldest | |
| 23 // value will also be removed. | |
| 24 void AddValue(int value); | |
|
stefan-webrtc
2016/03/01 08:52:10
Maybe just Add(int value)?
philipel
2016/03/01 10:27:06
Done.
| |
| 25 | |
| 26 // Calculates how many buckets have to be summed in | |
| 27 // order to accumulate at least the given probability. | |
| 28 size_t InverseCDF(float probability) const; | |
| 29 | |
| 30 // How many values that makes up this distribution. | |
|
stefan-webrtc
2016/03/01 08:52:10
make up
philipel
2016/03/01 10:27:06
Done.
| |
| 31 size_t NumValues() const; | |
| 32 | |
| 33 private: | |
| 34 std::vector<int> values_; | |
|
stefan-webrtc
2016/03/01 08:52:10
Comment on that this is a circular buffer of value
philipel
2016/03/01 10:27:06
Done.
| |
| 35 std::vector<int> buckets_; | |
| 36 size_t index_; | |
| 37 }; | |
| 38 | |
| 39 } // namespace webrtc | |
| 40 | |
| 41 #endif // WEBRTC_MODULES_VIDEO_CODING_DISTRIBUTION_H_ | |
| OLD | NEW |