Line data Source code
1 : /*
2 : * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 : *
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
6 : * tree. An additional intellectual property rights grant can be found
7 : * in the file PATENTS. All contributing project authors may
8 : * be found in the AUTHORS file in the root of the source tree.
9 : */
10 :
11 : #include "webrtc/common_audio/include/audio_util.h"
12 :
13 : #include "webrtc/typedefs.h"
14 :
15 : namespace webrtc {
16 :
17 0 : void FloatToS16(const float* src, size_t size, int16_t* dest) {
18 0 : for (size_t i = 0; i < size; ++i)
19 0 : dest[i] = FloatToS16(src[i]);
20 0 : }
21 :
22 0 : void S16ToFloat(const int16_t* src, size_t size, float* dest) {
23 0 : for (size_t i = 0; i < size; ++i)
24 0 : dest[i] = S16ToFloat(src[i]);
25 0 : }
26 :
27 0 : void FloatS16ToS16(const float* src, size_t size, int16_t* dest) {
28 0 : for (size_t i = 0; i < size; ++i)
29 0 : dest[i] = FloatS16ToS16(src[i]);
30 0 : }
31 :
32 0 : void FloatToFloatS16(const float* src, size_t size, float* dest) {
33 0 : for (size_t i = 0; i < size; ++i)
34 0 : dest[i] = FloatToFloatS16(src[i]);
35 0 : }
36 :
37 0 : void FloatS16ToFloat(const float* src, size_t size, float* dest) {
38 0 : for (size_t i = 0; i < size; ++i)
39 0 : dest[i] = FloatS16ToFloat(src[i]);
40 0 : }
41 :
42 : template <>
43 0 : void DownmixInterleavedToMono<int16_t>(const int16_t* interleaved,
44 : size_t num_frames,
45 : int num_channels,
46 : int16_t* deinterleaved) {
47 : DownmixInterleavedToMonoImpl<int16_t, int32_t>(interleaved, num_frames,
48 0 : num_channels, deinterleaved);
49 0 : }
50 :
51 : } // namespace webrtc
|