blob: f2936b071f4270dbdc4cd81184c111f5e1b91c9b [file] [log] [blame]
andrew@webrtc.org50b2efe2013-04-29 17:27:29 +00001/*
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
15namespace webrtc {
16
kwiberg@webrtc.orgefb81d82014-07-16 08:36:52 +000017void RoundToInt16(const float* src, size_t size, int16_t* dest) {
18 for (size_t i = 0; i < size; ++i)
andrew@webrtc.org17e40642014-03-04 20:58:13 +000019 dest[i] = RoundToInt16(src[i]);
andrew@webrtc.org50b2efe2013-04-29 17:27:29 +000020}
21
kwiberg@webrtc.orgefb81d82014-07-16 08:36:52 +000022void ScaleAndRoundToInt16(const float* src, size_t size, int16_t* dest) {
23 for (size_t i = 0; i < size; ++i)
andrew@webrtc.org17e40642014-03-04 20:58:13 +000024 dest[i] = ScaleAndRoundToInt16(src[i]);
25}
26
kwiberg@webrtc.orgefb81d82014-07-16 08:36:52 +000027void ScaleToFloat(const int16_t* src, size_t size, float* dest) {
28 for (size_t i = 0; i < size; ++i)
andrew@webrtc.org17e40642014-03-04 20:58:13 +000029 dest[i] = ScaleToFloat(src[i]);
andrew@webrtc.org50b2efe2013-04-29 17:27:29 +000030}
31
32} // namespace webrtc