| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // Returns a pointer array to the bands for a specific channel. | 88 // Returns a pointer array to the bands for a specific channel. |
| 89 // Usage: | 89 // Usage: |
| 90 // bands(channel)[band][sample]. | 90 // bands(channel)[band][sample]. |
| 91 // Where: | 91 // Where: |
| 92 // 0 <= channel < |num_channels_| | 92 // 0 <= channel < |num_channels_| |
| 93 // 0 <= band < |num_bands_| | 93 // 0 <= band < |num_bands_| |
| 94 // 0 <= sample < |num_frames_per_band_| | 94 // 0 <= sample < |num_frames_per_band_| |
| 95 const T* const* bands(size_t channel) const { | 95 const T* const* bands(size_t channel) const { |
| 96 RTC_DCHECK_LT(channel, num_channels_); | 96 RTC_DCHECK_LT(channel, num_channels_); |
| 97 RTC_DCHECK_GE(channel, 0u); | 97 RTC_DCHECK_GE(channel, 0); |
| 98 return &bands_[channel * num_bands_]; | 98 return &bands_[channel * num_bands_]; |
| 99 } | 99 } |
| 100 T* const* bands(size_t channel) { | 100 T* const* bands(size_t channel) { |
| 101 const ChannelBuffer<T>* t = this; | 101 const ChannelBuffer<T>* t = this; |
| 102 return const_cast<T* const*>(t->bands(channel)); | 102 return const_cast<T* const*>(t->bands(channel)); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Sets the |slice| pointers to the |start_frame| position for each channel. | 105 // Sets the |slice| pointers to the |start_frame| position for each channel. |
| 106 // Returns |slice| for convenience. | 106 // Returns |slice| for convenience. |
| 107 const T* const* Slice(T** slice, size_t start_frame) const { | 107 const T* const* Slice(T** slice, size_t start_frame) const { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 mutable bool ivalid_; | 178 mutable bool ivalid_; |
| 179 mutable ChannelBuffer<int16_t> ibuf_; | 179 mutable ChannelBuffer<int16_t> ibuf_; |
| 180 mutable bool fvalid_; | 180 mutable bool fvalid_; |
| 181 mutable ChannelBuffer<float> fbuf_; | 181 mutable ChannelBuffer<float> fbuf_; |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 } // namespace webrtc | 184 } // namespace webrtc |
| 185 | 185 |
| 186 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_CHANNEL_BUFFER_H_ | 186 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_CHANNEL_BUFFER_H_ |
| OLD | NEW |