<commit_before>/*
 *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef WEBRTC_VIDEO_ENGINE_OVERUSE_FRAME_DETECTOR_H_
#define WEBRTC_VIDEO_ENGINE_OVERUSE_FRAME_DETECTOR_H_

#include "webrtc/modules/interface/module.h"
#include "webrtc/system_wrappers/interface/constructor_magic.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/test/testsupport/gtest_prod_util.h"

namespace webrtc {

class Clock;
class CpuOveruseObserver;
class CriticalSectionWrapper;
class VCMExpFilter;

// Limits on standard deviation for under/overuse.
#ifdef WEBRTC_LINUX
const float kOveruseStdDevMs = 15.0f;
const float kNormalUseStdDevMs = 7.0f;
#elif WEBRTC_MAC
const float kOveruseStdDevMs = 24.0f;
const float kNormalUseStdDevMs = 14.0f;
#else
const float kOveruseStdDevMs = 17.0f;
const float kNormalUseStdDevMs = 10.0f;
#endif

// TODO(pbos): Move this somewhere appropriate.
class Statistics {
 public:
  Statistics();

  void AddSample(float sample_ms);
  void Reset();

  float Mean() const;
  float StdDev() const;
  uint64_t Count() const;

 private:
  float InitialMean() const;
  float InitialVariance() const;

  float sum_;<commit_msg>Modified overuse detection thresholds.<commit_after>/*
 *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef WEBRTC_VIDEO_ENGINE_OVERUSE_FRAME_DETECTOR_H_
#define WEBRTC_VIDEO_ENGINE_OVERUSE_FRAME_DETECTOR_H_

#include "webrtc/modules/interface/module.h"
#include "webrtc/system_wrappers/interface/constructor_magic.h"
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/test/testsupport/gtest_prod_util.h"

namespace webrtc {

class Clock;
class CpuOveruseObserver;
class CriticalSectionWrapper;
class VCMExpFilter;

// Limits on standard deviation for under/overuse.
#ifdef WEBRTC_ANDROID
const float kOveruseStdDevMs = 32.0f;
const float kNormalUseStdDevMs = 27.0f;
#elif WEBRTC_LINUX
const float kOveruseStdDevMs = 20.0f;
const float kNormalUseStdDevMs = 14.0f;
#elif WEBRTC_MAC
const float kOveruseStdDevMs = 27.0f;
const float kNormalUseStdDevMs = 21.0f;
#elif WEBRTC_WIN
const float kOveruseStdDevMs = 20.0f;
const float kNormalUseStdDevMs = 14.0f;
#else
const float kOveruseStdDevMs = 30.0f;
const float kNormalUseStdDevMs = 20.0f;
#endif

// TODO(pbos): Move this somewhere appropriate.
class Statistics {
 public:
  Statistics();

  void AddSample(float sample_ms);
  void Reset();

  float Mean() const;
  float StdDev() const;
  uint64_t Count() const;

 private:
  float InitialMean() const;
  float InitialVariance() const;

  float sum_;
{'fraction_non_alphanumeric': 0.07642725598526703, 'fraction_numerical': 0.01810926949048496, 'mean_word_length': 4.957952468007313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2549184', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1072, 'n_words': 338}