Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Side by Side Diff: webrtc/modules/audio_coding/codecs/ilbc/interface/ilbc.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 /* 11 /*
12 * ilbc.h 12 * ilbc.h
13 * 13 *
14 * This header file contains all of the API's for iLBC. 14 * This header file contains all of the API's for iLBC.
15 * 15 *
16 */ 16 */
17 17
18 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_MAIN_INTERFACE_ILBC_H_ 18 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_MAIN_INTERFACE_ILBC_H_
19 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_MAIN_INTERFACE_ILBC_H_ 19 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ILBC_MAIN_INTERFACE_ILBC_H_
20 20
21 #include <stddef.h>
22
21 /* 23 /*
22 * Define the fixpoint numeric formats 24 * Define the fixpoint numeric formats
23 */ 25 */
24 26
25 #include "webrtc/typedefs.h" 27 #include "webrtc/typedefs.h"
26 28
27 /* 29 /*
28 * Solution to support multiple instances 30 * Solution to support multiple instances
29 * Customer has to cast instance to proper type 31 * Customer has to cast instance to proper type
30 */ 32 */
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 * 132 *
131 * Output: 133 * Output:
132 * - encoded : The encoded data vector 134 * - encoded : The encoded data vector
133 * 135 *
134 * Return value : >0 - Length (in bytes) of coded data 136 * Return value : >0 - Length (in bytes) of coded data
135 * -1 - Error 137 * -1 - Error
136 */ 138 */
137 139
138 int WebRtcIlbcfix_Encode(IlbcEncoderInstance *iLBCenc_inst, 140 int WebRtcIlbcfix_Encode(IlbcEncoderInstance *iLBCenc_inst,
139 const int16_t *speechIn, 141 const int16_t *speechIn,
140 int16_t len, 142 size_t len,
141 uint8_t* encoded); 143 uint8_t* encoded);
142 144
143 /**************************************************************************** 145 /****************************************************************************
144 * WebRtcIlbcfix_DecoderInit(...) 146 * WebRtcIlbcfix_DecoderInit(...)
145 * 147 *
146 * This function initializes a iLBC instance with either 20 or 30 ms frames 148 * This function initializes a iLBC instance with either 20 or 30 ms frames
147 * Alternatively the WebRtcIlbcfix_DecoderInit_XXms can be used. Then it's 149 * Alternatively the WebRtcIlbcfix_DecoderInit_XXms can be used. Then it's
148 * not needed to specify the frame length with a variable. 150 * not needed to specify the frame length with a variable.
149 * 151 *
150 * Input: 152 * Input:
(...skipping 24 matching lines...) Expand all
175 * Output: 177 * Output:
176 * - decoded : The decoded vector 178 * - decoded : The decoded vector
177 * - speechType : 1 normal, 2 CNG 179 * - speechType : 1 normal, 2 CNG
178 * 180 *
179 * Return value : >0 - Samples in decoded vector 181 * Return value : >0 - Samples in decoded vector
180 * -1 - Error 182 * -1 - Error
181 */ 183 */
182 184
183 int WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst, 185 int WebRtcIlbcfix_Decode(IlbcDecoderInstance* iLBCdec_inst,
184 const uint8_t* encoded, 186 const uint8_t* encoded,
185 int16_t len, 187 size_t len,
186 int16_t* decoded, 188 int16_t* decoded,
187 int16_t* speechType); 189 int16_t* speechType);
188 int WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst, 190 int WebRtcIlbcfix_Decode20Ms(IlbcDecoderInstance* iLBCdec_inst,
189 const uint8_t* encoded, 191 const uint8_t* encoded,
190 int16_t len, 192 size_t len,
191 int16_t* decoded, 193 int16_t* decoded,
192 int16_t* speechType); 194 int16_t* speechType);
193 int WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst, 195 int WebRtcIlbcfix_Decode30Ms(IlbcDecoderInstance* iLBCdec_inst,
194 const uint8_t* encoded, 196 const uint8_t* encoded,
195 int16_t len, 197 size_t len,
196 int16_t* decoded, 198 int16_t* decoded,
197 int16_t* speechType); 199 int16_t* speechType);
198 200
199 /**************************************************************************** 201 /****************************************************************************
200 * WebRtcIlbcfix_DecodePlc(...) 202 * WebRtcIlbcfix_DecodePlc(...)
201 * 203 *
202 * This function conducts PLC for iLBC frame(s). Output speech length 204 * This function conducts PLC for iLBC frame(s). Output speech length
203 * will be a multiple of 160 or 240 samples. 205 * will be a multiple of 160 or 240 samples.
204 * 206 *
205 * Input: 207 * Input:
206 * - iLBCdec_inst : iLBC instance, i.e. the user that should perform 208 * - iLBCdec_inst : iLBC instance, i.e. the user that should perform
207 * a PLC 209 * a PLC
208 * - noOfLostFrames : Number of PLC frames to produce 210 * - noOfLostFrames : Number of PLC frames to produce
209 * 211 *
210 * Output: 212 * Output:
211 * - decoded : The "decoded" vector 213 * - decoded : The "decoded" vector
212 * 214 *
213 * Return value : >0 - Samples in decoded PLC vector 215 * Return value : Samples in decoded PLC vector
214 * -1 - Error
215 */ 216 */
216 217
217 int16_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance *iLBCdec_inst, 218 size_t WebRtcIlbcfix_DecodePlc(IlbcDecoderInstance *iLBCdec_inst,
218 int16_t *decoded, 219 int16_t *decoded,
219 int16_t noOfLostFrames); 220 size_t noOfLostFrames);
220 221
221 /**************************************************************************** 222 /****************************************************************************
222 * WebRtcIlbcfix_NetEqPlc(...) 223 * WebRtcIlbcfix_NetEqPlc(...)
223 * 224 *
224 * This function updates the decoder when a packet loss has occured, but it 225 * This function updates the decoder when a packet loss has occured, but it
225 * does not produce any PLC data. Function can be used if another PLC method 226 * does not produce any PLC data. Function can be used if another PLC method
226 * is used (i.e NetEq). 227 * is used (i.e NetEq).
227 * 228 *
228 * Input: 229 * Input:
229 * - iLBCdec_inst : iLBC instance that should be updated 230 * - iLBCdec_inst : iLBC instance that should be updated
230 * - noOfLostFrames : Number of lost frames 231 * - noOfLostFrames : Number of lost frames
231 * 232 *
232 * Output: 233 * Output:
233 * - decoded : The "decoded" vector (nothing in this case) 234 * - decoded : The "decoded" vector (nothing in this case)
234 * 235 *
235 * Return value : >0 - Samples in decoded PLC vector 236 * Return value : Samples in decoded PLC vector
236 * -1 - Error
237 */ 237 */
238 238
239 int16_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance *iLBCdec_inst, 239 size_t WebRtcIlbcfix_NetEqPlc(IlbcDecoderInstance *iLBCdec_inst,
240 int16_t *decoded, 240 int16_t *decoded,
241 int16_t noOfLostFrames); 241 size_t noOfLostFrames);
242 242
243 /**************************************************************************** 243 /****************************************************************************
244 * WebRtcIlbcfix_version(...) 244 * WebRtcIlbcfix_version(...)
245 * 245 *
246 * This function returns the version number of iLBC 246 * This function returns the version number of iLBC
247 * 247 *
248 * Output: 248 * Output:
249 * - version : Version number of iLBC (maximum 20 char) 249 * - version : Version number of iLBC (maximum 20 char)
250 */ 250 */
251 251
252 void WebRtcIlbcfix_version(char *version); 252 void WebRtcIlbcfix_version(char *version);
253 253
254 #ifdef __cplusplus 254 #ifdef __cplusplus
255 } 255 }
256 #endif 256 #endif
257 257
258 #endif 258 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698