33 #ifndef OPUS_MULTISTREAM_H
34 #define OPUS_MULTISTREAM_H
47 #define __opus_check_encstate_ptr(ptr) ((ptr) + ((ptr) - (OpusEncoder**)(ptr)))
48 #define __opus_check_decstate_ptr(ptr) ((ptr) + ((ptr) - (OpusDecoder**)(ptr)))
55 #define OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST 5120
56 #define OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST 5122
86 #define OPUS_MULTISTREAM_GET_ENCODER_STATE(x,y) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int(x), __opus_check_encstate_ptr(y)
99 #define OPUS_MULTISTREAM_GET_DECODER_STATE(x,y) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int(x), __opus_check_decstate_ptr(y)
262 const unsigned char *mapping,
265 ) OPUS_ARG_NONNULL(5);
272 int *coupled_streams,
273 unsigned char *mapping,
276 ) OPUS_ARG_NONNULL(5);
332 const unsigned char *mapping,
334 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
342 int *coupled_streams,
343 unsigned char *mapping,
345 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
383 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
428 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
509 const
unsigned char *mapping,
511 ) OPUS_ARG_NONNULL(5);
553 const
unsigned char *mapping
554 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
587 const
unsigned char *data,
592 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
625 const
unsigned char *data,
630 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
opus_int32 opus_multistream_surround_encoder_get_size(int channels, int mapping_family)
void opus_multistream_decoder_destroy(OpusMSDecoder *st)
Frees an OpusMSDecoder allocated by opus_multistream_decoder_create().
int opus_multistream_decode(OpusMSDecoder *st, const unsigned char *data, opus_int32 len, opus_int16 *pcm, int frame_size, int decode_fec)
Decode a multistream Opus packet.
opus_int32 opus_multistream_decoder_get_size(int streams, int coupled_streams)
Gets the size of an OpusMSDecoder structure.
short opus_int16
Definition: opus_types.h:144
int opus_multistream_surround_encoder_init(OpusMSEncoder *st, opus_int32 Fs, int channels, int mapping_family, int *streams, int *coupled_streams, unsigned char *mapping, int application)
int opus_multistream_encode(OpusMSEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *data, opus_int32 max_data_bytes)
Encodes a multistream Opus frame.
int opus_multistream_encoder_init(OpusMSEncoder *st, opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping, int application)
Initialize a previously allocated multistream encoder state.
int opus_multistream_encode_float(OpusMSEncoder *st, const float *pcm, int frame_size, unsigned char *data, opus_int32 max_data_bytes)
Encodes a multistream Opus frame from floating point input.
OpusMSEncoder * opus_multistream_surround_encoder_create(opus_int32 Fs, int channels, int mapping_family, int *streams, int *coupled_streams, unsigned char *mapping, int application, int *error)
int opus_int32
Definition: opus_types.h:146
int opus_multistream_decoder_init(OpusMSDecoder *st, opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping)
Intialize a previously allocated decoder state object.
int opus_multistream_decoder_ctl(OpusMSDecoder *st, int request,...)
Perform a CTL function on a multistream Opus decoder.
int opus_multistream_decode_float(OpusMSDecoder *st, const unsigned char *data, opus_int32 len, float *pcm, int frame_size, int decode_fec)
Decode a multistream Opus packet with floating point output.
struct OpusMSDecoder OpusMSDecoder
Opus multistream decoder state.
Definition: opus_multistream.h:183
struct OpusMSEncoder OpusMSEncoder
Opus multistream encoder state.
Definition: opus_multistream.h:175
Opus reference implementation API.
opus_int32 opus_multistream_encoder_get_size(int streams, int coupled_streams)
Gets the size of an OpusMSEncoder structure.
OpusMSEncoder * opus_multistream_encoder_create(opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping, int application, int *error)
Allocates and initializes a multistream encoder state.
void opus_multistream_encoder_destroy(OpusMSEncoder *st)
Frees an OpusMSEncoder allocated by opus_multistream_encoder_create().
OpusMSDecoder * opus_multistream_decoder_create(opus_int32 Fs, int channels, int streams, int coupled_streams, const unsigned char *mapping, int *error)
Allocates and initializes a multistream decoder state.
int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request,...)
Perform a CTL function on a multistream Opus encoder.