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

Side by Side Diff: webrtc/modules/video_coding/histogram.h

Issue 1715673002: Implement the NackModule as part of the new jitter buffer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment fixes. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
(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_HISTOGRAM_H_
12 #define WEBRTC_MODULES_VIDEO_CODING_HISTOGRAM_H_
13
14 #include <vector>
15
16 namespace webrtc {
17 namespace video_coding {
18 class Histogram {
19 public:
20 // A discrete histogram where every bucket with range [0, num_buckets).
21 // Values greater or equal to num_buckets will be placed in the last bucket.
22 Histogram(size_t num_buckets, size_t max_num_values);
23
24 // Add a value to the histogram. If there already is max_num_values in the
25 // histogram then the oldest value will be replaced with the new value.
26 void Add(size_t value);
27
28 // Calculates how many buckets have to be summed in order to accumulate at
29 // least the given probability.
30 size_t InverseCdf(float probability) const;
31
32 // How many values that make up this histogram.
33 size_t NumValues() const;
34
35 private:
36 // A circular buffer that holds the values that make up the histogram.
37 std::vector<size_t> values_;
38 std::vector<size_t> buckets_;
39 size_t index_;
40 };
41
42 } // namespace video_coding
43 } // namespace webrtc
44
45 #endif // WEBRTC_MODULES_VIDEO_CODING_HISTOGRAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698