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

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

Issue 2460393002: NetEq jitter calculation now done in int64_t. (Closed)
Patch Set: Turned jitter to int64_t. Using std::abs over SPL. Created 4 years, 1 month 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/rtcp.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/neteq/rtcp.cc
diff --git a/webrtc/modules/audio_coding/neteq/rtcp.cc b/webrtc/modules/audio_coding/neteq/rtcp.cc
index 7ef40bc814548de74cc86df77a3f4633a76c8f54..0263e763efb56dc377d4ef8308a0cb1185409297 100644
--- a/webrtc/modules/audio_coding/neteq/rtcp.cc
+++ b/webrtc/modules/audio_coding/neteq/rtcp.cc
@@ -10,11 +10,11 @@
#include "webrtc/modules/audio_coding/neteq/rtcp.h"
+#include <stdlib.h>
#include <string.h>
#include <algorithm>
-#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
#include "webrtc/modules/include/module_common_types.h"
namespace webrtc {
@@ -46,10 +46,10 @@ void Rtcp::Update(const RTPHeader& rtp_header, uint32_t receive_timestamp) {
// Note that the value in |jitter_| is in Q4.
if (received_packets_ > 1) {
int32_t ts_diff = receive_timestamp - (rtp_header.timestamp - transit_);
- ts_diff = WEBRTC_SPL_ABS_W32(ts_diff);
- int32_t jitter_diff = (ts_diff << 4) - jitter_;
+ int64_t jitter_diff = (std::abs(int64_t{ts_diff}) << 4) - jitter_;
// Calculate 15 * jitter_ / 16 + jitter_diff / 16 (with proper rounding).
jitter_ = jitter_ + ((jitter_diff + 8) >> 4);
+ RTC_DCHECK_GE(jitter_, 0);
ossu 2016/10/31 14:53:48 This, really, should be impossible: jitter_diff sh
}
transit_ = rtp_header.timestamp - receive_timestamp;
}
« no previous file with comments | « webrtc/modules/audio_coding/neteq/rtcp.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698