Skip to content

File syn_sbc.c

FileList > audio > syn_sbc.c

Go to the source code of this file

Bluetooth A2DP Sub-Band Codec (SBC) Decoder implementation.

  • #include "../util/syn_assert.h"
  • #include "syn_sbc.h"
  • #include <string.h>

Public Static Attributes

Type Name
const int32_t proto4_40 = /* multi line expression */
const int32_t proto8_80 = /* multi line expression */
const int32_t syn_cos4 = /* multi line expression */
const int32_t syn_cos8 = /* multi line expression */

Public Functions

Type Name
SYN_Status syn_sbc_decode_frame (SYN_SBC_Decoder * dec, const uint8_t * in, size_t in_len, int16_t * pcm_out, size_t pcm_cap, size_t * out_samples)
Decode a single SBC audio frame to 16-bit interleaved PCM samples.
void syn_sbc_decoder_init (SYN_SBC_Decoder * dec)
Initialize an SBC decoder instance.
SYN_Status syn_sbc_parse_header (const uint8_t * data, size_t len, SYN_SBC_FrameInfo * info)
Parse an SBC frame header without decoding audio payload.

Public Static Attributes Documentation

variable proto4_40

const int32_t proto4_40[40];

SBC Proto4 Windowing Coefficients for 4-subband synthesis


variable proto8_80

const int32_t proto8_80[80];

SBC Proto8 Windowing Coefficients for 8-subband synthesis (scaled fixed-point Q15)


variable syn_cos4

const int32_t syn_cos4[8][4];

IDCT matrix coefficients Q15 for 4 subbands


variable syn_cos8

const int32_t syn_cos8[16][8];

IDCT matrix coefficients Q15 for 8 subbands


Public Functions Documentation

function syn_sbc_decode_frame

Decode a single SBC audio frame to 16-bit interleaved PCM samples.

SYN_Status syn_sbc_decode_frame (
    SYN_SBC_Decoder * dec,
    const uint8_t * in,
    size_t in_len,
    int16_t * pcm_out,
    size_t pcm_cap,
    size_t * out_samples
) 

Parameters:

  • dec Decoder context pointer.
  • in Input SBC frame buffer starting at syncword 0x9C.
  • in_len Input frame buffer length.
  • pcm_out Output 16-bit PCM buffer (interleaved stereo or mono).
  • pcm_cap Capacity of output PCM buffer in samples.
  • out_samples Output pointer receiving actual decoded sample count.

Returns:

SYN_OK on successful frame decode, or error code (<0).


function syn_sbc_decoder_init

Initialize an SBC decoder instance.

void syn_sbc_decoder_init (
    SYN_SBC_Decoder * dec
) 

Parameters:

  • dec Decoder context pointer.

function syn_sbc_parse_header

Parse an SBC frame header without decoding audio payload.

SYN_Status syn_sbc_parse_header (
    const uint8_t * data,
    size_t len,
    SYN_SBC_FrameInfo * info
) 

Parameters:

  • data Input byte buffer containing SBC stream.
  • len Length of input buffer in bytes.
  • info Output frame header structure.

Returns:

SYN_OK on success, or SYN_INVALID_PARAM / SYN_ERROR if syncword missing or invalid.



The documentation for this class was generated from the following file src/syntropic/audio/syn_sbc.c