Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | |
| 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | |
| 13 | |
| 14 #include <stddef.h> | |
| 15 #include <vector> | |
| 16 | |
| 17 #include "webrtc/base/array_view.h" | |
| 18 #include "webrtc/base/constructormagic.h" | |
| 19 #include "webrtc/modules/audio_processing/aec3/aec3_constants.h" | |
| 20 | |
| 21 namespace webrtc { | |
| 22 | |
| 23 /* 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.
| |
| 24 class FrameBlocker { | |
| 25 public: | |
| 26 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.
| |
| 27 ~FrameBlocker(); | |
| 28 void InsertFrameAndExtractBlock(size_t sub_frame_index, | |
| 29 rtc::ArrayView<const float> frame, | |
| 30 rtc::ArrayView<float> block); | |
| 31 void InsertFrameAndExtractBlock(size_t sub_frame_index, | |
| 32 const float* const* frame, | |
| 33 rtc::ArrayView<float> block); | |
| 34 bool IsBlockAvailable(); | |
| 35 bool ExtractBlockIfAvailable(rtc::ArrayView<float> block); | |
| 36 | |
| 37 private: | |
| 38 const size_t num_bands_; | |
| 39 const size_t frame_length_; | |
| 40 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
| |
| 41 size_t buffer_size_ = 0; | |
| 42 | |
| 43 void InsertFrameAndExtractBlock( | |
|
hlundin-webrtc
2016/12/16 10:04:47
Methods before data members.
peah-webrtc
2016/12/20 10:10:26
Done.
| |
| 44 rtc::ArrayView<const rtc::ArrayView<const float>> frame, | |
| 45 rtc::ArrayView<float> block); | |
| 46 | |
| 47 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBlocker); | |
| 48 }; | |
| 49 } // namespace webrtc | |
| 50 | |
| 51 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | |
| OLD | NEW |