Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: webrtc/modules/audio_coding/neteq/time_stretch.cc

Issue 1753293002: Safe numeric library: base/numerics (copied from Chromium) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase with master + correct new safe_conversions.h include Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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" 16 #include "webrtc/base/numerics/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698