Add generated comfort noise counter.
Currently only implemented for codec internal CNG (Opus). Bug: webrtc:13322 Change-Id: I00622f2967f066dba64a792e26081038ae0cb0d9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259200 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36590}
This commit is contained in:

committed by
WebRTC LUCI CQ

parent
61a01af454
commit
098c4ea2ca
@ -88,6 +88,8 @@ struct NetEqLifetimeStatistics {
|
|||||||
// these events.
|
// these events.
|
||||||
int32_t interruption_count = 0;
|
int32_t interruption_count = 0;
|
||||||
int32_t total_interruption_duration_ms = 0;
|
int32_t total_interruption_duration_ms = 0;
|
||||||
|
// Total number of comfort noise samples generated during DTX.
|
||||||
|
uint64_t generated_noise_samples = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Metrics that describe the operations performed in NetEq, and the internal
|
// Metrics that describe the operations performed in NetEq, and the internal
|
||||||
|
@ -1455,6 +1455,7 @@ int NetEqImpl::DecodeCng(AudioDecoder* decoder,
|
|||||||
return kDecodedTooMuch;
|
return kDecodedTooMuch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stats_->GeneratedNoiseSamples(*decoded_length);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,6 +230,10 @@ void StatisticsCalculator::AcceleratedSamples(size_t num_samples) {
|
|||||||
lifetime_stats_.removed_samples_for_acceleration += num_samples;
|
lifetime_stats_.removed_samples_for_acceleration += num_samples;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StatisticsCalculator::GeneratedNoiseSamples(size_t num_samples) {
|
||||||
|
lifetime_stats_.generated_noise_samples += num_samples;
|
||||||
|
}
|
||||||
|
|
||||||
void StatisticsCalculator::PacketsDiscarded(size_t num_packets) {
|
void StatisticsCalculator::PacketsDiscarded(size_t num_packets) {
|
||||||
operations_and_state_.discarded_primary_packets += num_packets;
|
operations_and_state_.discarded_primary_packets += num_packets;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,9 @@ class StatisticsCalculator {
|
|||||||
// Reports that `num_samples` samples were removed through accelerate.
|
// Reports that `num_samples` samples were removed through accelerate.
|
||||||
void AcceleratedSamples(size_t num_samples);
|
void AcceleratedSamples(size_t num_samples);
|
||||||
|
|
||||||
|
// Reports that `num_samples` comfort noise samples were generated.
|
||||||
|
void GeneratedNoiseSamples(size_t num_samples);
|
||||||
|
|
||||||
// Reports that `num_packets` packets were discarded.
|
// Reports that `num_packets` packets were discarded.
|
||||||
virtual void PacketsDiscarded(size_t num_packets);
|
virtual void PacketsDiscarded(size_t num_packets);
|
||||||
|
|
||||||
|
@ -94,6 +94,12 @@ void NetEqStatsPlotter::SimulationEnded(int64_t simulation_time_ms) {
|
|||||||
printf(" interruption_ratio: %f\n",
|
printf(" interruption_ratio: %f\n",
|
||||||
static_cast<double>(lifetime_stats.total_interruption_duration_ms) /
|
static_cast<double>(lifetime_stats.total_interruption_duration_ms) /
|
||||||
simulation_time_ms);
|
simulation_time_ms);
|
||||||
|
printf(" removed_samples_for_acceleration: %" PRIu64 "\n",
|
||||||
|
lifetime_stats.removed_samples_for_acceleration);
|
||||||
|
printf(" inserted_samples_for_deceleration: %" PRIu64 "\n",
|
||||||
|
lifetime_stats.inserted_samples_for_deceleration);
|
||||||
|
printf(" generated_noise_samples: %" PRIu64 "\n",
|
||||||
|
lifetime_stats.generated_noise_samples);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user