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 "encode.h"
#include "internal.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, void *data, 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 AVCodec ff_libilbc_decoder
 
static const AVOption ilbc_enc_options []
 
static const AVClass ilbc_enc_class
 
static const AVCodecDefault ilbc_encode_defaults []
 
const AVCodec ff_libilbc_encoder
 

Macro Definition Documentation

◆ LIBILBC_VERSION_MAJOR

#define LIBILBC_VERSION_MAJOR   2

Definition at line 32 of file libilbc.c.

Function Documentation

◆ get_mode()

static int get_mode ( AVCodecContext avctx)
static

Definition at line 35 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 69 of file libilbc.c.

◆ ilbc_decode_frame()

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

Definition at line 89 of file libilbc.c.

◆ ilbc_encode_init()

static av_cold int ilbc_encode_init ( AVCodecContext avctx)
static

Definition at line 154 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 181 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 57 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 62 of file libilbc.c.

◆ ff_libilbc_decoder

const AVCodec ff_libilbc_decoder
Initial value:
= {
.name = "libilbc",
.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
.priv_data_size = sizeof(ILBCDecContext),
.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 142 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 147 of file libilbc.c.

◆ ilbc_encode_defaults

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

Definition at line 197 of file libilbc.c.

◆ ff_libilbc_encoder

const AVCodec ff_libilbc_encoder
Initial value:
= {
.name = "libilbc",
.long_name = NULL_IF_CONFIG_SMALL("iLBC (Internet Low Bitrate Codec)"),
.priv_data_size = sizeof(ILBCEncContext),
.encode2 = ilbc_encode_frame,
.defaults = ilbc_encode_defaults,
.priv_class = &ilbc_enc_class,
.wrapper_name = "libbilbc",
}

Definition at line 202 of file libilbc.c.

ILBCEncContext
Definition: libilbc.c:132
sample_fmts
static enum AVSampleFormat sample_fmts[]
Definition: adpcmenc.c:948
ilbc_decode_init
static av_cold int ilbc_decode_init(AVCodecContext *avctx)
Definition: libilbc.c:69
ilbc_encode_init
static av_cold int ilbc_encode_init(AVCodecContext *avctx)
Definition: libilbc.c:154
ilbc_dec_class
static const AVClass ilbc_dec_class
Definition: libilbc.c:62
ilbc_encode_defaults
static const AVCodecDefault ilbc_encode_defaults[]
Definition: libilbc.c:197
ilbc_decode_frame
static int ilbc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
Definition: libilbc.c:89
init
static int init
Definition: av_tx.c:47
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
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:277
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
ilbc_enc_class
static const AVClass ilbc_enc_class
Definition: libilbc.c:147
AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_AUDIO_PARAM
Definition: opt.h:279
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:235
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:117
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:59
ilbc_encode_frame
static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: libilbc.c:181
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
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:278
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:61
ilbc_enc_options
static const AVOption ilbc_enc_options[]
Definition: libilbc.c:142
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
ilbc_dec_options
static const AVOption ilbc_dec_options[]
Definition: libilbc.c:57
AV_CODEC_ID_ILBC
@ AV_CODEC_ID_ILBC
Definition: codec_id.h:482
ILBCDecContext
Definition: libilbc.c:47