| 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 "common_audio/include/audio_util.h" |
| 12 |
| 13 | namespace webrtc { |
| 14 |
| 15 | void FloatToS16(const float* src, size_t size, int16_t* dest) { |
| 16 | for (size_t i = 0; i < size; ++i) |
| 17 | dest[i] = FloatToS16(src[i]); |
| 18 | } |
| 19 |
| 20 | void S16ToFloat(const int16_t* src, size_t size, float* dest) { |
| 21 | for (size_t i = 0; i < size; ++i) |
| 22 | dest[i] = S16ToFloat(src[i]); |
| 23 | } |
| 24 |
| 25 | void S16ToFloatS16(const int16_t* src, size_t size, float* dest) { |
| 26 | for (size_t i = 0; i < size; ++i) |
| 27 | dest[i] = src[i]; |
| 28 | } |
| 29 |
| 30 | void FloatS16ToS16(const float* src, size_t size, int16_t* dest) { |
| 31 | for (size_t i = 0; i < size; ++i) |
| 32 | dest[i] = FloatS16ToS16(src[i]); |
| 33 | } |
| 34 |
| 35 | void FloatToFloatS16(const float* src, size_t size, float* dest) { |
| 36 | for (size_t i = 0; i < size; ++i) |
| 37 | dest[i] = FloatToFloatS16(src[i]); |
| 38 | } |
| 39 |
| 40 | void FloatS16ToFloat(const float* src, size_t size, float* dest) { |
| 41 | for (size_t i = 0; i < size; ++i) |
| 42 | dest[i] = FloatS16ToFloat(src[i]); |
| 43 | } |
| 44 |
| 45 | template <> |
| 46 | void DownmixInterleavedToMono<int16_t>(const int16_t* interleaved, |
| 47 | size_t num_frames, |
| 48 | int num_channels, |
| 49 | int16_t* deinterleaved) { |
| 50 | DownmixInterleavedToMonoImpl<int16_t, int32_t>(interleaved, num_frames, |
| 51 | num_channels, deinterleaved); |
| 52 | } |
| 53 |
| 54 | } // namespace webrtc |
| 55 |