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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 * - audio_in : Input speech data buffer | 57 * - audio_in : Input speech data buffer |
58 * - samples : Samples per channel in audio_in | 58 * - samples : Samples per channel in audio_in |
59 * - length_encoded_buffer : Output buffer size | 59 * - length_encoded_buffer : Output buffer size |
60 * | 60 * |
61 * Output: | 61 * Output: |
62 * - encoded : Output compressed data buffer | 62 * - encoded : Output compressed data buffer |
63 * | 63 * |
64 * Return value : >=0 - Length (in bytes) of coded data | 64 * Return value : >=0 - Length (in bytes) of coded data |
65 * -1 - Error | 65 * -1 - Error |
66 */ | 66 */ |
67 int16_t WebRtcOpus_Encode(OpusEncInst* inst, | 67 int WebRtcOpus_Encode(OpusEncInst* inst, |
68 const int16_t* audio_in, | 68 const int16_t* audio_in, |
69 int16_t samples, | 69 int16_t samples, |
70 int16_t length_encoded_buffer, | 70 int16_t length_encoded_buffer, |
71 uint8_t* encoded); | 71 uint8_t* encoded); |
72 | 72 |
73 /**************************************************************************** | 73 /**************************************************************************** |
74 * WebRtcOpus_SetBitRate(...) | 74 * WebRtcOpus_SetBitRate(...) |
75 * | 75 * |
76 * This function adjusts the target bitrate of the encoder. | 76 * This function adjusts the target bitrate of the encoder. |
77 * | 77 * |
78 * Input: | 78 * Input: |
79 * - inst : Encoder context | 79 * - inst : Encoder context |
80 * - rate : New target bitrate | 80 * - rate : New target bitrate |
81 * | 81 * |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 * | 229 * |
230 * Output: | 230 * Output: |
231 * - decoded : The decoded vector | 231 * - decoded : The decoded vector |
232 * - audio_type : 1 normal, 2 CNG (for Opus it should | 232 * - audio_type : 1 normal, 2 CNG (for Opus it should |
233 * always return 1 since we're not using Opus's | 233 * always return 1 since we're not using Opus's |
234 * built-in DTX/CNG scheme) | 234 * built-in DTX/CNG scheme) |
235 * | 235 * |
236 * Return value : >0 - Samples per channel in decoded vector | 236 * Return value : >0 - Samples per channel in decoded vector |
237 * -1 - Error | 237 * -1 - Error |
238 */ | 238 */ |
239 int16_t WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded, | 239 int WebRtcOpus_Decode(OpusDecInst* inst, const uint8_t* encoded, |
240 int16_t encoded_bytes, int16_t* decoded, | 240 int16_t encoded_bytes, int16_t* decoded, |
241 int16_t* audio_type); | 241 int16_t* audio_type); |
242 | 242 |
243 /**************************************************************************** | 243 /**************************************************************************** |
244 * WebRtcOpus_DecodePlc(...) | 244 * WebRtcOpus_DecodePlc(...) |
245 * | 245 * |
246 * This function processes PLC for opus frame(s). | 246 * This function processes PLC for opus frame(s). |
247 * Input: | 247 * Input: |
248 * - inst : Decoder context | 248 * - inst : Decoder context |
249 * - number_of_lost_frames : Number of PLC frames to produce | 249 * - number_of_lost_frames : Number of PLC frames to produce |
250 * | 250 * |
251 * Output: | 251 * Output: |
252 * - decoded : The decoded vector | 252 * - decoded : The decoded vector |
253 * | 253 * |
254 * Return value : >0 - number of samples in decoded PLC vector | 254 * Return value : >0 - number of samples in decoded PLC vector |
255 * -1 - Error | 255 * -1 - Error |
256 */ | 256 */ |
257 int16_t WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded, | 257 int WebRtcOpus_DecodePlc(OpusDecInst* inst, int16_t* decoded, |
258 int16_t number_of_lost_frames); | 258 int number_of_lost_frames); |
259 | 259 |
260 /**************************************************************************** | 260 /**************************************************************************** |
261 * WebRtcOpus_DecodeFec(...) | 261 * WebRtcOpus_DecodeFec(...) |
262 * | 262 * |
263 * This function decodes the FEC data from an Opus packet into one or more audio | 263 * This function decodes the FEC data from an Opus packet into one or more audio |
264 * frames at the ACM interface's sampling rate (32 kHz). | 264 * frames at the ACM interface's sampling rate (32 kHz). |
265 * | 265 * |
266 * Input: | 266 * Input: |
267 * - inst : Decoder context | 267 * - inst : Decoder context |
268 * - encoded : Encoded data | 268 * - encoded : Encoded data |
269 * - encoded_bytes : Bytes in encoded vector | 269 * - encoded_bytes : Bytes in encoded vector |
270 * | 270 * |
271 * Output: | 271 * Output: |
272 * - decoded : The decoded vector (previous frame) | 272 * - decoded : The decoded vector (previous frame) |
273 * | 273 * |
274 * Return value : >0 - Samples per channel in decoded vector | 274 * Return value : >0 - Samples per channel in decoded vector |
275 * 0 - No FEC data in the packet | 275 * 0 - No FEC data in the packet |
276 * -1 - Error | 276 * -1 - Error |
277 */ | 277 */ |
278 int16_t WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded, | 278 int WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded, |
279 int16_t encoded_bytes, int16_t* decoded, | 279 int16_t encoded_bytes, int16_t* decoded, |
280 int16_t* audio_type); | 280 int16_t* audio_type); |
281 | 281 |
282 /**************************************************************************** | 282 /**************************************************************************** |
283 * WebRtcOpus_DurationEst(...) | 283 * WebRtcOpus_DurationEst(...) |
284 * | 284 * |
285 * This function calculates the duration of an opus packet. | 285 * This function calculates the duration of an opus packet. |
286 * Input: | 286 * Input: |
287 * - inst : Decoder context | 287 * - inst : Decoder context |
288 * - payload : Encoded data pointer | 288 * - payload : Encoded data pointer |
289 * - payload_length_bytes : Bytes of encoded data | 289 * - payload_length_bytes : Bytes of encoded data |
290 * | 290 * |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 * 1 - the packet contains FEC. | 327 * 1 - the packet contains FEC. |
328 */ | 328 */ |
329 int WebRtcOpus_PacketHasFec(const uint8_t* payload, | 329 int WebRtcOpus_PacketHasFec(const uint8_t* payload, |
330 int payload_length_bytes); | 330 int payload_length_bytes); |
331 | 331 |
332 #ifdef __cplusplus | 332 #ifdef __cplusplus |
333 } // extern "C" | 333 } // extern "C" |
334 #endif | 334 #endif |
335 | 335 |
336 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_OPUS_INTERFACE_H_ | 336 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_OPUS_INTERFACE_H_ |
OLD | NEW |