OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // chunks of |chunk_length|, but process blocks of |block_length|. | 92 // chunks of |chunk_length|, but process blocks of |block_length|. |
93 size_t initial_delay() const { return blocker_.initial_delay(); } | 93 size_t initial_delay() const { return blocker_.initial_delay(); } |
94 | 94 |
95 private: | 95 private: |
96 // Internal middleware callback, given to the blocker. Transforms each block | 96 // Internal middleware callback, given to the blocker. Transforms each block |
97 // and hands it over to the processing method given at construction time. | 97 // and hands it over to the processing method given at construction time. |
98 class BlockThunk : public BlockerCallback { | 98 class BlockThunk : public BlockerCallback { |
99 public: | 99 public: |
100 explicit BlockThunk(LappedTransform* parent) : parent_(parent) {} | 100 explicit BlockThunk(LappedTransform* parent) : parent_(parent) {} |
101 | 101 |
102 void ProcessBlock(const float* const* input, | 102 void ProcessBlock(const float* const* input, |
103 size_t num_frames, | 103 size_t num_frames, |
104 size_t num_input_channels, | 104 size_t num_input_channels, |
105 size_t num_output_channels, | 105 size_t num_output_channels, |
106 float* const* output) override; | 106 float* const* output) override; |
107 | 107 |
108 private: | 108 private: |
109 LappedTransform* const parent_; | 109 LappedTransform* const parent_; |
110 } blocker_callback_; | 110 } blocker_callback_; |
111 | 111 |
112 const size_t num_in_channels_; | 112 const size_t num_in_channels_; |
113 const size_t num_out_channels_; | 113 const size_t num_out_channels_; |
114 | 114 |
115 const size_t block_length_; | 115 const size_t block_length_; |
116 const size_t chunk_length_; | 116 const size_t chunk_length_; |
117 | 117 |
118 Callback* const block_processor_; | 118 Callback* const block_processor_; |
119 Blocker blocker_; | 119 Blocker blocker_; |
120 | 120 |
121 std::unique_ptr<RealFourier> fft_; | 121 std::unique_ptr<RealFourier> fft_; |
122 const size_t cplx_length_; | 122 const size_t cplx_length_; |
123 AlignedArray<float> real_buf_; | 123 AlignedArray<float> real_buf_; |
124 AlignedArray<std::complex<float> > cplx_pre_; | 124 AlignedArray<std::complex<float> > cplx_pre_; |
125 AlignedArray<std::complex<float> > cplx_post_; | 125 AlignedArray<std::complex<float> > cplx_post_; |
126 }; | 126 }; |
127 | 127 |
128 } // namespace webrtc | 128 } // namespace webrtc |
129 | 129 |
130 #endif // WEBRTC_COMMON_AUDIO_LAPPED_TRANSFORM_H_ | 130 #endif // WEBRTC_COMMON_AUDIO_LAPPED_TRANSFORM_H_ |
131 | 131 |
OLD | NEW |