From df10de4b277970d0daf9d319dd1dd91843937fbf Mon Sep 17 00:00:00 2001 From: "henrik.lundin@webrtc.org" Date: Wed, 23 Nov 2011 09:36:23 +0000 Subject: [PATCH] Removing statistics API from NetEQ Removing WebRtcNetEQ_GetJitterStatistics(), WebRtcNetEQ_ResetJitterStatistics(), and the associated struct WebRtcNetEQ_JitterStatistics. The change ripples through all the way to the VoiceEngine API. Review URL: http://webrtc-codereview.appspot.com/285002 git-svn-id: http://webrtc.googlecode.com/svn/trunk@998 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/common_types.h | 52 ------------- .../main/interface/audio_coding_module.h | 24 ------ .../interface/audio_coding_module_typedefs.h | 62 ---------------- .../audio_coding/main/source/acm_neteq.cc | 60 --------------- .../audio_coding/main/source/acm_neteq.h | 22 ------ .../main/source/audio_coding_module_impl.cc | 17 ----- .../main/source/audio_coding_module_impl.h | 5 -- .../audio_coding/main/test/APITest.cpp | 27 ------- .../neteq/interface/webrtc_neteq_internal.h | 44 ----------- .../audio_coding/neteq/test/NetEqRTPplay.cc | 13 +--- src/modules/audio_coding/neteq/webrtc_neteq.c | 73 ------------------- .../main/interface/voe_neteq_stats.h | 8 -- src/voice_engine/main/source/channel.cc | 17 ----- src/voice_engine/main/source/channel.h | 2 - .../main/source/voe_neteq_stats_impl.cc | 51 ------------- .../main/source/voe_neteq_stats_impl.h | 5 -- .../main/test/auto_test/voe_standard_test.cc | 50 ------------- 17 files changed, 1 insertion(+), 531 deletions(-) diff --git a/src/common_types.h b/src/common_types.h index a3c12d9a0..e59b98594 100644 --- a/src/common_types.h +++ b/src/common_types.h @@ -265,58 +265,6 @@ struct NetworkStatistics // NETEQ statistics WebRtc_UWord16 currentAccelerateRate; }; -struct JitterStatistics -{ - // smallest Jitter Buffer size during call in ms - WebRtc_UWord32 jbMinSize; - // largest Jitter Buffer size during call in ms - WebRtc_UWord32 jbMaxSize; - // the average JB size, measured over time - ms - WebRtc_UWord32 jbAvgSize; - // number of times the Jitter Buffer changed (using Accelerate or - // Pre-emptive Expand) - WebRtc_UWord32 jbChangeCount; - // amount (in ms) of audio data received late - WebRtc_UWord32 lateLossMs; - // milliseconds removed to reduce jitter buffer size - WebRtc_UWord32 accelerateMs; - // milliseconds discarded through buffer flushing - WebRtc_UWord32 flushedMs; - // milliseconds of generated silence - WebRtc_UWord32 generatedSilentMs; - // milliseconds of synthetic audio data (non-background noise) - WebRtc_UWord32 interpolatedVoiceMs; - // milliseconds of synthetic audio data (background noise level) - WebRtc_UWord32 interpolatedSilentMs; - // count of tiny expansions in output audio - WebRtc_UWord32 countExpandMoreThan120ms; - // count of small expansions in output audio - WebRtc_UWord32 countExpandMoreThan250ms; - // count of medium expansions in output audio - WebRtc_UWord32 countExpandMoreThan500ms; - // count of long expansions in output audio - WebRtc_UWord32 countExpandMoreThan2000ms; - // duration of longest audio drop-out - WebRtc_UWord32 longestExpandDurationMs; - // count of times we got small network outage (inter-arrival time in - // [500, 1000) ms) - WebRtc_UWord32 countIAT500ms; - // count of times we got medium network outage (inter-arrival time in - // [1000, 2000) ms) - WebRtc_UWord32 countIAT1000ms; - // count of times we got large network outage (inter-arrival time >= - // 2000 ms) - WebRtc_UWord32 countIAT2000ms; - // longest packet inter-arrival time in ms - WebRtc_UWord32 longestIATms; - // min time incoming Packet "waited" to be played - WebRtc_UWord32 minPacketDelayMs; - // max time incoming Packet "waited" to be played - WebRtc_UWord32 maxPacketDelayMs; - // avg time incoming Packet "waited" to be played - WebRtc_UWord32 avgPacketDelayMs; -}; - typedef struct { int min; // minumum diff --git a/src/modules/audio_coding/main/interface/audio_coding_module.h b/src/modules/audio_coding/main/interface/audio_coding_module.h index 73bddd186..933259589 100644 --- a/src/modules/audio_coding/main/interface/audio_coding_module.h +++ b/src/modules/audio_coding/main/interface/audio_coding_module.h @@ -914,20 +914,6 @@ class AudioCodingModule: public Module { virtual WebRtc_Word32 NetworkStatistics( ACMNetworkStatistics& networkStatistics) const = 0; - /////////////////////////////////////////////////////////////////////////// - // WebRtc_Word32 JitterStatistics() - // Get the jitter statistics. - // - // Input: - // -jitterStatistics : the given jitter statistics. - // - // Return value: - // -1 if failed to set the jitter statistics, - // 0 if jitter statistics are set successfully. - // - virtual WebRtc_Word32 JitterStatistics( - ACMJitterStatistics& jitterStatistics) const = 0; - /////////////////////////////////////////////////////////////////////////// // WebRtc_Word32 PreferredBufferSize() // Get the optimal buffer size calculated for the current network @@ -943,16 +929,6 @@ class AudioCodingModule: public Module { // virtual WebRtc_Word32 PreferredBufferSize( WebRtc_UWord16& prefBufSize) const = 0; - - /////////////////////////////////////////////////////////////////////////// - // WebRtc_Word32 ResetJitterStatistics() - // Reset jitter statistics. - // - // Return value: - // -1 if failed to reset the statistics, - // 0 if succeeded. - // - virtual WebRtc_Word32 ResetJitterStatistics() const = 0; }; } // namespace webrtc diff --git a/src/modules/audio_coding/main/interface/audio_coding_module_typedefs.h b/src/modules/audio_coding/main/interface/audio_coding_module_typedefs.h index d66fdc9e4..a501deaf8 100644 --- a/src/modules/audio_coding/main/interface/audio_coding_module_typedefs.h +++ b/src/modules/audio_coding/main/interface/audio_coding_module_typedefs.h @@ -163,68 +163,6 @@ typedef struct { WebRtc_UWord16 currentAccelerateRate; } ACMNetworkStatistics; -/////////////////////////////////////////////////////////////////////////// -// -// Struct containing jitter statistics -// -// -jbMinSize : smallest Jitter Buffer size during call in ms -// -jbMaxSize : largest Jitter Buffer size during call in ms -// -jbAvgSize : the average JB size, measured over time - ms -// -jbChangeCount : number of times the Jitter Buffer changed (using -// Accelerate or Pre-emptive Expand) -// -lateLossMs : amount (in ms) of audio data received late -// -accelerateMs : milliseconds removed to reduce jitter buffer size -// -flushedMs : milliseconds discarded through buffer flushing -// -generatedSilentMs : milliseconds of generated silence -// -interpolatedVoiceMs : milliseconds of synthetic audio data -// (non-background noise) -// -interpolatedSilentMs : milliseconds of synthetic audio data (background -// noise level) -// -numExpandTiny : count of tiny expansions in output audio less -// than 250 ms -// -numExpandSmall : count of small expansions in output audio 250 to -// 500 ms -// -numExpandMedium : count of medium expansions in output audio 500 to -// 2000 ms -// -numExpandLong : count of long expansions in output audio longer -// than 2000 -// -longestExpandDurationMs : duration of longest audio drop-out -// -countIAT500ms : count of times we got small network outage -// (inter-arrival time in [500, 1000) ms) -// -countIAT1000ms : count of times we got medium network outage -// (inter-arrival time in [1000, 2000) ms) -// -countIAT2000ms : count of times we got large network outage -// (inter-arrival time >= 2000 ms) -// -longestIATms : longest packet inter-arrival time in ms -// -minPacketDelayMs : min time incoming Packet "waited" to be played -// -maxPacketDelayMs : max time incoming Packet "waited" to be played -// -avgPacketDelayMs : avg time incoming Packet "waited" to be played -// -typedef struct { - WebRtc_UWord32 jbMinSize; - WebRtc_UWord32 jbMaxSize; - WebRtc_UWord32 jbAvgSize; - WebRtc_UWord32 jbChangeCount; - WebRtc_UWord32 lateLossMs; - WebRtc_UWord32 accelerateMs; - WebRtc_UWord32 flushedMs; - WebRtc_UWord32 generatedSilentMs; - WebRtc_UWord32 interpolatedVoiceMs; - WebRtc_UWord32 interpolatedSilentMs; - WebRtc_UWord32 numExpandTiny; - WebRtc_UWord32 numExpandSmall; - WebRtc_UWord32 numExpandMedium; - WebRtc_UWord32 numExpandLong; - WebRtc_UWord32 longestExpandDurationMs; - WebRtc_UWord32 countIAT500ms; - WebRtc_UWord32 countIAT1000ms; - WebRtc_UWord32 countIAT2000ms; - WebRtc_UWord32 longestIATms; - WebRtc_UWord32 minPacketDelayMs; - WebRtc_UWord32 maxPacketDelayMs; - WebRtc_UWord32 avgPacketDelayMs; -} ACMJitterStatistics; - /////////////////////////////////////////////////////////////////////////// // // Enumeration of background noise mode a mapping from NetEQ interface. diff --git a/src/modules/audio_coding/main/source/acm_neteq.cc b/src/modules/audio_coding/main/source/acm_neteq.cc index 18d9032d5..c50a64e55 100644 --- a/src/modules/audio_coding/main/source/acm_neteq.cc +++ b/src/modules/audio_coding/main/source/acm_neteq.cc @@ -469,51 +469,6 @@ ACMNetEQ::NetworkStatistics( } -WebRtc_Word32 -ACMNetEQ::JitterStatistics( - ACMJitterStatistics* jitterStatistics) const -{ - WebRtcNetEQ_JitterStatistics stats; - CriticalSectionScoped lock(*_netEqCritSect); - if(!_isInitialized[0]) - { - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id, - "JitterStatistics: NetEq is not initialized."); - return -1; - } - if(WebRtcNetEQ_GetJitterStatistics(_inst[0], &stats) == 0) - { - jitterStatistics->accelerateMs = stats.accelerateMs; - jitterStatistics->avgPacketDelayMs = stats.avgPacketDelayMs; - jitterStatistics->numExpandTiny = stats.countExpandMoreThan120ms; - jitterStatistics->numExpandLong = stats.countExpandMoreThan2000ms; - jitterStatistics->numExpandSmall = stats.countExpandMoreThan250ms; - jitterStatistics->numExpandMedium = stats.countExpandMoreThan500ms; - jitterStatistics->countIAT1000ms = stats.countIAT1000ms; - jitterStatistics->countIAT2000ms = stats.countIAT2000ms; - jitterStatistics->countIAT500ms = stats.countIAT500ms; - jitterStatistics->flushedMs = stats.flushedMs; - jitterStatistics->generatedSilentMs = stats.generatedSilentMs; - jitterStatistics->interpolatedSilentMs = stats.interpolatedSilentMs; - jitterStatistics->interpolatedVoiceMs = stats.interpolatedVoiceMs; - jitterStatistics->jbAvgSize = stats.jbAvgSize; - jitterStatistics->jbChangeCount = stats.jbChangeCount; - jitterStatistics->jbMaxSize = stats.jbMaxSize; - jitterStatistics->jbMinSize = stats.jbMinSize; - jitterStatistics->lateLossMs = stats.lateLossMs; - jitterStatistics->longestExpandDurationMs = stats.longestExpandDurationMs; - jitterStatistics->longestIATms = stats.longestIATms; - jitterStatistics->maxPacketDelayMs = stats.maxPacketDelayMs; - jitterStatistics->minPacketDelayMs = stats.minPacketDelayMs; - return 0; - } - else - { - LogError("getJitterStatistics", 0); - return -1; - } -} - WebRtc_Word32 ACMNetEQ::PreferredBufferSize( WebRtc_UWord16* prefBufSize) const @@ -528,21 +483,6 @@ ACMNetEQ::PreferredBufferSize( return ok; } -WebRtc_Word32 -ACMNetEQ::ResetJitterStatistics() const -{ - CriticalSectionScoped lock(*_netEqCritSect); - if(WebRtcNetEQ_ResetJitterStatistics(_inst[0]) < 0) - { - LogError("resetJitterStatistics", 0); - return -1; - } - else - { - return 0; - } -} - WebRtc_Word32 ACMNetEQ::RecIn( const WebRtc_Word8* incomingPayload, diff --git a/src/modules/audio_coding/main/source/acm_neteq.h b/src/modules/audio_coding/main/source/acm_neteq.h index 821d1ebda..8d4b2c100 100644 --- a/src/modules/audio_coding/main/source/acm_neteq.h +++ b/src/modules/audio_coding/main/source/acm_neteq.h @@ -213,19 +213,6 @@ public: WebRtc_Word32 NetworkStatistics( ACMNetworkStatistics* statistics) const; - // - // JitterStatistics() - // Get the current jitter statistics from NetEQ. - // - // Output: - // - jitterStatistics : The current jitter statistics. - // - // Return value : 0 if ok. - // <0 if NetEQ returned an error. - // - WebRtc_Word32 JitterStatistics( - ACMJitterStatistics* jitterStatistics) const; - // // PreferredBufferSize() // Get the currently preferred buffer size from NetEQ. @@ -240,15 +227,6 @@ public: WebRtc_Word32 PreferredBufferSize( WebRtc_UWord16* prefBufSize) const; - // - // ResetJitterStatistics() - // Resets the NetEQ jitter statistics. - // - // Return value : 0 if ok. - // <0 if NetEQ returned an error. - // - WebRtc_Word32 ResetJitterStatistics() const; - // // VADMode() // Get the current VAD Mode. diff --git a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc index 1d4514b4b..370948131 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc +++ b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc @@ -2135,15 +2135,6 @@ AudioCodingModuleImpl::NetworkStatistics( return status; } -WebRtc_Word32 -AudioCodingModuleImpl::JitterStatistics( - ACMJitterStatistics& jitterStatistics) const -{ - WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceAudioCoding, _id, - "JitterStatistics()"); - return _netEq.JitterStatistics(&jitterStatistics); -} - WebRtc_Word32 AudioCodingModuleImpl::PreferredBufferSize( WebRtc_UWord16& prefbufsize) const @@ -2153,14 +2144,6 @@ AudioCodingModuleImpl::PreferredBufferSize( return _netEq.PreferredBufferSize(&prefbufsize); } -WebRtc_Word32 -AudioCodingModuleImpl::ResetJitterStatistics() const -{ - WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceAudioCoding, _id, - "ResetJitterStatistics()"); - return _netEq.ResetJitterStatistics(); -} - void AudioCodingModuleImpl::DestructEncoderInst( void* ptrInst) diff --git a/src/modules/audio_coding/main/source/audio_coding_module_impl.h b/src/modules/audio_coding/main/source/audio_coding_module_impl.h index 32246357a..707586faf 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module_impl.h +++ b/src/modules/audio_coding/main/source/audio_coding_module_impl.h @@ -243,14 +243,9 @@ public: WebRtc_Word32 NetworkStatistics( ACMNetworkStatistics& statistics) const; - WebRtc_Word32 JitterStatistics( - ACMJitterStatistics& jitterStatistics) const; - WebRtc_Word32 PreferredBufferSize( WebRtc_UWord16& prefbufsize) const; - WebRtc_Word32 ResetJitterStatistics() const; - void DestructEncoderInst(void* ptrInst); WebRtc_Word16 AudioBuffer(WebRtcACMAudioBuff& audioBuff); diff --git a/src/modules/audio_coding/main/test/APITest.cpp b/src/modules/audio_coding/main/test/APITest.cpp index aabd68e36..7d7e3e5f5 100644 --- a/src/modules/audio_coding/main/test/APITest.cpp +++ b/src/modules/audio_coding/main/test/APITest.cpp @@ -964,9 +964,7 @@ APITest::TestDelay(char side) *myMinDelay = (rand() % 1000) + 1; - ACMJitterStatistics jitterStat; ACMNetworkStatistics networkStat; - CHECK_ERROR_MT(myACM->JitterStatistics(jitterStat)); CHECK_ERROR_MT(myACM->NetworkStatistics(networkStat)); if(!_randomTest) @@ -980,31 +978,6 @@ APITest::TestDelay(char side) fprintf(stdout, "expand rate............. %d\n", networkStat.currentExpandRate); fprintf(stdout, "Preemptive rate......... %d\n", networkStat.currentPreemptiveRate); fprintf(stdout, "Accelerate rate......... %d\n", networkStat.currentAccelerateRate); - - fprintf(stdout, "\n\nJitter Statistics at side %c\n", side); - fprintf(stdout, "--------------------------------------\n"); - fprintf(stdout, "Jitter buffer min size....... %d\n", jitterStat.jbMinSize); - fprintf(stdout, "Jitter buffer Max size....... %d\n", jitterStat.jbMaxSize); - fprintf(stdout, "Jitter buffer Average size... %d\n", jitterStat.jbAvgSize); - fprintf(stdout, "Change Count................. %d ms\n", jitterStat.jbChangeCount); - fprintf(stdout, "Late Loss.................... %d ms\n", jitterStat.lateLossMs); - fprintf(stdout, "Accelerate................... %d ms\n", jitterStat.accelerateMs); - fprintf(stdout, "Flushed...................... %d ms\n", jitterStat.flushedMs); - fprintf(stdout, "Generated Silence............ %d ms\n", jitterStat.generatedSilentMs); - fprintf(stdout, "Interpolated Voice........... %d ms\n", jitterStat.interpolatedVoiceMs); - fprintf(stdout, "Interpolated Silence......... %d ms\n", jitterStat.interpolatedSilentMs); - fprintf(stdout, "No tiny expand............... %d\n", jitterStat.numExpandTiny); - fprintf(stdout, "No small expand.............. %d\n", jitterStat.numExpandSmall); - fprintf(stdout, "No Medium expand............. %d\n", jitterStat.numExpandMedium); - fprintf(stdout, "No long expand............... %d\n", jitterStat.numExpandLong); - fprintf(stdout, "longest expand............... %d ms\n", jitterStat.longestExpandDurationMs); - fprintf(stdout, "No IAT 500................... %d ms\n", jitterStat.countIAT500ms); - fprintf(stdout, "No IAT 1000.................. %d ms\n", jitterStat.countIAT1000ms); - fprintf(stdout, "No IAT 2000.................. %d ms\n", jitterStat.countIAT2000ms); - fprintf(stdout, "longest IAT.................. %d ms\n", jitterStat.longestIATms); - fprintf(stdout, "Min packet delay............. %d ms\n", jitterStat.minPacketDelayMs); - fprintf(stdout, "Max packet delay............. %d ms\n", jitterStat.maxPacketDelayMs); - fprintf(stdout, "Average packet delay......... %d ms\n", jitterStat.avgPacketDelayMs); } CHECK_ERROR_MT(myACM->SetMinimumPlayoutDelay(*myMinDelay)); diff --git a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h index a00cd9618..affcd61a9 100644 --- a/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h +++ b/src/modules/audio_coding/neteq/interface/webrtc_neteq_internal.h @@ -104,38 +104,6 @@ typedef struct * (in Q14) */ } WebRtcNetEQ_NetworkStatistics; -typedef struct -{ - WebRtc_UWord32 jbMinSize; /* smallest Jitter Buffer size during call in ms */ - WebRtc_UWord32 jbMaxSize; /* largest Jitter Buffer size during call in ms */ - WebRtc_UWord32 jbAvgSize; /* the average JB size, measured over time - ms */ - WebRtc_UWord32 jbChangeCount; /* number of times the Jitter Buffer changed - * (using Accelerate or Pre-emptive Expand) */ - WebRtc_UWord32 lateLossMs; /* amount (in ms) of audio data received late */ - WebRtc_UWord32 accelerateMs; /* milliseconds removed to reduce jitter buffer size */ - WebRtc_UWord32 flushedMs; /* milliseconds discarded through buffer flushing */ - WebRtc_UWord32 generatedSilentMs; /* milliseconds of generated silence */ - WebRtc_UWord32 interpolatedVoiceMs; /* milliseconds of synthetic audio data - * (non-background noise) */ - WebRtc_UWord32 interpolatedSilentMs; /* milliseconds of synthetic audio data - * (background noise level) */ - WebRtc_UWord32 countExpandMoreThan120ms; /* count of tiny expansions in output audio */ - WebRtc_UWord32 countExpandMoreThan250ms; /* count of small expansions in output audio */ - WebRtc_UWord32 countExpandMoreThan500ms; /* count of medium expansions in output audio */ - WebRtc_UWord32 countExpandMoreThan2000ms; /* count of long expansions in output audio */ - WebRtc_UWord32 longestExpandDurationMs; /* duration of longest audio drop-out */ - WebRtc_UWord32 countIAT500ms; /* count of times we got small network outage (inter-arrival - * time in [500, 1000) ms) */ - WebRtc_UWord32 countIAT1000ms; /* count of times we got medium network outage - * (inter-arrival time in [1000, 2000) ms) */ - WebRtc_UWord32 countIAT2000ms; /* count of times we got large network outage - * (inter-arrival time >= 2000 ms) */ - WebRtc_UWord32 longestIATms; /* longest packet inter-arrival time in ms */ - WebRtc_UWord32 minPacketDelayMs; /* min time incoming Packet "waited" to be played */ - WebRtc_UWord32 maxPacketDelayMs; /* max time incoming Packet "waited" to be played */ - WebRtc_UWord32 avgPacketDelayMs; /* avg time incoming Packet "waited" to be played */ -} WebRtcNetEQ_JitterStatistics; - /* * Get the "in-call" statistics from NetEQ. * The statistics are reset after the query. @@ -152,18 +120,6 @@ int WebRtcNetEQ_GetPreferredBufferSize(void *inst, WebRtc_UWord16 *preferredBuff */ int WebRtcNetEQ_GetCurrentDelay(const void *inst, WebRtc_UWord16 *currentDelayMs); -/* - * Get the "post-call" jitter statistics from NetEQ. - * The statistics are not reset by the query. Use the function - * WebRtcNetEQ_ResetJitterStatistics to reset the statistics. - */ -int WebRtcNetEQ_GetJitterStatistics(void *inst, WebRtcNetEQ_JitterStatistics *jitterStats); - -/* - * Reset "post-call" jitter statistics. - */ -int WebRtcNetEQ_ResetJitterStatistics(void *inst); - /***********************************************/ /* Functions for post-decode VAD functionality */ /***********************************************/ diff --git a/src/modules/audio_coding/neteq/test/NetEqRTPplay.cc b/src/modules/audio_coding/neteq/test/NetEqRTPplay.cc index 6a276bd75..9534fa56e 100644 --- a/src/modules/audio_coding/neteq/test/NetEqRTPplay.cc +++ b/src/modules/audio_coding/neteq/test/NetEqRTPplay.cc @@ -648,18 +648,7 @@ int main(int argc, char* argv[]) printf(" fraction_lost : %d (%f%%)\n", RTCPstat.fraction_lost, (float)(100.0*RTCPstat.fraction_lost/256.0)); printf(" jitter : %d\n", (int) RTCPstat.jitter); - WebRtcNetEQ_JitterStatistics jitterStats; - WebRtcNetEQ_GetJitterStatistics(NetEQvector[0]->instance(), &jitterStats); - - printf("\nPost-call statistics:\n"); - printf(" Call duration ms : %u\n", simClock-start_clock); - printf(" Expand (voice) ms : %u \t(%.2f%%)\n", jitterStats.interpolatedVoiceMs, (float) 100.0 * jitterStats.interpolatedVoiceMs/(simClock-start_clock)); - printf(" Expand (silence) ms : %u \t(%.2f%%)\n", jitterStats.interpolatedSilentMs, (float) 100.0 * jitterStats.interpolatedSilentMs/(simClock-start_clock)); - printf(" Accelerate ms : %u \t(%.2f%%)\n", jitterStats.accelerateMs, (float) 100.0 * jitterStats.accelerateMs/(simClock-start_clock)); - printf(" Flushed ms : %u \t(%.2f%%)\n", jitterStats.flushedMs, (float) 100.0 * jitterStats.flushedMs/(simClock-start_clock)); - printf(" JB avg size ms : %u\n", jitterStats.jbAvgSize); - printf(" JB max size ms : %u\n", jitterStats.jbMaxSize); - printf(" Max inter-arrival ms: %u\n", jitterStats.longestIATms); + printf("\n Call duration ms : %u\n", simClock-start_clock); printf("\nComplexity estimates (including sub-components):\n"); printf(" RecIn complexity : %.2f MCPS\n", NetEQvector[0]->getRecInTime() / ((float) 1000*(simClock-start_clock))); diff --git a/src/modules/audio_coding/neteq/webrtc_neteq.c b/src/modules/audio_coding/neteq/webrtc_neteq.c index 29576d8ef..489f178dc 100644 --- a/src/modules/audio_coding/neteq/webrtc_neteq.c +++ b/src/modules/audio_coding/neteq/webrtc_neteq.c @@ -1593,79 +1593,6 @@ int WebRtcNetEQ_GetCurrentDelay(const void *inst, WebRtc_UWord16 *currentDelayMs return 0; } -/* Get the "post-call" jitter statistics from NetEQ. - * The statistics are not reset by the query. Use the function WebRtcNetEQ_ResetJitterStatistics - * to reset the statistics. */ -int WebRtcNetEQ_GetJitterStatistics(void *inst, WebRtcNetEQ_JitterStatistics *jitterStats) -{ - - MainInst_t *NetEqMainInst = (MainInst_t*) inst; - - /* collect statistics not yet transfered to post-call statistics */ - NetEqMainInst->MCUinst.statInst.accelerateMs - += WebRtcSpl_DivU32U16( - WEBRTC_SPL_UMUL_32_16( NetEqMainInst->DSPinst.statInst.accelerateLength, (WebRtc_UWord16) 1000), - NetEqMainInst->MCUinst.fs); - - jitterStats->jbMinSize = NetEqMainInst->MCUinst.statInst.jbMinSize; /* smallest Jitter Buffer size during call - mSec */ - jitterStats->jbMaxSize = NetEqMainInst->MCUinst.statInst.jbMaxSize; /* largest Jitter Buffer size during call - mSec */ - jitterStats->jbAvgSize = NetEqMainInst->MCUinst.statInst.jbAvgSizeQ16 >> 16; /* the average JB size, measured over time - mSec */ - jitterStats->jbChangeCount = NetEqMainInst->MCUinst.statInst.jbChangeCount; /* number of times the Jitter Buffer changed */ - jitterStats->lateLossMs = (NetEqMainInst->MCUinst.PacketBuffer_inst.totalDiscardedPackets - * NetEqMainInst->MCUinst.PacketBuffer_inst.packSizeSamples * 1000) - / NetEqMainInst->MCUinst.fs; /* number of frames received late */ - jitterStats->accelerateMs = NetEqMainInst->MCUinst.statInst.accelerateMs; /* milliseconds removed to reduce jitter buffer size */ - jitterStats->flushedMs = (NetEqMainInst->MCUinst.PacketBuffer_inst.totalFlushedPackets - * NetEqMainInst->MCUinst.PacketBuffer_inst.packSizeSamples * 1000) - / NetEqMainInst->MCUinst.fs; - jitterStats->generatedSilentMs = NetEqMainInst->MCUinst.statInst.generatedSilentMs; /* number of generated silence frames */ - jitterStats->countExpandMoreThan120ms - = NetEqMainInst->MCUinst.statInst.countExpandMoreThan120ms; /* count of tiny BFI events output audio */ - jitterStats->countExpandMoreThan250ms - = NetEqMainInst->MCUinst.statInst.countExpandMoreThan250ms; /* count of small BFI events output audio */ - jitterStats->countExpandMoreThan500ms - = NetEqMainInst->MCUinst.statInst.countExpandMoreThan500ms; /* count of medium BFI events output audio */ - jitterStats->countExpandMoreThan2000ms - = NetEqMainInst->MCUinst.statInst.countExpandMoreThan2000ms; /* count of large BFI events output audio */ - jitterStats->longestExpandDurationMs - = NetEqMainInst->MCUinst.statInst.longestExpandDurationMs; /* mSec duration of longest audio drop-out */ - jitterStats->countIAT500ms - = NetEqMainInst->MCUinst.BufferStat_inst.Automode_inst.countIAT500ms; /* count of times we got small network outage */ - jitterStats->countIAT1000ms - = NetEqMainInst->MCUinst.BufferStat_inst.Automode_inst.countIAT1000ms; /* count of times we got medium network outage */ - jitterStats->countIAT2000ms - = NetEqMainInst->MCUinst.BufferStat_inst.Automode_inst.countIAT2000ms; /* count of times we got large network outage */ - jitterStats->longestIATms - = NetEqMainInst->MCUinst.BufferStat_inst.Automode_inst.longestIATms; /* mSec duration of longest network outage */ - jitterStats->minPacketDelayMs = NetEqMainInst->MCUinst.statInst.minPacketDelayMs; /* min time incoming frame "waited" to be played */ - jitterStats->maxPacketDelayMs = NetEqMainInst->MCUinst.statInst.maxPacketDelayMs; /* max time incoming frame "waited" to be played */ - jitterStats->avgPacketDelayMs = NetEqMainInst->MCUinst.statInst.avgPacketDelayMs; /* avg time incoming frame "waited" to be played */ - - jitterStats->interpolatedVoiceMs - = WebRtcSpl_DivU32U16( - WEBRTC_SPL_UMUL_32_16( NetEqMainInst->DSPinst.statInst.expandedVoiceSamples, (WebRtc_UWord16) 1000), - NetEqMainInst->MCUinst.fs); /* interpolated voice in ms */ - jitterStats->interpolatedSilentMs - = WebRtcSpl_DivU32U16( - WEBRTC_SPL_UMUL_32_16( NetEqMainInst->DSPinst.statInst.expandedNoiseSamples, (WebRtc_UWord16) 1000), - NetEqMainInst->MCUinst.fs); /* interpolated silence in ms */ - - return (0); -} - -/* Reset "post-call" jitter statistics. */ -int WebRtcNetEQ_ResetJitterStatistics(void *inst) -{ - - MainInst_t *NetEqMainInst = (MainInst_t*) inst; - - WebRtcNetEQ_ResetMcuJitterStat(&(NetEqMainInst->MCUinst)); - - WebRtcNetEQ_ClearPostCallStats(&(NetEqMainInst->DSPinst)); - - return (0); -} - /**************************************************************************** * WebRtcNetEQ_SetVADInstance(...) * diff --git a/src/voice_engine/main/interface/voe_neteq_stats.h b/src/voice_engine/main/interface/voe_neteq_stats.h index 197285c57..12526f08e 100644 --- a/src/voice_engine/main/interface/voe_neteq_stats.h +++ b/src/voice_engine/main/interface/voe_neteq_stats.h @@ -35,19 +35,11 @@ public: // The statistics are reset after the query. virtual int GetNetworkStatistics(int channel, NetworkStatistics& stats) = 0; - // Get the "post-call" jitter statistics from NetEQ. - // The statistics are not reset by the query. Use the function - // ResetJitterStatistics() to reset. - virtual int GetJitterStatistics(int channel, JitterStatistics& stats) = 0; - // Get the optimal buffer size calculated for the current network // conditions. virtual int GetPreferredBufferSize( int channel, unsigned short& preferredBufferSize) = 0; - // Reset "post-call" jitter statistics. - virtual int ResetJitterStatistics(int channel) = 0; - protected: VoENetEqStats() {} virtual ~VoENetEqStats() {} diff --git a/src/voice_engine/main/source/channel.cc b/src/voice_engine/main/source/channel.cc index eb6485483..3b9e63637 100644 --- a/src/voice_engine/main/source/channel.cc +++ b/src/voice_engine/main/source/channel.cc @@ -6107,15 +6107,6 @@ Channel::GetNetworkStatistics(NetworkStatistics& stats) (ACMNetworkStatistics &)stats); } -int -Channel::GetJitterStatistics(JitterStatistics& stats) -{ - WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), - "Channel::GetNetworkStatistics()"); - return _audioCodingModule.JitterStatistics( - (ACMJitterStatistics &)stats); -} - int Channel::GetPreferredBufferSize(unsigned short& preferredBufferSize) { @@ -6125,14 +6116,6 @@ Channel::GetPreferredBufferSize(unsigned short& preferredBufferSize) (WebRtc_UWord16 &)preferredBufferSize); } -int -Channel::ResetJitterStatistics() -{ - WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId), - "Channel::ResetJitterStatistics()"); - return _audioCodingModule.ResetJitterStatistics(); -} - int Channel::GetDelayEstimate(int& delayMs) const { diff --git a/src/voice_engine/main/source/channel.h b/src/voice_engine/main/source/channel.h index ec76faa5d..e06acd324 100644 --- a/src/voice_engine/main/source/channel.h +++ b/src/voice_engine/main/source/channel.h @@ -243,9 +243,7 @@ public: // VoENetEqStats int GetNetworkStatistics(NetworkStatistics& stats); - int GetJitterStatistics(JitterStatistics& stats); int GetPreferredBufferSize(unsigned short& preferredBufferSize); - int ResetJitterStatistics(); // VoEVideoSync int GetDelayEstimate(int& delayMs) const; diff --git a/src/voice_engine/main/source/voe_neteq_stats_impl.cc b/src/voice_engine/main/source/voe_neteq_stats_impl.cc index adb934aaf..f77a73340 100644 --- a/src/voice_engine/main/source/voe_neteq_stats_impl.cc +++ b/src/voice_engine/main/source/voe_neteq_stats_impl.cc @@ -95,32 +95,6 @@ int VoENetEqStatsImpl::GetNetworkStatistics(int channel, return channelPtr->GetNetworkStatistics(stats); } -int VoENetEqStatsImpl::GetJitterStatistics(int channel, - JitterStatistics& stats) -{ - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1), - "GetJitterStatistics(channel=%i)", channel); - ANDROID_NOT_SUPPORTED(); - IPHONE_NOT_SUPPORTED(); - - if (!_engineStatistics.Initialized()) - { - _engineStatistics.SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ScopedChannel sc(_channelManager, channel); - voe::Channel* channelPtr = sc.ChannelPtr(); - if (channelPtr == NULL) - { - _engineStatistics.SetLastError( - VE_CHANNEL_NOT_VALID, kTraceError, - "GetJitterStatistics() failed to locate channel"); - return -1; - } - - return channelPtr->GetJitterStatistics(stats); -} - int VoENetEqStatsImpl::GetPreferredBufferSize( int channel, unsigned short& preferredBufferSize) @@ -148,31 +122,6 @@ int VoENetEqStatsImpl::GetPreferredBufferSize( return channelPtr->GetPreferredBufferSize(preferredBufferSize); } -int VoENetEqStatsImpl::ResetJitterStatistics(int channel) -{ - WEBRTC_TRACE(kTraceApiCall, kTraceVoice, VoEId(_instanceId,-1), - "ResetJitterStatistics(channel=%i)", channel); - ANDROID_NOT_SUPPORTED(); - IPHONE_NOT_SUPPORTED(); - - if (!_engineStatistics.Initialized()) - { - _engineStatistics.SetLastError(VE_NOT_INITED, kTraceError); - return -1; - } - voe::ScopedChannel sc(_channelManager, channel); - voe::Channel* channelPtr = sc.ChannelPtr(); - if (channelPtr == NULL) - { - _engineStatistics.SetLastError( - VE_CHANNEL_NOT_VALID, kTraceError, - "ResetJitterStatistics() failed to locate channel"); - return -1; - } - - return channelPtr->ResetJitterStatistics(); -} - #endif // #ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API } // namespace webrtc diff --git a/src/voice_engine/main/source/voe_neteq_stats_impl.h b/src/voice_engine/main/source/voe_neteq_stats_impl.h index e8a7d27bd..5bbcded39 100644 --- a/src/voice_engine/main/source/voe_neteq_stats_impl.h +++ b/src/voice_engine/main/source/voe_neteq_stats_impl.h @@ -28,14 +28,9 @@ public: virtual int GetNetworkStatistics(int channel, NetworkStatistics& stats); - virtual int GetJitterStatistics(int channel, - JitterStatistics& stats); - virtual int GetPreferredBufferSize(int channel, unsigned short& preferredBufferSize); - virtual int ResetJitterStatistics(int channel); - protected: VoENetEqStatsImpl(); virtual ~VoENetEqStatsImpl(); diff --git a/src/voice_engine/main/test/auto_test/voe_standard_test.cc b/src/voice_engine/main/test/auto_test/voe_standard_test.cc index a2b3cc2f1..d16757c12 100644 --- a/src/voice_engine/main/test/auto_test/voe_standard_test.cc +++ b/src/voice_engine/main/test/auto_test/voe_standard_test.cc @@ -3595,59 +3595,9 @@ int VoETestManager::DoStandardTest() TEST_LOG(" preferredBufferSize = %hu \n", nStats.preferredBufferSize); - JitterStatistics jStats; - TEST_MUSTPASS(neteqst->GetJitterStatistics(0, jStats)); - TEST_LOG("\nJitter statistics: \n"); - TEST_LOG(" jbMinSize = %u \n", - jStats.jbMinSize); - TEST_LOG(" jbMaxSize = %u \n", - jStats.jbMaxSize); - TEST_LOG(" jbAvgSize = %u \n", - jStats.jbAvgSize); - TEST_LOG(" jbChangeCount = %u \n", - jStats.jbChangeCount); - TEST_LOG(" lateLossMs = %u \n", - jStats.lateLossMs); - TEST_LOG(" accelerateMs = %u \n", - jStats.accelerateMs); - TEST_LOG(" flushedMs = %u \n", - jStats.flushedMs); - TEST_LOG(" generatedSilentMs = %u \n", - jStats.generatedSilentMs); - TEST_LOG(" interpolatedVoiceMs = %u \n", - jStats.interpolatedVoiceMs); - TEST_LOG(" interpolatedSilentMs = %u \n", - jStats.interpolatedSilentMs); - TEST_LOG(" countExpandMoreThan120ms = %u \n", - jStats.countExpandMoreThan120ms); - TEST_LOG(" countExpandMoreThan250ms = %u \n", - jStats.countExpandMoreThan250ms); - TEST_LOG(" countExpandMoreThan500ms = %u \n", - jStats.countExpandMoreThan500ms); - TEST_LOG(" countExpandMoreThan2000ms = %u \n", - jStats.countExpandMoreThan2000ms); - TEST_LOG(" longestExpandDurationMs = %u \n", - jStats.longestExpandDurationMs); - TEST_LOG(" countIAT500ms = %u \n", - jStats.countIAT500ms); - TEST_LOG(" countIAT1000ms = %u \n", - jStats.countIAT1000ms); - TEST_LOG(" countIAT2000ms = %u \n", - jStats.countIAT2000ms); - TEST_LOG(" longestIATms = %u \n", - jStats.longestIATms); - TEST_LOG(" minPacketDelayMs = %u \n", - jStats.minPacketDelayMs); - TEST_LOG(" maxPacketDelayMs = %u \n", - jStats.maxPacketDelayMs); - TEST_LOG(" avgPacketDelayMs = %u \n", - jStats.avgPacketDelayMs); - unsigned short preferredBufferSize; TEST_MUSTPASS(neteqst->GetPreferredBufferSize(0, preferredBufferSize)); TEST_MUSTPASS(preferredBufferSize != nStats.preferredBufferSize); - - TEST_MUSTPASS(neteqst->ResetJitterStatistics(0)); #else TEST_LOG("Skipping NetEQ statistics tests - " "WEBRTC_VOICE_ENGINE_NETEQ_STATS_API not defined \n");