Chromium Code Reviews| Index: webrtc/modules/audio_processing/aec3/frame_blocker.h | 
| diff --git a/webrtc/modules/audio_processing/aec3/frame_blocker.h b/webrtc/modules/audio_processing/aec3/frame_blocker.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..18f3d511047796fb029e155c14eb700da1b0b2b6 | 
| --- /dev/null | 
| +++ b/webrtc/modules/audio_processing/aec3/frame_blocker.h | 
| @@ -0,0 +1,51 @@ | 
| +/* | 
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 
| + * | 
| + * Use of this source code is governed by a BSD-style license | 
| + * that can be found in the LICENSE file in the root of the source | 
| + * tree. An additional intellectual property rights grant can be found | 
| + * in the file PATENTS. All contributing project authors may | 
| + * be found in the AUTHORS file in the root of the source tree. | 
| + */ | 
| + | 
| +#ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | 
| +#define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | 
| + | 
| +#include <stddef.h> | 
| +#include <vector> | 
| + | 
| +#include "webrtc/base/array_view.h" | 
| +#include "webrtc/base/constructormagic.h" | 
| +#include "webrtc/modules/audio_processing/aec3/aec3_constants.h" | 
| + | 
| +namespace webrtc { | 
| + | 
| +/* Class for producing 64 sample multiband blocks from 10 ms frames */ | 
| 
 
hlundin-webrtc
2016/12/16 10:04:47
// style
 
peah-webrtc
2016/12/20 10:10:26
Done.
 
 | 
| +class FrameBlocker { | 
| + public: | 
| + explicit FrameBlocker(size_t num_bands, size_t frame_length); | 
| 
 
hlundin-webrtc
2016/12/16 10:04:47
Drop 'explicit'.
 
peah-webrtc
2016/12/20 10:10:26
Done.
 
 | 
| + ~FrameBlocker(); | 
| + void InsertFrameAndExtractBlock(size_t sub_frame_index, | 
| + rtc::ArrayView<const float> frame, | 
| + rtc::ArrayView<float> block); | 
| + void InsertFrameAndExtractBlock(size_t sub_frame_index, | 
| + const float* const* frame, | 
| + rtc::ArrayView<float> block); | 
| + bool IsBlockAvailable(); | 
| + bool ExtractBlockIfAvailable(rtc::ArrayView<float> block); | 
| + | 
| + private: | 
| + const size_t num_bands_; | 
| + const size_t frame_length_; | 
| + std::vector<float> buffer_; | 
| 
 
aleloi
2016/12/16 15:04:31
I think the copying and indexing in *ExtractBlock*
 
ivoc
2016/12/19 11:30:22
Perhaps there could even be a subclass to handle o
 
peah-webrtc
2016/12/20 10:10:26
Agree. I did it now as hundin@ suggested with a ve
 
peah-webrtc
2016/12/20 10:10:26
That would definitely make sense and the initial v
 
 | 
| + size_t buffer_size_ = 0; | 
| + | 
| + void InsertFrameAndExtractBlock( | 
| 
 
hlundin-webrtc
2016/12/16 10:04:47
Methods before data members.
 
peah-webrtc
2016/12/20 10:10:26
Done.
 
 | 
| + rtc::ArrayView<const rtc::ArrayView<const float>> frame, | 
| + rtc::ArrayView<float> block); | 
| + | 
| + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBlocker); | 
| +}; | 
| +} // namespace webrtc | 
| + | 
| +#endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ |