diff --git a/src/modules/rtp_rtcp/source/overuse_detector.h b/src/modules/rtp_rtcp/source/overuse_detector.h index b6b6a147c0..67913785a9 100644 --- a/src/modules/rtp_rtcp/source/overuse_detector.h +++ b/src/modules/rtp_rtcp/source/overuse_detector.h @@ -23,15 +23,6 @@ namespace webrtc { enum RateControlRegion; -struct FrameSample -{ - FrameSample() : _size(0), _completeTimeMs(-1), _timestamp(-1) {} - - WebRtc_UWord32 _size; - WebRtc_Word64 _completeTimeMs; - WebRtc_Word64 _timestamp; -}; - class OverUseDetector { public: @@ -46,39 +37,51 @@ public: void SetRateControlRegion(RateControlRegion region); private: - void CompensatedTimeDelta(const FrameSample& currentFrame, const FrameSample& prevFrame, WebRtc_Word64& tDelta, - double& tsDelta, bool wrapped); - void UpdateKalman(WebRtc_Word64 tDelta, double tsDelta, WebRtc_UWord32 frameSize, WebRtc_UWord32 prevFrameSize); + struct FrameSample + { + FrameSample() : _size(0), _completeTimeMs(-1), _timestamp(-1) {} + + WebRtc_UWord32 _size; + WebRtc_Word64 _completeTimeMs; + WebRtc_Word64 _timestamp; + }; + + void CompensatedTimeDelta(const FrameSample& currentFrame, + const FrameSample& prevFrame, + WebRtc_Word64& tDelta, + double& tsDelta, + bool wrapped); + void UpdateKalman(WebRtc_Word64 tDelta, + double tsDelta, + WebRtc_UWord32 frameSize, + WebRtc_UWord32 prevFrameSize); double UpdateMinFramePeriod(double tsDelta); void UpdateNoiseEstimate(double residual, double tsDelta, bool stableState); BandwidthUsage Detect(double tsDelta); double CurrentDrift(); - bool _firstPacket; - FrameSample _currentFrame; - FrameSample _prevFrame; - - WebRtc_UWord16 _numOfDeltas; - double _slope; - double _offset; - double _E[2][2]; - double _processNoise[2]; - double _avgNoise; - double _varNoise; - double _varFsDelta; - double _threshold; - ListWrapper _tsDeltaHist; - - double _prevOffset; - double _timeOverUsing; - WebRtc_UWord16 _overUseCounter; - BandwidthUsage _hypothesis; + bool _firstPacket; + FrameSample _currentFrame; + FrameSample _prevFrame; + WebRtc_UWord16 _numOfDeltas; + double _slope; + double _offset; + double _E[2][2]; + double _processNoise[2]; + double _avgNoise; + double _varNoise; + double _threshold; + ListWrapper _tsDeltaHist; + double _prevOffset; + double _timeOverUsing; + WebRtc_UWord16 _overUseCounter; + BandwidthUsage _hypothesis; #ifdef WEBRTC_BWE_MATLAB - MatlabPlot *_plot1; - MatlabPlot *_plot2; - MatlabPlot *_plot3; - MatlabPlot *_plot4; + MatlabPlot* _plot1; + MatlabPlot* _plot2; + MatlabPlot* _plot3; + MatlabPlot* _plot4; #endif }; } // namespace webrtc