FFmpeg
Data Structures | Functions | Variables
sbcdec.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "internal.h"
#include "libavutil/channel_layout.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, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 

Variables

const FFCodec 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 64 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 214 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 257 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 304 of file sbcdec.c.

Referenced by sbc_decode_frame().

◆ sbc_decode_init()

static int sbc_decode_init ( AVCodecContext avctx)
static

Definition at line 324 of file sbcdec.c.

◆ sbc_decode_frame()

static int sbc_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 340 of file sbcdec.c.

Variable Documentation

◆ ff_sbc_decoder

const FFCodec ff_sbc_decoder
Initial value:
= {
.p.name = "sbc",
.p.long_name = NULL_IF_CONFIG_SMALL("SBC (low-complexity subband codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_SBC,
.priv_data_size = sizeof(SBCDecContext),
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO,
{ 0 } },
.p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
.p.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 },
}

Definition at line 368 of file sbcdec.c.

sbc_decode_init
static int sbc_decode_init(AVCodecContext *avctx)
Definition: sbcdec.c:324
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:353
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:354
init
static int init
Definition: av_tx.c:47
AV_CODEC_ID_SBC
@ AV_CODEC_ID_SBC
Definition: codec_id.h:512
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
SBCDecContext
Definition: sbcdec.c:47
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:109
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:116
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:290
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
sbc_decode_frame
static int sbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: sbcdec.c:340
AV_SAMPLE_FMT_S16P
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
Definition: samplefmt.h:64
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
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: codec_internal.h:31