32#ifndef LIBILBC_VERSION_MAJOR
33#define LIBILBC_VERSION_MAJOR 2
43 return avctx->
bit_rate <= 14000 ? 30 : 20;
50#if LIBILBC_VERSION_MAJOR < 3
64 .class_name =
"libilbc",
80 WebRtcIlbcfix_InitDecode(&
s->decoder,
mode,
s->enhance);
93 const uint8_t *buf = avpkt->
data;
94 int buf_size = avpkt->
size;
98 if (
s->decoder.no_of_bytes > buf_size) {
99#if LIBILBC_VERSION_MAJOR < 3
104 buf_size,
s->decoder.no_of_bytes);
108 frame->nb_samples =
s->decoder.blockl;
112 WebRtcIlbcfix_DecodeImpl((int16_t *)
frame->data[0], (
const uint16_t *) buf, &
s->decoder, 1);
116 return s->decoder.no_of_bytes;
134#if LIBILBC_VERSION_MAJOR < 3
148 .class_name =
"libilbc",
172 s->mode =
s->mode != 30 ? 20 : 30;
173 WebRtcIlbcfix_InitEncode(&
s->encoder,
s->mode);
190 WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->
data, (
const int16_t *)
frame->data[0], &
s->encoder);
192 avpkt->
size =
s->encoder.no_of_bytes;
215 .p.wrapper_name =
"libbilbc",
const FFCodec ff_libilbc_decoder
const FFCodec ff_libilbc_encoder
Libavcodec external API header.
Public libavutil channel layout APIs header.
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_DECODE_CB(func)
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
#define CODEC_SAMPLEFMTS(...)
common internal and external API header
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int(* init)(AVBSFContext *ctx)
int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and allocate data.
#define AV_OPT_FLAG_AUDIO_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
@ AV_OPT_TYPE_INT
Underlying C type is int.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
#define AV_CHANNEL_LAYOUT_MONO
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_SAMPLE_FMT_S16
signed 16 bits
#define LIBAVUTIL_VERSION_INT
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 int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static const AVOption ilbc_enc_options[]
static av_cold int ilbc_encode_init(AVCodecContext *avctx)
static const AVOption ilbc_dec_options[]
static const AVClass ilbc_dec_class
static const FFCodecDefault ilbc_encode_defaults[]
static int get_mode(AVCodecContext *avctx)
static av_cold int ilbc_decode_init(AVCodecContext *avctx)
static const AVClass ilbc_enc_class
static int ilbc_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
main external API structure.
AVChannelLayout ch_layout
Audio channel layout.
enum AVSampleFormat sample_fmt
audio sample format
int64_t bit_rate
the average bitrate
int sample_rate
samples per second
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
int frame_size
Number of samples per channel in an audio frame.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.