OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 86 matching lines...) Loading... |
97 * - nrOfSamples : Size of speech vector | 97 * - nrOfSamples : Size of speech vector |
98 * - forceSID : not zero to force SID frame and reset | 98 * - forceSID : not zero to force SID frame and reset |
99 * | 99 * |
100 * Output: | 100 * Output: |
101 * - bytesOut : Nr of bytes to transmit, might be 0 | 101 * - bytesOut : Nr of bytes to transmit, might be 0 |
102 * | 102 * |
103 * Return value : 0 - Ok | 103 * Return value : 0 - Ok |
104 * -1 - Error | 104 * -1 - Error |
105 */ | 105 */ |
106 int WebRtcCng_Encode(CNG_enc_inst* cng_inst, int16_t* speech, | 106 int WebRtcCng_Encode(CNG_enc_inst* cng_inst, int16_t* speech, |
107 int16_t nrOfSamples, uint8_t* SIDdata, | 107 size_t nrOfSamples, uint8_t* SIDdata, |
108 int16_t* bytesOut, int16_t forceSID); | 108 size_t* bytesOut, int16_t forceSID); |
109 | 109 |
110 /**************************************************************************** | 110 /**************************************************************************** |
111 * WebRtcCng_UpdateSid(...) | 111 * WebRtcCng_UpdateSid(...) |
112 * | 112 * |
113 * These functions updates the CN state, when a new SID packet arrives | 113 * These functions updates the CN state, when a new SID packet arrives |
114 * | 114 * |
115 * Input: | 115 * Input: |
116 * - cng_inst : Pointer to created instance that should be freed | 116 * - cng_inst : Pointer to created instance that should be freed |
117 * - SID : SID packet, all headers removed | 117 * - SID : SID packet, all headers removed |
118 * - length : Length in bytes of SID packet | 118 * - length : Length in bytes of SID packet |
(...skipping 12 matching lines...) Loading... |
131 * Input: | 131 * Input: |
132 * - cng_inst : Pointer to created instance that should be freed | 132 * - cng_inst : Pointer to created instance that should be freed |
133 * - outData : pointer to area to write CN data | 133 * - outData : pointer to area to write CN data |
134 * - nrOfSamples : How much data to generate | 134 * - nrOfSamples : How much data to generate |
135 * - new_period : >0 if a new period of CNG, will reset history | 135 * - new_period : >0 if a new period of CNG, will reset history |
136 * | 136 * |
137 * Return value : 0 - Ok | 137 * Return value : 0 - Ok |
138 * -1 - Error | 138 * -1 - Error |
139 */ | 139 */ |
140 int16_t WebRtcCng_Generate(CNG_dec_inst* cng_inst, int16_t* outData, | 140 int16_t WebRtcCng_Generate(CNG_dec_inst* cng_inst, int16_t* outData, |
141 int16_t nrOfSamples, int16_t new_period); | 141 size_t nrOfSamples, int16_t new_period); |
142 | 142 |
143 /***************************************************************************** | 143 /***************************************************************************** |
144 * WebRtcCng_GetErrorCodeEnc/Dec(...) | 144 * WebRtcCng_GetErrorCodeEnc/Dec(...) |
145 * | 145 * |
146 * This functions can be used to check the error code of a CNG instance. When | 146 * This functions can be used to check the error code of a CNG instance. When |
147 * a function returns -1 a error code will be set for that instance. The | 147 * a function returns -1 a error code will be set for that instance. The |
148 * function below extract the code of the last error that occurred in the | 148 * function below extract the code of the last error that occurred in the |
149 * specified instance. | 149 * specified instance. |
150 * | 150 * |
151 * Input: | 151 * Input: |
152 * - CNG_inst : CNG enc/dec instance | 152 * - CNG_inst : CNG enc/dec instance |
153 * | 153 * |
154 * Return value : Error code | 154 * Return value : Error code |
155 */ | 155 */ |
156 int16_t WebRtcCng_GetErrorCodeEnc(CNG_enc_inst* cng_inst); | 156 int16_t WebRtcCng_GetErrorCodeEnc(CNG_enc_inst* cng_inst); |
157 int16_t WebRtcCng_GetErrorCodeDec(CNG_dec_inst* cng_inst); | 157 int16_t WebRtcCng_GetErrorCodeDec(CNG_dec_inst* cng_inst); |
158 | 158 |
159 #ifdef __cplusplus | 159 #ifdef __cplusplus |
160 } | 160 } |
161 #endif | 161 #endif |
162 | 162 |
163 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_CNG_MAIN_INTERFACE_WEBRTC_CNG_H_ | 163 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_CNG_MAIN_INTERFACE_WEBRTC_CNG_H_ |
OLD | NEW |