mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1286644
: cherry-pick AEC fix from Chromium Issue 576624 r=pkerr
This commit is contained in:
parent
c97cce853d
commit
ae674679d8
@ -615,16 +615,33 @@ int WebRtc_ProcessBinarySpectrum(BinaryDelayEstimator* self,
|
||||
((value_best_candidate < self->minimum_probability) ||
|
||||
(value_best_candidate < self->last_delay_probability)));
|
||||
|
||||
if (self->robust_validation_enabled) {
|
||||
int is_histogram_valid = 0;
|
||||
// Check for nonstationary farend signal.
|
||||
int non_stationary_farend = 0;
|
||||
for (i = 0; i < self->history_size; ++i) {
|
||||
if (self->farend->far_bit_counts[i] > 0) {
|
||||
non_stationary_farend = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (non_stationary_farend) {
|
||||
// Only update the validation statistics when the farend is nonstationary
|
||||
// as the underlying estimates are otherwise frozen.
|
||||
UpdateRobustValidationStatistics(self, candidate_delay, valley_depth,
|
||||
value_best_candidate);
|
||||
}
|
||||
|
||||
if (self->robust_validation_enabled) {
|
||||
int is_histogram_valid = 0;
|
||||
is_histogram_valid = HistogramBasedValidation(self, candidate_delay);
|
||||
valid_candidate = RobustValidation(self, candidate_delay, valid_candidate,
|
||||
is_histogram_valid);
|
||||
|
||||
}
|
||||
if (valid_candidate) {
|
||||
|
||||
// Only update the delay estimate when the farend is nonstationary and when
|
||||
// a valid delay candidate is available.
|
||||
if (non_stationary_farend && valid_candidate) {
|
||||
if (candidate_delay != self->last_delay) {
|
||||
self->last_delay_histogram =
|
||||
(self->histogram[candidate_delay] > kLastHistogramMax ?
|
||||
|
Loading…
Reference in New Issue
Block a user