OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 20 matching lines...) Expand all Loading... | |
31 virtual ~SincResamplerCallback() {} | 31 virtual ~SincResamplerCallback() {} |
32 virtual void Run(size_t frames, float* destination) = 0; | 32 virtual void Run(size_t frames, float* destination) = 0; |
33 }; | 33 }; |
34 | 34 |
35 // SincResampler is a high-quality single-channel sample-rate converter. | 35 // SincResampler is a high-quality single-channel sample-rate converter. |
36 class SincResampler { | 36 class SincResampler { |
37 public: | 37 public: |
38 // The kernel size can be adjusted for quality (higher is better) at the | 38 // The kernel size can be adjusted for quality (higher is better) at the |
39 // expense of performance. Must be a multiple of 32. | 39 // expense of performance. Must be a multiple of 32. |
40 // TODO(dalecurtis): Test performance to see if we can jack this up to 64+. | 40 // TODO(dalecurtis): Test performance to see if we can jack this up to 64+. |
41 static const size_t kKernelSize = 32; | 41 enum : size_t { kKernelSize = 32 }; |
kwiberg-webrtc
2016/11/28 05:17:48
This is needed because RTC_DCHECK_op takes referen
ossu
2016/11/28 14:54:25
I don't get it. Why can't you take a reference to
kwiberg-webrtc
2016/11/28 23:01:47
IIRC it was a linker error. I believe the template
ossu
2016/11/29 10:23:48
Ah, I see! So the problem is that kKernelSize does
kwiberg-webrtc
2016/11/29 10:31:15
Yes, exactly. (And note that the godbolt example a
| |
42 | 42 |
43 // Default request size. Affects how often and for how much SincResampler | 43 // Default request size. Affects how often and for how much SincResampler |
44 // calls back for input. Must be greater than kKernelSize. | 44 // calls back for input. Must be greater than kKernelSize. |
45 static const size_t kDefaultRequestSize = 512; | 45 static const size_t kDefaultRequestSize = 512; |
46 | 46 |
47 // The kernel offset count is used for interpolation and is the number of | 47 // The kernel offset count is used for interpolation and is the number of |
48 // sub-sample kernel shifts. Can be adjusted for quality (higher is better) | 48 // sub-sample kernel shifts. Can be adjusted for quality (higher is better) |
49 // at the expense of allocating more memory. | 49 // at the expense of allocating more memory. |
50 static const size_t kKernelOffsetCount = 32; | 50 static const size_t kKernelOffsetCount = 32; |
51 static const size_t kKernelStorageSize = | 51 static const size_t kKernelStorageSize = |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 float* const r2_; | 162 float* const r2_; |
163 float* r3_; | 163 float* r3_; |
164 float* r4_; | 164 float* r4_; |
165 | 165 |
166 RTC_DISALLOW_COPY_AND_ASSIGN(SincResampler); | 166 RTC_DISALLOW_COPY_AND_ASSIGN(SincResampler); |
167 }; | 167 }; |
168 | 168 |
169 } // namespace webrtc | 169 } // namespace webrtc |
170 | 170 |
171 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_SINC_RESAMPLER_H_ | 171 #endif // WEBRTC_COMMON_AUDIO_RESAMPLER_SINC_RESAMPLER_H_ |
OLD | NEW |