OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_PCM16B_MAIN_INTERFACE_PCM16B_H_ |
13 /* | 13 /* |
14 * Define the fixpoint numeric formats | 14 * Define the fixpoint numeric formats |
15 */ | 15 */ |
16 | 16 |
| 17 #include <stddef.h> |
| 18 |
17 #include "webrtc/typedefs.h" | 19 #include "webrtc/typedefs.h" |
18 | 20 |
19 #ifdef __cplusplus | 21 #ifdef __cplusplus |
20 extern "C" { | 22 extern "C" { |
21 #endif | 23 #endif |
22 | 24 |
23 /**************************************************************************** | 25 /**************************************************************************** |
24 * WebRtcPcm16b_Encode(...) | 26 * WebRtcPcm16b_Encode(...) |
25 * | 27 * |
26 * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian) | 28 * "Encode" a sample vector to 16 bit linear (Encoded standard is big endian) |
27 * | 29 * |
28 * Input: | 30 * Input: |
29 * - speech : Input speech vector | 31 * - speech : Input speech vector |
30 * - len : Number of samples in speech vector | 32 * - len : Number of samples in speech vector |
31 * | 33 * |
32 * Output: | 34 * Output: |
33 * - encoded : Encoded data vector (big endian 16 bit) | 35 * - encoded : Encoded data vector (big endian 16 bit) |
34 * | 36 * |
35 * Returned value : Length (in bytes) of coded data. | 37 * Returned value : Length (in bytes) of coded data. |
36 * Always equal to twice the len input parameter. | 38 * Always equal to twice the len input parameter. |
37 */ | 39 */ |
38 | 40 |
39 int16_t WebRtcPcm16b_Encode(const int16_t* speech, | 41 size_t WebRtcPcm16b_Encode(const int16_t* speech, |
40 int16_t len, | 42 size_t len, |
41 uint8_t* encoded); | 43 uint8_t* encoded); |
42 | 44 |
43 /**************************************************************************** | 45 /**************************************************************************** |
44 * WebRtcPcm16b_Decode(...) | 46 * WebRtcPcm16b_Decode(...) |
45 * | 47 * |
46 * "Decode" a vector to 16 bit linear (Encoded standard is big endian) | 48 * "Decode" a vector to 16 bit linear (Encoded standard is big endian) |
47 * | 49 * |
48 * Input: | 50 * Input: |
49 * - encoded : Encoded data vector (big endian 16 bit) | 51 * - encoded : Encoded data vector (big endian 16 bit) |
50 * - len : Number of bytes in encoded | 52 * - len : Number of bytes in encoded |
51 * | 53 * |
52 * Output: | 54 * Output: |
53 * - speech : Decoded speech vector | 55 * - speech : Decoded speech vector |
54 * | 56 * |
55 * Returned value : Samples in speech | 57 * Returned value : Samples in speech |
56 */ | 58 */ |
57 | 59 |
58 int16_t WebRtcPcm16b_Decode(const uint8_t* encoded, | 60 size_t WebRtcPcm16b_Decode(const uint8_t* encoded, |
59 int16_t len, | 61 size_t len, |
60 int16_t* speech); | 62 int16_t* speech); |
61 | 63 |
62 #ifdef __cplusplus | 64 #ifdef __cplusplus |
63 } | 65 } |
64 #endif | 66 #endif |
65 | 67 |
66 #endif /* PCM16B */ | 68 #endif /* PCM16B */ |
OLD | NEW |