blob: a8af8bdef5d4184ae70a09d988ed094ebb45d9b0 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
braveyao@webrtc.orgd7131432012-03-29 10:39:44 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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/*
12 * Contains functions often used by different parts of VoiceEngine.
13 */
14
15#ifndef WEBRTC_VOICE_ENGINE_UTILITY_H
16#define WEBRTC_VOICE_ENGINE_UTILITY_H
17
18#include "typedefs.h"
19#include "voice_engine_defines.h"
20
21namespace webrtc
22{
23
24class Module;
25
26namespace voe
27{
28
29class Utility
30{
31public:
32 static void MixWithSat(WebRtc_Word16 target[],
braveyao@webrtc.orgd7131432012-03-29 10:39:44 +000033 int target_channel,
niklase@google.com470e71d2011-07-07 08:21:25 +000034 const WebRtc_Word16 source[],
braveyao@webrtc.orgd7131432012-03-29 10:39:44 +000035 int source_channel,
36 int source_len);
niklase@google.com470e71d2011-07-07 08:21:25 +000037
38 static void MixSubtractWithSat(WebRtc_Word16 target[],
39 const WebRtc_Word16 source[],
40 WebRtc_UWord16 len);
41
42 static void MixAndScaleWithSat(WebRtc_Word16 target[],
43 const WebRtc_Word16 source[],
44 float scale,
45 WebRtc_UWord16 len);
46
47 static void Scale(WebRtc_Word16 vector[], float scale, WebRtc_UWord16 len);
48
49 static void ScaleWithSat(WebRtc_Word16 vector[],
50 float scale,
51 WebRtc_UWord16 len);
niklase@google.com470e71d2011-07-07 08:21:25 +000052};
53
54} // namespace voe
55
56} // namespace webrtc
57
58#endif // WEBRTC_VOICE_ENGINE_UTILITY_H