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

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

Issue 2784023002: Major AEC3 render pipeline changes (Closed)
Patch Set: Corrected buffer lengths Created 3 years, 9 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/render_buffer.h
diff --git a/webrtc/modules/audio_processing/aec3/fft_buffer.h b/webrtc/modules/audio_processing/aec3/render_buffer.h
similarity index 64%
rename from webrtc/modules/audio_processing/aec3/fft_buffer.h
rename to webrtc/modules/audio_processing/aec3/render_buffer.h
index c99c9570f35e58ed6db62c522c4471ea34305bbe..a1f5de09f803fdaf3627902a2bf2b25f3382a12e 100644
--- a/webrtc/modules/audio_processing/aec3/fft_buffer.h
+++ b/webrtc/modules/audio_processing/aec3/render_buffer.h
@@ -8,31 +8,41 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FFT_BUFFER_H_
-#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FFT_BUFFER_H_
+#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_BUFFER_H_
+#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_BUFFER_H_
#include <memory>
#include <vector>
#include "webrtc/base/array_view.h"
#include "webrtc/base/constructormagic.h"
+#include "webrtc/modules/audio_processing/aec3/aec3_fft.h"
#include "webrtc/modules/audio_processing/aec3/fft_data.h"
namespace webrtc {
-// Provides a circular buffer for 128 point real-valued FFT data.
-class FftBuffer {
+// Provides a buffer of the render data for the echo remover.
+class RenderBuffer {
public:
- // The constructor takes as parameters the size of the buffer, as well as a
+ // The constructor takes apart from the other parameters a
ivoc 2017/03/31 13:58:31 This is unclear to me, how about something like th
peah-webrtc 2017/04/03 08:02:33 Great! I modified it along your suggestion. PTAL
ivoc 2017/04/03 16:09:07 Ok, looks good now.
// vector containing the number of FFTs that will be included in the spectral
// sums in the call to SpectralSum.
- FftBuffer(Aec3Optimization optimization,
- size_t size,
- const std::vector<size_t> num_ffts_for_spectral_sums);
- ~FftBuffer();
+ RenderBuffer(Aec3Optimization optimization,
+ size_t num_bands,
+ size_t size,
+ const std::vector<size_t> num_ffts_for_spectral_sums);
+ ~RenderBuffer();
- // Insert an FFT into the buffer.
- void Insert(const FftData& fft);
+ // Clears the buffer.
+ void Clear();
+
+ // Insert a block into the buffer.
+ void Insert(const std::vector<std::vector<float>>& block);
+
+ // Gets the last inserted block.
+ const std::vector<std::vector<float>>& MostRecentBlock() const {
+ return last_block_;
+ }
// Get the spectrum from one of the FFTs in the buffer
const std::array<float, kFftLengthBy2Plus1>& Spectrum(
@@ -61,10 +71,11 @@ class FftBuffer {
size_t spectral_sums_length_;
std::vector<std::array<float, kFftLengthBy2Plus1>> spectral_sums_;
size_t position_ = 0;
-
- RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FftBuffer);
+ std::vector<std::vector<float>> last_block_;
+ const Aec3Fft fft_;
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderBuffer);
};
} // namespace webrtc
-#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FFT_BUFFER_H_
+#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_BUFFER_H_

Powered by Google App Engine
This is Rietveld 408576698