Index: webrtc/modules/audio_processing/aec/aec_core.h |
diff --git a/webrtc/modules/audio_processing/aec/aec_core.h b/webrtc/modules/audio_processing/aec/aec_core.h |
index 4f2db63108fc99f20286e32b4656cf111a4a05e1..1f3077c87983d514aa411bd31c97feadf1eeea59 100644 |
--- a/webrtc/modules/audio_processing/aec/aec_core.h |
+++ b/webrtc/modules/audio_processing/aec/aec_core.h |
@@ -83,6 +83,21 @@ typedef struct PowerLevel { |
float minlevel; |
} PowerLevel; |
+class BlockBuffer { |
+ public: |
+ BlockBuffer(); |
+ ~BlockBuffer(); |
+ void ReInit(); |
+ void Insert(const float block[PART_LEN]); |
+ void ExtractExtendedBlock(float extended_block[PART_LEN]); |
+ int AdjustSize(int buffer_size_decrease); |
+ size_t Size(); |
+ size_t AvaliableSpace(); |
+ |
+ private: |
+ RingBuffer* buffer_; |
+}; |
+ |
class DivergentFilterFraction { |
public: |
DivergentFilterFraction(); |
@@ -168,7 +183,7 @@ struct AecCore { |
int xfBufBlockPos; |
- RingBuffer* far_time_buf; |
+ BlockBuffer farend_block_buffer_; |
int system_delay; // Current system delay buffered in AEC. |
@@ -246,7 +261,7 @@ void WebRtcAec_InitAec_mips(void); |
void WebRtcAec_InitAec_neon(void); |
#endif |
-void WebRtcAec_BufferFarendPartition(AecCore* aec, const float* farend); |
+void WebRtcAec_BufferFarendBlock(AecCore* aec, const float* farend); |
void WebRtcAec_ProcessFrames(AecCore* aec, |
const float* const* nearend, |
size_t num_bands, |
@@ -254,10 +269,11 @@ void WebRtcAec_ProcessFrames(AecCore* aec, |
int knownDelay, |
float* const* out); |
-// A helper function to call WebRtc_MoveReadPtr() for all far-end buffers. |
-// Returns the number of elements moved, and adjusts |system_delay| by the |
-// corresponding amount in ms. |
-int WebRtcAec_MoveFarReadPtr(AecCore* aec, int elements); |
+// A helper function to call adjust the farend buffer size. |
+// Returns the number of elements the size was decreased with, and adjusts |
+// |system_delay| by the corresponding amount in ms. |
+int WebRtcAec_AdjustFarendBufferSizeAndSystemDelay(AecCore* aec, |
+ int size_decrease); |
// Calculates the median, standard deviation and amount of poor values among the |
// delay estimates aggregated up to the first call to the function. After that |