/*
* AMR Audio encoder stub
- * Copyright (c) 2003 the ffmpeg project
+ * Copyright (c) 2003 The FFmpeg project
*
* This file is part of Libav.
*
} AMRWBContext;
static const AVOption options[] = {
- { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
+ { "dtx", "Allow DTX (generate comfort noise)", offsetof(AMRWBContext, allow_dtx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
};
static const AVClass class = {
- "libvo_amrwbenc", av_default_item_name, options, LIBAVUTIL_VERSION_INT
+ .class_name = "libvo_amrwbenc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
};
static int get_wb_bitrate_mode(int bitrate, void *log_ctx)
{
- /* make the correspondance between bitrate and mode */
+ /* make the correspondence between bitrate and mode */
static const int rates[] = { 6600, 8850, 12650, 14250, 15850, 18250,
19850, 23050, 23850 };
int i, best = -1, min_diff = 0;
s->last_bitrate = avctx->bit_rate;
avctx->frame_size = 320;
- avctx->delay = 80;
-#if FF_API_OLD_ENCODE_AUDIO
- avctx->coded_frame = avcodec_alloc_frame();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-#endif
+ avctx->initial_padding = 80;
s->state = E_IF_init();
AMRWBContext *s = avctx->priv_data;
E_IF_exit(s->state);
- av_freep(&avctx->coded_frame);
return 0;
}
}
if (frame->pts != AV_NOPTS_VALUE)
- avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->delay);
+ avpkt->pts = frame->pts - ff_samples_to_time_base(avctx, avctx->initial_padding);
avpkt->size = size;
*got_packet_ptr = 1;
AVCodec ff_libvo_amrwbenc_encoder = {
.name = "libvo_amrwbenc",
+ .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
+ "(Adaptive Multi-Rate Wide-Band)"),
.type = AVMEDIA_TYPE_AUDIO,
.id = AV_CODEC_ID_AMR_WB,
.priv_data_size = sizeof(AMRWBContext),
.close = amr_wb_encode_close,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
AV_SAMPLE_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("Android VisualOn AMR-WB "
- "(Adaptive Multi-Rate Wide-Band)"),
.priv_class = &class,
};