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

Side by Side Diff: webrtc/voice_engine/utility.h

Issue 1338833002: Fix the maximum native sample rate in AudioProcessing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Format Created 5 years, 2 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 | « webrtc/voice_engine/transmit_mixer.cc ('k') | webrtc/voice_engine/utility.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
11 /* 11 /*
12 * Contains functions often used by different parts of VoiceEngine. 12 * Contains functions often used by different parts of VoiceEngine.
13 */ 13 */
14 14
15 #ifndef WEBRTC_VOICE_ENGINE_UTILITY_H_ 15 #ifndef WEBRTC_VOICE_ENGINE_UTILITY_H_
16 #define WEBRTC_VOICE_ENGINE_UTILITY_H_ 16 #define WEBRTC_VOICE_ENGINE_UTILITY_H_
17 17
18 #include "webrtc/common_audio/resampler/include/push_resampler.h" 18 #include "webrtc/common_audio/resampler/include/push_resampler.h"
19 #include "webrtc/typedefs.h" 19 #include "webrtc/typedefs.h"
20 20
21 namespace webrtc { 21 namespace webrtc {
22 22
23 class AudioFrame; 23 class AudioFrame;
24 24
25 namespace voe { 25 namespace voe {
26 26
27 // Upmix or downmix and resample the audio in |src_frame| to |dst_frame|. 27 // Upmix or downmix and resample the audio to |dst_frame|. Expects |dst_frame|
28 // Expects |dst_frame| to have its sample rate and channels members set to the 28 // to have its sample rate and channels members set to the desired values.
29 // desired values. Updates the samples per channel member accordingly. No other 29 // Updates the |samples_per_channel_| member accordingly.
30 // members will be changed. 30 //
31 // This version has an AudioFrame |src_frame| as input and sets the output
32 // |timestamp_|, |elapsed_time_ms_| and |ntp_time_ms_| members equals to the
33 // input ones.
31 void RemixAndResample(const AudioFrame& src_frame, 34 void RemixAndResample(const AudioFrame& src_frame,
32 PushResampler<int16_t>* resampler, 35 PushResampler<int16_t>* resampler,
33 AudioFrame* dst_frame); 36 AudioFrame* dst_frame);
34 37
35 // Downmix and downsample the audio in |src_data| to |dst_af| as necessary, 38 // This version has a pointer to the samples |src_data| as input and receives
36 // specified by |codec_num_channels| and |codec_rate_hz|. |mono_buffer| is 39 // |samples_per_channel|, |num_channels| and |sample_rate_hz| of the data as
37 // temporary space and must be of sufficient size to hold the downmixed source 40 // parameters.
38 // audio (recommend using a size of kMaxMonoDataSizeSamples). 41 void RemixAndResample(const int16_t* src_data,
39 // 42 size_t samples_per_channel,
40 // |dst_af| will have its data and format members (sample rate, channels and 43 int num_channels,
41 // samples per channel) set appropriately. No other members will be changed. 44 int sample_rate_hz,
42 // TODO(ajm): For now, this still calls Reset() on |dst_af|. Remove this, as 45 PushResampler<int16_t>* resampler,
43 // it shouldn't be needed. 46 AudioFrame* dst_frame);
44 void DownConvertToCodecFormat(const int16_t* src_data,
45 size_t samples_per_channel,
46 int num_channels,
47 int sample_rate_hz,
48 int codec_num_channels,
49 int codec_rate_hz,
50 int16_t* mono_buffer,
51 PushResampler<int16_t>* resampler,
52 AudioFrame* dst_af);
53 47
54 void MixWithSat(int16_t target[], 48 void MixWithSat(int16_t target[],
55 int target_channel, 49 int target_channel,
56 const int16_t source[], 50 const int16_t source[],
57 int source_channel, 51 int source_channel,
58 size_t source_len); 52 size_t source_len);
59 53
60 } // namespace voe 54 } // namespace voe
61 } // namespace webrtc 55 } // namespace webrtc
62 56
63 #endif // WEBRTC_VOICE_ENGINE_UTILITY_H_ 57 #endif // WEBRTC_VOICE_ENGINE_UTILITY_H_
OLDNEW
« no previous file with comments | « webrtc/voice_engine/transmit_mixer.cc ('k') | webrtc/voice_engine/utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698