FFmpeg
Data Structures | Functions | Variables
sbcdec.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.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",
CODEC_LONG_NAME("SBC (low-complexity subband codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.p.id = AV_CODEC_ID_SBC,
.priv_data_size = sizeof(SBCDecContext),
.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 365 of file sbcdec.c.

AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:393
sbc_decode_init
static int sbc_decode_init(AVCodecContext *avctx)
Definition: sbcdec.c:324
AV_CODEC_ID_SBC
@ AV_CODEC_ID_SBC
Definition: codec_id.h:533
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
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:106
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:317
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
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:392