Refactor NetEq delay manager logic.
- Removes dependence on sequence number for calculating target delay. - Changes target delay unit to milliseconds instead of number of packets. - Moves acceleration/preemptive expand thresholds to decision logic. Tests for this will be added in a follow up cl. Bug: webrtc:10333 Change-Id: If690aae4abf41ef1d9353f0ff01fb7d121cf8a26 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186265 Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org> Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32326}
This commit is contained in:

committed by
Commit Bot

parent
76d3e7a8d1
commit
f8e62fcb14
@ -70,19 +70,16 @@ class DecisionLogic : public NetEqController {
|
||||
// Adds |value| to |sample_memory_|.
|
||||
void AddSampleMemory(int32_t value) override { sample_memory_ += value; }
|
||||
|
||||
int TargetLevelMs() const override {
|
||||
return ((delay_manager_->TargetLevel() * packet_length_samples_) >> 8) /
|
||||
rtc::CheckedDivExact(sample_rate_, 1000);
|
||||
}
|
||||
int TargetLevelMs() const override { return delay_manager_->TargetDelayMs(); }
|
||||
|
||||
absl::optional<int> PacketArrived(bool last_cng_or_dtmf,
|
||||
absl::optional<int> PacketArrived(bool is_cng_or_dtmf,
|
||||
size_t packet_length_samples,
|
||||
bool should_update_stats,
|
||||
uint16_t main_sequence_number,
|
||||
uint32_t main_timestamp,
|
||||
int fs_hz) override;
|
||||
|
||||
void RegisterEmptyPacket() override { delay_manager_->RegisterEmptyPacket(); }
|
||||
void RegisterEmptyPacket() override {}
|
||||
|
||||
bool SetMaximumDelay(int delay_ms) override {
|
||||
return delay_manager_->SetMaximumDelay(delay_ms);
|
||||
@ -120,8 +117,8 @@ class DecisionLogic : public NetEqController {
|
||||
enum CngState { kCngOff, kCngRfc3389On, kCngInternalOn };
|
||||
|
||||
// Updates the |buffer_level_filter_| with the current buffer level
|
||||
// |buffer_size_packets|.
|
||||
void FilterBufferLevel(size_t buffer_size_packets);
|
||||
// |buffer_size_samples|.
|
||||
void FilterBufferLevel(size_t buffer_size_samples);
|
||||
|
||||
// Returns the operation given that the next available packet is a comfort
|
||||
// noise payload (RFC 3389 only, not codec-internal).
|
||||
@ -186,6 +183,7 @@ class DecisionLogic : public NetEqController {
|
||||
std::unique_ptr<TickTimer::Countdown> timescale_countdown_;
|
||||
int num_consecutive_expands_ = 0;
|
||||
int time_stretched_cn_samples_ = 0;
|
||||
bool last_pack_cng_or_dtmf_ = true;
|
||||
FieldTrialParameter<bool> estimate_dtx_delay_;
|
||||
FieldTrialParameter<bool> time_stretch_cn_;
|
||||
FieldTrialConstrained<int> target_level_window_ms_;
|
||||
|
Reference in New Issue
Block a user