| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef MODULES_AUDIO_CODING_NETEQ_HISTOGRAM_H_
- #define MODULES_AUDIO_CODING_NETEQ_HISTOGRAM_H_
- #include <string.h> // Provide access to size_t.
- #include <vector>
- #include "absl/types/optional.h"
- namespace webrtc {
- class Histogram {
- public:
-
- Histogram(size_t num_buckets,
- int forget_factor,
- absl::optional<double> start_forget_weight = absl::nullopt);
- virtual ~Histogram();
-
- virtual void Reset();
-
- virtual void Add(int index);
-
-
- virtual int Quantile(int probability);
-
- virtual int NumBuckets() const;
-
- std::vector<int> buckets() const { return buckets_; }
-
- int base_forget_factor_for_testing() const { return base_forget_factor_; }
- int forget_factor_for_testing() const { return forget_factor_; }
- absl::optional<double> start_forget_weight_for_testing() const {
- return start_forget_weight_;
- }
- private:
- std::vector<int> buckets_;
- int forget_factor_;
- const int base_forget_factor_;
- int add_count_;
- const absl::optional<double> start_forget_weight_;
- };
- }
- #endif
|