Infineon Logo AIROC BTSDK v4.4 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
opus.h File Reference

Opus reference implementation API. More...

Data Structures

struct  StereoWidthState
 
struct  OpusEncoder
 

Macros

#define MAX_ENCODER_BUFFER   480
 
#define OPUS_ENCODER_RESET_START   stream_channels
 

Typedefs

typedef struct OpusEncoder OpusEncoder
 Opus encoder state. More...
 
typedef struct OpusDecoder OpusDecoder
 Opus decoder state. More...
 
typedef struct OpusRepacketizer OpusRepacketizer
 

Functions

OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_encoder_get_size (int channels)
 Gets the size of an OpusEncoder structure. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT
OpusEncoder
opus_encoder_create (int Fs, int channels, int *error)
 Allocates and initializes an encoder state. More...
 
OPUS_EXPORT int opus_encoder_init (OpusEncoder *st, int Fs, int channels) OPUS_ARG_NONNULL(1)
 Initializes a previously allocated encoder state The memory pointed to by st must be at least the size returned by opus_encoder_get_size(). More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_encode_ed (OpusEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *data, int max_data_bytes) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4)
 Encodes an Opus frame. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_encode_float (OpusEncoder *st, const float *pcm, int frame_size, unsigned char *data, int max_data_bytes) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4)
 Encodes an Opus frame from floating point input. More...
 
OPUS_EXPORT void opus_encoder_destroy (OpusEncoder *st)
 Frees an OpusEncoder allocated by opus_encoder_create(). More...
 
OPUS_EXPORT int opus_encoder_ctl (OpusEncoder *st, int request,...) OPUS_ARG_NONNULL(1)
 Perform a CTL function on an Opus encoder. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_decoder_get_size (int channels)
 Gets the size of an OpusDecoder structure. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT
OpusDecoder
celt_opus_decoder_create (int Fs, int channels, int *error)
 Allocates and initializes a decoder state. More...
 
OPUS_EXPORT int celt_opus_decoder_init (OpusDecoder *st, int Fs, int channels) OPUS_ARG_NONNULL(1)
 Initializes a previously allocated decoder state. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_decode (OpusDecoder *st, const unsigned char *data, int len, opus_int16 *pcm, int frame_size, int decode_fec) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4)
 Decode an Opus packet. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_decode_float (OpusDecoder *st, const unsigned char *data, int len, float *pcm, int frame_size, int decode_fec) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4)
 Decode an Opus packet with floating point output. More...
 
OPUS_EXPORT int celt_opus_decoder_ctl (OpusDecoder *st, int request,...) OPUS_ARG_NONNULL(1)
 Perform a CTL function on an Opus decoder. More...
 
OPUS_EXPORT void celt_opus_decoder_destroy (OpusDecoder *st)
 Frees an OpusDecoder allocated by celt_opus_decoder_create(). More...
 
OPUS_EXPORT int celt_opus_packet_parse (const unsigned char *data, int len, unsigned char *out_toc, const unsigned char *frames[48], opus_int16 size[48], int *payload_offset) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4)
 Parse an opus packet into one or more frames. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_packet_get_bandwidth (const unsigned char *data) OPUS_ARG_NONNULL(1)
 Gets the bandwidth of an Opus packet. More...
 
int celt_opus_packet_get_samples_per_frame (const unsigned char *data, int Fs) OPUS_ARG_NONNULL(1)
 Gets the number of samples per frame from an Opus packet. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_packet_get_nb_channels (const unsigned char *data) OPUS_ARG_NONNULL(1)
 Gets the number of channels from an Opus packet. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_packet_get_nb_frames (const unsigned char packet[], int len) OPUS_ARG_NONNULL(1)
 Gets the number of frames in an Opus packet. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_packet_get_nb_samples (const unsigned char packet[], int len, int Fs) OPUS_ARG_NONNULL(1)
 Gets the number of samples of an Opus packet. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
celt_opus_decoder_get_nb_samples (const OpusDecoder *dec, const unsigned char packet[], int len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2)
 Gets the number of samples of an Opus packet. More...
 
OPUS_EXPORT void opus_pcm_soft_clip (float *pcm, int frame_size, int channels, float *softclip_mem)
 Applies soft-clipping to bring a float signal within the [-1,1] range. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_repacketizer_get_size (void)
 Gets the size of an OpusRepacketizer structure. More...
 
OPUS_EXPORT OpusRepacketizer * opus_repacketizer_init (OpusRepacketizer *rp) OPUS_ARG_NONNULL(1)
 (Re)initializes a previously allocated repacketizer state. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT
OpusRepacketizer * 
opus_repacketizer_create (void)
 Allocates memory and initializes the new repacketizer with opus_repacketizer_init().
 
OPUS_EXPORT void opus_repacketizer_destroy (OpusRepacketizer *rp)
 Frees an OpusRepacketizer allocated by opus_repacketizer_create(). More...
 
OPUS_EXPORT int opus_repacketizer_cat (OpusRepacketizer *rp, const unsigned char *data, int len) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2)
 Add a packet to the current repacketizer state. More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_repacketizer_out_range (OpusRepacketizer *rp, int begin, int end, unsigned char *data, int maxlen) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4)
 Construct a new packet from data previously submitted to the repacketizer state via opus_repacketizer_cat(). More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_repacketizer_get_nb_frames (OpusRepacketizer *rp) OPUS_ARG_NONNULL(1)
 Return the total number of frames contained in packet data submitted to the repacketizer state so far via opus_repacketizer_cat() since the last call to opus_repacketizer_init() or opus_repacketizer_create(). More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_repacketizer_out (OpusRepacketizer *rp, unsigned char *data, int maxlen) OPUS_ARG_NONNULL(1)
 Construct a new packet from data previously submitted to the repacketizer state via opus_repacketizer_cat(). More...
 
OPUS_EXPORT int opus_packet_pad (unsigned char *data, int len, int new_len)
 Pads a given Opus packet to a larger size (possibly changing the TOC sequence). More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_packet_unpad (unsigned char *data, int len)
 Remove all padding from a given Opus packet and rewrite the TOC sequence to minimize space usage. More...
 
OPUS_EXPORT int opus_multistream_packet_pad (unsigned char *data, int len, int new_len, int nb_streams)
 Pads a given Opus multi-stream packet to a larger size (possibly changing the TOC sequence). More...
 
OPUS_EXPORT
OPUS_WARN_UNUSED_RESULT int 
opus_multistream_packet_unpad (unsigned char *data, int len, int nb_streams)
 Remove all padding from a given Opus multi-stream packet and rewrite the TOC sequence to minimize space usage. More...
 

Detailed Description

Opus reference implementation API.