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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc

Issue 1412683004: Fix bug in how send timestamps are converted to 24 bits. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: some stuff Created 5 years, 2 months 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
Index: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
index 56a309c59db9174454f0ef4750ba03fff0e31747..522489e921347ec4b25485452e834a43804fd30c 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.cc
@@ -64,6 +64,15 @@ std::vector<K> Keys(const std::map<K, V>& map) {
return keys;
}
+uint32_t ConvertMsTo24Bits(int64_t time_ms) {
+ uint32_t time_24_bits =
+ static_cast<uint32_t>(
+ ((static_cast<uint64_t>(time_ms) << kAbsSendTimeFraction) + 500) /
+ 1000) &
+ 0x00FFFFFF;
+ return time_24_bits;
+}
+
bool RemoteBitrateEstimatorAbsSendTime::IsWithinClusterBounds(
int send_delta_ms,
const Cluster& cluster_aggregate) {
@@ -219,12 +228,8 @@ bool RemoteBitrateEstimatorAbsSendTime::IsBitrateImproving(
void RemoteBitrateEstimatorAbsSendTime::IncomingPacketFeedbackVector(
const std::vector<PacketInfo>& packet_feedback_vector) {
for (const auto& packet_info : packet_feedback_vector) {
- // TODO(holmer): We should get rid of this conversion if possible as we may
- // lose precision.
- uint32_t send_time_32bits = (packet_info.send_time_ms) / kTimestampToMs;
- uint32_t send_time_24bits =
- send_time_32bits >> kAbsSendTimeInterArrivalUpshift;
- IncomingPacketInfo(packet_info.arrival_time_ms, send_time_24bits,
+ IncomingPacketInfo(packet_info.arrival_time_ms,
+ ConvertMsTo24Bits(packet_info.send_time_ms),
packet_info.payload_size, 0, packet_info.was_paced);
}
}
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698