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 |
(...skipping 20 matching lines...) Expand all Loading... |
31 * - speechIn : Input speech vector | 31 * - speechIn : Input speech vector |
32 * - len : Samples in speechIn | 32 * - len : Samples in speechIn |
33 * | 33 * |
34 * Output: | 34 * Output: |
35 * - encoded : The encoded data vector | 35 * - encoded : The encoded data vector |
36 * | 36 * |
37 * Return value : Length (in bytes) of coded data. | 37 * Return value : Length (in bytes) of coded data. |
38 * Always equal to len input parameter. | 38 * Always equal to len input parameter. |
39 */ | 39 */ |
40 | 40 |
41 int16_t WebRtcG711_EncodeA(const int16_t* speechIn, | 41 size_t WebRtcG711_EncodeA(const int16_t* speechIn, |
42 int16_t len, | 42 size_t len, |
43 uint8_t* encoded); | 43 uint8_t* encoded); |
44 | 44 |
45 /**************************************************************************** | 45 /**************************************************************************** |
46 * WebRtcG711_EncodeU(...) | 46 * WebRtcG711_EncodeU(...) |
47 * | 47 * |
48 * This function encodes a G711 U-law frame and inserts it into a packet. | 48 * This function encodes a G711 U-law frame and inserts it into a packet. |
49 * Input speech length has be of any length. | 49 * Input speech length has be of any length. |
50 * | 50 * |
51 * Input: | 51 * Input: |
52 * - speechIn : Input speech vector | 52 * - speechIn : Input speech vector |
53 * - len : Samples in speechIn | 53 * - len : Samples in speechIn |
54 * | 54 * |
55 * Output: | 55 * Output: |
56 * - encoded : The encoded data vector | 56 * - encoded : The encoded data vector |
57 * | 57 * |
58 * Return value : Length (in bytes) of coded data. | 58 * Return value : Length (in bytes) of coded data. |
59 * Always equal to len input parameter. | 59 * Always equal to len input parameter. |
60 */ | 60 */ |
61 | 61 |
62 int16_t WebRtcG711_EncodeU(const int16_t* speechIn, | 62 size_t WebRtcG711_EncodeU(const int16_t* speechIn, |
63 int16_t len, | 63 size_t len, |
64 uint8_t* encoded); | 64 uint8_t* encoded); |
65 | 65 |
66 /**************************************************************************** | 66 /**************************************************************************** |
67 * WebRtcG711_DecodeA(...) | 67 * WebRtcG711_DecodeA(...) |
68 * | 68 * |
69 * This function decodes a packet G711 A-law frame. | 69 * This function decodes a packet G711 A-law frame. |
70 * | 70 * |
71 * Input: | 71 * Input: |
72 * - encoded : Encoded data | 72 * - encoded : Encoded data |
73 * - len : Bytes in encoded vector | 73 * - len : Bytes in encoded vector |
74 * | 74 * |
75 * Output: | 75 * Output: |
76 * - decoded : The decoded vector | 76 * - decoded : The decoded vector |
77 * - speechType : 1 normal, 2 CNG (for G711 it should | 77 * - speechType : 1 normal, 2 CNG (for G711 it should |
78 * always return 1 since G711 does not have a | 78 * always return 1 since G711 does not have a |
79 * built-in DTX/CNG scheme) | 79 * built-in DTX/CNG scheme) |
80 * | 80 * |
81 * Return value : >0 - Samples in decoded vector | 81 * Return value : >0 - Samples in decoded vector |
82 * -1 - Error | 82 * -1 - Error |
83 */ | 83 */ |
84 | 84 |
85 int16_t WebRtcG711_DecodeA(const uint8_t* encoded, | 85 size_t WebRtcG711_DecodeA(const uint8_t* encoded, |
86 int16_t len, | 86 size_t len, |
87 int16_t* decoded, | 87 int16_t* decoded, |
88 int16_t* speechType); | 88 int16_t* speechType); |
89 | 89 |
90 /**************************************************************************** | 90 /**************************************************************************** |
91 * WebRtcG711_DecodeU(...) | 91 * WebRtcG711_DecodeU(...) |
92 * | 92 * |
93 * This function decodes a packet G711 U-law frame. | 93 * This function decodes a packet G711 U-law frame. |
94 * | 94 * |
95 * Input: | 95 * Input: |
96 * - encoded : Encoded data | 96 * - encoded : Encoded data |
97 * - len : Bytes in encoded vector | 97 * - len : Bytes in encoded vector |
98 * | 98 * |
99 * Output: | 99 * Output: |
100 * - decoded : The decoded vector | 100 * - decoded : The decoded vector |
101 * - speechType : 1 normal, 2 CNG (for G711 it should | 101 * - speechType : 1 normal, 2 CNG (for G711 it should |
102 * always return 1 since G711 does not have a | 102 * always return 1 since G711 does not have a |
103 * built-in DTX/CNG scheme) | 103 * built-in DTX/CNG scheme) |
104 * | 104 * |
105 * Return value : >0 - Samples in decoded vector | 105 * Return value : >0 - Samples in decoded vector |
106 * -1 - Error | 106 * -1 - Error |
107 */ | 107 */ |
108 | 108 |
109 int16_t WebRtcG711_DecodeU(const uint8_t* encoded, | 109 size_t WebRtcG711_DecodeU(const uint8_t* encoded, |
110 int16_t len, | 110 size_t len, |
111 int16_t* decoded, | 111 int16_t* decoded, |
112 int16_t* speechType); | 112 int16_t* speechType); |
113 | 113 |
114 /********************************************************************** | 114 /********************************************************************** |
115 * WebRtcG711_Version(...) | 115 * WebRtcG711_Version(...) |
116 * | 116 * |
117 * This function gives the version string of the G.711 codec. | 117 * This function gives the version string of the G.711 codec. |
118 * | 118 * |
119 * Input: | 119 * Input: |
120 * - lenBytes: the size of Allocated space (in Bytes) where | 120 * - lenBytes: the size of Allocated space (in Bytes) where |
121 * the version number is written to (in string format). | 121 * the version number is written to (in string format). |
122 * | 122 * |
123 * Output: | 123 * Output: |
124 * - version: Pointer to a buffer where the version number is | 124 * - version: Pointer to a buffer where the version number is |
125 * written to. | 125 * written to. |
126 * | 126 * |
127 */ | 127 */ |
128 | 128 |
129 int16_t WebRtcG711_Version(char* version, int16_t lenBytes); | 129 int16_t WebRtcG711_Version(char* version, int16_t lenBytes); |
130 | 130 |
131 #ifdef __cplusplus | 131 #ifdef __cplusplus |
132 } | 132 } |
133 #endif | 133 #endif |
134 | 134 |
135 #endif /* MODULES_AUDIO_CODING_CODECS_G711_MAIN_INTERFACE_G711_INTERFACE_H_ */ | 135 #endif /* MODULES_AUDIO_CODING_CODECS_G711_MAIN_INTERFACE_G711_INTERFACE_H_ */ |
OLD | NEW |