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

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h

Issue 1179093002: Reland "Upconvert various types to int.", isac portion. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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) 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 * 121 *
122 * Output: 122 * Output:
123 * - encoded : the encoded data vector 123 * - encoded : the encoded data vector
124 * 124 *
125 * Return value : >0 - Length (in bytes) of coded data 125 * Return value : >0 - Length (in bytes) of coded data
126 * 0 - The buffer didn't reach the chosen framesiz e 126 * 0 - The buffer didn't reach the chosen framesiz e
127 * so it keeps buffering speech samples. 127 * so it keeps buffering speech samples.
128 * -1 - Error 128 * -1 - Error
129 */ 129 */
130 130
131 int16_t WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst, 131 int WebRtcIsacfix_Encode(ISACFIX_MainStruct *ISAC_main_inst,
132 const int16_t *speechIn, 132 const int16_t *speechIn,
133 uint8_t* encoded); 133 uint8_t* encoded);
134 134
135 135
136 136
137 /**************************************************************************** 137 /****************************************************************************
138 * WebRtcIsacfix_EncodeNb(...) 138 * WebRtcIsacfix_EncodeNb(...)
139 * 139 *
140 * This function encodes 10ms narrow band (8 kHz sampling) frame(s) and insert s 140 * This function encodes 10ms narrow band (8 kHz sampling) frame(s) and insert s
141 * it into a package. Input speech length has to be 80 samples (10ms). The enc oder 141 * it into a package. Input speech length has to be 80 samples (10ms). The enc oder
142 * interpolates into wide-band (16 kHz sampling) buffers those 142 * interpolates into wide-band (16 kHz sampling) buffers those
143 * 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band sam ples 143 * 10ms frames until it reaches the chosen Framesize (480 or 960 wide-band sam ples
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 * - encoded : encoded ISAC frame(s) 244 * - encoded : encoded ISAC frame(s)
245 * - len : bytes in encoded vector 245 * - len : bytes in encoded vector
246 * 246 *
247 * Output: 247 * Output:
248 * - decoded : The decoded vector 248 * - decoded : The decoded vector
249 * 249 *
250 * Return value : >0 - number of samples in decoded vector 250 * Return value : >0 - number of samples in decoded vector
251 * -1 - Error 251 * -1 - Error
252 */ 252 */
253 253
254 int16_t WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst, 254 int WebRtcIsacfix_Decode(ISACFIX_MainStruct *ISAC_main_inst,
255 const uint8_t* encoded, 255 const uint8_t* encoded,
256 int16_t len, 256 int16_t len,
257 int16_t *decoded, 257 int16_t *decoded,
258 int16_t *speechType); 258 int16_t *speechType);
259 259
260 260
261 /**************************************************************************** 261 /****************************************************************************
262 * WebRtcIsacfix_DecodeNb(...) 262 * WebRtcIsacfix_DecodeNb(...)
263 * 263 *
264 * This function decodes a ISAC frame in narrow-band (8 kHz sampling). 264 * This function decodes a ISAC frame in narrow-band (8 kHz sampling).
265 * Output speech length will be a multiple of 240 samples: 240 or 480 samples, 265 * Output speech length will be a multiple of 240 samples: 240 or 480 samples,
266 * depending on the framesize (30 or 60 ms). 266 * depending on the framesize (30 or 60 ms).
267 * 267 *
268 * The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined 268 * The function is enabled if WEBRTC_ISAC_FIX_NB_CALLS_ENABLED is defined
269 * 269 *
270 * Input: 270 * Input:
271 * - ISAC_main_inst : ISAC instance. 271 * - ISAC_main_inst : ISAC instance.
272 * - encoded : encoded ISAC frame(s) 272 * - encoded : encoded ISAC frame(s)
273 * - len : bytes in encoded vector 273 * - len : bytes in encoded vector
274 * 274 *
275 * Output: 275 * Output:
276 * - decoded : The decoded vector 276 * - decoded : The decoded vector
277 * 277 *
278 * Return value : >0 - number of samples in decoded vector 278 * Return value : >0 - number of samples in decoded vector
279 * -1 - Error 279 * -1 - Error
280 */ 280 */
281 281
282 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 282 #ifdef WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
283 int16_t WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst, 283 int WebRtcIsacfix_DecodeNb(ISACFIX_MainStruct *ISAC_main_inst,
284 const uint16_t *encoded, 284 const uint16_t *encoded,
285 int16_t len, 285 int16_t len,
286 int16_t *decoded, 286 int16_t *decoded,
287 int16_t *speechType); 287 int16_t *speechType);
288 #endif // WEBRTC_ISAC_FIX_NB_CALLS_ENABLED 288 #endif // WEBRTC_ISAC_FIX_NB_CALLS_ENABLED
289 289
290 290
291 /**************************************************************************** 291 /****************************************************************************
292 * WebRtcIsacfix_DecodePlcNb(...) 292 * WebRtcIsacfix_DecodePlcNb(...)
293 * 293 *
294 * This function conducts PLC for ISAC frame(s) in narrow-band (8kHz sampling) . 294 * This function conducts PLC for ISAC frame(s) in narrow-band (8kHz sampling) .
295 * Output speech length will be "240*noOfLostFrames" samples 295 * Output speech length will be "240*noOfLostFrames" samples
296 * that equevalent of "30*noOfLostFrames" millisecond. 296 * that equevalent of "30*noOfLostFrames" millisecond.
297 * 297 *
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 * - ISAC_main_inst : ISAC instance. 371 * - ISAC_main_inst : ISAC instance.
372 * - rate : limit on the short-term average bit rate, 372 * - rate : limit on the short-term average bit rate,
373 * in bits/second (between 10000 and 32000) 373 * in bits/second (between 10000 and 32000)
374 * - framesize : number of milliseconds per frame (30 or 60) 374 * - framesize : number of milliseconds per frame (30 or 60)
375 * 375 *
376 * Return value : 0 - ok 376 * Return value : 0 - ok
377 * -1 - Error 377 * -1 - Error
378 */ 378 */
379 379
380 int16_t WebRtcIsacfix_Control(ISACFIX_MainStruct *ISAC_main_inst, 380 int16_t WebRtcIsacfix_Control(ISACFIX_MainStruct *ISAC_main_inst,
381 int16_t rate, 381 int16_t rate,
382 int16_t framesize); 382 int framesize);
383 383
384 384
385 385
386 /**************************************************************************** 386 /****************************************************************************
387 * WebRtcIsacfix_ControlBwe(...) 387 * WebRtcIsacfix_ControlBwe(...)
388 * 388 *
389 * This function sets the initial values of bottleneck and frame-size if 389 * This function sets the initial values of bottleneck and frame-size if
390 * iSAC is used in channel-adaptive mode. Through this API, users can 390 * iSAC is used in channel-adaptive mode. Through this API, users can
391 * enforce a frame-size for all values of bottleneck. Then iSAC will not 391 * enforce a frame-size for all values of bottleneck. Then iSAC will not
392 * automatically change the frame-size. 392 * automatically change the frame-size.
393 * 393 *
394 * 394 *
395 * Input: 395 * Input:
396 * - ISAC_main_inst : ISAC instance. 396 * - ISAC_main_inst : ISAC instance.
397 * - rateBPS : initial value of bottleneck in bits/second 397 * - rateBPS : initial value of bottleneck in bits/second
398 * 10000 <= rateBPS <= 32000 is accepted 398 * 10000 <= rateBPS <= 32000 is accepted
399 * - frameSizeMs : number of milliseconds per frame (30 or 60) 399 * - frameSizeMs : number of milliseconds per frame (30 or 60)
400 * - enforceFrameSize : 1 to enforce the given frame-size through out 400 * - enforceFrameSize : 1 to enforce the given frame-size through out
401 * the adaptation process, 0 to let iSAC change 401 * the adaptation process, 0 to let iSAC change
402 * the frame-size if required. 402 * the frame-size if required.
403 * 403 *
404 * Return value : 0 - ok 404 * Return value : 0 - ok
405 * -1 - Error 405 * -1 - Error
406 */ 406 */
407 407
408 int16_t WebRtcIsacfix_ControlBwe(ISACFIX_MainStruct *ISAC_main_inst, 408 int16_t WebRtcIsacfix_ControlBwe(ISACFIX_MainStruct *ISAC_main_inst,
409 int16_t rateBPS, 409 int16_t rateBPS,
410 int16_t frameSizeMs, 410 int frameSizeMs,
411 int16_t enforceFrameSize); 411 int16_t enforceFrameSize);
412 412
413 413
414 414
415 /**************************************************************************** 415 /****************************************************************************
416 * WebRtcIsacfix_version(...) 416 * WebRtcIsacfix_version(...)
417 * 417 *
418 * This function returns the version number. 418 * This function returns the version number.
419 * 419 *
420 * Output: 420 * Output:
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 int16_t WebRtcIsacfix_GetNewFrameLen(ISACFIX_MainStruct *ISAC_main_inst); 627 int16_t WebRtcIsacfix_GetNewFrameLen(ISACFIX_MainStruct *ISAC_main_inst);
628 628
629 629
630 #if defined(__cplusplus) 630 #if defined(__cplusplus)
631 } 631 }
632 #endif 632 #endif
633 633
634 634
635 635
636 #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_ISACFIX_H_ */ 636 #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_ISACFIX_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698