Add minimum waiting time to NetEQ metrics

Adding minWaitingTimeMs to ACMNetworkStatistics and to
NetworkStatistics. Also adding unittest.

TEST=audio_coding_unittests

Review URL: http://webrtc-codereview.appspot.com/350006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1408 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org 2012-01-12 14:16:44 +00:00
parent 40ea5106f6
commit 053c7991e3
6 changed files with 11 additions and 0 deletions

View File

@ -271,6 +271,8 @@ struct NetworkStatistics // NETEQ statistics
int meanWaitingTimeMs;
// median packet waiting time in the jitter buffer (ms)
int medianWaitingTimeMs;
// min packet waiting time in the jitter buffer (ms)
int minWaitingTimeMs;
// max packet waiting time in the jitter buffer (ms)
int maxWaitingTimeMs;
};

View File

@ -160,6 +160,7 @@ enum ACMAMRPackingFormat {
// rate is higher than sender sample rate.
// -meanWaitingTimeMs : average packet waiting time in the buffer
// -medianWaitingTimeMs : median packet waiting time in the buffer
// -minWaitingTimeMs : min packet waiting time in the buffer
// -maxWaitingTimeMs : max packet waiting time in the buffer
typedef struct {
WebRtc_UWord16 currentBufferSize;
@ -173,6 +174,7 @@ typedef struct {
int32_t clockDriftPPM;
int meanWaitingTimeMs;
int medianWaitingTimeMs;
int minWaitingTimeMs;
int maxWaitingTimeMs;
} ACMNetworkStatistics;

View File

@ -486,6 +486,7 @@ ACMNetEQ::NetworkStatistics(
{
statistics->meanWaitingTimeMs = -1;
statistics->medianWaitingTimeMs = -1;
statistics->minWaitingTimeMs = -1;
statistics->maxWaitingTimeMs = -1;
}
else
@ -500,6 +501,7 @@ ACMNetEQ::NetworkStatistics(
{
statistics->medianWaitingTimeMs = waiting_times_vec[size / 2];
}
statistics->minWaitingTimeMs = waiting_times_vec.front();
statistics->maxWaitingTimeMs = waiting_times_vec.back();
double sum = 0;
for (size_t i = 0; i < size; ++i) {

View File

@ -113,6 +113,7 @@ TEST_F(AcmNetEqTest, NetworkStatistics) {
EXPECT_EQ(0, stats.currentAccelerateRate);
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
EXPECT_EQ(300, stats.maxWaitingTimeMs);
EXPECT_EQ(10, stats.minWaitingTimeMs);
EXPECT_EQ(159, stats.meanWaitingTimeMs);
EXPECT_EQ(160, stats.medianWaitingTimeMs);
}
@ -137,6 +138,7 @@ TEST_F(AcmNetEqTest, TestZeroLengthWaitingTimesVector) {
EXPECT_EQ(0, stats.currentPreemptiveRate);
EXPECT_EQ(0, stats.currentAccelerateRate);
EXPECT_EQ(-916, stats.clockDriftPPM); // Initial value is slightly off.
EXPECT_EQ(-1, stats.minWaitingTimeMs);
EXPECT_EQ(-1, stats.maxWaitingTimeMs);
EXPECT_EQ(-1, stats.meanWaitingTimeMs);
EXPECT_EQ(-1, stats.medianWaitingTimeMs);

View File

@ -987,6 +987,7 @@ APITest::TestDelay(char side)
fprintf(stdout, "Clock-drift............. %d\n", networkStat.clockDriftPPM);
fprintf(stdout, "Mean waiting time....... %d\n", networkStat.meanWaitingTimeMs);
fprintf(stdout, "Median waiting time..... %d\n", networkStat.medianWaitingTimeMs);
fprintf(stdout, "Min waiting time........ %d\n", networkStat.minWaitingTimeMs);
fprintf(stdout, "Max waiting time........ %d\n", networkStat.maxWaitingTimeMs);
}

View File

@ -2593,6 +2593,8 @@ TEST_MUSTPASS(voe_codec_->SetSendCodec(0, ci));
nStats.meanWaitingTimeMs);
TEST_LOG(" medianWaitingTimeMs = %i \n",
nStats.medianWaitingTimeMs);
TEST_LOG(" minWaitingTimeMs = %i \n",
nStats.minWaitingTimeMs);
TEST_LOG(" maxWaitingTimeMs = %i \n",
nStats.maxWaitingTimeMs);
#else