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

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

Issue 1769113003: Revert "Revert of Implement the NackModule as part of the new jitter buffer. (patchset #19 id:36000… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Histogram DCHECK 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
« no previous file with comments | « webrtc/modules/modules.gyp ('k') | webrtc/modules/video_coding/histogram.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <cstddef>
15 #include <vector>
16
17 namespace webrtc {
18 namespace video_coding {
19 class Histogram {
20 public:
21 // A discrete histogram where every bucket with range [0, num_buckets).
22 // Values greater or equal to num_buckets will be placed in the last bucket.
23 Histogram(size_t num_buckets, size_t max_num_values);
24
25 // Add a value to the histogram. If there already is max_num_values in the
26 // histogram then the oldest value will be replaced with the new value.
27 void Add(size_t value);
28
29 // Calculates how many buckets have to be summed in order to accumulate at
30 // least the given probability.
31 size_t InverseCdf(float probability) const;
32
33 // How many values that make up this histogram.
34 size_t NumValues() const;
35
36 private:
37 // A circular buffer that holds the values that make up the histogram.
38 std::vector<size_t> values_;
39 std::vector<size_t> buckets_;
40 size_t index_;
41 };
42
43 } // namespace video_coding
44 } // namespace webrtc
45
46 #endif // WEBRTC_MODULES_VIDEO_CODING_HISTOGRAM_H_
OLDNEW
« no previous file with comments | « webrtc/modules/modules.gyp ('k') | webrtc/modules/video_coding/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698