blob: fcb4462e5207b1a8c54903756d4180cb8ea3825f [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
pbos@webrtc.org956aa7e2013-05-21 13:52:32 +000018#include "webrtc/typedefs.h"
19#include "webrtc/voice_engine/voice_engine_defines.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000020
21namespace webrtc
22{
23
24class Module;
25
26namespace voe
27{
28
29class Utility
30{
31public:
pbos@webrtc.org6141e132013-04-09 10:09:10 +000032 static void MixWithSat(int16_t target[],
braveyao@webrtc.orgd7131432012-03-29 10:39:44 +000033 int target_channel,
pbos@webrtc.org6141e132013-04-09 10:09:10 +000034 const int16_t 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
pbos@webrtc.org6141e132013-04-09 10:09:10 +000038 static void MixSubtractWithSat(int16_t target[],
39 const int16_t source[],
40 uint16_t len);
niklase@google.com470e71d2011-07-07 08:21:25 +000041
pbos@webrtc.org6141e132013-04-09 10:09:10 +000042 static void MixAndScaleWithSat(int16_t target[],
43 const int16_t source[],
niklase@google.com470e71d2011-07-07 08:21:25 +000044 float scale,
pbos@webrtc.org6141e132013-04-09 10:09:10 +000045 uint16_t len);
niklase@google.com470e71d2011-07-07 08:21:25 +000046
pbos@webrtc.org6141e132013-04-09 10:09:10 +000047 static void Scale(int16_t vector[], float scale, uint16_t len);
niklase@google.com470e71d2011-07-07 08:21:25 +000048
pbos@webrtc.org6141e132013-04-09 10:09:10 +000049 static void ScaleWithSat(int16_t vector[],
niklase@google.com470e71d2011-07-07 08:21:25 +000050 float scale,
pbos@webrtc.org6141e132013-04-09 10:09:10 +000051 uint16_t len);
niklase@google.com470e71d2011-07-07 08:21:25 +000052};
53
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000054} // namespace voe
niklase@google.com470e71d2011-07-07 08:21:25 +000055
pbos@webrtc.orgd900e8b2013-07-03 15:12:26 +000056} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000057
58#endif // WEBRTC_VOICE_ENGINE_UTILITY_H