OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/base/array_view.h" | 17 #include "webrtc/base/array_view.h" |
18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/modules/audio_processing/aec3/aec3_constants.h" | 19 #include "webrtc/modules/audio_processing/aec3/aec3_common.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 // Class for producing 64 sample multiband blocks from frames consisting of 1 or | 23 // Class for producing 64 sample multiband blocks from frames consisting of 1 or |
24 // 2 subframes of 80 samples. | 24 // 2 subframes of 80 samples. |
25 class FrameBlocker { | 25 class FrameBlocker { |
26 public: | 26 public: |
27 explicit FrameBlocker(size_t num_bands); | 27 explicit FrameBlocker(size_t num_bands); |
28 ~FrameBlocker(); | 28 ~FrameBlocker(); |
29 // Inserts one 80 sample multiband subframe from the multiband frame and | 29 // Inserts one 80 sample multiband subframe from the multiband frame and |
30 // extracts one 64 sample multiband block. | 30 // extracts one 64 sample multiband block. |
31 void InsertSubFrameAndExtractBlock( | 31 void InsertSubFrameAndExtractBlock( |
32 const std::vector<rtc::ArrayView<float>>& sub_frame, | 32 const std::vector<rtc::ArrayView<float>>& sub_frame, |
33 std::vector<std::vector<float>>* block); | 33 std::vector<std::vector<float>>* block); |
34 // Reports whether a multiband block of 64 samples is available for | 34 // Reports whether a multiband block of 64 samples is available for |
35 // extraction. | 35 // extraction. |
36 bool IsBlockAvailable() const; | 36 bool IsBlockAvailable() const; |
37 // Extracts a multiband block of 64 samples. | 37 // Extracts a multiband block of 64 samples. |
38 void ExtractBlock(std::vector<std::vector<float>>* block); | 38 void ExtractBlock(std::vector<std::vector<float>>* block); |
39 | 39 |
40 private: | 40 private: |
41 const size_t num_bands_; | 41 const size_t num_bands_; |
42 std::vector<std::vector<float>> buffer_; | 42 std::vector<std::vector<float>> buffer_; |
43 | 43 |
44 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBlocker); | 44 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBlocker); |
45 }; | 45 }; |
46 } // namespace webrtc | 46 } // namespace webrtc |
47 | 47 |
48 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ | 48 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_FRAME_BLOCKER_H_ |
OLD | NEW |