2013-01-29 12:09:21 +00:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-06-09 08:10:28 +00:00
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2015-08-25 13:08:04 +02:00
|
|
|
#include <deque>
|
2015-08-19 10:46:50 +02:00
|
|
|
#include <string>
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2017-07-01 16:42:22 +02:00
|
|
|
#include "webrtc/base/constructormagic.h"
|
2015-10-29 11:31:02 +01:00
|
|
|
#include "webrtc/modules/audio_coding/neteq/include/neteq.h"
|
2013-01-29 12:09:21 +00:00
|
|
|
#include "webrtc/typedefs.h"
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// Forward declarations.
|
|
|
|
|
class DecisionLogic;
|
|
|
|
|
class DelayManager;
|
|
|
|
|
|
|
|
|
|
// This class handles various network statistics in NetEq.
|
|
|
|
|
class StatisticsCalculator {
|
|
|
|
|
public:
|
|
|
|
|
StatisticsCalculator();
|
|
|
|
|
|
2015-08-25 13:08:04 +02:00
|
|
|
virtual ~StatisticsCalculator();
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Resets most of the counters.
|
|
|
|
|
void Reset();
|
|
|
|
|
|
|
|
|
|
// Resets the counters that are not handled by Reset().
|
|
|
|
|
void ResetMcu();
|
|
|
|
|
|
|
|
|
|
// Reports that |num_samples| samples were produced through expansion, and
|
|
|
|
|
// that the expansion produced other than just noise samples.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void ExpandedVoiceSamples(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Reports that |num_samples| samples were produced through expansion, and
|
|
|
|
|
// that the expansion produced only noise samples.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void ExpandedNoiseSamples(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2017-05-05 05:04:16 -07:00
|
|
|
// Corrects the statistics for number of samples produced through non-noise
|
|
|
|
|
// expansion by adding |num_samples| (negative or positive) to the current
|
|
|
|
|
// value. The result is capped to zero to avoid negative values.
|
|
|
|
|
void ExpandedVoiceSamplesCorrection(int num_samples);
|
|
|
|
|
|
|
|
|
|
// Same as ExpandedVoiceSamplesCorrection but for noise samples.
|
|
|
|
|
void ExpandedNoiseSamplesCorrection(int num_samples);
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
// Reports that |num_samples| samples were produced through preemptive
|
|
|
|
|
// expansion.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void PreemptiveExpandedSamples(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Reports that |num_samples| samples were removed through accelerate.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void AcceleratedSamples(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Reports that |num_samples| zeros were inserted into the output.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void AddZeros(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Reports that |num_packets| packets were discarded.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void PacketsDiscarded(size_t num_packets);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Reports that |num_samples| were lost.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void LostSamples(size_t num_samples);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Increases the report interval counter with |num_samples| at a sample rate
|
2015-08-19 10:46:50 +02:00
|
|
|
// of |fs_hz|. This is how the StatisticsCalculator gets notified that current
|
|
|
|
|
// time is increasing.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
void IncreaseCounter(size_t num_samples, int fs_hz);
|
2013-01-29 12:09:21 +00:00
|
|
|
|
|
|
|
|
// Stores new packet waiting time in waiting time statistics.
|
|
|
|
|
void StoreWaitingTime(int waiting_time_ms);
|
|
|
|
|
|
2015-02-17 10:17:09 +00:00
|
|
|
// Reports that |num_samples| samples were decoded from secondary packets.
|
|
|
|
|
void SecondaryDecodedSamples(int num_samples);
|
|
|
|
|
|
2015-08-18 14:58:09 +02:00
|
|
|
// Logs a delayed packet outage event of |outage_duration_ms|. A delayed
|
|
|
|
|
// packet outage event is defined as an expand period caused not by an actual
|
|
|
|
|
// packet loss, but by a delayed packet.
|
|
|
|
|
virtual void LogDelayedPacketOutageEvent(int outage_duration_ms);
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
// Returns the current network statistics in |stats|. The current sample rate
|
|
|
|
|
// is |fs_hz|, the total number of samples in packet buffer and sync buffer
|
|
|
|
|
// yet to play out is |num_samples_in_buffers|, and the number of samples per
|
|
|
|
|
// packet is |samples_per_packet|.
|
|
|
|
|
void GetNetworkStatistics(int fs_hz,
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
size_t num_samples_in_buffers,
|
|
|
|
|
size_t samples_per_packet,
|
2013-01-29 12:09:21 +00:00
|
|
|
const DelayManager& delay_manager,
|
|
|
|
|
const DecisionLogic& decision_logic,
|
|
|
|
|
NetEqNetworkStatistics *stats);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static const int kMaxReportPeriod = 60; // Seconds before auto-reset.
|
2015-08-25 13:08:04 +02:00
|
|
|
static const size_t kLenWaitingTimes = 100;
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2015-08-19 10:46:50 +02:00
|
|
|
class PeriodicUmaLogger {
|
|
|
|
|
public:
|
|
|
|
|
PeriodicUmaLogger(const std::string& uma_name,
|
|
|
|
|
int report_interval_ms,
|
|
|
|
|
int max_value);
|
|
|
|
|
virtual ~PeriodicUmaLogger();
|
|
|
|
|
void AdvanceClock(int step_ms);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void LogToUma(int value) const;
|
|
|
|
|
virtual int Metric() const = 0;
|
|
|
|
|
virtual void Reset() = 0;
|
|
|
|
|
|
|
|
|
|
const std::string uma_name_;
|
|
|
|
|
const int report_interval_ms_;
|
|
|
|
|
const int max_value_;
|
|
|
|
|
int timer_ = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PeriodicUmaCount final : public PeriodicUmaLogger {
|
|
|
|
|
public:
|
|
|
|
|
PeriodicUmaCount(const std::string& uma_name,
|
|
|
|
|
int report_interval_ms,
|
|
|
|
|
int max_value);
|
|
|
|
|
~PeriodicUmaCount() override;
|
|
|
|
|
void RegisterSample();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int Metric() const override;
|
|
|
|
|
void Reset() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int counter_ = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class PeriodicUmaAverage final : public PeriodicUmaLogger {
|
|
|
|
|
public:
|
|
|
|
|
PeriodicUmaAverage(const std::string& uma_name,
|
|
|
|
|
int report_interval_ms,
|
|
|
|
|
int max_value);
|
|
|
|
|
~PeriodicUmaAverage() override;
|
|
|
|
|
void RegisterSample(int value);
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int Metric() const override;
|
|
|
|
|
void Reset() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
double sum_ = 0.0;
|
|
|
|
|
int counter_ = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2013-01-29 12:09:21 +00:00
|
|
|
// Calculates numerator / denominator, and returns the value in Q14.
|
Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.
This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.
This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002
The change is being landed as TBR to all the folks who reviewed the above.
BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher
Review URL: https://codereview.webrtc.org/1230503003 .
Cr-Commit-Position: refs/heads/master@{#9768}
2015-08-24 14:52:23 -07:00
|
|
|
static uint16_t CalculateQ14Ratio(size_t numerator, uint32_t denominator);
|
|
|
|
|
|
|
|
|
|
size_t preemptive_samples_;
|
|
|
|
|
size_t accelerate_samples_;
|
|
|
|
|
size_t added_zero_samples_;
|
|
|
|
|
size_t expanded_speech_samples_;
|
|
|
|
|
size_t expanded_noise_samples_;
|
|
|
|
|
size_t discarded_packets_;
|
|
|
|
|
size_t lost_timestamps_;
|
2014-10-08 12:10:53 +00:00
|
|
|
uint32_t timestamps_since_last_report_;
|
2015-08-25 13:08:04 +02:00
|
|
|
std::deque<int> waiting_times_;
|
2015-02-17 10:17:09 +00:00
|
|
|
uint32_t secondary_decoded_samples_;
|
2015-08-19 10:46:50 +02:00
|
|
|
PeriodicUmaCount delayed_packet_outage_counter_;
|
|
|
|
|
PeriodicUmaAverage excess_buffer_delay_;
|
2013-01-29 12:09:21 +00:00
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(StatisticsCalculator);
|
2013-01-29 12:09:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
2014-06-09 08:10:28 +00:00
|
|
|
#endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_
|