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

Side by Side Diff: webrtc/modules/audio_coding/neteq/accelerate.h

Issue 1228843002: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comments Created 5 years, 4 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
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/accelerate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 27 matching lines...) Expand all
38 // read from |input|, of length |input_length| elements, and are written to 38 // read from |input|, of length |input_length| elements, and are written to
39 // |output|. The number of samples removed through time-stretching is 39 // |output|. The number of samples removed through time-stretching is
40 // is provided in the output |length_change_samples|. The method returns 40 // is provided in the output |length_change_samples|. The method returns
41 // the outcome of the operation as an enumerator value. If |fast_accelerate| 41 // the outcome of the operation as an enumerator value. If |fast_accelerate|
42 // is true, the algorithm will relax the requirements on finding strong 42 // is true, the algorithm will relax the requirements on finding strong
43 // correlations, and may remove multiple pitch periods if possible. 43 // correlations, and may remove multiple pitch periods if possible.
44 ReturnCodes Process(const int16_t* input, 44 ReturnCodes Process(const int16_t* input,
45 size_t input_length, 45 size_t input_length,
46 bool fast_accelerate, 46 bool fast_accelerate,
47 AudioMultiVector* output, 47 AudioMultiVector* output,
48 int16_t* length_change_samples); 48 size_t* length_change_samples);
49 49
50 protected: 50 protected:
51 // Sets the parameters |best_correlation| and |peak_index| to suitable 51 // Sets the parameters |best_correlation| and |peak_index| to suitable
52 // values when the signal contains no active speech. 52 // values when the signal contains no active speech.
53 void SetParametersForPassiveSpeech(size_t len, 53 void SetParametersForPassiveSpeech(size_t len,
54 int16_t* best_correlation, 54 int16_t* best_correlation,
55 int* peak_index) const override; 55 size_t* peak_index) const override;
56 56
57 // Checks the criteria for performing the time-stretching operation and, 57 // Checks the criteria for performing the time-stretching operation and,
58 // if possible, performs the time-stretching. 58 // if possible, performs the time-stretching.
59 ReturnCodes CheckCriteriaAndStretch(const int16_t* input, 59 ReturnCodes CheckCriteriaAndStretch(const int16_t* input,
60 size_t input_length, 60 size_t input_length,
61 size_t peak_index, 61 size_t peak_index,
62 int16_t best_correlation, 62 int16_t best_correlation,
63 bool active_speech, 63 bool active_speech,
64 bool fast_mode, 64 bool fast_mode,
65 AudioMultiVector* output) const override; 65 AudioMultiVector* output) const override;
66 66
67 private: 67 private:
68 DISALLOW_COPY_AND_ASSIGN(Accelerate); 68 DISALLOW_COPY_AND_ASSIGN(Accelerate);
69 }; 69 };
70 70
71 struct AccelerateFactory { 71 struct AccelerateFactory {
72 AccelerateFactory() {} 72 AccelerateFactory() {}
73 virtual ~AccelerateFactory() {} 73 virtual ~AccelerateFactory() {}
74 74
75 virtual Accelerate* Create(int sample_rate_hz, 75 virtual Accelerate* Create(int sample_rate_hz,
76 size_t num_channels, 76 size_t num_channels,
77 const BackgroundNoise& background_noise) const; 77 const BackgroundNoise& background_noise) const;
78 }; 78 };
79 79
80 } // namespace webrtc 80 } // namespace webrtc
81 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_ACCELERATE_H_ 81 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_ACCELERATE_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/neteq/accelerate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698