From 532531b65643a3abb82fd6f3878d25b613b6fb80 Mon Sep 17 00:00:00 2001 From: Bjorn Volcker Date: Wed, 6 May 2015 11:58:04 +0200 Subject: [PATCH] audio_processing/delay_estimator: Always update robust validation statistics The delay estimator has a robust_validation mode used to deliver more stable delay etimates. The cost is increased reaction time when we have a delay jump. This mode can be turned on and off on the fly, but statistics are not updated while disabled. This makes the estimator unreliable if it is enabled on the fly. This CL makes sure the update is always done. BUG=4472 R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/50889004 Cr-Commit-Position: refs/heads/master@{#9143} --- webrtc/modules/audio_processing/utility/delay_estimator.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webrtc/modules/audio_processing/utility/delay_estimator.c b/webrtc/modules/audio_processing/utility/delay_estimator.c index 60c7a0421..f9f3dc245 100644 --- a/webrtc/modules/audio_processing/utility/delay_estimator.c +++ b/webrtc/modules/audio_processing/utility/delay_estimator.c @@ -615,11 +615,10 @@ int WebRtc_ProcessBinarySpectrum(BinaryDelayEstimator* self, ((value_best_candidate < self->minimum_probability) || (value_best_candidate < self->last_delay_probability))); + UpdateRobustValidationStatistics(self, candidate_delay, valley_depth, + value_best_candidate); if (self->robust_validation_enabled) { - int is_histogram_valid = 0; - UpdateRobustValidationStatistics(self, candidate_delay, valley_depth, - value_best_candidate); - is_histogram_valid = HistogramBasedValidation(self, candidate_delay); + int is_histogram_valid = HistogramBasedValidation(self, candidate_delay); valid_candidate = RobustValidation(self, candidate_delay, valid_candidate, is_histogram_valid);