Files
platform-external-webrtc/modules/remote_bitrate_estimator/BUILD.gn
Victor Boivie ae1f8f59ac Use a std::deque in RemoteEstimatorProxy
Before this CL, the RemoteEstimatorProxy used a std::map to track which
arrival time a packet with a certain sequence number was received at.
While this works, it's fairly slow as most manipulations and insertions
are O(log(N)) and there were quite many of them.

By taking advantage that sequence numbers generally are received in
sequence, recording a packet is now amortized O(1). Also other
operations such as creating the periodic feedback reports, are also
much faster as it previously was done by searching quite a few times
in that map.

In highly loaded Media Servers, RemoteEstimatorProxy's usage of
std::map attributes to around 0.52% CPU.

Bug: webrtc:12689
Change-Id: I3dd58105f9fbfb111f176833cd4aa6b040c0e01d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217388
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33979}
2021-05-11 10:19:06 +00:00

136 lines
4.0 KiB
Plaintext

# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../webrtc.gni")
rtc_library("remote_bitrate_estimator") {
sources = [
"aimd_rate_control.cc",
"aimd_rate_control.h",
"bwe_defines.cc",
"include/bwe_defines.h",
"include/remote_bitrate_estimator.h",
"inter_arrival.cc",
"inter_arrival.h",
"overuse_detector.cc",
"overuse_detector.h",
"overuse_estimator.cc",
"overuse_estimator.h",
"packet_arrival_map.cc",
"packet_arrival_map.h",
"remote_bitrate_estimator_abs_send_time.cc",
"remote_bitrate_estimator_abs_send_time.h",
"remote_bitrate_estimator_single_stream.cc",
"remote_bitrate_estimator_single_stream.h",
"remote_estimator_proxy.cc",
"remote_estimator_proxy.h",
"test/bwe_test_logging.h",
]
if (rtc_enable_bwe_test_logging) {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1" ]
sources += [ "test/bwe_test_logging.cc" ]
} else {
defines = [ "BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0" ]
}
deps = [
"../../api:network_state_predictor_api",
"../../api:rtp_headers",
"../../api/transport:field_trial_based_config",
"../../api/transport:network_control",
"../../api/transport:webrtc_key_value_config",
"../../api/units:data_rate",
"../../api/units:timestamp",
"../../modules:module_api",
"../../modules:module_api_public",
"../../modules/congestion_controller/goog_cc:link_capacity_estimator",
"../../modules/rtp_rtcp:rtp_rtcp_format",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_numerics",
"../../rtc_base:safe_minmax",
"../../rtc_base/experiments:field_trial_parser",
"../../rtc_base/synchronization:mutex",
"../../system_wrappers",
"../../system_wrappers:field_trial",
"../../system_wrappers:metrics",
]
absl_deps = [
"//third_party/abseil-cpp/absl/strings",
"//third_party/abseil-cpp/absl/types:optional",
]
}
if (!build_with_chromium) {
rtc_library("bwe_rtp") {
testonly = true
sources = [
"tools/bwe_rtp.cc",
"tools/bwe_rtp.h",
]
deps = [
":remote_bitrate_estimator",
"../../rtc_base:rtc_base_approved",
"../../test:rtp_test_utils",
"../rtp_rtcp",
]
absl_deps = [
"//third_party/abseil-cpp/absl/flags:flag",
"//third_party/abseil-cpp/absl/flags:parse",
]
}
rtc_executable("rtp_to_text") {
testonly = true
sources = [ "tools/rtp_to_text.cc" ]
deps = [
":bwe_rtp",
"../../modules/rtp_rtcp",
"../../rtc_base:macromagic",
"../../rtc_base:stringutils",
"../../test:rtp_test_utils",
]
}
}
if (rtc_include_tests) {
rtc_library("remote_bitrate_estimator_unittests") {
testonly = true
sources = [
"aimd_rate_control_unittest.cc",
"inter_arrival_unittest.cc",
"overuse_detector_unittest.cc",
"packet_arrival_map_test.cc",
"remote_bitrate_estimator_abs_send_time_unittest.cc",
"remote_bitrate_estimator_single_stream_unittest.cc",
"remote_bitrate_estimator_unittest_helper.cc",
"remote_bitrate_estimator_unittest_helper.h",
"remote_estimator_proxy_unittest.cc",
]
deps = [
":remote_bitrate_estimator",
"..:module_api_public",
"../../api/transport:field_trial_based_config",
"../../api/transport:mock_network_control",
"../../api/transport:network_control",
"../../rtc_base",
"../../rtc_base:checks",
"../../rtc_base:rtc_base_approved",
"../../system_wrappers",
"../../test:field_trial",
"../../test:fileutils",
"../../test:test_support",
"../pacing",
"../rtp_rtcp:rtp_rtcp_format",
]
}
}