mSBC Library
Data Structures | Typedefs | Functions
mSBC API

Data Structures

struct  sbc_struct
 Structure to hold internal memory and state required by an instance of the mSBC codec. More...
 

Typedefs

typedef struct sbc_struct sbc_t
 Structure to hold internal memory and state required by an instance of the mSBC codec.
 
typedef int32_t ssize_t
 ssize_t type definition More...
 

Functions

ssize_t sbc_decode (sbc_t *sbc, const void *input, size_t input_len, void *output, size_t output_len, size_t *written)
 Decodes ONE input block into ONE output block. More...
 
ssize_t sbc_encode (sbc_t *sbc, const void *input, size_t input_len, void *output, size_t output_len, size_t *written)
 Encodes ONE input block into ONE output block. More...
 
void sbc_finish (sbc_t *sbc)
 Reset state and free memory. More...
 
int sbc_init_msbc (sbc_t *sbc, unsigned long flags)
 Allocate and initialize SBC structures. More...
 

Detailed Description

Typedef Documentation

§ ssize_t

typedef int32_t ssize_t

ssize_t type definition

This type is a 32-bit signed integer on the TI SimpleLink platform

Function Documentation

§ sbc_decode()

ssize_t sbc_decode ( sbc_t sbc,
const void *  input,
size_t  input_len,
void *  output,
size_t  output_len,
size_t *  written 
)

Decodes ONE input block into ONE output block.

Precondition
sbc_init_msbc() has been called.
Parameters
[in]sbcAn instance of the sbc_t structure
[in]inputPointer to the input bit stream, will be uncompressed
[in]input_lenLength of the input array in bytes
[out]outputPointer to memory where output PCM frame will be written
[in]output_lenSize of output PCM frame buffer in bytes
[out]writtenNumber of bytes written into output buffer
Returns
Returns the length in bytes of the packed input frame, or a negative value on error. The error codes are:

-1 Data stream too short -2 Sync byte incorrect -3 CRC8 incorrect -4 Bitpool value out of bounds

§ sbc_encode()

ssize_t sbc_encode ( sbc_t sbc,
const void *  input,
size_t  input_len,
void *  output,
size_t  output_len,
size_t *  written 
)

Encodes ONE input block into ONE output block.

Precondition
sbc_init_msbc() has been called.
Parameters
[in]sbcAn instance of the sbc_t structure
[in]inputPointer to the input PCM frame, will be compressed
[in]input_lenLength of the input PCM frame in bytes
[out]outputPointer to memory where output bitstream will be written
[in]output_lenSize of output buffer in bytes
[out]writtenNumber of bytes written into output buffer
Returns
Returns the length in bytes of the input PCM frame, Error codes otherwise.

§ sbc_finish()

void sbc_finish ( sbc_t sbc)

Reset state and free memory.

This function frees the memory allocated by sbc_init_msbc and resets the sbc structure to a known state.

Precondition
sbc_init_msbc() has been called.
Parameters
[in]sbcAn instance of the sbc_t structure

§ sbc_init_msbc()

int sbc_init_msbc ( sbc_t sbc,
unsigned long  flags 
)

Allocate and initialize SBC structures.

This function will initialize the sbc_t structure and allocate from heap private memory used required by the mSBC codec. These structures are set to a known state.

Parameters
[in]sbcAn instance of the sbc_t structure
[in]flagsThis parameter is unused.
Returns
0 on success, Error codes otherwise.
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale