22 #include <vo-aacenc/voAAC.h>
23 #include <vo-aacenc/cmnMemory.h>
30 #define FRAME_SIZE 1024
31 #define ENC_DELAY 1600
50 #if FF_API_OLD_ENCODE_AUDIO
63 AACENC_PARAM params = { 0 };
66 #if FF_API_OLD_ENCODE_AUDIO
89 s->
user_data.memflag = VO_IMF_USERMEMOPERATOR;
104 for (index = 0; index < 16; index++)
122 avctx->
extradata[0] = 0x02 << 3 | index >> 1;
132 const AVFrame *frame,
int *got_packet_ptr)
135 VO_CODECBUFFER input = { 0 }, output = { 0 };
136 VO_AUDIO_OUTPUTINFO output_info = { { 0 } };
157 samples = (VO_PBYTE)frame->
data[0];
171 output.Buffer = avpkt->
data;
172 output.Length = avpkt->
size;
185 avpkt->
size = output.Length;
191 .
name =
"libvo_aacenc",
This structure describes decoded (raw) audio or video data.
AVFrame * coded_frame
the picture in the bitstream
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
AVCodec ff_libvo_aacenc_encoder
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.
static int init(AVCodecParserContext *s)
#define CODEC_CAP_SMALL_LAST_FRAME
VO_MEM_OPERATOR mem_operator
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
struct AACContext AACContext
AVFrame * avcodec_alloc_frame(void)
Allocate an AVFrame and set its fields to default values.
int bit_rate
the average bitrate
VO_CODEC_INIT_USERDATA user_data
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
int frame_size
Number of samples per channel in an audio frame.
int sample_rate
samples per second
main external API structure.
static void close(AVCodecParserContext *s)
#define FF_INPUT_BUFFER_PADDING_SIZE
#define CODEC_FLAG_GLOBAL_HEADER
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)
common internal api header.
AVSampleFormat
Audio Sample Formats.
void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
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
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...