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/numerics/safe_conversions.h" | 16 #include "webrtc/base/safe_conversions.h" |
17 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" | 17 #include "webrtc/common_audio/signal_processing/include/signal_processing_librar
y.h" |
18 #include "webrtc/modules/audio_coding/neteq/background_noise.h" | 18 #include "webrtc/modules/audio_coding/neteq/background_noise.h" |
19 #include "webrtc/modules/audio_coding/neteq/dsp_helper.h" | 19 #include "webrtc/modules/audio_coding/neteq/dsp_helper.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 TimeStretch::ReturnCodes TimeStretch::Process(const int16_t* input, | 23 TimeStretch::ReturnCodes TimeStretch::Process(const int16_t* input, |
24 size_t input_len, | 24 size_t input_len, |
25 bool fast_mode, | 25 bool fast_mode, |
26 AudioMultiVector* output, | 26 AudioMultiVector* output, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 int temp_scale = WebRtcSpl_NormW32(left_side); | 208 int temp_scale = WebRtcSpl_NormW32(left_side); |
209 left_side = left_side << temp_scale; | 209 left_side = left_side << temp_scale; |
210 right_side = right_side >> (2 * scaling - temp_scale); | 210 right_side = right_side >> (2 * scaling - temp_scale); |
211 } else { | 211 } else { |
212 left_side = left_side << 2 * scaling; | 212 left_side = left_side << 2 * scaling; |
213 } | 213 } |
214 return left_side > right_side; | 214 return left_side > right_side; |
215 } | 215 } |
216 | 216 |
217 } // namespace webrtc | 217 } // namespace webrtc |
OLD | NEW |