FFmpeg
Data Structures | Macros | Functions | Variables
libilbc.c File Reference
#include <ilbc.h>
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "encode.h"

Go to the source code of this file.

Data Structures

struct  ILBCDecContext
 
struct  ILBCEncContext
 

Macros

#define LIBILBC_VERSION_MAJOR   2
 

Functions

static int get_mode (AVCodecContext *avctx)
 
static av_cold int ilbc_decode_init (AVCodecContext *avctx)
 
static int ilbc_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold int ilbc_encode_init (AVCodecContext *avctx)
 
static int ilbc_encode_frame (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
 

Variables

static const AVOption ilbc_dec_options []
 
static const AVClass ilbc_dec_class
 
const FFCodec ff_libilbc_decoder
 
static const AVOption ilbc_enc_options []
 
static const AVClass ilbc_enc_class
 
static const FFCodecDefault ilbc_encode_defaults []
 
const FFCodec ff_libilbc_encoder
 

Macro Definition Documentation

◆ LIBILBC_VERSION_MAJOR

#define LIBILBC_VERSION_MAJOR   2

Definition at line 33 of file libilbc.c.

Function Documentation

◆ get_mode()

static int get_mode ( AVCodecContext avctx)
static

Definition at line 36 of file libilbc.c.

Referenced by ilbc_decode_init(), and ilbc_encode_init().

◆ ilbc_decode_init()

static av_cold int ilbc_decode_init ( AVCodecContext avctx)
static

Definition at line 70 of file libilbc.c.

◆ ilbc_decode_frame()

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

Definition at line 90 of file libilbc.c.

◆ ilbc_encode_init()

static av_cold int ilbc_encode_init ( AVCodecContext avctx)
static

Definition at line 155 of file libilbc.c.

◆ ilbc_encode_frame()

static int ilbc_encode_frame ( AVCodecContext avctx,
AVPacket avpkt,
const AVFrame frame,
int got_packet_ptr 
)
static

Definition at line 182 of file libilbc.c.

Variable Documentation

◆ ilbc_dec_options

const AVOption ilbc_dec_options[]
static
Initial value:
= {
{ "enhance", "Enhance the decoded audio (adds delay)", 0x42, AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM },
{ NULL }
}

Definition at line 58 of file libilbc.c.

◆ ilbc_dec_class

const AVClass ilbc_dec_class
static
Initial value:
= {
.class_name = "libilbc",
.item_name = av_default_item_name,
.option = ilbc_dec_options,
}

Definition at line 63 of file libilbc.c.

◆ ff_libilbc_decoder

const FFCodec ff_libilbc_decoder
Initial value:
= {
.p.name = "libilbc",
CODEC_LONG_NAME("iLBC (Internet Low Bitrate Codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(ILBCDecContext),
.p.priv_class = &ilbc_dec_class,
}

Definition at line 120 of file libilbc.c.

◆ ilbc_enc_options

const AVOption ilbc_enc_options[]
static
Initial value:
= {
{ "mode", "iLBC mode (20 or 30 ms frames)", 0x42, AV_OPT_TYPE_INT, { .i64 = 20 }, 20, 30, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
}

Definition at line 143 of file libilbc.c.

◆ ilbc_enc_class

const AVClass ilbc_enc_class
static
Initial value:
= {
.class_name = "libilbc",
.item_name = av_default_item_name,
.option = ilbc_enc_options,
}

Definition at line 148 of file libilbc.c.

◆ ilbc_encode_defaults

const FFCodecDefault ilbc_encode_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ NULL }
}

Definition at line 198 of file libilbc.c.

◆ ff_libilbc_encoder

const FFCodec ff_libilbc_encoder
Initial value:
= {
.p.name = "libilbc",
CODEC_LONG_NAME("iLBC (Internet Low Bitrate Codec)"),
.p.type = AVMEDIA_TYPE_AUDIO,
.priv_data_size = sizeof(ILBCEncContext),
.p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
.defaults = ilbc_encode_defaults,
.p.priv_class = &ilbc_enc_class,
.p.wrapper_name = "libbilbc",
}

Definition at line 203 of file libilbc.c.

ILBCEncContext
Definition: libilbc.c:133
ilbc_decode_init
static av_cold int ilbc_decode_init(AVCodecContext *avctx)
Definition: libilbc.c:70
ilbc_encode_init
static av_cold int ilbc_encode_init(AVCodecContext *avctx)
Definition: libilbc.c:155
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
ilbc_dec_class
static const AVClass ilbc_dec_class
Definition: libilbc.c:63
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:296
AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:274
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
ilbc_enc_class
static const AVClass ilbc_enc_class
Definition: libilbc.c:148
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:269
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:365
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
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
ilbc_encode_defaults
static const FFCodecDefault ilbc_encode_defaults[]
Definition: libilbc.c:198
ilbc_encode_frame
static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libilbc.c:182
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
ilbc_enc_options
static const AVOption ilbc_enc_options[]
Definition: libilbc.c:143
ilbc_decode_frame
static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Definition: libilbc.c:90
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:273
ilbc_dec_options
static const AVOption ilbc_dec_options[]
Definition: libilbc.c:58
AV_CODEC_ID_ILBC
@ AV_CODEC_ID_ILBC
Definition: codec_id.h:499
ILBCDecContext
Definition: libilbc.c:48