Add number of inserted samples to NetEq statistics.

BUG=

Review URL: https://webrtc-codereview.appspot.com/964030

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3289 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
roosa@google.com
2012-12-14 00:06:18 +00:00
parent c454fab03b
commit b8ba4d8109
10 changed files with 17 additions and 4 deletions

2
DEPS
View File

@ -14,7 +14,7 @@ vars = {
# External resources like video and audio files used for testing purposes. # External resources like video and audio files used for testing purposes.
# Downloaded on demand when needed. # Downloaded on demand when needed.
"webrtc_resources_revision": "11", "webrtc_resources_revision": "12",
} }
# NOTE: Prefer revision numbers to tags for svn deps. Use http rather than # NOTE: Prefer revision numbers to tags for svn deps. Use http rather than

View File

@ -314,6 +314,8 @@ struct NetworkStatistics // NETEQ statistics
int minWaitingTimeMs; int minWaitingTimeMs;
// max packet waiting time in the jitter buffer (ms) // max packet waiting time in the jitter buffer (ms)
int maxWaitingTimeMs; int maxWaitingTimeMs;
// added samples in off mode due to packet loss
int addedSamples;
}; };
typedef struct typedef struct

View File

@ -165,6 +165,7 @@ enum ACMAMRPackingFormat {
// -medianWaitingTimeMs : median packet waiting time in the buffer // -medianWaitingTimeMs : median packet waiting time in the buffer
// -minWaitingTimeMs : min packet waiting time in the buffer // -minWaitingTimeMs : min packet waiting time in the buffer
// -maxWaitingTimeMs : max packet waiting time in the buffer // -maxWaitingTimeMs : max packet waiting time in the buffer
// -addedSamples : samples inserted because of packet loss in off mode
typedef struct { typedef struct {
WebRtc_UWord16 currentBufferSize; WebRtc_UWord16 currentBufferSize;
WebRtc_UWord16 preferredBufferSize; WebRtc_UWord16 preferredBufferSize;
@ -179,6 +180,7 @@ typedef struct {
int medianWaitingTimeMs; int medianWaitingTimeMs;
int minWaitingTimeMs; int minWaitingTimeMs;
int maxWaitingTimeMs; int maxWaitingTimeMs;
int addedSamples;
} ACMNetworkStatistics; } ACMNetworkStatistics;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////

View File

@ -366,6 +366,7 @@ WebRtc_Word32 ACMNetEQ::NetworkStatistics(
statistics->currentPreemptiveRate = stats.currentPreemptiveRate; statistics->currentPreemptiveRate = stats.currentPreemptiveRate;
statistics->preferredBufferSize = stats.preferredBufferSize; statistics->preferredBufferSize = stats.preferredBufferSize;
statistics->clockDriftPPM = stats.clockDriftPPM; statistics->clockDriftPPM = stats.clockDriftPPM;
statistics->addedSamples = stats.addedSamples;
} else { } else {
LogError("getNetworkStatistics", 0); LogError("getNetworkStatistics", 0);
return -1; return -1;

View File

@ -365,12 +365,11 @@ int WebRtcNetEQ_AddressInit(DSPInst_t *inst, const void *data2McuAddress,
int WebRtcNetEQ_ClearInCallStats(DSPInst_t *inst) int WebRtcNetEQ_ClearInCallStats(DSPInst_t *inst)
{ {
/* Reset statistics counters */ /* Reset statistics counters */
inst->statInst.accelerateLength = 0; inst->statInst.accelerateLength = 0;
inst->statInst.expandLength = 0; inst->statInst.expandLength = 0;
inst->statInst.preemptiveLength = 0; inst->statInst.preemptiveLength = 0;
inst->statInst.addedSamples = 0;
return (0); return (0);
} }
@ -394,7 +393,6 @@ int WebRtcNetEQ_ClearPostCallStats(DSPInst_t *inst)
/* Reset statistics counters */ /* Reset statistics counters */
inst->statInst.expandedVoiceSamples = 0; inst->statInst.expandedVoiceSamples = 0;
inst->statInst.expandedNoiseSamples = 0; inst->statInst.expandedNoiseSamples = 0;
return (0); return (0);
} }

View File

@ -107,6 +107,8 @@ typedef struct
* acceleration (in Q14). */ * acceleration (in Q14). */
int32_t clockDriftPPM; /* Average clock-drift in parts-per- int32_t clockDriftPPM; /* Average clock-drift in parts-per-
* million (positive or negative). */ * million (positive or negative). */
int addedSamples; /* Number of zero samples added in off
* mode */
} WebRtcNetEQ_NetworkStatistics; } WebRtcNetEQ_NetworkStatistics;
/* /*

View File

@ -28,6 +28,7 @@ typedef struct
WebRtc_UWord32 preemptiveLength; /* number of samples produced through pre-emptive WebRtc_UWord32 preemptiveLength; /* number of samples produced through pre-emptive
expand */ expand */
WebRtc_UWord32 accelerateLength; /* number of samples removed through accelerate */ WebRtc_UWord32 accelerateLength; /* number of samples removed through accelerate */
int addedSamples; /* number of samples inserted in off mode */
/* variables for post-call statistics; queried through WebRtcNetEQ_GetJitterStatistics */ /* variables for post-call statistics; queried through WebRtcNetEQ_GetJitterStatistics */
WebRtc_UWord32 expandedVoiceSamples; /* number of voice samples produced through expand */ WebRtc_UWord32 expandedVoiceSamples; /* number of voice samples produced through expand */

View File

@ -1090,6 +1090,8 @@ int WebRtcNetEQ_RecOutInternal(DSPInst_t *inst, WebRtc_Word16 *pw16_outData,
len = inst->timestampsPerCall; len = inst->timestampsPerCall;
/* ZeroStuffing... */ /* ZeroStuffing... */
WebRtcSpl_MemSetW16(pw16_NetEqAlgorithm_buffer, 0, len); WebRtcSpl_MemSetW16(pw16_NetEqAlgorithm_buffer, 0, len);
/* By not advancing the timestamp, NetEq inserts samples. */
inst->statInst.addedSamples += len;
} }
inst->ExpandInst.w16_consecExp = 0; inst->ExpandInst.w16_consecExp = 0;
break; break;

View File

@ -1171,6 +1171,8 @@ int WebRtcNetEQ_GetNetworkStatistics(void *inst, WebRtcNetEQ_NetworkStatistics *
/* Instance sanity */ /* Instance sanity */
if (NetEqMainInst == NULL) return (-1); if (NetEqMainInst == NULL) return (-1);
stats->addedSamples = NetEqMainInst->DSPinst.statInst.addedSamples;
/*******************/ /*******************/
/* Get buffer size */ /* Get buffer size */
/*******************/ /*******************/

View File

@ -49,4 +49,7 @@ TEST_F(NetEQStatsTest, ManualPrintStatisticsAfterRunningAWhile) {
network_statistics.minWaitingTimeMs); network_statistics.minWaitingTimeMs);
TEST_LOG(" maxWaitingTimeMs = %i \n", TEST_LOG(" maxWaitingTimeMs = %i \n",
network_statistics.maxWaitingTimeMs); network_statistics.maxWaitingTimeMs);
// This is only set to a non-zero value in off-mode.
EXPECT_EQ(0, network_statistics.addedSamples);
} }