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

Unified Diff: webrtc/modules/audio_coding/neteq/expand.cc

Issue 1290113002: NetEq: Implement logging of Delayed Packet Outage Events (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.h ('k') | webrtc/modules/audio_coding/neteq/expand_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/expand.cc
diff --git a/webrtc/modules/audio_coding/neteq/expand.cc b/webrtc/modules/audio_coding/neteq/expand.cc
index ae12e504616844cc62515bd2a72ce62b6c75723b..d0d0024ba6d1776914b8c14679177fd1b6973e59 100644
--- a/webrtc/modules/audio_coding/neteq/expand.cc
+++ b/webrtc/modules/audio_coding/neteq/expand.cc
@@ -20,6 +20,7 @@
#include "webrtc/modules/audio_coding/neteq/background_noise.h"
#include "webrtc/modules/audio_coding/neteq/dsp_helper.h"
#include "webrtc/modules/audio_coding/neteq/random_vector.h"
+#include "webrtc/modules/audio_coding/neteq/statistics_calculator.h"
#include "webrtc/modules/audio_coding/neteq/sync_buffer.h"
namespace webrtc {
@@ -27,6 +28,7 @@ namespace webrtc {
Expand::Expand(BackgroundNoise* background_noise,
SyncBuffer* sync_buffer,
RandomVector* random_vector,
+ StatisticsCalculator* statistics,
int fs,
size_t num_channels)
: random_vector_(random_vector),
@@ -36,6 +38,7 @@ Expand::Expand(BackgroundNoise* background_noise,
num_channels_(num_channels),
consecutive_expands_(0),
background_noise_(background_noise),
+ statistics_(statistics),
ivoc 2015/08/14 13:00:03 Shouldn't expand_duration_samples_ get an initial
hlundin-webrtc 2015/08/17 12:07:28 Done.
overlap_length_(5 * fs / 8000),
lag_index_direction_(0),
current_lag_index_(0),
@@ -78,6 +81,7 @@ int Expand::Process(AudioMultiVector* output) {
// Perform initial setup if this is the first expansion since last reset.
AnalyzeSignal(random_vector);
first_expand_ = false;
+ expand_duration_samples_ = 0;
} else {
// This is not the first expansion, parameters are already estimated.
// Extract a noise segment.
@@ -298,6 +302,9 @@ int Expand::Process(AudioMultiVector* output) {
// Increase call number and cap it.
consecutive_expands_ = consecutive_expands_ >= kMaxConsecutiveExpands ?
kMaxConsecutiveExpands : consecutive_expands_ + 1;
+ expand_duration_samples_ += output->Size();
+ // Clamp the duration counter at 2 seconds.
+ expand_duration_samples_ = std::min(expand_duration_samples_, fs_hz_ * 2);
return 0;
}
@@ -305,6 +312,8 @@ void Expand::SetParametersForNormalAfterExpand() {
current_lag_index_ = 0;
lag_index_direction_ = 0;
stop_muting_ = true; // Do not mute signal any more.
+ statistics_->LogDelayedPacketOutageEvent(expand_duration_samples_ /
+ (fs_hz_ / 1000));
}
void Expand::SetParametersForMergeAfterExpand() {
@@ -833,10 +842,11 @@ void Expand::UpdateLagIndex() {
Expand* ExpandFactory::Create(BackgroundNoise* background_noise,
SyncBuffer* sync_buffer,
RandomVector* random_vector,
+ StatisticsCalculator* statistics,
int fs,
size_t num_channels) const {
- return new Expand(background_noise, sync_buffer, random_vector, fs,
- num_channels);
+ return new Expand(background_noise, sync_buffer, random_vector, statistics,
+ fs, num_channels);
}
// TODO(turajs): This can be moved to BackgroundNoise class.
« no previous file with comments | « webrtc/modules/audio_coding/neteq/expand.h ('k') | webrtc/modules/audio_coding/neteq/expand_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698