Delete unused NetEq stats currentPacketLossRate, currentDiscardRate and addedSamples
Bug: webrtc:11622 Change-Id: I097bb7284d952ada41f4f38dd7adf3536bd040ee Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183620 Reviewed-by: Minyue Li <minyue@google.com> Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Sam Zackrisson <saza@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32148}
This commit is contained in:
@ -36,7 +36,6 @@ struct NetEqNetworkStatistics {
|
||||
uint16_t preferred_buffer_size_ms; // Target buffer size in ms.
|
||||
uint16_t jitter_peaks_found; // 1 if adding extra delay due to peaky
|
||||
// jitter; 0 otherwise.
|
||||
uint16_t packet_loss_rate; // Loss rate (network + late) in Q14.
|
||||
uint16_t expand_rate; // Fraction (of original stream) of synthesized
|
||||
// audio inserted through expansion (in Q14).
|
||||
uint16_t speech_expand_rate; // Fraction (of original stream) of synthesized
|
||||
@ -49,7 +48,6 @@ struct NetEqNetworkStatistics {
|
||||
// decoding (in Q14).
|
||||
uint16_t secondary_discarded_rate; // Fraction of discarded FEC/RED data (in
|
||||
// Q14).
|
||||
size_t added_zero_samples; // Number of zero samples added in "off" mode.
|
||||
// Statistics for packet waiting times, i.e., the time between a packet
|
||||
// arrives until it is decoded.
|
||||
int mean_waiting_time_ms;
|
||||
|
@ -67,9 +67,8 @@ const std::pair<int, SdpAudioFormat> kReceiveCodec = {
|
||||
123,
|
||||
{"codec_name_recv", 96000, 0}};
|
||||
const NetworkStatistics kNetworkStats = {
|
||||
123, 456, false, 789012, 3456, 123, 456, 789, 543, 123,
|
||||
432, 321, 123, 101, 0, {}, 789, 12, 345, 678,
|
||||
901, 0, -1, -1, -1, -1, 0, 0, 0, 0};
|
||||
123, 456, false, 789012, 3456, 123, 456, 789, 543, 123, 432, 321, 123, 101,
|
||||
789, 12, 345, 678, 901, 0, -1, -1, -1, -1, 0, 0, 0, 0};
|
||||
const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
|
||||
|
||||
struct ConfigHelper {
|
||||
|
@ -252,7 +252,6 @@ void AcmReceiver::GetNetworkStatistics(
|
||||
// NetEq function always returns zero, so we don't check the return value.
|
||||
neteq_->NetworkStatistics(&neteq_stat);
|
||||
|
||||
acm_stat->currentPacketLossRate = neteq_stat.packet_loss_rate;
|
||||
acm_stat->currentExpandRate = neteq_stat.expand_rate;
|
||||
acm_stat->currentSpeechExpandRate = neteq_stat.speech_expand_rate;
|
||||
acm_stat->currentPreemptiveRate = neteq_stat.preemptive_rate;
|
||||
@ -260,21 +259,18 @@ void AcmReceiver::GetNetworkStatistics(
|
||||
acm_stat->currentSecondaryDecodedRate = neteq_stat.secondary_decoded_rate;
|
||||
acm_stat->currentSecondaryDiscardedRate =
|
||||
neteq_stat.secondary_discarded_rate;
|
||||
acm_stat->addedSamples = neteq_stat.added_zero_samples;
|
||||
acm_stat->meanWaitingTimeMs = neteq_stat.mean_waiting_time_ms;
|
||||
acm_stat->medianWaitingTimeMs = neteq_stat.median_waiting_time_ms;
|
||||
acm_stat->minWaitingTimeMs = neteq_stat.min_waiting_time_ms;
|
||||
acm_stat->maxWaitingTimeMs = neteq_stat.max_waiting_time_ms;
|
||||
} else {
|
||||
neteq_stat = neteq_->CurrentNetworkStatistics();
|
||||
acm_stat->currentPacketLossRate = 0;
|
||||
acm_stat->currentExpandRate = 0;
|
||||
acm_stat->currentSpeechExpandRate = 0;
|
||||
acm_stat->currentPreemptiveRate = 0;
|
||||
acm_stat->currentAccelerateRate = 0;
|
||||
acm_stat->currentSecondaryDecodedRate = 0;
|
||||
acm_stat->currentSecondaryDiscardedRate = 0;
|
||||
acm_stat->addedSamples = 0;
|
||||
acm_stat->meanWaitingTimeMs = -1;
|
||||
acm_stat->medianWaitingTimeMs = -1;
|
||||
acm_stat->minWaitingTimeMs = -1;
|
||||
|
@ -97,12 +97,6 @@ struct NetworkStatistics {
|
||||
uint64_t fecPacketsReceived;
|
||||
uint64_t fecPacketsDiscarded;
|
||||
// Stats below DO NOT correspond directly to anything in the WebRTC stats
|
||||
// Loss rate (network + late); fraction between 0 and 1, scaled to Q14.
|
||||
uint16_t currentPacketLossRate;
|
||||
// Late loss rate; fraction between 0 and 1, scaled to Q14.
|
||||
union {
|
||||
RTC_DEPRECATED uint16_t currentDiscardRate;
|
||||
};
|
||||
// fraction (of original stream) of synthesized audio inserted through
|
||||
// expansion (in Q14)
|
||||
uint16_t currentExpandRate;
|
||||
@ -129,8 +123,6 @@ struct NetworkStatistics {
|
||||
int minWaitingTimeMs;
|
||||
// max packet waiting time in the jitter buffer (ms)
|
||||
int maxWaitingTimeMs;
|
||||
// added samples in off mode due to packet loss
|
||||
size_t addedSamples;
|
||||
// count of the number of buffer flushes
|
||||
uint64_t packetBufferFlushes;
|
||||
// number of samples expanded due to delayed packets
|
||||
|
@ -1326,13 +1326,6 @@ int NetEqImpl::GetDecision(Operation* operation,
|
||||
int extracted_samples = 0;
|
||||
if (packet) {
|
||||
sync_buffer_->IncreaseEndTimestamp(packet->timestamp - end_timestamp);
|
||||
if (controller_->CngOff()) {
|
||||
// Adjustment of timestamp only corresponds to an actual packet loss
|
||||
// if comfort noise is not played. If comfort noise was just played,
|
||||
// this adjustment of timestamp is only done to get back in sync with the
|
||||
// stream timestamp; no loss to report.
|
||||
stats_->LostSamples(packet->timestamp - end_timestamp);
|
||||
}
|
||||
|
||||
if (*operation != Operation::kRfc3389Cng) {
|
||||
// We are about to decode and use a non-CNG packet.
|
||||
|
@ -215,14 +215,12 @@ class NetEqNetworkStatsTest {
|
||||
CHECK_NETEQ_NETWORK_STATS(current_buffer_size_ms);
|
||||
CHECK_NETEQ_NETWORK_STATS(preferred_buffer_size_ms);
|
||||
CHECK_NETEQ_NETWORK_STATS(jitter_peaks_found);
|
||||
CHECK_NETEQ_NETWORK_STATS(packet_loss_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(expand_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(speech_expand_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(preemptive_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(accelerate_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(secondary_decoded_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(secondary_discarded_rate);
|
||||
CHECK_NETEQ_NETWORK_STATS(added_zero_samples);
|
||||
|
||||
#undef CHECK_NETEQ_NETWORK_STATS
|
||||
}
|
||||
@ -276,14 +274,12 @@ class NetEqNetworkStatsTest {
|
||||
|
||||
// Next we introduce packet losses.
|
||||
SetPacketLossRate(0.1);
|
||||
expects.stats_ref.packet_loss_rate = 1337;
|
||||
expects.stats_ref.expand_rate = expects.stats_ref.speech_expand_rate = 1065;
|
||||
RunTest(50, expects);
|
||||
|
||||
// Next we enable FEC.
|
||||
decoder_->set_fec_enabled(true);
|
||||
// If FEC fills in the lost packets, no packet loss will be counted.
|
||||
expects.stats_ref.packet_loss_rate = 0;
|
||||
expects.stats_ref.expand_rate = expects.stats_ref.speech_expand_rate = 0;
|
||||
expects.stats_ref.secondary_decoded_rate = 2006;
|
||||
expects.stats_ref.secondary_discarded_rate = 14336;
|
||||
|
@ -90,10 +90,10 @@ TEST_F(NetEqDecodingTest, MAYBE_TestBitExactness) {
|
||||
"8d73c98645917cdeaaa01c20cf095ccc5a10b2b5");
|
||||
|
||||
const std::string network_stats_checksum =
|
||||
PlatformChecksum("3d186ea7e243abfdbd3d39b8ebf8f02a318117e4",
|
||||
"0b725774133da5dd823f2046663c12a76e0dbd79", "not used",
|
||||
"3d186ea7e243abfdbd3d39b8ebf8f02a318117e4",
|
||||
"3d186ea7e243abfdbd3d39b8ebf8f02a318117e4");
|
||||
PlatformChecksum("8e50f528f245b7957db20ab406a72d81be60f5f4",
|
||||
"4260b22ea6d2723b2d573e50d2c1476680c7fa4c", "not used",
|
||||
"8e50f528f245b7957db20ab406a72d81be60f5f4",
|
||||
"8e50f528f245b7957db20ab406a72d81be60f5f4");
|
||||
|
||||
DecodeAndCompare(input_rtp_file, output_checksum, network_stats_checksum,
|
||||
absl::GetFlag(FLAGS_gen_ref));
|
||||
@ -117,11 +117,11 @@ TEST_F(NetEqDecodingTest, MAYBE_TestOpusBitExactness) {
|
||||
"625055e5eb0e6de2c9d170b4494eadc5afab08c8", maybe_sse, maybe_sse);
|
||||
|
||||
const std::string network_stats_checksum =
|
||||
PlatformChecksum("439a3d0c9b5115e6d4f8387f64ed2d57cae29b0a",
|
||||
"048f33d85d0a32a328b7da42448f560456a5fef0",
|
||||
"c876f2a04c4f0a91da7f084f80e87871b7c5a4a1",
|
||||
"439a3d0c9b5115e6d4f8387f64ed2d57cae29b0a",
|
||||
"439a3d0c9b5115e6d4f8387f64ed2d57cae29b0a");
|
||||
PlatformChecksum("ec29e047b019a86ec06e2c40643143dc1975c69f",
|
||||
"0c24649824eb7147d4891b0767e86e732dd6ecc8",
|
||||
"10f3e0b66c6947f78d60301454f2841033a6fcc0",
|
||||
"ec29e047b019a86ec06e2c40643143dc1975c69f",
|
||||
"ec29e047b019a86ec06e2c40643143dc1975c69f");
|
||||
|
||||
DecodeAndCompare(input_rtp_file, output_checksum, network_stats_checksum,
|
||||
absl::GetFlag(FLAGS_gen_ref));
|
||||
@ -145,7 +145,7 @@ TEST_F(NetEqDecodingTest, MAYBE_TestOpusDtxBitExactness) {
|
||||
"709a3f0f380393d3a67bace10e2265b90a6ebbeb", maybe_sse, maybe_sse);
|
||||
|
||||
const std::string network_stats_checksum =
|
||||
"8caf49765f35b6862066d3f17531ce44d8e25f60";
|
||||
"80f5283ac71b27596204210152927666c1732de4";
|
||||
|
||||
DecodeAndCompare(input_rtp_file, output_checksum, network_stats_checksum,
|
||||
absl::GetFlag(FLAGS_gen_ref));
|
||||
|
@ -7,8 +7,8 @@ message NetEqNetworkStatistics {
|
||||
optional uint32 current_buffer_size_ms = 1;
|
||||
optional uint32 preferred_buffer_size_ms = 2;
|
||||
optional uint32 jitter_peaks_found = 3;
|
||||
optional uint32 packet_loss_rate = 4;
|
||||
optional uint32 packet_discard_rate = 5 [deprecated = true];
|
||||
reserved 4; // Was packet_loss_rate.
|
||||
reserved 5; // Was packet_discard_rate.
|
||||
optional uint32 expand_rate = 6;
|
||||
optional uint32 speech_expand_rate = 7;
|
||||
optional uint32 preemptive_rate = 8;
|
||||
@ -16,7 +16,7 @@ message NetEqNetworkStatistics {
|
||||
optional uint32 secondary_decoded_rate = 10;
|
||||
optional uint32 secondary_discarded_rate = 17;
|
||||
optional int32 clockdrift_ppm = 11;
|
||||
optional uint64 added_zero_samples = 12;
|
||||
reserved 12; // Was added_zero_samples.
|
||||
optional int32 mean_waiting_time_ms = 13;
|
||||
optional int32 median_waiting_time_ms = 14;
|
||||
optional int32 min_waiting_time_ms = 15;
|
||||
@ -29,4 +29,3 @@ message RtcpStatistics {
|
||||
optional uint32 extended_max_sequence_number = 3;
|
||||
optional uint32 jitter = 4;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,6 @@ StatisticsCalculator::StatisticsCalculator()
|
||||
accelerate_samples_(0),
|
||||
expanded_speech_samples_(0),
|
||||
expanded_noise_samples_(0),
|
||||
lost_timestamps_(0),
|
||||
timestamps_since_last_report_(0),
|
||||
secondary_decoded_samples_(0),
|
||||
discarded_secondary_packets_(0),
|
||||
@ -145,7 +144,6 @@ void StatisticsCalculator::Reset() {
|
||||
}
|
||||
|
||||
void StatisticsCalculator::ResetMcu() {
|
||||
lost_timestamps_ = 0;
|
||||
timestamps_since_last_report_ = 0;
|
||||
}
|
||||
|
||||
@ -246,10 +244,6 @@ void StatisticsCalculator::SecondaryPacketsReceived(size_t num_packets) {
|
||||
lifetime_stats_.fec_packets_received += num_packets;
|
||||
}
|
||||
|
||||
void StatisticsCalculator::LostSamples(size_t num_samples) {
|
||||
lost_timestamps_ += num_samples;
|
||||
}
|
||||
|
||||
void StatisticsCalculator::IncreaseCounter(size_t num_samples, int fs_hz) {
|
||||
const int time_step_ms =
|
||||
rtc::CheckedDivExact(static_cast<int>(1000 * num_samples), fs_hz);
|
||||
@ -259,7 +253,6 @@ void StatisticsCalculator::IncreaseCounter(size_t num_samples, int fs_hz) {
|
||||
timestamps_since_last_report_ += static_cast<uint32_t>(num_samples);
|
||||
if (timestamps_since_last_report_ >
|
||||
static_cast<uint32_t>(fs_hz * kMaxReportPeriod)) {
|
||||
lost_timestamps_ = 0;
|
||||
timestamps_since_last_report_ = 0;
|
||||
}
|
||||
lifetime_stats_.total_samples_received += num_samples;
|
||||
@ -316,11 +309,6 @@ void StatisticsCalculator::GetNetworkStatistics(size_t samples_per_packet,
|
||||
NetEqNetworkStatistics* stats) {
|
||||
RTC_DCHECK(stats);
|
||||
|
||||
stats->added_zero_samples = 0;
|
||||
|
||||
stats->packet_loss_rate =
|
||||
CalculateQ14Ratio(lost_timestamps_, timestamps_since_last_report_);
|
||||
|
||||
stats->accelerate_rate =
|
||||
CalculateQ14Ratio(accelerate_samples_, timestamps_since_last_report_);
|
||||
|
||||
|
@ -71,9 +71,6 @@ class StatisticsCalculator {
|
||||
// Reports that |num_packets| secondary (FEC) packets were received.
|
||||
virtual void SecondaryPacketsReceived(size_t num_packets);
|
||||
|
||||
// Reports that |num_samples| were lost.
|
||||
void LostSamples(size_t num_samples);
|
||||
|
||||
// Increases the report interval counter with |num_samples| at a sample rate
|
||||
// of |fs_hz|. This is how the StatisticsCalculator gets notified that current
|
||||
// time is increasing.
|
||||
@ -192,7 +189,6 @@ class StatisticsCalculator {
|
||||
size_t expanded_speech_samples_;
|
||||
size_t expanded_noise_samples_;
|
||||
size_t concealed_samples_at_event_end_ = 0;
|
||||
size_t lost_timestamps_;
|
||||
uint32_t timestamps_since_last_report_;
|
||||
std::deque<int> waiting_times_;
|
||||
uint32_t secondary_decoded_samples_;
|
||||
|
@ -35,14 +35,12 @@ void Convert(const webrtc::NetEqNetworkStatistics& stats_raw,
|
||||
stats->set_current_buffer_size_ms(stats_raw.current_buffer_size_ms);
|
||||
stats->set_preferred_buffer_size_ms(stats_raw.preferred_buffer_size_ms);
|
||||
stats->set_jitter_peaks_found(stats_raw.jitter_peaks_found);
|
||||
stats->set_packet_loss_rate(stats_raw.packet_loss_rate);
|
||||
stats->set_expand_rate(stats_raw.expand_rate);
|
||||
stats->set_speech_expand_rate(stats_raw.speech_expand_rate);
|
||||
stats->set_preemptive_rate(stats_raw.preemptive_rate);
|
||||
stats->set_accelerate_rate(stats_raw.accelerate_rate);
|
||||
stats->set_secondary_decoded_rate(stats_raw.secondary_decoded_rate);
|
||||
stats->set_secondary_discarded_rate(stats_raw.secondary_discarded_rate);
|
||||
stats->set_added_zero_samples(stats_raw.added_zero_samples);
|
||||
stats->set_mean_waiting_time_ms(stats_raw.mean_waiting_time_ms);
|
||||
stats->set_median_waiting_time_ms(stats_raw.median_waiting_time_ms);
|
||||
stats->set_min_waiting_time_ms(stats_raw.min_waiting_time_ms);
|
||||
|
@ -103,14 +103,12 @@ NetEqStatsGetter::Stats NetEqStatsGetter::AverageStats() const {
|
||||
a.current_buffer_size_ms += b.current_buffer_size_ms;
|
||||
a.preferred_buffer_size_ms += b.preferred_buffer_size_ms;
|
||||
a.jitter_peaks_found += b.jitter_peaks_found;
|
||||
a.packet_loss_rate += b.packet_loss_rate / 16384.0;
|
||||
a.expand_rate += b.expand_rate / 16384.0;
|
||||
a.speech_expand_rate += b.speech_expand_rate / 16384.0;
|
||||
a.preemptive_rate += b.preemptive_rate / 16384.0;
|
||||
a.accelerate_rate += b.accelerate_rate / 16384.0;
|
||||
a.secondary_decoded_rate += b.secondary_decoded_rate / 16384.0;
|
||||
a.secondary_discarded_rate += b.secondary_discarded_rate / 16384.0;
|
||||
a.added_zero_samples += b.added_zero_samples;
|
||||
a.mean_waiting_time_ms += b.mean_waiting_time_ms;
|
||||
a.median_waiting_time_ms += b.median_waiting_time_ms;
|
||||
a.min_waiting_time_ms = std::min(
|
||||
|
@ -517,18 +517,6 @@ int main(int argc, char* argv[]) {
|
||||
"Preemptive rate", plot);
|
||||
});
|
||||
|
||||
plots.RegisterPlot("simulated_neteq_packet_loss_rate", [&](Plot* plot) {
|
||||
if (!neteq_stats) {
|
||||
neteq_stats = webrtc::SimulateNetEq(parsed_log, config, wav_path, 48000);
|
||||
}
|
||||
webrtc::CreateNetEqNetworkStatsGraph(
|
||||
parsed_log, config, *neteq_stats,
|
||||
[](const webrtc::NetEqNetworkStatistics& stats) {
|
||||
return stats.packet_loss_rate / 16384.f;
|
||||
},
|
||||
"Packet loss rate", plot);
|
||||
});
|
||||
|
||||
plots.RegisterPlot("simulated_neteq_concealment_events", [&](Plot* plot) {
|
||||
if (!neteq_stats) {
|
||||
neteq_stats = webrtc::SimulateNetEq(parsed_log, config, wav_path, 48000);
|
||||
|
Reference in New Issue
Block a user