OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 assert(num_proc_channels_ > 0 && num_proc_channels_ <= num_input_channels_); | 68 assert(num_proc_channels_ > 0 && num_proc_channels_ <= num_input_channels_); |
69 | 69 |
70 if (input_num_frames_ != proc_num_frames_ || | 70 if (input_num_frames_ != proc_num_frames_ || |
71 output_num_frames_ != proc_num_frames_) { | 71 output_num_frames_ != proc_num_frames_) { |
72 // Create an intermediate buffer for resampling. | 72 // Create an intermediate buffer for resampling. |
73 process_buffer_.reset(new ChannelBuffer<float>(proc_num_frames_, | 73 process_buffer_.reset(new ChannelBuffer<float>(proc_num_frames_, |
74 num_proc_channels_)); | 74 num_proc_channels_)); |
75 | 75 |
76 if (input_num_frames_ != proc_num_frames_) { | 76 if (input_num_frames_ != proc_num_frames_) { |
77 for (size_t i = 0; i < num_proc_channels_; ++i) { | 77 for (size_t i = 0; i < num_proc_channels_; ++i) { |
78 input_resamplers_.push_back( | 78 input_resamplers_.push_back(std::unique_ptr<PushSincResampler>( |
79 new PushSincResampler(input_num_frames_, | 79 new PushSincResampler(input_num_frames_, proc_num_frames_))); |
80 proc_num_frames_)); | |
81 } | 80 } |
82 } | 81 } |
83 | 82 |
84 if (output_num_frames_ != proc_num_frames_) { | 83 if (output_num_frames_ != proc_num_frames_) { |
85 for (size_t i = 0; i < num_proc_channels_; ++i) { | 84 for (size_t i = 0; i < num_proc_channels_; ++i) { |
86 output_resamplers_.push_back( | 85 output_resamplers_.push_back(std::unique_ptr<PushSincResampler>( |
87 new PushSincResampler(proc_num_frames_, | 86 new PushSincResampler(proc_num_frames_, output_num_frames_))); |
88 output_num_frames_)); | |
89 } | 87 } |
90 } | 88 } |
91 } | 89 } |
92 | 90 |
93 if (num_bands_ > 1) { | 91 if (num_bands_ > 1) { |
94 split_data_.reset(new IFChannelBuffer(proc_num_frames_, | 92 split_data_.reset(new IFChannelBuffer(proc_num_frames_, |
95 num_proc_channels_, | 93 num_proc_channels_, |
96 num_bands_)); | 94 num_bands_)); |
97 splitting_filter_.reset(new SplittingFilter(num_proc_channels_, | 95 splitting_filter_.reset(new SplittingFilter(num_proc_channels_, |
98 num_bands_, | 96 num_bands_, |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 456 |
459 void AudioBuffer::SplitIntoFrequencyBands() { | 457 void AudioBuffer::SplitIntoFrequencyBands() { |
460 splitting_filter_->Analysis(data_.get(), split_data_.get()); | 458 splitting_filter_->Analysis(data_.get(), split_data_.get()); |
461 } | 459 } |
462 | 460 |
463 void AudioBuffer::MergeFrequencyBands() { | 461 void AudioBuffer::MergeFrequencyBands() { |
464 splitting_filter_->Synthesis(split_data_.get(), data_.get()); | 462 splitting_filter_->Synthesis(split_data_.get(), data_.get()); |
465 } | 463 } |
466 | 464 |
467 } // namespace webrtc | 465 } // namespace webrtc |
OLD | NEW |