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 |
11 #include "webrtc/modules/audio_coding/neteq/time_stretch.h" | 11 #include "webrtc/modules/audio_coding/neteq/time_stretch.h" |
12 | 12 |
13 #include <algorithm> // min, max | 13 #include <algorithm> // min, max |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "webrtc/base/safe_conversions.h" | |
17 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 16 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
18 #include "webrtc/modules/audio_coding/neteq/background_noise.h" | 17 #include "webrtc/modules/audio_coding/neteq/background_noise.h" |
19 #include "webrtc/modules/audio_coding/neteq/cross_correlation.h" | 18 #include "webrtc/modules/audio_coding/neteq/cross_correlation.h" |
20 #include "webrtc/modules/audio_coding/neteq/dsp_helper.h" | 19 #include "webrtc/modules/audio_coding/neteq/dsp_helper.h" |
| 20 #include "webrtc/rtc_base/safe_conversions.h" |
21 | 21 |
22 namespace webrtc { | 22 namespace webrtc { |
23 | 23 |
24 TimeStretch::ReturnCodes TimeStretch::Process(const int16_t* input, | 24 TimeStretch::ReturnCodes TimeStretch::Process(const int16_t* input, |
25 size_t input_len, | 25 size_t input_len, |
26 bool fast_mode, | 26 bool fast_mode, |
27 AudioMultiVector* output, | 27 AudioMultiVector* output, |
28 size_t* length_change_samples) { | 28 size_t* length_change_samples) { |
29 // Pre-calculate common multiplication with |fs_mult_|. | 29 // Pre-calculate common multiplication with |fs_mult_|. |
30 size_t fs_mult_120 = | 30 size_t fs_mult_120 = |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 int temp_scale = WebRtcSpl_NormW32(left_side); | 205 int temp_scale = WebRtcSpl_NormW32(left_side); |
206 left_side = left_side << temp_scale; | 206 left_side = left_side << temp_scale; |
207 right_side = right_side >> (2 * scaling - temp_scale); | 207 right_side = right_side >> (2 * scaling - temp_scale); |
208 } else { | 208 } else { |
209 left_side = left_side << 2 * scaling; | 209 left_side = left_side << 2 * scaling; |
210 } | 210 } |
211 return left_side > right_side; | 211 return left_side > right_side; |
212 } | 212 } |
213 | 213 |
214 } // namespace webrtc | 214 } // namespace webrtc |
OLD | NEW |