Use backticks not vertical bars to denote variables in comments for /modules/congestion_controller

Bug: webrtc:12338
Change-Id: Id46786886f13266177dd7fa8f1fb30c097df1373
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227094
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34622}
This commit is contained in:
Artem Titov
2021-07-28 20:26:13 +02:00
committed by WebRTC LUCI CQ
parent d00ce747c7
commit 6f4b4fa18b
14 changed files with 44 additions and 44 deletions

View File

@ -34,23 +34,23 @@ struct RobustThroughputEstimatorSettings {
// The estimator handles delay spikes by removing the largest receive time
// gap, but this introduces some bias that may lead to overestimation when
// there isn't any delay spike. If |reduce_bias| is true, we instead replace
// there isn't any delay spike. If `reduce_bias` is true, we instead replace
// the largest receive time gap by the second largest. This reduces the bias
// at the cost of not completely removing the genuine delay spikes.
bool reduce_bias = true;
// If |assume_shared_link| is false, we ignore the size of the first packet
// If `assume_shared_link` is false, we ignore the size of the first packet
// when computing the receive rate. Otherwise, we remove half of the first
// and last packet's sizes.
bool assume_shared_link = false;
// The estimator window keeps at least |min_packets| packets and up to
// kMaxPackets received during the last |window_duration|.
// The estimator window keeps at least `min_packets` packets and up to
// kMaxPackets received during the last `window_duration`.
unsigned min_packets = 20;
TimeDelta window_duration = TimeDelta::Millis(500);
// The estimator window requires at least |initial_packets| packets received
// over at least |initial_duration|.
// The estimator window requires at least `initial_packets` packets received
// over at least `initial_duration`.
unsigned initial_packets = 20;
// If audio packets are included in allocation, but not in bandwidth

View File

@ -96,7 +96,7 @@ void StreamGenerator::set_capacity_bps(int capacity_bps) {
capacity_ = capacity_bps;
}
// Divides |bitrate_bps| among all streams. The allocated bitrate per stream
// Divides `bitrate_bps` among all streams. The allocated bitrate per stream
// is decided by the current allocation ratios.
void StreamGenerator::SetBitrateBps(int bitrate_bps) {
ASSERT_GE(streams_.size(), 0u);
@ -253,8 +253,8 @@ bool DelayBasedBweTest::GenerateAndProcessFrame(uint32_t ssrc,
return overuse;
}
// Run the bandwidth estimator with a stream of |number_of_frames| frames, or
// until it reaches |target_bitrate|.
// Run the bandwidth estimator with a stream of `number_of_frames` frames, or
// until it reaches `target_bitrate`.
// Can for instance be used to run the estimator for some time to get it
// into a steady state.
uint32_t DelayBasedBweTest::SteadyStateRun(uint32_t ssrc,
@ -265,7 +265,7 @@ uint32_t DelayBasedBweTest::SteadyStateRun(uint32_t ssrc,
uint32_t target_bitrate) {
uint32_t bitrate_bps = start_bitrate;
bool bitrate_update_seen = false;
// Produce |number_of_frames| frames and give them to the estimator.
// Produce `number_of_frames` frames and give them to the estimator.
for (int i = 0; i < max_number_of_frames; ++i) {
bool overuse = GenerateAndProcessFrame(ssrc, bitrate_bps);
if (overuse) {
@ -476,7 +476,7 @@ void DelayBasedBweTest::TestTimestampGroupingTestHelper() {
const int kTimestampGroupLength = 15;
for (int i = 0; i < 100; ++i) {
for (int j = 0; j < kTimestampGroupLength; ++j) {
// Insert |kTimestampGroupLength| frames with just 1 timestamp ticks in
// Insert `kTimestampGroupLength` frames with just 1 timestamp ticks in
// between. Should be treated as part of the same group by the estimator.
IncomingFeedback(clock_.TimeInMilliseconds(), send_time_ms, 100);
clock_.AdvanceTimeMilliseconds(kFrameIntervalMs / kTimestampGroupLength);

View File

@ -89,11 +89,11 @@ class StreamGenerator {
// Set the link capacity.
void set_capacity_bps(int capacity_bps);
// Divides |bitrate_bps| among all streams. The allocated bitrate per stream
// Divides `bitrate_bps` among all streams. The allocated bitrate per stream
// is decided by the initial allocation ratios.
void SetBitrateBps(int bitrate_bps);
// Set the RTP timestamp offset for the stream identified by |ssrc|.
// Set the RTP timestamp offset for the stream identified by `ssrc`.
void set_rtp_timestamp_offset(uint32_t ssrc, uint32_t offset);
// TODO(holmer): Break out the channel simulation part from this class to make
@ -138,8 +138,8 @@ class DelayBasedBweTest : public ::testing::TestWithParam<std::string> {
// target bitrate after the call to this function.
bool GenerateAndProcessFrame(uint32_t ssrc, uint32_t bitrate_bps);
// Run the bandwidth estimator with a stream of |number_of_frames| frames, or
// until it reaches |target_bitrate|.
// Run the bandwidth estimator with a stream of `number_of_frames` frames, or
// until it reaches `target_bitrate`.
// Can for instance be used to run the estimator for some time to get it
// into a steady state.
uint32_t SteadyStateRun(uint32_t ssrc,

View File

@ -102,8 +102,8 @@ bool InterArrivalDelta::ComputeDeltas(Timestamp send_time,
return calculated_deltas;
}
// Assumes that |timestamp| is not reordered compared to
// |current_timestamp_group_|.
// Assumes that `timestamp` is not reordered compared to
// `current_timestamp_group_`.
bool InterArrivalDelta::NewTimestampGroup(Timestamp arrival_time,
Timestamp send_time) const {
if (current_timestamp_group_.IsFirstPacket()) {

View File

@ -38,12 +38,12 @@ class InterArrivalDelta {
// This function returns true if a delta was computed, or false if the current
// group is still incomplete or if only one group has been completed.
// |send_time| is the send time.
// |arrival_time| is the time at which the packet arrived.
// |packet_size| is the size of the packet.
// |timestamp_delta| (output) is the computed send time delta.
// |arrival_time_delta_ms| (output) is the computed arrival-time delta.
// |packet_size_delta| (output) is the computed size delta.
// `send_time` is the send time.
// `arrival_time` is the time at which the packet arrived.
// `packet_size` is the size of the packet.
// `timestamp_delta` (output) is the computed send time delta.
// `arrival_time_delta_ms` (output) is the computed arrival-time delta.
// `packet_size_delta` (output) is the computed size delta.
bool ComputeDeltas(Timestamp send_time,
Timestamp arrival_time,
Timestamp system_time,
@ -73,7 +73,7 @@ class InterArrivalDelta {
};
// Returns true if the last packet was the end of the current batch and the
// packet with |send_time| is the first of a new batch.
// packet with `send_time` is the first of a new batch.
bool NewTimestampGroup(Timestamp arrival_time, Timestamp send_time) const;
bool BelongsToBurst(Timestamp arrival_time, Timestamp send_time) const;

View File

@ -119,14 +119,14 @@ absl::optional<DataRate> ProbeBitrateEstimator::HandleProbeAndEstimateBitrate(
}
return absl::nullopt;
}
// Since the |send_interval| does not include the time it takes to actually
// Since the `send_interval` does not include the time it takes to actually
// send the last packet the size of the last sent packet should not be
// included when calculating the send bitrate.
RTC_DCHECK_GT(cluster->size_total, cluster->size_last_send);
DataSize send_size = cluster->size_total - cluster->size_last_send;
DataRate send_rate = send_size / send_interval;
// Since the |receive_interval| does not include the time it takes to
// Since the `receive_interval` does not include the time it takes to
// actually receive the first packet the size of the first received packet
// should not be included when calculating the receive bitrate.
RTC_DCHECK_GT(cluster->size_total, cluster->size_first_receive);

View File

@ -45,7 +45,7 @@ class ProbeBitrateEstimator {
DataSize size_total = DataSize::Zero();
};
// Erases old cluster data that was seen before |timestamp|.
// Erases old cluster data that was seen before `timestamp`.
void EraseOldClusters(Timestamp timestamp);
std::map<int, AggregatedCluster> clusters_;

View File

@ -38,7 +38,7 @@ constexpr int kMinProbeDurationMs = 15;
// the measured results back.
constexpr int64_t kMaxWaitingTimeForProbingResultMs = 1000;
// Value of |min_bitrate_to_probe_further_bps_| that indicates
// Value of `min_bitrate_to_probe_further_bps_` that indicates
// further probing is disabled.
constexpr int kExponentialProbingDisabled = 0;
@ -46,16 +46,16 @@ constexpr int kExponentialProbingDisabled = 0;
// specify max bitrate.
constexpr int64_t kDefaultMaxProbingBitrateBps = 5000000;
// If the bitrate drops to a factor |kBitrateDropThreshold| or lower
// and we recover within |kBitrateDropTimeoutMs|, then we'll send
// a probe at a fraction |kProbeFractionAfterDrop| of the original bitrate.
// If the bitrate drops to a factor `kBitrateDropThreshold` or lower
// and we recover within `kBitrateDropTimeoutMs`, then we'll send
// a probe at a fraction `kProbeFractionAfterDrop` of the original bitrate.
constexpr double kBitrateDropThreshold = 0.66;
constexpr int kBitrateDropTimeoutMs = 5000;
constexpr double kProbeFractionAfterDrop = 0.85;
// Timeout for probing after leaving ALR. If the bitrate drops significantly,
// (as determined by the delay based estimator) and we leave ALR, then we will
// send a probe if we recover within |kLeftAlrTimeoutMs| ms.
// send a probe if we recover within `kLeftAlrTimeoutMs` ms.
constexpr int kAlrEndedTimeoutMs = 3000;
// The expected uncertainty of probe result (as a fraction of the target probe
@ -155,8 +155,8 @@ std::vector<ProbeClusterConfig> ProbeController::SetBitrates(
start_bitrate_bps_ = min_bitrate_bps;
}
// The reason we use the variable |old_max_bitrate_pbs| is because we
// need to set |max_bitrate_bps_| before we call InitiateProbing.
// The reason we use the variable `old_max_bitrate_pbs` is because we
// need to set `max_bitrate_bps_` before we call InitiateProbing.
int64_t old_max_bitrate_bps = max_bitrate_bps_;
max_bitrate_bps_ = max_bitrate_bps;

View File

@ -94,7 +94,7 @@ class ProbeController {
void SetMaxBitrate(int64_t max_bitrate_bps);
// Resets the ProbeController to a state equivalent to as if it was just
// created EXCEPT for |enable_periodic_alr_probing_|.
// created EXCEPT for `enable_periodic_alr_probing_`.
void Reset(int64_t at_time_ms);
ABSL_MUST_USE_RESULT std::vector<ProbeClusterConfig> Process(

View File

@ -279,7 +279,7 @@ TEST_F(ProbeControllerTest, PeriodicProbingAfterReset) {
kMaxBitrateBps, NowMs());
EXPECT_EQ(probes.size(), 2u);
// Make sure we use |kStartBitrateBps| as the estimated bitrate
// Make sure we use `kStartBitrateBps` as the estimated bitrate
// until SetEstimatedBitrate is called with an updated estimate.
clock_.AdvanceTimeMilliseconds(10000);
probes = probe_controller_->Process(NowMs());

View File

@ -134,15 +134,15 @@ class SendSideBandwidthEstimation {
// Gets the upper limit for the target bitrate. This is the minimum of the
// delay based limit, the receiver limit and the loss based controller limit.
DataRate GetUpperLimit() const;
// Prints a warning if |bitrate| if sufficiently long time has past since last
// Prints a warning if `bitrate` if sufficiently long time has past since last
// warning.
void MaybeLogLowBitrateWarning(DataRate bitrate, Timestamp at_time);
// Stores an update to the event log if the loss rate has changed, the target
// has changed, or sufficient time has passed since last stored event.
void MaybeLogLossBasedEvent(Timestamp at_time);
// Cap |bitrate| to [min_bitrate_configured_, max_bitrate_configured_] and
// set |current_bitrate_| to the capped value and updates the event log.
// Cap `bitrate` to [min_bitrate_configured_, max_bitrate_configured_] and
// set `current_bitrate_` to the capped value and updates the event log.
void UpdateTargetBitrate(DataRate bitrate, Timestamp at_time);
// Applies lower and upper bounds to the current target rate.
// TODO(srte): This seems to be called even when limits haven't changed, that

View File

@ -60,7 +60,7 @@ class ReceiveSideCongestionController : public CallStatsObserver,
void OnBitrateChanged(int bitrate_bps);
// Ensures the remote party is notified of the receive bitrate no larger than
// |bitrate| using RTCP REMB.
// `bitrate` using RTCP REMB.
void SetMaxDesiredReceiveBitrate(DataRate bitrate);
// Implements Module.

View File

@ -28,9 +28,9 @@ namespace webrtc {
namespace {
// Helper to convert some time format to resolution used in absolute send time
// header extension, rounded upwards. |t| is the time to convert, in some
// resolution. |denom| is the value to divide |t| by to get whole seconds,
// e.g. |denom| = 1000 if |t| is in milliseconds.
// header extension, rounded upwards. `t` is the time to convert, in some
// resolution. `denom` is the value to divide `t` by to get whole seconds,
// e.g. `denom` = 1000 if `t` is in milliseconds.
uint32_t AbsSendTime(int64_t t, int64_t denom) {
return (((t << 18) + (denom >> 1)) / denom) & 0x00fffffful;
}

View File

@ -30,7 +30,7 @@ class RembThrottler : public RemoteBitrateObserver {
RembThrottler(RembSender remb_sender, Clock* clock);
// Ensures the remote party is notified of the receive bitrate no larger than
// |bitrate| using RTCP REMB.
// `bitrate` using RTCP REMB.
void SetMaxDesiredReceiveBitrate(DataRate bitrate);
// Implements RemoteBitrateObserver;