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

Unified Diff: webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h

Issue 2782423003: Major updates to the echo removal functionality in AEC3 (Closed)
Patch Set: Added initialization of uninitialized vector 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/adaptive_fir_filter.h
diff --git a/webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h b/webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h
index a27fa6c2d99e62779329d0d49930233c3b0a005e..4fe10eabbba679541bdf1882f7159b1b7965a8b7 100644
--- a/webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h
+++ b/webrtc/modules/audio_processing/aec3/adaptive_fir_filter.h
@@ -26,21 +26,21 @@
namespace webrtc {
namespace aec3 {
// Adapts the filter partitions.
-void AdaptPartitions(const RenderBuffer& X_buffer,
+void AdaptPartitions(const RenderBuffer& render_buffer,
const FftData& G,
rtc::ArrayView<FftData> H);
#if defined(WEBRTC_ARCH_X86_FAMILY)
-void AdaptPartitions_SSE2(const RenderBuffer& X_buffer,
+void AdaptPartitions_SSE2(const RenderBuffer& render_buffer,
const FftData& G,
rtc::ArrayView<FftData> H);
#endif
// Produces the filter output.
-void ApplyFilter(const RenderBuffer& X_buffer,
+void ApplyFilter(const RenderBuffer& render_buffer,
rtc::ArrayView<const FftData> H,
FftData* S);
#if defined(WEBRTC_ARCH_X86_FAMILY)
-void ApplyFilter_SSE2(const RenderBuffer& X_buffer,
+void ApplyFilter_SSE2(const RenderBuffer& render_buffer,
rtc::ArrayView<const FftData> H,
FftData* S);
#endif
@@ -51,17 +51,16 @@ void ApplyFilter_SSE2(const RenderBuffer& X_buffer,
class AdaptiveFirFilter {
public:
AdaptiveFirFilter(size_t size_partitions,
- bool use_filter_statistics,
Aec3Optimization optimization,
ApmDataDumper* data_dumper);
~AdaptiveFirFilter();
// Produces the output of the filter.
- void Filter(const RenderBuffer& X_buffer, FftData* S) const;
+ void Filter(const RenderBuffer& render_buffer, FftData* S) const;
// Adapts the filter.
- void Adapt(const RenderBuffer& X_buffer, const FftData& G);
+ void Adapt(const RenderBuffer& render_buffer, const FftData& G);
// Receives reports that known echo path changes have occured and adjusts
// the filter adaptation accordingly.
@@ -70,25 +69,13 @@ class AdaptiveFirFilter {
// Returns the filter size.
size_t SizePartitions() const { return H_.size(); }
- // Returns the filter based echo return loss. This method can only be used if
- // the usage of filter statistics has been specified during the creation of
- // the adaptive filter.
- const std::array<float, kFftLengthBy2Plus1>& Erl() const {
- RTC_DCHECK(erl_) << "The filter must be created with use_filter_statistics "
- "set to true in order to be able to call retrieve the "
- "ERL.";
- return *erl_;
- }
+ // Returns the filter based echo return loss.
+ const std::array<float, kFftLengthBy2Plus1>& Erl() const { return erl_; }
- // Returns the frequency responses for the filter partitions. This method can
- // only be used if the usage of filter statistics has been specified during
- // the creation of the adaptive filter.
+ // Returns the frequency responses for the filter partitions.
const std::vector<std::array<float, kFftLengthBy2Plus1>>&
FilterFrequencyResponse() const {
- RTC_DCHECK(H2_) << "The filter must be created with use_filter_statistics "
- "set to true in order to be able to call retrieve the "
- "filter frequency responde.";
- return *H2_;
+ return H2_;
}
void DumpFilter(const char* name) {
@@ -103,8 +90,8 @@ class AdaptiveFirFilter {
const Aec3Fft fft_;
const Aec3Optimization optimization_;
std::vector<FftData> H_;
- std::unique_ptr<std::vector<std::array<float, kFftLengthBy2Plus1>>> H2_;
- std::unique_ptr<std::array<float, kFftLengthBy2Plus1>> erl_;
+ std::vector<std::array<float, kFftLengthBy2Plus1>> H2_;
+ std::array<float, kFftLengthBy2Plus1> erl_;
size_t partition_to_constrain_ = 0;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AdaptiveFirFilter);
« no previous file with comments | « webrtc/modules/audio_processing/BUILD.gn ('k') | webrtc/modules/audio_processing/aec3/adaptive_fir_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698