FFmpeg
Data Structures | Functions | Variables
sbcdec.c File Reference
#include "avcodec.h"
#include "internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "sbc.h"
#include "sbcdec_data.h"

Go to the source code of this file.

Data Structures

struct  sbc_decoder_state
 
struct  SBCDecContext
 

Functions

static int sbc_unpack_frame (const uint8_t *data, struct sbc_frame *frame, size_t len)
 
static void sbc_synthesize_four (struct sbc_decoder_state *state, struct sbc_frame *frame, int ch, int blk, AVFrame *output_frame)
 
static void sbc_synthesize_eight (struct sbc_decoder_state *state, struct sbc_frame *frame, int ch, int blk, AVFrame *output_frame)
 
static void sbc_synthesize_audio (struct sbc_decoder_state *state, struct sbc_frame *frame, AVFrame *output_frame)
 
static int sbc_decode_init (AVCodecContext *avctx)
 
static int sbc_decode_frame (AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

const AVCodec ff_sbc_decoder
 

Detailed Description

SBC decoder implementation

Definition in file sbcdec.c.

Function Documentation

◆ sbc_unpack_frame()

static int sbc_unpack_frame ( const uint8_t *  data,
struct sbc_frame frame,
size_t  len 
)
static

Definition at line 62 of file sbcdec.c.

Referenced by sbc_decode_frame().

◆ sbc_synthesize_four()

static void sbc_synthesize_four ( struct sbc_decoder_state state,
struct sbc_frame frame,
int  ch,
int  blk,
AVFrame output_frame 
)
inlinestatic

Definition at line 212 of file sbcdec.c.

Referenced by sbc_synthesize_audio().

◆ sbc_synthesize_eight()

static void sbc_synthesize_eight ( struct sbc_decoder_state state,
struct sbc_frame frame,
int  ch,
int  blk,
AVFrame output_frame 
)
inlinestatic

Definition at line 255 of file sbcdec.c.

Referenced by sbc_synthesize_audio().

◆ sbc_synthesize_audio()

static void sbc_synthesize_audio ( struct sbc_decoder_state state,
struct sbc_frame frame,
AVFrame output_frame 
)
static

Definition at line 302 of file sbcdec.c.

Referenced by sbc_decode_frame().

◆ sbc_decode_init()

static int sbc_decode_init ( AVCodecContext avctx)
static

Definition at line 322 of file sbcdec.c.

◆ sbc_decode_frame()

static int sbc_decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 338 of file sbcdec.c.

Variable Documentation

◆ ff_sbc_decoder

const AVCodec ff_sbc_decoder
Initial value:
= {
.name = "sbc",
.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"),
.priv_data_size = sizeof(SBCDecContext),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 },
}

Definition at line 366 of file sbcdec.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:41
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:31
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:90
sbc_decode_init
static int sbc_decode_init(AVCodecContext *avctx)
Definition: sbcdec.c:322
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:91
AV_CODEC_ID_SBC
@ AV_CODEC_ID_SBC
Definition: codec_id.h:508
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
SBCDecContext
Definition: sbcdec.c:45
sbc_decode_frame
static int sbc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: sbcdec.c:338
AV_CODEC_CAP_CHANNEL_CONF
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition: codec.h:104
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:67
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
channel_layouts
static const uint16_t channel_layouts[7]
Definition: dca_lbr.c:114