Avoid incorrect filter alignment due to call skew detection
Bug: chromium:892040,webrtc:9816 Change-Id: I46e8b2de61eedf67e235fcea8f3b9e85f690e64f Reviewed-on: https://webrtc-review.googlesource.com/c/103661 Reviewed-by: Per Åhgren <peah@webrtc.org> Commit-Queue: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24982}
This commit is contained in:

committed by
Commit Bot

parent
8ca5c5216d
commit
d7b0c46bd9
@ -40,6 +40,10 @@ int GetSkewHysteresis(const EchoCanceller3Config& config) {
|
|||||||
return static_cast<int>(config.delay.skew_hysteresis_blocks);
|
return static_cast<int>(config.delay.skew_hysteresis_blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UseOffsetBlocks() {
|
||||||
|
return field_trial::IsEnabled("WebRTC-Aec3UseOffsetBlocks");
|
||||||
|
}
|
||||||
|
|
||||||
constexpr int kSkewHistorySizeLog2 = 8;
|
constexpr int kSkewHistorySizeLog2 = 8;
|
||||||
|
|
||||||
class RenderDelayControllerImpl final : public RenderDelayController {
|
class RenderDelayControllerImpl final : public RenderDelayController {
|
||||||
@ -63,6 +67,7 @@ class RenderDelayControllerImpl final : public RenderDelayController {
|
|||||||
const int hysteresis_limit_1_blocks_;
|
const int hysteresis_limit_1_blocks_;
|
||||||
const int hysteresis_limit_2_blocks_;
|
const int hysteresis_limit_2_blocks_;
|
||||||
const int skew_hysteresis_blocks_;
|
const int skew_hysteresis_blocks_;
|
||||||
|
const bool use_offset_blocks_;
|
||||||
absl::optional<DelayEstimate> delay_;
|
absl::optional<DelayEstimate> delay_;
|
||||||
EchoPathDelayEstimator delay_estimator_;
|
EchoPathDelayEstimator delay_estimator_;
|
||||||
std::vector<float> delay_buf_;
|
std::vector<float> delay_buf_;
|
||||||
@ -131,6 +136,7 @@ RenderDelayControllerImpl::RenderDelayControllerImpl(
|
|||||||
hysteresis_limit_2_blocks_(
|
hysteresis_limit_2_blocks_(
|
||||||
static_cast<int>(config.delay.hysteresis_limit_2_blocks)),
|
static_cast<int>(config.delay.hysteresis_limit_2_blocks)),
|
||||||
skew_hysteresis_blocks_(GetSkewHysteresis(config)),
|
skew_hysteresis_blocks_(GetSkewHysteresis(config)),
|
||||||
|
use_offset_blocks_(UseOffsetBlocks()),
|
||||||
delay_estimator_(data_dumper_.get(), config),
|
delay_estimator_(data_dumper_.get(), config),
|
||||||
delay_buf_(kBlockSize * non_causal_offset, 0.f),
|
delay_buf_(kBlockSize * non_causal_offset, 0.f),
|
||||||
skew_estimator_(kSkewHistorySizeLog2) {
|
skew_estimator_(kSkewHistorySizeLog2) {
|
||||||
@ -237,6 +243,8 @@ absl::optional<DelayEstimate> RenderDelayControllerImpl::GetDelay(
|
|||||||
soft_reset_counter_ = 0;
|
soft_reset_counter_ = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!use_offset_blocks_)
|
||||||
|
offset_blocks = 0;
|
||||||
|
|
||||||
// Log any changes in the skew.
|
// Log any changes in the skew.
|
||||||
skew_shift_reporting_counter_ =
|
skew_shift_reporting_counter_ =
|
||||||
|
Reference in New Issue
Block a user