OLD | NEW |
1 /* Copyright (c) 2011 Xiph.Org Foundation | 1 /* Copyright (c) 2011 Xiph.Org Foundation |
2 Written by Jean-Marc Valin */ | 2 Written by Jean-Marc Valin */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 * coupled_streams</code>) must be no | 198 * coupled_streams</code>) must be no |
199 * more than 255. | 199 * more than 255. |
200 * @returns The size in bytes on success, or a negative error code | 200 * @returns The size in bytes on success, or a negative error code |
201 * (see @ref opus_errorcodes) on error. | 201 * (see @ref opus_errorcodes) on error. |
202 */ | 202 */ |
203 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size
( | 203 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_encoder_get_size
( |
204 int streams, | 204 int streams, |
205 int coupled_streams | 205 int coupled_streams |
206 ); | 206 ); |
207 | 207 |
| 208 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_multistream_surround_encoder
_get_size( |
| 209 int channels, |
| 210 int mapping_family |
| 211 ); |
| 212 |
| 213 |
208 /** Allocates and initializes a multistream encoder state. | 214 /** Allocates and initializes a multistream encoder state. |
209 * Call opus_multistream_encoder_destroy() to release | 215 * Call opus_multistream_encoder_destroy() to release |
210 * this object when finished. | 216 * this object when finished. |
211 * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). | 217 * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). |
212 * This must be one of 8000, 12000, 16000, | 218 * This must be one of 8000, 12000, 16000, |
213 * 24000, or 48000. | 219 * 24000, or 48000. |
214 * @param channels <tt>int</tt>: Number of channels in the input signal. | 220 * @param channels <tt>int</tt>: Number of channels in the input signal. |
215 * This must be at most 255. | 221 * This must be at most 255. |
216 * It may be greater than the number of | 222 * It may be greater than the number of |
217 * coded channels (<code>streams + | 223 * coded channels (<code>streams + |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_crea
te( | 257 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_encoder_crea
te( |
252 opus_int32 Fs, | 258 opus_int32 Fs, |
253 int channels, | 259 int channels, |
254 int streams, | 260 int streams, |
255 int coupled_streams, | 261 int coupled_streams, |
256 const unsigned char *mapping, | 262 const unsigned char *mapping, |
257 int application, | 263 int application, |
258 int *error | 264 int *error |
259 ) OPUS_ARG_NONNULL(5); | 265 ) OPUS_ARG_NONNULL(5); |
260 | 266 |
| 267 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSEncoder *opus_multistream_surround_enc
oder_create( |
| 268 opus_int32 Fs, |
| 269 int channels, |
| 270 int mapping_family, |
| 271 int *streams, |
| 272 int *coupled_streams, |
| 273 unsigned char *mapping, |
| 274 int application, |
| 275 int *error |
| 276 ) OPUS_ARG_NONNULL(5); |
| 277 |
261 /** Initialize a previously allocated multistream encoder state. | 278 /** Initialize a previously allocated multistream encoder state. |
262 * The memory pointed to by \a st must be at least the size returned by | 279 * The memory pointed to by \a st must be at least the size returned by |
263 * opus_multistream_encoder_get_size(). | 280 * opus_multistream_encoder_get_size(). |
264 * This is intended for applications which use their own allocator instead of | 281 * This is intended for applications which use their own allocator instead of |
265 * malloc. | 282 * malloc. |
266 * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. | 283 * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL. |
267 * @see opus_multistream_encoder_create | 284 * @see opus_multistream_encoder_create |
268 * @see opus_multistream_encoder_get_size | 285 * @see opus_multistream_encoder_get_size |
269 * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. | 286 * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state to initialize. |
270 * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). | 287 * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz). |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 OPUS_EXPORT int opus_multistream_encoder_init( | 326 OPUS_EXPORT int opus_multistream_encoder_init( |
310 OpusMSEncoder *st, | 327 OpusMSEncoder *st, |
311 opus_int32 Fs, | 328 opus_int32 Fs, |
312 int channels, | 329 int channels, |
313 int streams, | 330 int streams, |
314 int coupled_streams, | 331 int coupled_streams, |
315 const unsigned char *mapping, | 332 const unsigned char *mapping, |
316 int application | 333 int application |
317 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); | 334 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); |
318 | 335 |
| 336 OPUS_EXPORT int opus_multistream_surround_encoder_init( |
| 337 OpusMSEncoder *st, |
| 338 opus_int32 Fs, |
| 339 int channels, |
| 340 int mapping_family, |
| 341 int *streams, |
| 342 int *coupled_streams, |
| 343 unsigned char *mapping, |
| 344 int application |
| 345 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6); |
| 346 |
319 /** Encodes a multistream Opus frame. | 347 /** Encodes a multistream Opus frame. |
320 * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. | 348 * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state. |
321 * @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved | 349 * @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved |
322 * samples. | 350 * samples. |
323 * This must contain | 351 * This must contain |
324 * <code>frame_size*channels</code> | 352 * <code>frame_size*channels</code> |
325 * samples. | 353 * samples. |
326 * @param frame_size <tt>int</tt>: Number of samples per channel in the input | 354 * @param frame_size <tt>int</tt>: Number of samples per channel in the input |
327 * signal. | 355 * signal. |
328 * This must be an Opus frame size for the | 356 * This must be an Opus frame size for the |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 651 |
624 /**@}*/ | 652 /**@}*/ |
625 | 653 |
626 /**@}*/ | 654 /**@}*/ |
627 | 655 |
628 #ifdef __cplusplus | 656 #ifdef __cplusplus |
629 } | 657 } |
630 #endif | 658 #endif |
631 | 659 |
632 #endif /* OPUS_MULTISTREAM_H */ | 660 #endif /* OPUS_MULTISTREAM_H */ |
OLD | NEW |