andrew@webrtc.org | b6fadb1 | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 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 | |
andrew@webrtc.org | 5350e31 | 2014-03-04 20:58:13 +0000 | [diff] [blame^] | 17 | void RoundToInt16(const float* src, int size, int16_t* dest) { |
| 18 | for (int i = 0; i < size; ++i) |
| 19 | dest[i] = RoundToInt16(src[i]); |
andrew@webrtc.org | b6fadb1 | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 20 | } |
| 21 | |
andrew@webrtc.org | 5350e31 | 2014-03-04 20:58:13 +0000 | [diff] [blame^] | 22 | void ScaleAndRoundToInt16(const float* src, int size, int16_t* dest) { |
| 23 | for (int i = 0; i < size; ++i) |
| 24 | dest[i] = ScaleAndRoundToInt16(src[i]); |
| 25 | } |
| 26 | |
| 27 | void ScaleToFloat(const int16_t* src, int size, float* dest) { |
| 28 | for (int i = 0; i < size; ++i) |
| 29 | dest[i] = ScaleToFloat(src[i]); |
andrew@webrtc.org | b6fadb1 | 2013-04-29 17:27:29 +0000 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | } // namespace webrtc |