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

Unified Diff: webrtc/modules/video_coding/codec_timer.h

Issue 1742323002: VCMCodecTimer: Change filter from max to 95th percentile (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix off-by-one bug Created 4 years, 10 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/video_coding/codec_timer.h
diff --git a/webrtc/modules/video_coding/codec_timer.h b/webrtc/modules/video_coding/codec_timer.h
index 8ebd82ab9c240f38070f6ef23ec5fa0ae81ccec4..7f92a9d0fb71e5025a2e2a567c6052cc78737f42 100644
--- a/webrtc/modules/video_coding/codec_timer.h
+++ b/webrtc/modules/video_coding/codec_timer.h
@@ -11,45 +11,41 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_CODEC_TIMER_H_
#define WEBRTC_MODULES_VIDEO_CODING_CODEC_TIMER_H_
+#include <queue>
+
#include "webrtc/modules/include/module_common_types.h"
+#include "webrtc/modules/video_coding/percentile_filter.h"
#include "webrtc/typedefs.h"
namespace webrtc {
-// MAX_HISTORY_SIZE * SHORT_FILTER_MS defines the window size in milliseconds
-#define MAX_HISTORY_SIZE 10
-#define SHORT_FILTER_MS 1000
-
-class VCMShortMaxSample {
- public:
- VCMShortMaxSample() : shortMax(0), timeMs(-1) {}
-
- int32_t shortMax;
- int64_t timeMs;
-};
-
class VCMCodecTimer {
public:
VCMCodecTimer();
// Updates the max filtered decode time.
- void MaxFilter(int32_t newDecodeTimeMs, int64_t nowMs);
+ void MaxFilter(int32_t new_decode_time_ms, int64_t now_ms);
philipel 2016/03/03 13:34:31 Is MaxFilter still the correct term to use now? Ma
philipel 2016/03/03 13:34:31 Always use int64_t when storing time intervals or
magjed_webrtc 2016/03/04 14:19:41 Done.
magjed_webrtc 2016/03/04 14:19:41 MaxFilter is a strange name indeed, even before my
- // Empty the list of timers.
+ // Restore to the ctor state.
void Reset();
// Get the required decode time in ms.
int32_t RequiredDecodeTimeMs(FrameType frameType) const;
magjed_webrtc 2016/03/04 14:19:41 Since I'm changing the interface now, I took the o
philipel 2016/03/04 15:20:13 Good.
private:
- void UpdateMaxHistory(int32_t decodeTime, int64_t now);
- void ProcessHistory(int64_t nowMs);
+ struct Sample {
+ Sample(int32_t decode_time_ms, int64_t sample_time_ms);
+ int32_t decode_time_ms;
philipel 2016/03/03 13:34:31 int64_t decode_time_ms;
magjed_webrtc 2016/03/04 14:19:41 Done.
+ int64_t sample_time_ms;
+ };
- int32_t _filteredMax;
// The number of samples ignored so far.
- int32_t _ignoredSampleCount;
- int32_t _shortMax;
- VCMShortMaxSample _history[MAX_HISTORY_SIZE];
+ int32_t ignoredSampleCount_;
philipel 2016/03/03 13:34:31 Change int32_t to int.
magjed_webrtc 2016/03/04 14:19:41 Done.
+ // Queue with history of latest decode time values.
+ std::queue<Sample> history_;
+ // |filter_| contains the same values as |history_|, but in a data structure
+ // that allows efficient retrieval of the percentile value.
+ PercentileFilter filter_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698