22 #include <vo-aacenc/voAAC.h>
23 #include <vo-aacenc/cmnMemory.h>
30 #define FRAME_SIZE 1024
31 #define ENC_DELAY 1600
60 AACENC_PARAM
params = { 0 };
81 s->
user_data.memflag = VO_IMF_USERMEMOPERATOR;
96 for (index = 0; index < 16; index++)
114 avctx->
extradata[0] = 0x02 << 3 | index >> 1;
127 VO_CODECBUFFER input = { 0 }, output = { 0 };
128 VO_AUDIO_OUTPUTINFO output_info = { { 0 } };
149 samples = (VO_PBYTE)frame->
data[0];
159 input.Buffer = samples;
161 output.Buffer = avpkt->
data;
162 output.Length = avpkt->
size;
175 avpkt->
size = output.Length;
183 96000, 88200, 64000, 48000, 44100, 32000,
184 24000, 22050, 16000, 12000, 11025, 8000, 7350
188 .
name =
"libvo_aacenc",
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and/or allocate data.
This structure describes decoded (raw) audio or video data.
static av_cold int init(AVCodecContext *avctx)
AVCodec ff_libvo_aacenc_encoder
#define CODEC_FLAG_GLOBAL_HEADER
Place global headers in extradata instead of every keyframe.
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
static av_cold int aac_encode_init(AVCodecContext *avctx)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
VO_MEM_OPERATOR mem_operator
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
#define CODEC_CAP_SMALL_LAST_FRAME
Codec can be fed a final frame with a smaller size.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int initial_padding
Audio only.
const char * name
Name of the codec implementation.
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
Libavcodec external API header.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
int bit_rate
the average bitrate
VO_CODEC_INIT_USERDATA user_data
int frame_size
Number of samples per channel in an audio frame.
AVSampleFormat
Audio sample formats.
int sample_rate
samples per second
main external API structure.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
const int avpriv_mpeg4audio_sample_rates[16]
static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
static int aac_encode_close(AVCodecContext *avctx)
static const int mpeg4audio_sample_rates[16]
common internal api header.
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int *duration)
Remove frame(s) from the queue.
int channels
number of audio channels
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
VO_AUDIO_CODECAPI codec_api
static void * av_mallocz_array(size_t nmemb, size_t size)
static enum AVSampleFormat sample_fmts[]
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...