Use backticks not vertical bars to denote variables in comments for /modules/rtp_rtcp
Bug: webrtc:12338 Change-Id: I52eb3b6675c4705e22f51b70799ed6139a3b46bc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227164 Reviewed-by: Harald Alvestrand <hta@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34686}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
7f9ab1aa1b
commit
913cfa76ec
@ -155,7 +155,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
uint8_t fec_packet_masks_[kMaxNumberMediaPackets][kMaxNumberMediaPackets];
|
||||
FILE* fp_mask_;
|
||||
|
||||
// Measure of the gap of the loss for configuration given by |state|.
|
||||
// Measure of the gap of the loss for configuration given by `state`.
|
||||
// This is to measure degree of consecutiveness for the loss configuration.
|
||||
// Useful if the packets are sent out in order of sequence numbers and there
|
||||
// is little/no re-ordering during transmission.
|
||||
@ -183,8 +183,8 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
// Returns the number of recovered media packets for the XOR code, given the
|
||||
// packet mask |fec_packet_masks_|, for the loss state/configuration given by
|
||||
// |state|.
|
||||
// packet mask `fec_packet_masks_`, for the loss state/configuration given by
|
||||
// `state`.
|
||||
int RecoveredMediaPackets(int num_media_packets,
|
||||
int num_fec_packets,
|
||||
uint8_t* state) {
|
||||
@ -241,7 +241,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
// Compute the probability of occurence of the loss state/configuration,
|
||||
// given by |state|, for all the loss models considered in this test.
|
||||
// given by `state`, for all the loss models considered in this test.
|
||||
void ComputeProbabilityWeight(double* prob_weight,
|
||||
uint8_t* state,
|
||||
int tot_num_packets) {
|
||||
@ -317,8 +317,8 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
// Compute the residual loss per gap, by summing the
|
||||
// |residual_loss_per_loss_gap| over all loss configurations up to loss number
|
||||
// = |num_fec_packets|.
|
||||
// `residual_loss_per_loss_gap` over all loss configurations up to loss number
|
||||
// = `num_fec_packets`.
|
||||
double ComputeResidualLossPerGap(MetricsFecCode metrics,
|
||||
int gap_number,
|
||||
int num_fec_packets,
|
||||
@ -339,7 +339,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
// Compute the recovery rate per loss number, by summing the
|
||||
// |residual_loss_per_loss_gap| over all gap configurations.
|
||||
// `residual_loss_per_loss_gap` over all gap configurations.
|
||||
void ComputeRecoveryRatePerLoss(MetricsFecCode* metrics,
|
||||
int num_media_packets,
|
||||
int num_fec_packets,
|
||||
@ -358,7 +358,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
if (tot_num_configs > 0) {
|
||||
arl = arl / static_cast<double>(tot_num_configs);
|
||||
}
|
||||
// Recovery rate for a given loss |loss| is 1 minus the scaled |arl|,
|
||||
// Recovery rate for a given loss `loss` is 1 minus the scaled `arl`,
|
||||
// where the scale factor is relative to code size/parameters.
|
||||
double scaled_loss =
|
||||
static_cast<double>(loss * num_media_packets) /
|
||||
@ -376,8 +376,8 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
sizeof(double) * 2 * kMaxMediaPacketsTest + 1);
|
||||
}
|
||||
|
||||
// Compute the metrics for an FEC code, given by the code type |code_type|
|
||||
// (XOR-random/ bursty or RS), and by the code index |code_index|
|
||||
// Compute the metrics for an FEC code, given by the code type `code_type`
|
||||
// (XOR-random/ bursty or RS), and by the code index `code_index`
|
||||
// (which containes the code size parameters/protection length).
|
||||
void ComputeMetricsForCode(CodeType code_type, int code_index) {
|
||||
std::unique_ptr<double[]> prob_weight(new double[kNumLossModels]);
|
||||
@ -393,7 +393,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
|
||||
int num_loss_configurations = 1 << tot_num_packets;
|
||||
// Loop over all loss configurations for the symbol sequence of length
|
||||
// |tot_num_packets|. In this version we process up to (k=12, m=12) codes,
|
||||
// `tot_num_packets`. In this version we process up to (k=12, m=12) codes,
|
||||
// and get exact expressions for the residual loss.
|
||||
// TODO(marpan): For larger codes, loop over some random sample of loss
|
||||
// configurations, sampling driven by the underlying statistical loss model
|
||||
@ -470,16 +470,16 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
metrics_code.residual_loss_per_loss_gap[index] += residual_loss;
|
||||
if (code_type == xor_random_code) {
|
||||
// The configuration density is only a function of the code length and
|
||||
// only needs to computed for the first |code_type| passed here.
|
||||
// only needs to computed for the first `code_type` passed here.
|
||||
code_params_[code_index].configuration_density[index]++;
|
||||
}
|
||||
} // Done with loop over configurations.
|
||||
// Normalize the average residual loss and compute/normalize the variance.
|
||||
for (int k = 0; k < kNumLossModels; k++) {
|
||||
// Normalize the average residual loss by the total number of packets
|
||||
// |tot_num_packets| (i.e., the code length). For a code with no (zero)
|
||||
// `tot_num_packets` (i.e., the code length). For a code with no (zero)
|
||||
// recovery, the average residual loss for that code would be reduced like
|
||||
// ~|average_loss_rate| * |num_media_packets| / |tot_num_packets|. This is
|
||||
// ~`average_loss_rate` * `num_media_packets` / `tot_num_packets`. This is
|
||||
// the expected reduction in the average residual loss just from adding
|
||||
// FEC packets to the symbol sequence.
|
||||
metrics_code.average_residual_loss[k] =
|
||||
@ -516,7 +516,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
void WriteOutMetricsAllFecCodes() {
|
||||
std::string filename = test::OutputPath() + "data_metrics_all_codes";
|
||||
FILE* fp = fopen(filename.c_str(), "wb");
|
||||
// Loop through codes up to |kMaxMediaPacketsTest|.
|
||||
// Loop through codes up to `kMaxMediaPacketsTest`.
|
||||
int code_index = 0;
|
||||
for (int num_media_packets = 1; num_media_packets <= kMaxMediaPacketsTest;
|
||||
num_media_packets++) {
|
||||
@ -714,7 +714,7 @@ class FecPacketMaskMetricsTest : public ::testing::Test {
|
||||
const int packet_mask_max = kMaxMediaPackets[fec_mask_type];
|
||||
std::unique_ptr<uint8_t[]> packet_mask(
|
||||
new uint8_t[packet_mask_max * kUlpfecMaxPacketMaskSize]);
|
||||
// Loop through codes up to |kMaxMediaPacketsTest|.
|
||||
// Loop through codes up to `kMaxMediaPacketsTest`.
|
||||
for (int num_media_packets = 1; num_media_packets <= kMaxMediaPacketsTest;
|
||||
++num_media_packets) {
|
||||
const int mask_bytes_fec_packet =
|
||||
@ -955,7 +955,7 @@ TEST_F(FecPacketMaskMetricsTest, FecXorBurstyPerfectRecoveryConsecutiveLoss) {
|
||||
for (int code_index = 0; code_index < max_num_codes_; code_index++) {
|
||||
int num_fec_packets = code_params_[code_index].num_fec_packets;
|
||||
for (int loss = 1; loss <= num_fec_packets; loss++) {
|
||||
int index = loss; // |gap| is zero.
|
||||
int index = loss; // `gap` is zero.
|
||||
EXPECT_EQ(kMetricsXorBursty[code_index].residual_loss_per_loss_gap[index],
|
||||
0.0);
|
||||
}
|
||||
@ -1010,8 +1010,8 @@ TEST_F(FecPacketMaskMetricsTest, FecRecoveryRateUnderLossConditions) {
|
||||
for (int code_index = 0; code_index < max_num_codes_; code_index++) {
|
||||
int num_media_packets = code_params_[code_index].num_media_packets;
|
||||
int num_fec_packets = code_params_[code_index].num_fec_packets;
|
||||
// Perfect recovery (|recovery_rate_per_loss| == 1) is expected for
|
||||
// |loss_number| = 1, for all codes.
|
||||
// Perfect recovery (`recovery_rate_per_loss` == 1) is expected for
|
||||
// `loss_number` = 1, for all codes.
|
||||
int loss_number = 1;
|
||||
EXPECT_EQ(
|
||||
kMetricsReedSolomon[code_index].recovery_rate_per_loss[loss_number],
|
||||
@ -1020,7 +1020,7 @@ TEST_F(FecPacketMaskMetricsTest, FecRecoveryRateUnderLossConditions) {
|
||||
1.0);
|
||||
EXPECT_EQ(kMetricsXorBursty[code_index].recovery_rate_per_loss[loss_number],
|
||||
1.0);
|
||||
// For |loss_number| = |num_fec_packets| / 2, we expect the following:
|
||||
// For `loss_number` = `num_fec_packets` / 2, we expect the following:
|
||||
// Perfect recovery for RS, and recovery for XOR above the threshold.
|
||||
loss_number = num_fec_packets / 2 > 0 ? num_fec_packets / 2 : 1;
|
||||
EXPECT_EQ(
|
||||
@ -1030,7 +1030,7 @@ TEST_F(FecPacketMaskMetricsTest, FecRecoveryRateUnderLossConditions) {
|
||||
kRecoveryRateXorRandom[0]);
|
||||
EXPECT_GE(kMetricsXorBursty[code_index].recovery_rate_per_loss[loss_number],
|
||||
kRecoveryRateXorBursty[0]);
|
||||
// For |loss_number| = |num_fec_packets|, we expect the following:
|
||||
// For `loss_number` = `num_fec_packets`, we expect the following:
|
||||
// Perfect recovery for RS, and recovery for XOR above the threshold.
|
||||
loss_number = num_fec_packets;
|
||||
EXPECT_EQ(
|
||||
@ -1040,7 +1040,7 @@ TEST_F(FecPacketMaskMetricsTest, FecRecoveryRateUnderLossConditions) {
|
||||
kRecoveryRateXorRandom[1]);
|
||||
EXPECT_GE(kMetricsXorBursty[code_index].recovery_rate_per_loss[loss_number],
|
||||
kRecoveryRateXorBursty[1]);
|
||||
// For |loss_number| = |num_fec_packets| + 1, we expect the following:
|
||||
// For `loss_number` = `num_fec_packets` + 1, we expect the following:
|
||||
// Zero recovery for RS, but non-zero recovery for XOR.
|
||||
if (num_fec_packets > 1 && num_media_packets > 2) {
|
||||
loss_number = num_fec_packets + 1;
|
||||
|
||||
Reference in New Issue
Block a user