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 |
11 #include "webrtc/modules/audio_processing/splitting_filter.h" | 11 #include "webrtc/modules/audio_processing/splitting_filter.h" |
12 | 12 |
13 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
14 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 14 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
15 #include "webrtc/common_audio/channel_buffer.h" | 15 #include "webrtc/common_audio/channel_buffer.h" |
16 | 16 |
17 namespace webrtc { | 17 namespace webrtc { |
18 | 18 |
19 SplittingFilter::SplittingFilter(int num_channels, | 19 SplittingFilter::SplittingFilter(int num_channels, |
20 int num_bands, | 20 size_t num_bands, |
21 int num_frames) | 21 size_t num_frames) |
22 : num_bands_(num_bands) { | 22 : num_bands_(num_bands) { |
23 CHECK(num_bands_ == 2 || num_bands_ == 3); | 23 CHECK(num_bands_ == 2 || num_bands_ == 3); |
24 if (num_bands_ == 2) { | 24 if (num_bands_ == 2) { |
25 two_bands_states_.resize(num_channels); | 25 two_bands_states_.resize(num_channels); |
26 } else if (num_bands_ == 3) { | 26 } else if (num_bands_ == 3) { |
27 for (int i = 0; i < num_channels; ++i) { | 27 for (int i = 0; i < num_channels; ++i) { |
28 three_band_filter_banks_.push_back(new ThreeBandFilterBank(num_frames)); | 28 three_band_filter_banks_.push_back(new ThreeBandFilterBank(num_frames)); |
29 } | 29 } |
30 } | 30 } |
31 } | 31 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 DCHECK_EQ(static_cast<int>(three_band_filter_banks_.size()), | 98 DCHECK_EQ(static_cast<int>(three_band_filter_banks_.size()), |
99 data->num_channels()); | 99 data->num_channels()); |
100 for (size_t i = 0; i < three_band_filter_banks_.size(); ++i) { | 100 for (size_t i = 0; i < three_band_filter_banks_.size(); ++i) { |
101 three_band_filter_banks_[i]->Synthesis(bands->fbuf_const()->bands(i), | 101 three_band_filter_banks_[i]->Synthesis(bands->fbuf_const()->bands(i), |
102 bands->num_frames_per_band(), | 102 bands->num_frames_per_band(), |
103 data->fbuf()->channels()[i]); | 103 data->fbuf()->channels()[i]); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 } // namespace webrtc | 107 } // namespace webrtc |
OLD | NEW |