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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Splitting filter which is able to split into and merge from 2 or 3 frequency | 39 // Splitting filter which is able to split into and merge from 2 or 3 frequency |
40 // bands. The number of channels needs to be provided at construction time. | 40 // bands. The number of channels needs to be provided at construction time. |
41 // | 41 // |
42 // For each block, Analysis() is called to split into bands and then Synthesis() | 42 // For each block, Analysis() is called to split into bands and then Synthesis() |
43 // to merge these bands again. The input and output signals are contained in | 43 // to merge these bands again. The input and output signals are contained in |
44 // IFChannelBuffers and for the different bands an array of IFChannelBuffers is | 44 // IFChannelBuffers and for the different bands an array of IFChannelBuffers is |
45 // used. | 45 // used. |
46 class SplittingFilter { | 46 class SplittingFilter { |
47 public: | 47 public: |
48 SplittingFilter(int num_channels, size_t num_bands, size_t num_frames); | 48 SplittingFilter(size_t num_channels, size_t num_bands, size_t num_frames); |
49 | 49 |
50 void Analysis(const IFChannelBuffer* data, IFChannelBuffer* bands); | 50 void Analysis(const IFChannelBuffer* data, IFChannelBuffer* bands); |
51 void Synthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); | 51 void Synthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); |
52 | 52 |
53 private: | 53 private: |
54 // Two-band analysis and synthesis work for 640 samples or less. | 54 // Two-band analysis and synthesis work for 640 samples or less. |
55 void TwoBandsAnalysis(const IFChannelBuffer* data, IFChannelBuffer* bands); | 55 void TwoBandsAnalysis(const IFChannelBuffer* data, IFChannelBuffer* bands); |
56 void TwoBandsSynthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); | 56 void TwoBandsSynthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); |
57 void ThreeBandsAnalysis(const IFChannelBuffer* data, IFChannelBuffer* bands); | 57 void ThreeBandsAnalysis(const IFChannelBuffer* data, IFChannelBuffer* bands); |
58 void ThreeBandsSynthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); | 58 void ThreeBandsSynthesis(const IFChannelBuffer* bands, IFChannelBuffer* data); |
59 void InitBuffers(); | 59 void InitBuffers(); |
60 | 60 |
61 const size_t num_bands_; | 61 const size_t num_bands_; |
62 std::vector<TwoBandsStates> two_bands_states_; | 62 std::vector<TwoBandsStates> two_bands_states_; |
63 ScopedVector<ThreeBandFilterBank> three_band_filter_banks_; | 63 ScopedVector<ThreeBandFilterBank> three_band_filter_banks_; |
64 }; | 64 }; |
65 | 65 |
66 } // namespace webrtc | 66 } // namespace webrtc |
67 | 67 |
68 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_SPLITTING_FILTER_H_ | 68 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_SPLITTING_FILTER_H_ |
OLD | NEW |