74 gsm_option(avctx->
priv_data, GSM_OPT_WAV49, &one);
90 const AVFrame *frame,
int *got_packet_ptr)
151 s->
state = gsm_create();
160 gsm_option(s->
state, GSM_OPT_WAV49, &one);
172 gsm_destroy(s->
state);
178 int *got_frame_ptr,
AVPacket *avpkt)
184 int buf_size = avpkt->
size;
187 if (buf_size < avctx->block_align) {
198 samples = (int16_t *)frame->
data[0];
201 if ((ret = gsm_decode(s->
state, buf, samples)) < 0)
216 gsm_destroy(s->
state);
217 s->
state = gsm_create();
219 gsm_option(s->
state, GSM_OPT_WAV49, &one);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
#define GSM_MS_BLOCK_SIZE
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define FF_COMPLIANCE_UNOFFICIAL
Allow unofficial extensions.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVCodec ff_libgsm_ms_encoder
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
AVCodec ff_libgsm_encoder
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
uint64_t channel_layout
Audio channel layout.
static av_cold int libgsm_encode_close(AVCodecContext *avctx)
int bit_rate
the average bitrate
audio channel layout utility functions
AVCodec ff_libgsm_ms_decoder
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
static av_cold int libgsm_decode_close(AVCodecContext *avctx)
if(ac->has_optimized_func)
int frame_size
Number of samples per channel in an audio frame.
Libavcodec external API header.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static void libgsm_flush(AVCodecContext *avctx)
common internal api header.
common internal and external API header
static av_cold int libgsm_encode_init(AVCodecContext *avctx)
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
static int libgsm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
AVSampleFormat
Audio Sample Formats.
static av_cold int init(AVCodecParserContext *s)
static av_cold int libgsm_decode_init(AVCodecContext *avctx)
static int libgsm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
as in Berlin toast format
int channels
number of audio channels
#define AV_CH_LAYOUT_MONO
AVCodec ff_libgsm_decoder
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
int strict_std_compliance
strictly follow the standard (MPEG4, ...).