Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: webrtc/modules/audio_processing/aec3/block_processor.cc

Issue 2787123003: Correction of the AEC3 underrun behavior and minor other corrections (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/aec3/block_processor.cc
diff --git a/webrtc/modules/audio_processing/aec3/block_processor.cc b/webrtc/modules/audio_processing/aec3/block_processor.cc
index 79892345b10ff28d2d35bead2c538e76b9adc1aa..bb1286cd43ac7206f024883f51a6c5b24c160e4e 100644
--- a/webrtc/modules/audio_processing/aec3/block_processor.cc
+++ b/webrtc/modules/audio_processing/aec3/block_processor.cc
@@ -101,34 +101,34 @@ void BlockProcessorImpl::ProcessCapture(
// been a render buffer overrun as the buffer alignment may be noncausal.
delay_controller_->Reset();
render_buffer_->Reset();
- } else {
- // Update the render buffers with new render data, filling the buffers with
- // empty blocks when there is no render data available.
- render_buffer_underrun = !render_buffer_->UpdateBuffers();
-
- // Compute and and apply the render delay required to achieve proper signal
- // alignment.
- const size_t old_delay = render_buffer_->Delay();
- const size_t new_delay = delay_controller_->GetDelay(
- render_buffer_->GetDownsampledRenderBuffer(), (*capture_block)[0]);
- render_buffer_->SetDelay(new_delay);
- const size_t achieved_delay = render_buffer_->Delay();
-
- // Inform the delay controller of the actually set delay to allow it to
- // properly react to a non-feasible delay.
- delay_controller_->SetDelay(achieved_delay);
-
- // Remove the echo from the capture signal.
- echo_remover_->ProcessCapture(
- delay_controller_->AlignmentHeadroomSamples(),
- EchoPathVariability(echo_path_gain_change,
- old_delay != achieved_delay ||
- old_delay != new_delay ||
- render_buffer_overrun_occurred_),
- capture_signal_saturation, render_buffer_->GetRenderBuffer(),
- capture_block);
}
+ // Update the render buffers with new render data, filling the buffers with
+ // empty blocks when there is no render data available.
+ render_buffer_underrun = !render_buffer_->UpdateBuffers();
+
+ // Compute and and apply the render delay required to achieve proper signal
+ // alignment.
+ const size_t old_delay = render_buffer_->Delay();
+ const size_t new_delay = delay_controller_->GetDelay(
+ render_buffer_->GetDownsampledRenderBuffer(), (*capture_block)[0]);
+ render_buffer_->SetDelay(new_delay);
+ const size_t achieved_delay = render_buffer_->Delay();
+
+ // Inform the delay controller of the actually set delay to allow it to
+ // properly react to a non-feasible delay.
+ delay_controller_->SetDelay(achieved_delay);
+
+ // Remove the echo from the capture signal.
+ echo_remover_->ProcessCapture(
+ delay_controller_->AlignmentHeadroomSamples(),
+ EchoPathVariability(echo_path_gain_change,
+ old_delay != achieved_delay ||
+ old_delay != new_delay ||
+ render_buffer_overrun_occurred_),
+ capture_signal_saturation, render_buffer_->GetRenderBuffer(),
+ capture_block);
+
// Update the metrics.
metrics_.UpdateCapture(render_buffer_underrun);
« no previous file with comments | « webrtc/modules/audio_processing/aec3/aec3_common.h ('k') | webrtc/modules/audio_processing/aec3/render_delay_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698